@popmenu/common-ui 0.16.0 → 0.17.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/components/AudioPlayer/AudioPlayer.d.ts +3 -0
- package/build/components/AudioPlayer/AudioPlayerProps.d.ts +4 -0
- package/build/components/AudioPlayer/index.d.ts +2 -0
- package/build/components/AudioPlayer/util/audioPlayerReducer.d.ts +11 -0
- package/build/components/AudioPlayer/util/formatTime.d.ts +1 -0
- package/build/components/AudioPlayer/util/index.d.ts +6 -0
- package/build/components/AudioPlayer/util/setupAudioRef.d.ts +8 -0
- package/build/components/AudioPlayer/util/types.d.ts +74 -0
- package/build/components/AudioPlayer/util/usePlaybackIcon.d.ts +2 -0
- package/build/components/AudioPlayer/util/useVolumeIcon.d.ts +2 -0
- package/build/components/index.d.ts +1 -0
- package/build/index.es.js +684 -360
- package/build/index.es.js.map +1 -1
- package/build/index.js +671 -346
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -6,8 +6,10 @@ var Alert = require('@material-ui/lab/Alert');
|
|
|
6
6
|
var core = require('@material-ui/core');
|
|
7
7
|
var AppBar = require('@material-ui/core/AppBar');
|
|
8
8
|
var React = require('react');
|
|
9
|
-
var
|
|
9
|
+
var MuiIconButton = require('@material-ui/core/IconButton');
|
|
10
|
+
var MuiTypography = require('@material-ui/core/Typography');
|
|
10
11
|
var styles = require('@material-ui/core/styles');
|
|
12
|
+
var MuiAvatar = require('@material-ui/core/Avatar');
|
|
11
13
|
var Badge = require('@material-ui/core/Badge');
|
|
12
14
|
var MuiButton = require('@material-ui/core/Button');
|
|
13
15
|
var CircularProgress = require('@material-ui/core/CircularProgress');
|
|
@@ -22,7 +24,6 @@ var MuiCheckbox = require('@material-ui/core/Checkbox');
|
|
|
22
24
|
var FormControlLabel = require('@material-ui/core/FormControlLabel');
|
|
23
25
|
var Chip = require('@material-ui/core/Chip');
|
|
24
26
|
var Collapse = require('@material-ui/core/Collapse');
|
|
25
|
-
var MuiTypography = require('@material-ui/core/Typography');
|
|
26
27
|
var Dialog = require('@material-ui/core/Dialog');
|
|
27
28
|
var DialogActions = require('@material-ui/core/DialogActions');
|
|
28
29
|
var DialogContent = require('@material-ui/core/DialogContent');
|
|
@@ -30,7 +31,6 @@ var DialogTitle = require('@material-ui/core/DialogTitle');
|
|
|
30
31
|
var Drawer = require('@material-ui/core/Drawer');
|
|
31
32
|
var FormControl = require('@material-ui/core/FormControl');
|
|
32
33
|
var Grid = require('@material-ui/core/Grid');
|
|
33
|
-
var MuiIconButton = require('@material-ui/core/IconButton');
|
|
34
34
|
var InputAdornment = require('@material-ui/core/InputAdornment');
|
|
35
35
|
var LinearProgress = require('@material-ui/core/LinearProgress');
|
|
36
36
|
var MuiLink = require('@material-ui/core/Link');
|
|
@@ -78,6 +78,8 @@ var Alert__default = /*#__PURE__*/_interopDefaultLegacy(Alert);
|
|
|
78
78
|
var AppBar__default = /*#__PURE__*/_interopDefaultLegacy(AppBar);
|
|
79
79
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
80
80
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
81
|
+
var MuiIconButton__default = /*#__PURE__*/_interopDefaultLegacy(MuiIconButton);
|
|
82
|
+
var MuiTypography__default = /*#__PURE__*/_interopDefaultLegacy(MuiTypography);
|
|
81
83
|
var MuiAvatar__default = /*#__PURE__*/_interopDefaultLegacy(MuiAvatar);
|
|
82
84
|
var Badge__default = /*#__PURE__*/_interopDefaultLegacy(Badge);
|
|
83
85
|
var MuiButton__default = /*#__PURE__*/_interopDefaultLegacy(MuiButton);
|
|
@@ -93,7 +95,6 @@ var MuiCheckbox__default = /*#__PURE__*/_interopDefaultLegacy(MuiCheckbox);
|
|
|
93
95
|
var FormControlLabel__default = /*#__PURE__*/_interopDefaultLegacy(FormControlLabel);
|
|
94
96
|
var Chip__default = /*#__PURE__*/_interopDefaultLegacy(Chip);
|
|
95
97
|
var Collapse__default = /*#__PURE__*/_interopDefaultLegacy(Collapse);
|
|
96
|
-
var MuiTypography__default = /*#__PURE__*/_interopDefaultLegacy(MuiTypography);
|
|
97
98
|
var Dialog__default = /*#__PURE__*/_interopDefaultLegacy(Dialog);
|
|
98
99
|
var DialogActions__default = /*#__PURE__*/_interopDefaultLegacy(DialogActions);
|
|
99
100
|
var DialogContent__default = /*#__PURE__*/_interopDefaultLegacy(DialogContent);
|
|
@@ -101,7 +102,6 @@ var DialogTitle__default = /*#__PURE__*/_interopDefaultLegacy(DialogTitle);
|
|
|
101
102
|
var Drawer__default = /*#__PURE__*/_interopDefaultLegacy(Drawer);
|
|
102
103
|
var FormControl__default = /*#__PURE__*/_interopDefaultLegacy(FormControl);
|
|
103
104
|
var Grid__default = /*#__PURE__*/_interopDefaultLegacy(Grid);
|
|
104
|
-
var MuiIconButton__default = /*#__PURE__*/_interopDefaultLegacy(MuiIconButton);
|
|
105
105
|
var InputAdornment__default = /*#__PURE__*/_interopDefaultLegacy(InputAdornment);
|
|
106
106
|
var LinearProgress__default = /*#__PURE__*/_interopDefaultLegacy(LinearProgress);
|
|
107
107
|
var MuiLink__default = /*#__PURE__*/_interopDefaultLegacy(MuiLink);
|
|
@@ -170,144 +170,6 @@ function __spreadArray(to, from, pack) {
|
|
|
170
170
|
return to.concat(ar || from);
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
var LoadingStatus;
|
|
174
|
-
(function (LoadingStatus) {
|
|
175
|
-
LoadingStatus["ERROR"] = "ERROR";
|
|
176
|
-
LoadingStatus["LOADED"] = "LOADED";
|
|
177
|
-
LoadingStatus["PENDING"] = "PENDING";
|
|
178
|
-
})(LoadingStatus || (LoadingStatus = {}));
|
|
179
|
-
/**
|
|
180
|
-
* Hook returns [imgProps, loaded]
|
|
181
|
-
* ref: Merged default and provided imgProp object. Includes load and error events for img tag. To be passed to MuiAvatar.
|
|
182
|
-
* loaded: Indicates whether the src supplied to an img within Avatar results in loaded or error
|
|
183
|
-
*/
|
|
184
|
-
var useImgProps = function (avatarProps) {
|
|
185
|
-
var _a = React__default['default'].useState(LoadingStatus.PENDING), loaded = _a[0], setLoaded = _a[1];
|
|
186
|
-
var imgProps = __assign(__assign({}, avatarProps.imgProps), { onError: function (event) {
|
|
187
|
-
var _a, _b;
|
|
188
|
-
setLoaded(LoadingStatus.ERROR);
|
|
189
|
-
(_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
190
|
-
}, onLoad: function (event) {
|
|
191
|
-
var _a, _b;
|
|
192
|
-
setLoaded(LoadingStatus.LOADED);
|
|
193
|
-
(_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
194
|
-
} });
|
|
195
|
-
return { imgProps: imgProps, loaded: loaded };
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
var getAvatarDimensions = function (theme, props) {
|
|
199
|
-
var factors = {
|
|
200
|
-
'extra-small': 3,
|
|
201
|
-
small: 4,
|
|
202
|
-
medium: 5,
|
|
203
|
-
large: 6,
|
|
204
|
-
'extra-large': 12.5,
|
|
205
|
-
};
|
|
206
|
-
var sizeFactor = factors[props.size || 'medium'];
|
|
207
|
-
return theme.spacing(sizeFactor);
|
|
208
|
-
};
|
|
209
|
-
var getAvatarFontSize = function (props) {
|
|
210
|
-
var fontSizes = {
|
|
211
|
-
'extra-small': '0.75rem',
|
|
212
|
-
small: '1rem',
|
|
213
|
-
medium: '1rem',
|
|
214
|
-
large: '1.25rem',
|
|
215
|
-
'extra-large': '3.5rem',
|
|
216
|
-
};
|
|
217
|
-
return fontSizes[props.size || 'medium'];
|
|
218
|
-
};
|
|
219
|
-
var getAvatarBackground = function (props) {
|
|
220
|
-
var src = props.src, loaded = props.loaded;
|
|
221
|
-
var background = props.background;
|
|
222
|
-
if (src && loaded === LoadingStatus.LOADED) {
|
|
223
|
-
background = 'transparent';
|
|
224
|
-
}
|
|
225
|
-
return background;
|
|
226
|
-
};
|
|
227
|
-
var useAvatarStyles = styles.makeStyles(function (theme) { return ({
|
|
228
|
-
root: {
|
|
229
|
-
width: function (props) { return getAvatarDimensions(theme, props); },
|
|
230
|
-
height: function (props) { return getAvatarDimensions(theme, props); },
|
|
231
|
-
fontSize: function (props) { return getAvatarFontSize(props); },
|
|
232
|
-
backgroundColor: function (props) { return getAvatarBackground(props); },
|
|
233
|
-
color: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
|
|
234
|
-
objectFit: function (props) { return props.fit; },
|
|
235
|
-
},
|
|
236
|
-
silhouette: {
|
|
237
|
-
'& path': {
|
|
238
|
-
fill: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
}); });
|
|
242
|
-
|
|
243
|
-
var _path$2;
|
|
244
|
-
|
|
245
|
-
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); }
|
|
246
|
-
|
|
247
|
-
function SvgSilhouetteFemale(props) {
|
|
248
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
|
|
249
|
-
viewBox: "0 0 300 300",
|
|
250
|
-
fill: "none",
|
|
251
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
252
|
-
}, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
253
|
-
d: "M179.417 182.917a3.362 3.362 0 00-2.951 1.076 3.461 3.461 0 00-.875 3.021c1.916 10.069 8.368 23.889 28.173 32.493 2.347 1.014 5.972 1.805 10.57 2.799 17.208 3.722 45.986 9.958 53.055 36.333a3.488 3.488 0 001.622 2.11 3.491 3.491 0 002.639.345 3.488 3.488 0 002.109-1.622 3.473 3.473 0 00.345-2.639c-8.173-30.465-40.777-37.527-58.298-41.319-4.056-.882-7.563-1.639-9.278-2.389-11.903-5.167-19.59-12.833-22.924-22.819 33.07 2.458 48.042-10.716 48.702-11.313a3.469 3.469 0 001.121-2.951 3.478 3.478 0 00-1.732-2.639c-19.084-10.903-19.084-48.577-19.084-62.764 0-39.674-26.722-71.125-60.979-71.618-.326-.011-.652-.018-.979-.021h-.007c-34.757.194-63.035 31.68-63.035 70.194 0 14.188 0 51.868-19.083 62.764a3.5 3.5 0 00-1.73 2.769 3.494 3.494 0 001.313 2.988c.959.743 22.14 16.952 48.202 12.028-3.486 9.569-11.07 16.931-22.625 21.951-1.674.73-5.007 1.528-8.868 2.445-17.64 4.194-50.48 12.007-58.702 42.687a3.481 3.481 0 00.348 2.638 3.475 3.475 0 006.368-.839c7.145-26.694 36.229-33.604 53.597-37.743 4.354-1.035 7.791-1.854 10.028-2.82 19.805-8.604 26.25-22.423 28.173-32.493a3.45 3.45 0 00-1.104-3.243 3.457 3.457 0 00-3.347-.722c-18.799 5.917-36.167-2.222-43.757-6.736 18.132-15.181 18.132-50.118 18.132-65.674 0-34.7 25.18-63.076 56.389-63.263l.736.041c30.778.438 53.986 28.236 53.986 64.667 0 15.562 0 50.576 18.208 65.757-6.271 3.583-20.569 9.382-44.458 6.521z",
|
|
254
|
-
fill: "#2E3042"
|
|
255
|
-
})));
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
var _path$1;
|
|
259
|
-
|
|
260
|
-
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); }
|
|
261
|
-
|
|
262
|
-
function SvgSilhouetteMale(props) {
|
|
263
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
264
|
-
viewBox: "0 0 300 300",
|
|
265
|
-
fill: "none",
|
|
266
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
267
|
-
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
268
|
-
d: "M27.594 261.886a3.513 3.513 0 004.281-2.478c7.204-26.904 36.484-33.877 53.984-38.05 4.386-1.043 7.848-1.869 10.1-2.842 19.935-8.66 26.433-22.592 28.377-32.757a3.493 3.493 0 00-.133-1.81 3.492 3.492 0 00-1.021-1.501c-10.38-8.968-19.137-22.431-24.663-37.917a3.447 3.447 0 00-.72-1.197c-7.31-7.953-11.506-16.361-11.506-23.06 0-3.914 1.475-6.539 4.798-8.52a3.5 3.5 0 001.7-2.857c1.545-35.662 26.922-63.735 58.047-63.917l.749.049c31.279.434 56.495 29.11 57.397 65.275a3.487 3.487 0 001.245 2.584c2.189 1.855 3.211 4.207 3.211 7.4 0 5.607-2.987 12.503-8.401 19.406a3.633 3.633 0 00-.587 1.106c-5.596 17.754-15.64 33.429-27.545 43.02a3.517 3.517 0 00-1.245 3.381c1.945 10.159 8.442 24.083 28.377 32.757 2.357 1.022 6.015 1.821 10.653 2.822 17.325 3.752 46.318 10.046 53.431 36.628a3.503 3.503 0 002.926 2.562 3.494 3.494 0 003.922-3.019 3.52 3.52 0 00-.091-1.363c-8.219-30.713-41.065-37.833-58.705-41.655-4.092-.889-7.625-1.652-9.345-2.408-13.01-5.657-21.026-14.275-23.859-25.658 12.08-10.383 22.187-26.401 27.965-44.365 6.134-7.981 9.505-16.2 9.505-23.221 0-4.684-1.511-8.59-4.504-11.643-1.665-39.232-29.636-70.127-64.35-70.624L150.545 38c-34.085.182-62.175 30.264-64.63 68.818-4.379 3.22-6.603 7.736-6.603 13.47 0 8.282 4.68 18.188 12.87 27.275 5.659 15.563 14.43 29.235 24.873 38.805-2.819 11.426-10.842 20.072-23.88 25.735-1.685.735-5.043 1.541-8.932 2.465-17.773 4.228-50.843 12.104-59.125 43.034a3.501 3.501 0 002.476 4.284z",
|
|
269
|
-
fill: "#2E3042"
|
|
270
|
-
})));
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
var _path;
|
|
274
|
-
|
|
275
|
-
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); }
|
|
276
|
-
|
|
277
|
-
function SvgSilhouetteNeutral(props) {
|
|
278
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
279
|
-
viewBox: "0 0 300 300",
|
|
280
|
-
fill: "none",
|
|
281
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
282
|
-
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
283
|
-
fillRule: "evenodd",
|
|
284
|
-
clipRule: "evenodd",
|
|
285
|
-
d: "M209 121c0 32.585-26.415 59-59 59s-59-26.415-59-59 26.415-59 59-59 59 26.415 59 59zm8 0c0 37.003-29.997 67-67 67s-67-29.997-67-67 29.997-67 67-67 67 29.997 67 67zm35 137.333V284h8v-25.667c0-13.614-5.821-26.671-16.182-36.298C233.456 212.408 219.403 207 204.75 207H94.25c-14.653 0-28.706 5.408-39.068 15.035C44.821 231.662 39 244.719 39 258.333V284h8v-25.667c0-11.295 4.824-22.257 13.628-30.437C69.45 219.698 81.537 215 94.25 215h110.5c12.714 0 24.799 4.698 33.622 12.896 8.804 8.18 13.628 19.142 13.628 30.437z",
|
|
286
|
-
fill: "#2E3042"
|
|
287
|
-
})));
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
var silhouettes = {
|
|
291
|
-
female: SvgSilhouetteFemale,
|
|
292
|
-
male: SvgSilhouetteMale,
|
|
293
|
-
neutral: SvgSilhouetteNeutral,
|
|
294
|
-
};
|
|
295
|
-
var Avatar = React.forwardRef(function (props, ref) {
|
|
296
|
-
var children = props.children, _a = props.silhouette, silhouette = _a === void 0 ? 'neutral' : _a, muiProps = __rest(props, ["children", "silhouette"]);
|
|
297
|
-
var _b = useImgProps(props), imgProps = _b.imgProps, loaded = _b.loaded;
|
|
298
|
-
var classes = useAvatarStyles(__assign(__assign({}, props), { loaded: loaded }));
|
|
299
|
-
var Silhouette = silhouettes[silhouette];
|
|
300
|
-
var fallback = muiProps.src || silhouette === 'none' ? '' : React__default['default'].createElement(Silhouette, { className: classes.silhouette });
|
|
301
|
-
return (React__default['default'].createElement(MuiAvatar__default['default'], __assign({ ref: ref, classes: { root: classes.root } }, muiProps, imgProps), children || fallback));
|
|
302
|
-
});
|
|
303
|
-
Avatar.defaultProps = {
|
|
304
|
-
size: 'medium',
|
|
305
|
-
fit: 'cover',
|
|
306
|
-
background: '#E0E0E0',
|
|
307
|
-
silhouette: 'neutral',
|
|
308
|
-
};
|
|
309
|
-
Avatar.displayName = 'Avatar';
|
|
310
|
-
|
|
311
173
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
312
174
|
|
|
313
175
|
var classnames = {exports: {}};
|
|
@@ -1552,54 +1414,680 @@ function style(options) {
|
|
|
1552
1414
|
return null;
|
|
1553
1415
|
}
|
|
1554
1416
|
|
|
1555
|
-
var propValue = props[prop];
|
|
1556
|
-
var theme = props.theme;
|
|
1557
|
-
var themeMapping = getPath(theme, themeKey) || {};
|
|
1417
|
+
var propValue = props[prop];
|
|
1418
|
+
var theme = props.theme;
|
|
1419
|
+
var themeMapping = getPath(theme, themeKey) || {};
|
|
1420
|
+
|
|
1421
|
+
var styleFromPropValue = function styleFromPropValue(propValueFinal) {
|
|
1422
|
+
var value;
|
|
1423
|
+
|
|
1424
|
+
if (typeof themeMapping === 'function') {
|
|
1425
|
+
value = themeMapping(propValueFinal);
|
|
1426
|
+
} else if (Array.isArray(themeMapping)) {
|
|
1427
|
+
value = themeMapping[propValueFinal] || propValueFinal;
|
|
1428
|
+
} else {
|
|
1429
|
+
value = getPath(themeMapping, propValueFinal) || propValueFinal;
|
|
1430
|
+
|
|
1431
|
+
if (transform) {
|
|
1432
|
+
value = transform(value);
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
if (cssProperty === false) {
|
|
1437
|
+
return value;
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
return _defineProperty({}, cssProperty, value);
|
|
1441
|
+
};
|
|
1442
|
+
|
|
1443
|
+
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
1444
|
+
};
|
|
1445
|
+
|
|
1446
|
+
fn.propTypes = process.env.NODE_ENV !== 'production' ? _defineProperty({}, prop, responsivePropType) : {};
|
|
1447
|
+
fn.filterProps = [prop];
|
|
1448
|
+
return fn;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
var gap = style({
|
|
1452
|
+
prop: 'gap',
|
|
1453
|
+
themeKey: 'spacing',
|
|
1454
|
+
});
|
|
1455
|
+
var useBoxStyles = core.makeStyles(function (theme) { return ({
|
|
1456
|
+
root: function (props) { return gap(__assign(__assign({}, props), { theme: theme })); },
|
|
1457
|
+
}); });
|
|
1458
|
+
|
|
1459
|
+
var Box = function (props) {
|
|
1460
|
+
var className = props.className; props.gap; var restProps = __rest(props, ["className", "gap"]);
|
|
1461
|
+
var root = useBoxStyles(props).root;
|
|
1462
|
+
return React__default['default'].createElement(core.Box, __assign({ className: classNames(root, className) }, restProps));
|
|
1463
|
+
};
|
|
1464
|
+
Box.displayName = 'Box';
|
|
1465
|
+
|
|
1466
|
+
var useIconStyles = core.makeStyles(function (_a) {
|
|
1467
|
+
var spacing = _a.spacing, palette = _a.palette;
|
|
1468
|
+
var getFontSize = function (_a) {
|
|
1469
|
+
var size = _a.size;
|
|
1470
|
+
var sizes = {
|
|
1471
|
+
inherit: 'inherit',
|
|
1472
|
+
small: spacing(1.5),
|
|
1473
|
+
medium: spacing(2),
|
|
1474
|
+
large: spacing(2.5),
|
|
1475
|
+
'extra-large': spacing(3),
|
|
1476
|
+
};
|
|
1477
|
+
return size ? sizes[size] : 'inherit';
|
|
1478
|
+
};
|
|
1479
|
+
var getColor = function (props) {
|
|
1480
|
+
var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
|
|
1481
|
+
var value = 'inherit';
|
|
1482
|
+
if (props.color) {
|
|
1483
|
+
if (semanticColors.includes(props.color.split('.')[0])) {
|
|
1484
|
+
var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
|
|
1485
|
+
value = palette[color][variant];
|
|
1486
|
+
}
|
|
1487
|
+
else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {
|
|
1488
|
+
value = props.color;
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
return value;
|
|
1492
|
+
};
|
|
1493
|
+
return {
|
|
1494
|
+
root: {
|
|
1495
|
+
color: getColor,
|
|
1496
|
+
fontSize: getFontSize,
|
|
1497
|
+
strokeWidth: '1.3px',
|
|
1498
|
+
},
|
|
1499
|
+
};
|
|
1500
|
+
});
|
|
1501
|
+
|
|
1502
|
+
var iconStaticClassName = 'pop-icon';
|
|
1503
|
+
var Icon = function (props) {
|
|
1504
|
+
var icon = props.icon, className = props.className, restProps = __rest(props, ["icon", "className"]);
|
|
1505
|
+
var classes = useIconStyles(props);
|
|
1506
|
+
var isValid = true;
|
|
1507
|
+
if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {
|
|
1508
|
+
isValid = false;
|
|
1509
|
+
}
|
|
1510
|
+
return isValid
|
|
1511
|
+
? React.createElement(icon, __assign({ className: classNames([classes.root, iconStaticClassName, className]) }, restProps))
|
|
1512
|
+
: null;
|
|
1513
|
+
};
|
|
1514
|
+
Icon.defaultProps = {
|
|
1515
|
+
size: 'inherit',
|
|
1516
|
+
color: 'inherit',
|
|
1517
|
+
};
|
|
1518
|
+
Icon.displayName = 'Icon';
|
|
1519
|
+
|
|
1520
|
+
var IconButton = React.forwardRef(function (props, ref) {
|
|
1521
|
+
return React__default['default'].createElement(MuiIconButton__default['default'], __assign({ ref: ref }, props));
|
|
1522
|
+
});
|
|
1523
|
+
IconButton.displayName = 'IconButton';
|
|
1524
|
+
IconButton.defaultProps = {
|
|
1525
|
+
color: 'secondary',
|
|
1526
|
+
};
|
|
1527
|
+
|
|
1528
|
+
var useTypographyStyles = styles.makeStyles(function () {
|
|
1529
|
+
var _a;
|
|
1530
|
+
return ({
|
|
1531
|
+
root: (_a = {},
|
|
1532
|
+
_a["& ." + iconStaticClassName] = {
|
|
1533
|
+
position: 'relative',
|
|
1534
|
+
top: '0.125em',
|
|
1535
|
+
padding: '0 0.125em',
|
|
1536
|
+
boxSizing: 'content-box',
|
|
1537
|
+
},
|
|
1538
|
+
_a),
|
|
1539
|
+
caption: {
|
|
1540
|
+
display: 'inline',
|
|
1541
|
+
},
|
|
1542
|
+
overline: {
|
|
1543
|
+
display: 'inline',
|
|
1544
|
+
},
|
|
1545
|
+
});
|
|
1546
|
+
});
|
|
1547
|
+
|
|
1548
|
+
var Typography = React.forwardRef(function (props, ref) {
|
|
1549
|
+
var classes = useTypographyStyles(props);
|
|
1550
|
+
return React__default['default'].createElement(MuiTypography__default['default'], __assign({ ref: ref, classes: classes }, props));
|
|
1551
|
+
});
|
|
1552
|
+
Typography.displayName = 'Typography';
|
|
1553
|
+
|
|
1554
|
+
var useStyles$1 = core.makeStyles(function (_a) {
|
|
1555
|
+
var spacing = _a.spacing;
|
|
1556
|
+
return ({
|
|
1557
|
+
root: {
|
|
1558
|
+
'&:last-child': {
|
|
1559
|
+
marginBottom: 0,
|
|
1560
|
+
},
|
|
1561
|
+
marginBottom: spacing(4),
|
|
1562
|
+
padding: spacing(4),
|
|
1563
|
+
},
|
|
1564
|
+
});
|
|
1565
|
+
});
|
|
1566
|
+
var Paper = React.forwardRef(function (props, ref) {
|
|
1567
|
+
var legacyStyles = props.legacyStyles, restProps = __rest(props, ["legacyStyles"]);
|
|
1568
|
+
var classes = useStyles$1(props);
|
|
1569
|
+
return React__default['default'].createElement(core.Paper, __assign({}, ref, { classes: __assign({}, (legacyStyles && classes)) }, restProps));
|
|
1570
|
+
});
|
|
1571
|
+
Paper.displayName = 'Paper';
|
|
1572
|
+
Paper.defaultProps = {
|
|
1573
|
+
legacyStyles: false,
|
|
1574
|
+
};
|
|
1575
|
+
|
|
1576
|
+
var AUDIO_PLAYER_EVENT_TYPES;
|
|
1577
|
+
(function (AUDIO_PLAYER_EVENT_TYPES) {
|
|
1578
|
+
AUDIO_PLAYER_EVENT_TYPES["TOGGLE_PLAYBACK"] = "TOGGLE_PLAYBACK";
|
|
1579
|
+
AUDIO_PLAYER_EVENT_TYPES["TOGGLE_VOLUME_CONTROL"] = "TOGGLE_VOLUME_CONTROL";
|
|
1580
|
+
AUDIO_PLAYER_EVENT_TYPES["TOGGLE_MUTE"] = "TOGGLE_MUTE";
|
|
1581
|
+
AUDIO_PLAYER_EVENT_TYPES["VOLUME_CHANGE"] = "VOLUME_CHANGE";
|
|
1582
|
+
AUDIO_PLAYER_EVENT_TYPES["TIME_CHANGE"] = "TIME_CHANGE";
|
|
1583
|
+
AUDIO_PLAYER_EVENT_TYPES["DURATION_CHANGE"] = "DURATION_CHANGE";
|
|
1584
|
+
AUDIO_PLAYER_EVENT_TYPES["SET_TIME"] = "SET_TIME";
|
|
1585
|
+
AUDIO_PLAYER_EVENT_TYPES["CAN_PLAY"] = "CAN_PLAY";
|
|
1586
|
+
})(AUDIO_PLAYER_EVENT_TYPES || (AUDIO_PLAYER_EVENT_TYPES = {}));
|
|
1587
|
+
var PLAYBACK_STATES;
|
|
1588
|
+
(function (PLAYBACK_STATES) {
|
|
1589
|
+
PLAYBACK_STATES["NONE"] = "NONE";
|
|
1590
|
+
PLAYBACK_STATES["PLAYABLE"] = "PLAYABLE";
|
|
1591
|
+
PLAYBACK_STATES["PAUSED"] = "PAUSED";
|
|
1592
|
+
PLAYBACK_STATES["PLAYING"] = "PLAYING";
|
|
1593
|
+
})(PLAYBACK_STATES || (PLAYBACK_STATES = {}));
|
|
1594
|
+
var CONTROL_LABELS;
|
|
1595
|
+
(function (CONTROL_LABELS) {
|
|
1596
|
+
CONTROL_LABELS["PAUSE"] = "PAUSE";
|
|
1597
|
+
CONTROL_LABELS["PLAY"] = "PLAY";
|
|
1598
|
+
CONTROL_LABELS["MUTE"] = "MUTE";
|
|
1599
|
+
CONTROL_LABELS["UNMUTE"] = "UNMUTE";
|
|
1600
|
+
})(CONTROL_LABELS || (CONTROL_LABELS = {}));
|
|
1601
|
+
var VOLUME_CONTROL_STATES;
|
|
1602
|
+
(function (VOLUME_CONTROL_STATES) {
|
|
1603
|
+
VOLUME_CONTROL_STATES["SHOW"] = "SHOW";
|
|
1604
|
+
VOLUME_CONTROL_STATES["HIDE"] = "HIDE";
|
|
1605
|
+
})(VOLUME_CONTROL_STATES || (VOLUME_CONTROL_STATES = {}));
|
|
1606
|
+
|
|
1607
|
+
var initialAudioPlayerState = {
|
|
1608
|
+
playback: PLAYBACK_STATES.NONE,
|
|
1609
|
+
volumeControls: VOLUME_CONTROL_STATES.HIDE,
|
|
1610
|
+
context: {
|
|
1611
|
+
volume: 100,
|
|
1612
|
+
playbackButtonLabel: CONTROL_LABELS.PLAY,
|
|
1613
|
+
volumeButtonLabel: CONTROL_LABELS.MUTE,
|
|
1614
|
+
},
|
|
1615
|
+
};
|
|
1616
|
+
var audioPlayerReducer = function (state, event) {
|
|
1617
|
+
var _a, _b;
|
|
1618
|
+
console.log(event.type);
|
|
1619
|
+
var audioRef = state.context.audioRef;
|
|
1620
|
+
var nextState = __assign({}, state);
|
|
1621
|
+
switch (state.playback) {
|
|
1622
|
+
case PLAYBACK_STATES.NONE:
|
|
1623
|
+
if (event.type === AUDIO_PLAYER_EVENT_TYPES.CAN_PLAY) {
|
|
1624
|
+
nextState.playback = PLAYBACK_STATES.PAUSED;
|
|
1625
|
+
return nextState;
|
|
1626
|
+
}
|
|
1627
|
+
break;
|
|
1628
|
+
case PLAYBACK_STATES.PAUSED:
|
|
1629
|
+
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK) {
|
|
1630
|
+
(_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
1631
|
+
nextState.playback = PLAYBACK_STATES.PLAYING;
|
|
1632
|
+
nextState.context.playbackButtonLabel = CONTROL_LABELS.PAUSE;
|
|
1633
|
+
return nextState;
|
|
1634
|
+
}
|
|
1635
|
+
break;
|
|
1636
|
+
case PLAYBACK_STATES.PLAYING:
|
|
1637
|
+
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK) {
|
|
1638
|
+
(_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.pause();
|
|
1639
|
+
nextState.playback = PLAYBACK_STATES.PAUSED;
|
|
1640
|
+
nextState.context.playbackButtonLabel = CONTROL_LABELS.PLAY;
|
|
1641
|
+
return nextState;
|
|
1642
|
+
}
|
|
1643
|
+
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TIME_CHANGE) {
|
|
1644
|
+
// time change is managed by audioRef automatically, return state to force re-render so ui stays synced
|
|
1645
|
+
return nextState;
|
|
1646
|
+
}
|
|
1647
|
+
break;
|
|
1648
|
+
}
|
|
1649
|
+
switch (state.volumeControls) {
|
|
1650
|
+
case VOLUME_CONTROL_STATES.SHOW:
|
|
1651
|
+
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL) {
|
|
1652
|
+
nextState.volumeControls = VOLUME_CONTROL_STATES.HIDE;
|
|
1653
|
+
return nextState;
|
|
1654
|
+
}
|
|
1655
|
+
if (event.type === AUDIO_PLAYER_EVENT_TYPES.VOLUME_CHANGE) {
|
|
1656
|
+
if (nextState.context.volume !== event.context.volume) {
|
|
1657
|
+
nextState.context.volume = event.context.volume;
|
|
1658
|
+
if (audioRef.current) {
|
|
1659
|
+
audioRef.current.volume = event.context.volume;
|
|
1660
|
+
}
|
|
1661
|
+
return nextState;
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
break;
|
|
1665
|
+
case VOLUME_CONTROL_STATES.HIDE:
|
|
1666
|
+
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL) {
|
|
1667
|
+
nextState.volumeControls = VOLUME_CONTROL_STATES.SHOW;
|
|
1668
|
+
return nextState;
|
|
1669
|
+
}
|
|
1670
|
+
break;
|
|
1671
|
+
}
|
|
1672
|
+
switch (event.type) {
|
|
1673
|
+
case AUDIO_PLAYER_EVENT_TYPES.TOGGLE_MUTE:
|
|
1674
|
+
if (audioRef.current) {
|
|
1675
|
+
audioRef.current.muted = !audioRef.current.muted;
|
|
1676
|
+
return nextState;
|
|
1677
|
+
}
|
|
1678
|
+
break;
|
|
1679
|
+
case AUDIO_PLAYER_EVENT_TYPES.SET_TIME:
|
|
1680
|
+
if (audioRef.current) {
|
|
1681
|
+
audioRef.current.currentTime = event.context.time;
|
|
1682
|
+
return nextState;
|
|
1683
|
+
}
|
|
1684
|
+
break;
|
|
1685
|
+
}
|
|
1686
|
+
return state;
|
|
1687
|
+
};
|
|
1688
|
+
|
|
1689
|
+
var _path$3K;
|
|
1690
|
+
|
|
1691
|
+
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); }
|
|
1692
|
+
|
|
1693
|
+
function SvgMore(props) {
|
|
1694
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3$({
|
|
1695
|
+
viewBox: "0 0 16 16",
|
|
1696
|
+
strokeLinecap: "round",
|
|
1697
|
+
strokeLinejoin: "round",
|
|
1698
|
+
stroke: "currentColor",
|
|
1699
|
+
width: "1em",
|
|
1700
|
+
height: "1em",
|
|
1701
|
+
fill: "none"
|
|
1702
|
+
}, props), _path$3K || (_path$3K = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1703
|
+
d: "M8 8.667a.667.667 0 100-1.334.667.667 0 000 1.334zM8 4a.667.667 0 100-1.333A.667.667 0 008 4zm0 9.333A.667.667 0 108 12a.667.667 0 000 1.333z"
|
|
1704
|
+
})));
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
var _path$2X;
|
|
1708
|
+
|
|
1709
|
+
function _extends$3b() { _extends$3b = 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$3b.apply(this, arguments); }
|
|
1710
|
+
|
|
1711
|
+
function SvgChevronDown(props) {
|
|
1712
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3b({
|
|
1713
|
+
viewBox: "0 0 16 16",
|
|
1714
|
+
strokeLinecap: "round",
|
|
1715
|
+
strokeLinejoin: "round",
|
|
1716
|
+
stroke: "currentColor",
|
|
1717
|
+
width: "1em",
|
|
1718
|
+
height: "1em",
|
|
1719
|
+
fill: "none"
|
|
1720
|
+
}, props), _path$2X || (_path$2X = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1721
|
+
d: "M4 6l4 4 4-4"
|
|
1722
|
+
})));
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
var _path$2W;
|
|
1726
|
+
|
|
1727
|
+
function _extends$3a() { _extends$3a = 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$3a.apply(this, arguments); }
|
|
1728
|
+
|
|
1729
|
+
function SvgChevronUp(props) {
|
|
1730
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3a({
|
|
1731
|
+
viewBox: "0 0 16 16",
|
|
1732
|
+
strokeLinecap: "round",
|
|
1733
|
+
strokeLinejoin: "round",
|
|
1734
|
+
stroke: "currentColor",
|
|
1735
|
+
width: "1em",
|
|
1736
|
+
height: "1em",
|
|
1737
|
+
fill: "none"
|
|
1738
|
+
}, props), _path$2W || (_path$2W = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1739
|
+
d: "M12 10L8 6l-4 4"
|
|
1740
|
+
})));
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
var _path$1f;
|
|
1744
|
+
|
|
1745
|
+
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); }
|
|
1746
|
+
|
|
1747
|
+
function SvgPause(props) {
|
|
1748
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1p({
|
|
1749
|
+
viewBox: "0 0 16 16",
|
|
1750
|
+
strokeLinecap: "round",
|
|
1751
|
+
strokeLinejoin: "round",
|
|
1752
|
+
stroke: "currentColor",
|
|
1753
|
+
width: "1em",
|
|
1754
|
+
height: "1em",
|
|
1755
|
+
fill: "none"
|
|
1756
|
+
}, props), _path$1f || (_path$1f = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1757
|
+
d: "M6.667 2.667H4v10.666h2.667V2.667zm5.333 0H9.333v10.666H12V2.667z"
|
|
1758
|
+
})));
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
var _path$1d;
|
|
1762
|
+
|
|
1763
|
+
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); }
|
|
1764
|
+
|
|
1765
|
+
function SvgPlay(props) {
|
|
1766
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1n({
|
|
1767
|
+
viewBox: "0 0 16 16",
|
|
1768
|
+
strokeLinecap: "round",
|
|
1769
|
+
strokeLinejoin: "round",
|
|
1770
|
+
stroke: "currentColor",
|
|
1771
|
+
width: "1em",
|
|
1772
|
+
height: "1em",
|
|
1773
|
+
fill: "none"
|
|
1774
|
+
}, props), _path$1d || (_path$1d = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1775
|
+
d: "M3.333 2l9.334 6-9.334 6V2z"
|
|
1776
|
+
})));
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
var _path$10;
|
|
1780
|
+
|
|
1781
|
+
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); }
|
|
1782
|
+
|
|
1783
|
+
function SvgVolumeDown(props) {
|
|
1784
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1a({
|
|
1785
|
+
viewBox: "0 0 16 16",
|
|
1786
|
+
strokeLinecap: "round",
|
|
1787
|
+
strokeLinejoin: "round",
|
|
1788
|
+
stroke: "currentColor",
|
|
1789
|
+
width: "1em",
|
|
1790
|
+
height: "1em",
|
|
1791
|
+
fill: "none"
|
|
1792
|
+
}, props), _path$10 || (_path$10 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1793
|
+
d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.713"
|
|
1794
|
+
})));
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
var _path$$;
|
|
1798
|
+
|
|
1799
|
+
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); }
|
|
1800
|
+
|
|
1801
|
+
function SvgVolumeMute(props) {
|
|
1802
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$19({
|
|
1803
|
+
viewBox: "0 0 16 16",
|
|
1804
|
+
strokeLinecap: "round",
|
|
1805
|
+
strokeLinejoin: "round",
|
|
1806
|
+
stroke: "currentColor",
|
|
1807
|
+
width: "1em",
|
|
1808
|
+
height: "1em",
|
|
1809
|
+
fill: "none"
|
|
1810
|
+
}, props), _path$$ || (_path$$ = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1811
|
+
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333z"
|
|
1812
|
+
})));
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
var _path$_;
|
|
1816
|
+
|
|
1817
|
+
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); }
|
|
1818
|
+
|
|
1819
|
+
function SvgVolumeOff(props) {
|
|
1820
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$18({
|
|
1821
|
+
viewBox: "0 0 16 16",
|
|
1822
|
+
strokeLinecap: "round",
|
|
1823
|
+
strokeLinejoin: "round",
|
|
1824
|
+
stroke: "currentColor",
|
|
1825
|
+
width: "1em",
|
|
1826
|
+
height: "1em",
|
|
1827
|
+
fill: "none"
|
|
1828
|
+
}, props), _path$_ || (_path$_ = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1829
|
+
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm8 2.667l-4 4m0-4l4 4"
|
|
1830
|
+
})));
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
var _path$Z;
|
|
1834
|
+
|
|
1835
|
+
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); }
|
|
1836
|
+
|
|
1837
|
+
function SvgVolumeUp(props) {
|
|
1838
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$17({
|
|
1839
|
+
viewBox: "0 0 16 16",
|
|
1840
|
+
strokeLinecap: "round",
|
|
1841
|
+
strokeLinejoin: "round",
|
|
1842
|
+
stroke: "currentColor",
|
|
1843
|
+
width: "1em",
|
|
1844
|
+
height: "1em",
|
|
1845
|
+
fill: "none"
|
|
1846
|
+
}, props), _path$Z || (_path$Z = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1847
|
+
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"
|
|
1848
|
+
})));
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
var usePlaybackIcon = function (state) {
|
|
1852
|
+
var _a;
|
|
1853
|
+
var options = (_a = {},
|
|
1854
|
+
_a[PLAYBACK_STATES.PAUSED] = SvgPlay,
|
|
1855
|
+
_a[PLAYBACK_STATES.PLAYING] = SvgPause,
|
|
1856
|
+
_a[PLAYBACK_STATES.NONE] = SvgPlay,
|
|
1857
|
+
_a[PLAYBACK_STATES.PLAYABLE] = SvgPlay,
|
|
1858
|
+
_a);
|
|
1859
|
+
return options[state.playback];
|
|
1860
|
+
};
|
|
1861
|
+
|
|
1862
|
+
var useVolumeIcon = function (state) {
|
|
1863
|
+
var volumeIcon = SvgVolumeUp;
|
|
1864
|
+
if (state.context.volume >= 0.5) {
|
|
1865
|
+
volumeIcon = SvgVolumeUp;
|
|
1866
|
+
}
|
|
1867
|
+
else if (state.context.volume < 0.5 && state.context.volume > 0) {
|
|
1868
|
+
volumeIcon = SvgVolumeDown;
|
|
1869
|
+
}
|
|
1870
|
+
else if (state.context.volume === 0) {
|
|
1871
|
+
volumeIcon = SvgVolumeMute;
|
|
1872
|
+
}
|
|
1873
|
+
if (state.context.audioRef.current) {
|
|
1874
|
+
if (state.context.audioRef.current.muted) {
|
|
1875
|
+
volumeIcon = SvgVolumeOff;
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
return volumeIcon;
|
|
1879
|
+
};
|
|
1880
|
+
|
|
1881
|
+
var appendZero = function (num) { return (num < 10 ? "0" + num : num); };
|
|
1882
|
+
var formatTime = function (time, remaning) {
|
|
1883
|
+
if (remaning === void 0) { remaning = false; }
|
|
1884
|
+
var dateTime = new Date(0, 0, 0, 0, 0, time, 0);
|
|
1885
|
+
var dateTimeH = appendZero(dateTime.getHours());
|
|
1886
|
+
var dateTimeM = appendZero(dateTime.getMinutes());
|
|
1887
|
+
var dateTimeS = appendZero(dateTime.getSeconds());
|
|
1888
|
+
var minus = remaning ? '-' : '';
|
|
1889
|
+
return dateTimeH > 0 ? "" + minus + dateTimeH + ":" + dateTimeM + ":" + dateTimeS : "" + minus + dateTimeM + ":" + dateTimeS;
|
|
1890
|
+
};
|
|
1891
|
+
|
|
1892
|
+
var setupAudioRef = function (config) { return function () {
|
|
1893
|
+
var _a, _b, _c;
|
|
1894
|
+
var audioRef = config.audioRef, send = config.send;
|
|
1895
|
+
var handleDurationChange = function (event) {
|
|
1896
|
+
var duration = event.target.duration;
|
|
1897
|
+
send({ type: AUDIO_PLAYER_EVENT_TYPES.DURATION_CHANGE, context: { duration: duration } });
|
|
1898
|
+
};
|
|
1899
|
+
var handleTimeUpdate = function (event) {
|
|
1900
|
+
var currentTime = event.target.currentTime;
|
|
1901
|
+
send({ type: AUDIO_PLAYER_EVENT_TYPES.TIME_CHANGE, context: { currentTime: currentTime } });
|
|
1902
|
+
};
|
|
1903
|
+
var handleCanPlay = function () {
|
|
1904
|
+
send({ type: AUDIO_PLAYER_EVENT_TYPES.CAN_PLAY });
|
|
1905
|
+
};
|
|
1906
|
+
(_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('durationchange', handleDurationChange);
|
|
1907
|
+
(_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('timeupdate', handleTimeUpdate);
|
|
1908
|
+
(_c = audioRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('canplay', handleCanPlay);
|
|
1909
|
+
return function () {
|
|
1910
|
+
var _a, _b, _c;
|
|
1911
|
+
(_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('durationchange', handleDurationChange);
|
|
1912
|
+
(_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('timeupdate', handleTimeUpdate);
|
|
1913
|
+
(_c = audioRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('canplay', handleCanPlay);
|
|
1914
|
+
};
|
|
1915
|
+
}; };
|
|
1916
|
+
|
|
1917
|
+
var AudioPlayer = function (props) {
|
|
1918
|
+
var _a, _b, _c, _d;
|
|
1919
|
+
var src = props.src;
|
|
1920
|
+
var volumeRef = React.useRef(null);
|
|
1921
|
+
var audioRef = React.useRef(null);
|
|
1922
|
+
var _f = React.useState(false), disableRipple = _f[0], setDisableRipple = _f[1];
|
|
1923
|
+
var _g = React.useReducer(audioPlayerReducer, __assign(__assign({}, initialAudioPlayerState), { context: __assign(__assign({}, initialAudioPlayerState.context), { audioRef: audioRef }) })), state = _g[0], send = _g[1];
|
|
1924
|
+
React.useEffect(setupAudioRef({ audioRef: audioRef, send: send }), [audioRef]);
|
|
1925
|
+
var PlaybackIcon = usePlaybackIcon(state);
|
|
1926
|
+
var VolumeIcon = useVolumeIcon(state);
|
|
1927
|
+
var togglePlayback = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK }); };
|
|
1928
|
+
var toggleVolumeControl = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL }); };
|
|
1929
|
+
var toggleMute = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_MUTE }); };
|
|
1930
|
+
var setTime = function (_e, time) { return send({ type: AUDIO_PLAYER_EVENT_TYPES.SET_TIME, context: { time: time } }); };
|
|
1931
|
+
var setVolume = function (_e, volume) { return send({ type: AUDIO_PLAYER_EVENT_TYPES.VOLUME_CHANGE, context: { volume: volume } }); };
|
|
1932
|
+
return (React__default['default'].createElement(Box, { display: "flex", alignItems: "center", gap: 1 },
|
|
1933
|
+
React__default['default'].createElement("audio", { ref: audioRef, src: src }),
|
|
1934
|
+
React__default['default'].createElement(Box, null,
|
|
1935
|
+
React__default['default'].createElement(IconButton, { "aria-label": state.context.playbackButtonLabel, disabled: state.playback === PLAYBACK_STATES.NONE, onClick: togglePlayback },
|
|
1936
|
+
React__default['default'].createElement(Icon, { icon: PlaybackIcon })),
|
|
1937
|
+
React__default['default'].createElement(IconButton, { "aria-label": state.context.volumeButtonLabel, ref: volumeRef, onClick: toggleMute, onMouseEnter: toggleVolumeControl, onMouseLeave: toggleVolumeControl, disableRipple: disableRipple },
|
|
1938
|
+
React__default['default'].createElement(Icon, { icon: VolumeIcon }),
|
|
1939
|
+
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" }, function (_a) {
|
|
1940
|
+
var TransitionProps = _a.TransitionProps;
|
|
1941
|
+
return (React__default['default'].createElement(core.Grow, __assign({}, TransitionProps),
|
|
1942
|
+
React__default['default'].createElement(Paper, { elevation: 1 },
|
|
1943
|
+
React__default['default'].createElement(Box, { py: 1, height: 80 },
|
|
1944
|
+
React__default['default'].createElement(core.Slider, { color: "secondary", orientation: "vertical", value: state.context.volume, onChange: setVolume, max: 1, step: 0.01 })))));
|
|
1945
|
+
}))),
|
|
1946
|
+
React__default['default'].createElement(Box, { display: "flex", flexGrow: 1, alignItems: "center", gap: 1 },
|
|
1947
|
+
React__default['default'].createElement(Box, { flexBasis: 60 },
|
|
1948
|
+
React__default['default'].createElement(Typography, null, formatTime(((_a = state.context.audioRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) || 0))),
|
|
1949
|
+
React__default['default'].createElement(core.Slider, { color: "secondary", value: ((_b = state.context.audioRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0, max: ((_c = state.context.audioRef.current) === null || _c === void 0 ? void 0 : _c.duration) || 1, onChange: setTime, disabled: state.playback === PLAYBACK_STATES.NONE }),
|
|
1950
|
+
React__default['default'].createElement(Box, { flexBasis: 60, textAlign: "end" },
|
|
1951
|
+
React__default['default'].createElement(Typography, null, formatTime(((_d = state.context.audioRef.current) === null || _d === void 0 ? void 0 : _d.duration) || 0))))));
|
|
1952
|
+
};
|
|
1953
|
+
|
|
1954
|
+
var LoadingStatus;
|
|
1955
|
+
(function (LoadingStatus) {
|
|
1956
|
+
LoadingStatus["ERROR"] = "ERROR";
|
|
1957
|
+
LoadingStatus["LOADED"] = "LOADED";
|
|
1958
|
+
LoadingStatus["PENDING"] = "PENDING";
|
|
1959
|
+
})(LoadingStatus || (LoadingStatus = {}));
|
|
1960
|
+
/**
|
|
1961
|
+
* Hook returns [imgProps, loaded]
|
|
1962
|
+
* ref: Merged default and provided imgProp object. Includes load and error events for img tag. To be passed to MuiAvatar.
|
|
1963
|
+
* loaded: Indicates whether the src supplied to an img within Avatar results in loaded or error
|
|
1964
|
+
*/
|
|
1965
|
+
var useImgProps = function (avatarProps) {
|
|
1966
|
+
var _a = React__default['default'].useState(LoadingStatus.PENDING), loaded = _a[0], setLoaded = _a[1];
|
|
1967
|
+
var imgProps = __assign(__assign({}, avatarProps.imgProps), { onError: function (event) {
|
|
1968
|
+
var _a, _b;
|
|
1969
|
+
setLoaded(LoadingStatus.ERROR);
|
|
1970
|
+
(_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
1971
|
+
}, onLoad: function (event) {
|
|
1972
|
+
var _a, _b;
|
|
1973
|
+
setLoaded(LoadingStatus.LOADED);
|
|
1974
|
+
(_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
1975
|
+
} });
|
|
1976
|
+
return { imgProps: imgProps, loaded: loaded };
|
|
1977
|
+
};
|
|
1978
|
+
|
|
1979
|
+
var getAvatarDimensions = function (theme, props) {
|
|
1980
|
+
var factors = {
|
|
1981
|
+
'extra-small': 3,
|
|
1982
|
+
small: 4,
|
|
1983
|
+
medium: 5,
|
|
1984
|
+
large: 6,
|
|
1985
|
+
'extra-large': 12.5,
|
|
1986
|
+
};
|
|
1987
|
+
var sizeFactor = factors[props.size || 'medium'];
|
|
1988
|
+
return theme.spacing(sizeFactor);
|
|
1989
|
+
};
|
|
1990
|
+
var getAvatarFontSize = function (props) {
|
|
1991
|
+
var fontSizes = {
|
|
1992
|
+
'extra-small': '0.75rem',
|
|
1993
|
+
small: '1rem',
|
|
1994
|
+
medium: '1rem',
|
|
1995
|
+
large: '1.25rem',
|
|
1996
|
+
'extra-large': '3.5rem',
|
|
1997
|
+
};
|
|
1998
|
+
return fontSizes[props.size || 'medium'];
|
|
1999
|
+
};
|
|
2000
|
+
var getAvatarBackground = function (props) {
|
|
2001
|
+
var src = props.src, loaded = props.loaded;
|
|
2002
|
+
var background = props.background;
|
|
2003
|
+
if (src && loaded === LoadingStatus.LOADED) {
|
|
2004
|
+
background = 'transparent';
|
|
2005
|
+
}
|
|
2006
|
+
return background;
|
|
2007
|
+
};
|
|
2008
|
+
var useAvatarStyles = styles.makeStyles(function (theme) { return ({
|
|
2009
|
+
root: {
|
|
2010
|
+
width: function (props) { return getAvatarDimensions(theme, props); },
|
|
2011
|
+
height: function (props) { return getAvatarDimensions(theme, props); },
|
|
2012
|
+
fontSize: function (props) { return getAvatarFontSize(props); },
|
|
2013
|
+
backgroundColor: function (props) { return getAvatarBackground(props); },
|
|
2014
|
+
color: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
|
|
2015
|
+
objectFit: function (props) { return props.fit; },
|
|
2016
|
+
},
|
|
2017
|
+
silhouette: {
|
|
2018
|
+
'& path': {
|
|
2019
|
+
fill: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
|
|
2020
|
+
},
|
|
2021
|
+
},
|
|
2022
|
+
}); });
|
|
2023
|
+
|
|
2024
|
+
var _path$2;
|
|
2025
|
+
|
|
2026
|
+
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); }
|
|
1558
2027
|
|
|
1559
|
-
|
|
1560
|
-
|
|
2028
|
+
function SvgSilhouetteFemale(props) {
|
|
2029
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
|
|
2030
|
+
viewBox: "0 0 300 300",
|
|
2031
|
+
fill: "none",
|
|
2032
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2033
|
+
}, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
2034
|
+
d: "M179.417 182.917a3.362 3.362 0 00-2.951 1.076 3.461 3.461 0 00-.875 3.021c1.916 10.069 8.368 23.889 28.173 32.493 2.347 1.014 5.972 1.805 10.57 2.799 17.208 3.722 45.986 9.958 53.055 36.333a3.488 3.488 0 001.622 2.11 3.491 3.491 0 002.639.345 3.488 3.488 0 002.109-1.622 3.473 3.473 0 00.345-2.639c-8.173-30.465-40.777-37.527-58.298-41.319-4.056-.882-7.563-1.639-9.278-2.389-11.903-5.167-19.59-12.833-22.924-22.819 33.07 2.458 48.042-10.716 48.702-11.313a3.469 3.469 0 001.121-2.951 3.478 3.478 0 00-1.732-2.639c-19.084-10.903-19.084-48.577-19.084-62.764 0-39.674-26.722-71.125-60.979-71.618-.326-.011-.652-.018-.979-.021h-.007c-34.757.194-63.035 31.68-63.035 70.194 0 14.188 0 51.868-19.083 62.764a3.5 3.5 0 00-1.73 2.769 3.494 3.494 0 001.313 2.988c.959.743 22.14 16.952 48.202 12.028-3.486 9.569-11.07 16.931-22.625 21.951-1.674.73-5.007 1.528-8.868 2.445-17.64 4.194-50.48 12.007-58.702 42.687a3.481 3.481 0 00.348 2.638 3.475 3.475 0 006.368-.839c7.145-26.694 36.229-33.604 53.597-37.743 4.354-1.035 7.791-1.854 10.028-2.82 19.805-8.604 26.25-22.423 28.173-32.493a3.45 3.45 0 00-1.104-3.243 3.457 3.457 0 00-3.347-.722c-18.799 5.917-36.167-2.222-43.757-6.736 18.132-15.181 18.132-50.118 18.132-65.674 0-34.7 25.18-63.076 56.389-63.263l.736.041c30.778.438 53.986 28.236 53.986 64.667 0 15.562 0 50.576 18.208 65.757-6.271 3.583-20.569 9.382-44.458 6.521z",
|
|
2035
|
+
fill: "#2E3042"
|
|
2036
|
+
})));
|
|
2037
|
+
}
|
|
1561
2038
|
|
|
1562
|
-
|
|
1563
|
-
value = themeMapping(propValueFinal);
|
|
1564
|
-
} else if (Array.isArray(themeMapping)) {
|
|
1565
|
-
value = themeMapping[propValueFinal] || propValueFinal;
|
|
1566
|
-
} else {
|
|
1567
|
-
value = getPath(themeMapping, propValueFinal) || propValueFinal;
|
|
2039
|
+
var _path$1;
|
|
1568
2040
|
|
|
1569
|
-
|
|
1570
|
-
value = transform(value);
|
|
1571
|
-
}
|
|
1572
|
-
}
|
|
2041
|
+
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); }
|
|
1573
2042
|
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
2043
|
+
function SvgSilhouetteMale(props) {
|
|
2044
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
2045
|
+
viewBox: "0 0 300 300",
|
|
2046
|
+
fill: "none",
|
|
2047
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2048
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
2049
|
+
d: "M27.594 261.886a3.513 3.513 0 004.281-2.478c7.204-26.904 36.484-33.877 53.984-38.05 4.386-1.043 7.848-1.869 10.1-2.842 19.935-8.66 26.433-22.592 28.377-32.757a3.493 3.493 0 00-.133-1.81 3.492 3.492 0 00-1.021-1.501c-10.38-8.968-19.137-22.431-24.663-37.917a3.447 3.447 0 00-.72-1.197c-7.31-7.953-11.506-16.361-11.506-23.06 0-3.914 1.475-6.539 4.798-8.52a3.5 3.5 0 001.7-2.857c1.545-35.662 26.922-63.735 58.047-63.917l.749.049c31.279.434 56.495 29.11 57.397 65.275a3.487 3.487 0 001.245 2.584c2.189 1.855 3.211 4.207 3.211 7.4 0 5.607-2.987 12.503-8.401 19.406a3.633 3.633 0 00-.587 1.106c-5.596 17.754-15.64 33.429-27.545 43.02a3.517 3.517 0 00-1.245 3.381c1.945 10.159 8.442 24.083 28.377 32.757 2.357 1.022 6.015 1.821 10.653 2.822 17.325 3.752 46.318 10.046 53.431 36.628a3.503 3.503 0 002.926 2.562 3.494 3.494 0 003.922-3.019 3.52 3.52 0 00-.091-1.363c-8.219-30.713-41.065-37.833-58.705-41.655-4.092-.889-7.625-1.652-9.345-2.408-13.01-5.657-21.026-14.275-23.859-25.658 12.08-10.383 22.187-26.401 27.965-44.365 6.134-7.981 9.505-16.2 9.505-23.221 0-4.684-1.511-8.59-4.504-11.643-1.665-39.232-29.636-70.127-64.35-70.624L150.545 38c-34.085.182-62.175 30.264-64.63 68.818-4.379 3.22-6.603 7.736-6.603 13.47 0 8.282 4.68 18.188 12.87 27.275 5.659 15.563 14.43 29.235 24.873 38.805-2.819 11.426-10.842 20.072-23.88 25.735-1.685.735-5.043 1.541-8.932 2.465-17.773 4.228-50.843 12.104-59.125 43.034a3.501 3.501 0 002.476 4.284z",
|
|
2050
|
+
fill: "#2E3042"
|
|
2051
|
+
})));
|
|
2052
|
+
}
|
|
1577
2053
|
|
|
1578
|
-
|
|
1579
|
-
};
|
|
2054
|
+
var _path;
|
|
1580
2055
|
|
|
1581
|
-
|
|
1582
|
-
};
|
|
2056
|
+
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); }
|
|
1583
2057
|
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
2058
|
+
function SvgSilhouetteNeutral(props) {
|
|
2059
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2060
|
+
viewBox: "0 0 300 300",
|
|
2061
|
+
fill: "none",
|
|
2062
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2063
|
+
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
2064
|
+
fillRule: "evenodd",
|
|
2065
|
+
clipRule: "evenodd",
|
|
2066
|
+
d: "M209 121c0 32.585-26.415 59-59 59s-59-26.415-59-59 26.415-59 59-59 59 26.415 59 59zm8 0c0 37.003-29.997 67-67 67s-67-29.997-67-67 29.997-67 67-67 67 29.997 67 67zm35 137.333V284h8v-25.667c0-13.614-5.821-26.671-16.182-36.298C233.456 212.408 219.403 207 204.75 207H94.25c-14.653 0-28.706 5.408-39.068 15.035C44.821 231.662 39 244.719 39 258.333V284h8v-25.667c0-11.295 4.824-22.257 13.628-30.437C69.45 219.698 81.537 215 94.25 215h110.5c12.714 0 24.799 4.698 33.622 12.896 8.804 8.18 13.628 19.142 13.628 30.437z",
|
|
2067
|
+
fill: "#2E3042"
|
|
2068
|
+
})));
|
|
1587
2069
|
}
|
|
1588
2070
|
|
|
1589
|
-
var
|
|
1590
|
-
|
|
1591
|
-
|
|
2071
|
+
var silhouettes = {
|
|
2072
|
+
female: SvgSilhouetteFemale,
|
|
2073
|
+
male: SvgSilhouetteMale,
|
|
2074
|
+
neutral: SvgSilhouetteNeutral,
|
|
2075
|
+
};
|
|
2076
|
+
var Avatar = React.forwardRef(function (props, ref) {
|
|
2077
|
+
var children = props.children, _a = props.silhouette, silhouette = _a === void 0 ? 'neutral' : _a, muiProps = __rest(props, ["children", "silhouette"]);
|
|
2078
|
+
var _b = useImgProps(props), imgProps = _b.imgProps, loaded = _b.loaded;
|
|
2079
|
+
var classes = useAvatarStyles(__assign(__assign({}, props), { loaded: loaded }));
|
|
2080
|
+
var Silhouette = silhouettes[silhouette];
|
|
2081
|
+
var fallback = muiProps.src || silhouette === 'none' ? '' : React__default['default'].createElement(Silhouette, { className: classes.silhouette });
|
|
2082
|
+
return (React__default['default'].createElement(MuiAvatar__default['default'], __assign({ ref: ref, classes: { root: classes.root } }, muiProps, imgProps), children || fallback));
|
|
1592
2083
|
});
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
var className = props.className; props.gap; var restProps = __rest(props, ["className", "gap"]);
|
|
1599
|
-
var root = useBoxStyles(props).root;
|
|
1600
|
-
return React__default['default'].createElement(core.Box, __assign({ className: classNames(root, className) }, restProps));
|
|
2084
|
+
Avatar.defaultProps = {
|
|
2085
|
+
size: 'medium',
|
|
2086
|
+
fit: 'cover',
|
|
2087
|
+
background: '#E0E0E0',
|
|
2088
|
+
silhouette: 'neutral',
|
|
1601
2089
|
};
|
|
1602
|
-
|
|
2090
|
+
Avatar.displayName = 'Avatar';
|
|
1603
2091
|
|
|
1604
2092
|
var useButtonStyles = styles.makeStyles(function () { return ({
|
|
1605
2093
|
root: {
|
|
@@ -1633,86 +2121,6 @@ var Checkbox = React.forwardRef(function (props, ref) {
|
|
|
1633
2121
|
});
|
|
1634
2122
|
Checkbox.displayName = 'Checkbox';
|
|
1635
2123
|
|
|
1636
|
-
var useIconStyles = core.makeStyles(function (_a) {
|
|
1637
|
-
var spacing = _a.spacing, palette = _a.palette;
|
|
1638
|
-
var getFontSize = function (_a) {
|
|
1639
|
-
var size = _a.size;
|
|
1640
|
-
var sizes = {
|
|
1641
|
-
inherit: 'inherit',
|
|
1642
|
-
small: spacing(1.5),
|
|
1643
|
-
medium: spacing(2),
|
|
1644
|
-
large: spacing(2.5),
|
|
1645
|
-
'extra-large': spacing(3),
|
|
1646
|
-
};
|
|
1647
|
-
return size ? sizes[size] : 'inherit';
|
|
1648
|
-
};
|
|
1649
|
-
var getColor = function (props) {
|
|
1650
|
-
var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
|
|
1651
|
-
var value = 'inherit';
|
|
1652
|
-
if (props.color) {
|
|
1653
|
-
if (semanticColors.includes(props.color.split('.')[0])) {
|
|
1654
|
-
var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
|
|
1655
|
-
value = palette[color][variant];
|
|
1656
|
-
}
|
|
1657
|
-
else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {
|
|
1658
|
-
value = props.color;
|
|
1659
|
-
}
|
|
1660
|
-
}
|
|
1661
|
-
return value;
|
|
1662
|
-
};
|
|
1663
|
-
return {
|
|
1664
|
-
root: {
|
|
1665
|
-
color: getColor,
|
|
1666
|
-
fontSize: getFontSize,
|
|
1667
|
-
strokeWidth: '1.3px',
|
|
1668
|
-
},
|
|
1669
|
-
};
|
|
1670
|
-
});
|
|
1671
|
-
|
|
1672
|
-
var iconStaticClassName = 'pop-icon';
|
|
1673
|
-
var Icon = function (props) {
|
|
1674
|
-
var icon = props.icon, className = props.className, restProps = __rest(props, ["icon", "className"]);
|
|
1675
|
-
var classes = useIconStyles(props);
|
|
1676
|
-
var isValid = true;
|
|
1677
|
-
if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {
|
|
1678
|
-
isValid = false;
|
|
1679
|
-
}
|
|
1680
|
-
return isValid
|
|
1681
|
-
? React.createElement(icon, __assign({ className: classNames([classes.root, iconStaticClassName, className]) }, restProps))
|
|
1682
|
-
: null;
|
|
1683
|
-
};
|
|
1684
|
-
Icon.defaultProps = {
|
|
1685
|
-
size: 'inherit',
|
|
1686
|
-
color: 'inherit',
|
|
1687
|
-
};
|
|
1688
|
-
Icon.displayName = 'Icon';
|
|
1689
|
-
|
|
1690
|
-
var useTypographyStyles = styles.makeStyles(function () {
|
|
1691
|
-
var _a;
|
|
1692
|
-
return ({
|
|
1693
|
-
root: (_a = {},
|
|
1694
|
-
_a["& ." + iconStaticClassName] = {
|
|
1695
|
-
position: 'relative',
|
|
1696
|
-
top: '0.125em',
|
|
1697
|
-
padding: '0 0.125em',
|
|
1698
|
-
boxSizing: 'content-box',
|
|
1699
|
-
},
|
|
1700
|
-
_a),
|
|
1701
|
-
caption: {
|
|
1702
|
-
display: 'inline',
|
|
1703
|
-
},
|
|
1704
|
-
overline: {
|
|
1705
|
-
display: 'inline',
|
|
1706
|
-
},
|
|
1707
|
-
});
|
|
1708
|
-
});
|
|
1709
|
-
|
|
1710
|
-
var Typography = React.forwardRef(function (props, ref) {
|
|
1711
|
-
var classes = useTypographyStyles(props);
|
|
1712
|
-
return React__default['default'].createElement(MuiTypography__default['default'], __assign({ ref: ref, classes: classes }, props));
|
|
1713
|
-
});
|
|
1714
|
-
Typography.displayName = 'Typography';
|
|
1715
|
-
|
|
1716
2124
|
var getFadeStop = function (_a, typographyVariant) {
|
|
1717
2125
|
var typography = _a.typography;
|
|
1718
2126
|
return !isNaN(Number(typography[typographyVariant].lineHeight))
|
|
@@ -1769,7 +2177,7 @@ var SemanticColors;
|
|
|
1769
2177
|
SemanticColors["SECONDARY_DARK"] = "secondary.dark";
|
|
1770
2178
|
SemanticColors["SECONDARY_LIGHT"] = "secondary.light";
|
|
1771
2179
|
})(SemanticColors || (SemanticColors = {}));
|
|
1772
|
-
var useStyles
|
|
2180
|
+
var useStyles = core.makeStyles(function (theme) { return ({
|
|
1773
2181
|
dividerRoot: {
|
|
1774
2182
|
gap: theme.spacing(2),
|
|
1775
2183
|
},
|
|
@@ -1807,7 +2215,7 @@ var useStyles$1 = core.makeStyles(function (theme) { return ({
|
|
|
1807
2215
|
}); });
|
|
1808
2216
|
var Divider = function (props) {
|
|
1809
2217
|
var className = props.className, text = props.text, textTransform = props.textTransform, TypographyProps = props.TypographyProps;
|
|
1810
|
-
var classes = useStyles
|
|
2218
|
+
var classes = useStyles(props);
|
|
1811
2219
|
var casingOffset = textTransform === 'lowercase' ? '.25rem' : 'unset';
|
|
1812
2220
|
return (React__default['default'].createElement(Box, { className: classNames([classes.dividerRoot, className]), display: "flex", alignItems: "center" },
|
|
1813
2221
|
React__default['default'].createElement(Box, { className: classes.dividerLine, display: "flex", flexGrow: 1, height: "1px", marginTop: casingOffset }),
|
|
@@ -1820,14 +2228,6 @@ Divider.defaultProps = {
|
|
|
1820
2228
|
textTransform: 'lowercase',
|
|
1821
2229
|
};
|
|
1822
2230
|
|
|
1823
|
-
var IconButton = React.forwardRef(function (props, ref) {
|
|
1824
|
-
return React__default['default'].createElement(MuiIconButton__default['default'], __assign({ ref: ref }, props));
|
|
1825
|
-
});
|
|
1826
|
-
IconButton.displayName = 'IconButton';
|
|
1827
|
-
IconButton.defaultProps = {
|
|
1828
|
-
color: 'secondary',
|
|
1829
|
-
};
|
|
1830
|
-
|
|
1831
2231
|
var getLinkColor = function (_a, _b) {
|
|
1832
2232
|
var palette = _a.palette;
|
|
1833
2233
|
var _c = _b.color, color = _c === void 0 ? 'info' : _c;
|
|
@@ -1868,28 +2268,6 @@ Link.defaultProps = {
|
|
|
1868
2268
|
};
|
|
1869
2269
|
Link.displayName = 'Link';
|
|
1870
2270
|
|
|
1871
|
-
var useStyles = core.makeStyles(function (_a) {
|
|
1872
|
-
var spacing = _a.spacing;
|
|
1873
|
-
return ({
|
|
1874
|
-
root: {
|
|
1875
|
-
'&:last-child': {
|
|
1876
|
-
marginBottom: 0,
|
|
1877
|
-
},
|
|
1878
|
-
marginBottom: spacing(4),
|
|
1879
|
-
padding: spacing(4),
|
|
1880
|
-
},
|
|
1881
|
-
});
|
|
1882
|
-
});
|
|
1883
|
-
var Paper = React.forwardRef(function (props, ref) {
|
|
1884
|
-
var legacyStyles = props.legacyStyles, restProps = __rest(props, ["legacyStyles"]);
|
|
1885
|
-
var classes = useStyles(props);
|
|
1886
|
-
return React__default['default'].createElement(core.Paper, __assign({}, ref, { classes: __assign({}, (legacyStyles && classes)) }, restProps));
|
|
1887
|
-
});
|
|
1888
|
-
Paper.displayName = 'Paper';
|
|
1889
|
-
Paper.defaultProps = {
|
|
1890
|
-
legacyStyles: false,
|
|
1891
|
-
};
|
|
1892
|
-
|
|
1893
2271
|
var PaperContent = function (props) {
|
|
1894
2272
|
var children = props.children;
|
|
1895
2273
|
return React__default['default'].createElement(Box, { padding: 4 }, children);
|
|
@@ -6587,60 +6965,6 @@ var useTableHeaderCellStyles = core.makeStyles(function (theme) { return ({
|
|
|
6587
6965
|
},
|
|
6588
6966
|
}); });
|
|
6589
6967
|
|
|
6590
|
-
var _path$3K;
|
|
6591
|
-
|
|
6592
|
-
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); }
|
|
6593
|
-
|
|
6594
|
-
function SvgMore(props) {
|
|
6595
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3$({
|
|
6596
|
-
viewBox: "0 0 16 16",
|
|
6597
|
-
strokeLinecap: "round",
|
|
6598
|
-
strokeLinejoin: "round",
|
|
6599
|
-
stroke: "currentColor",
|
|
6600
|
-
width: "1em",
|
|
6601
|
-
height: "1em",
|
|
6602
|
-
fill: "none"
|
|
6603
|
-
}, props), _path$3K || (_path$3K = /*#__PURE__*/React__namespace.createElement("path", {
|
|
6604
|
-
d: "M8 8.667a.667.667 0 100-1.334.667.667 0 000 1.334zM8 4a.667.667 0 100-1.333A.667.667 0 008 4zm0 9.333A.667.667 0 108 12a.667.667 0 000 1.333z"
|
|
6605
|
-
})));
|
|
6606
|
-
}
|
|
6607
|
-
|
|
6608
|
-
var _path$2X;
|
|
6609
|
-
|
|
6610
|
-
function _extends$3b() { _extends$3b = 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$3b.apply(this, arguments); }
|
|
6611
|
-
|
|
6612
|
-
function SvgChevronDown(props) {
|
|
6613
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3b({
|
|
6614
|
-
viewBox: "0 0 16 16",
|
|
6615
|
-
strokeLinecap: "round",
|
|
6616
|
-
strokeLinejoin: "round",
|
|
6617
|
-
stroke: "currentColor",
|
|
6618
|
-
width: "1em",
|
|
6619
|
-
height: "1em",
|
|
6620
|
-
fill: "none"
|
|
6621
|
-
}, props), _path$2X || (_path$2X = /*#__PURE__*/React__namespace.createElement("path", {
|
|
6622
|
-
d: "M4 6l4 4 4-4"
|
|
6623
|
-
})));
|
|
6624
|
-
}
|
|
6625
|
-
|
|
6626
|
-
var _path$2W;
|
|
6627
|
-
|
|
6628
|
-
function _extends$3a() { _extends$3a = 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$3a.apply(this, arguments); }
|
|
6629
|
-
|
|
6630
|
-
function SvgChevronUp(props) {
|
|
6631
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3a({
|
|
6632
|
-
viewBox: "0 0 16 16",
|
|
6633
|
-
strokeLinecap: "round",
|
|
6634
|
-
strokeLinejoin: "round",
|
|
6635
|
-
stroke: "currentColor",
|
|
6636
|
-
width: "1em",
|
|
6637
|
-
height: "1em",
|
|
6638
|
-
fill: "none"
|
|
6639
|
-
}, props), _path$2W || (_path$2W = /*#__PURE__*/React__namespace.createElement("path", {
|
|
6640
|
-
d: "M12 10L8 6l-4 4"
|
|
6641
|
-
})));
|
|
6642
|
-
}
|
|
6643
|
-
|
|
6644
6968
|
var TableHeaderCell = function (props) {
|
|
6645
6969
|
var children = props.children, column = props.column; props.tableProps; var restProps = __rest(props, ["children", "column", "tableProps"]);
|
|
6646
6970
|
var root = useTableHeaderCellStyles(props).root;
|
|
@@ -7266,6 +7590,7 @@ Object.defineProperty(exports, 'Tabs', {
|
|
|
7266
7590
|
return Tabs__default['default'];
|
|
7267
7591
|
}
|
|
7268
7592
|
});
|
|
7593
|
+
exports.AudioPlayer = AudioPlayer;
|
|
7269
7594
|
exports.Avatar = Avatar;
|
|
7270
7595
|
exports.Box = Box;
|
|
7271
7596
|
exports.Button = Button;
|