@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.es.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export { default as Alert } from '@material-ui/lab/Alert';
|
|
2
|
-
import { makeStyles
|
|
2
|
+
import { makeStyles, Box as Box$1, Paper as Paper$1, Popper, Grow, Slider, useTheme as useTheme$1 } from '@material-ui/core';
|
|
3
3
|
export { Accordion, AccordionActions, AccordionDetails, AccordionSummary, Breadcrumbs, ButtonBase, ClickAwayListener, Fab, GridList, Hidden, Modal, Popover, Popper, Step, StepButton, StepConnector, StepContent, StepIcon, StepLabel, Stepper, ThemeProvider, Toolbar, alpha, createTheme, darken, decomposeColor, getLuminance, hexToRgb, lighten, makeStyles, recomposeColor, rgbToHex } from '@material-ui/core';
|
|
4
4
|
export { default as AppBar } from '@material-ui/core/AppBar';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import React__default, {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
6
|
+
import React__default, { createElement, forwardRef, useRef, useState, useReducer, useEffect, Fragment, useMemo } from 'react';
|
|
7
|
+
import MuiIconButton from '@material-ui/core/IconButton';
|
|
8
|
+
import MuiTypography from '@material-ui/core/Typography';
|
|
9
|
+
import { makeStyles as makeStyles$1, useTheme } from '@material-ui/core/styles';
|
|
9
10
|
export { ServerStyleSheets } from '@material-ui/core/styles';
|
|
11
|
+
import MuiAvatar from '@material-ui/core/Avatar';
|
|
10
12
|
export { default as Badge } from '@material-ui/core/Badge';
|
|
11
13
|
import MuiButton from '@material-ui/core/Button';
|
|
12
14
|
import CircularProgress from '@material-ui/core/CircularProgress';
|
|
@@ -23,7 +25,6 @@ import FormControlLabel from '@material-ui/core/FormControlLabel';
|
|
|
23
25
|
export { default as FormControlLabel } from '@material-ui/core/FormControlLabel';
|
|
24
26
|
export { default as Chip } from '@material-ui/core/Chip';
|
|
25
27
|
import Collapse from '@material-ui/core/Collapse';
|
|
26
|
-
import MuiTypography from '@material-ui/core/Typography';
|
|
27
28
|
export { default as Dialog } from '@material-ui/core/Dialog';
|
|
28
29
|
export { default as DialogActions } from '@material-ui/core/DialogActions';
|
|
29
30
|
export { default as DialogContent } from '@material-ui/core/DialogContent';
|
|
@@ -31,7 +32,6 @@ export { default as DialogTitle } from '@material-ui/core/DialogTitle';
|
|
|
31
32
|
export { default as Drawer } from '@material-ui/core/Drawer';
|
|
32
33
|
export { default as FormControl } from '@material-ui/core/FormControl';
|
|
33
34
|
export { default as Grid } from '@material-ui/core/Grid';
|
|
34
|
-
import MuiIconButton from '@material-ui/core/IconButton';
|
|
35
35
|
export { default as InputAdornment } from '@material-ui/core/InputAdornment';
|
|
36
36
|
export { default as LinearProgress } from '@material-ui/core/LinearProgress';
|
|
37
37
|
import MuiLink from '@material-ui/core/Link';
|
|
@@ -104,144 +104,6 @@ function __spreadArray(to, from, pack) {
|
|
|
104
104
|
return to.concat(ar || from);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
var LoadingStatus;
|
|
108
|
-
(function (LoadingStatus) {
|
|
109
|
-
LoadingStatus["ERROR"] = "ERROR";
|
|
110
|
-
LoadingStatus["LOADED"] = "LOADED";
|
|
111
|
-
LoadingStatus["PENDING"] = "PENDING";
|
|
112
|
-
})(LoadingStatus || (LoadingStatus = {}));
|
|
113
|
-
/**
|
|
114
|
-
* Hook returns [imgProps, loaded]
|
|
115
|
-
* ref: Merged default and provided imgProp object. Includes load and error events for img tag. To be passed to MuiAvatar.
|
|
116
|
-
* loaded: Indicates whether the src supplied to an img within Avatar results in loaded or error
|
|
117
|
-
*/
|
|
118
|
-
var useImgProps = function (avatarProps) {
|
|
119
|
-
var _a = React__default.useState(LoadingStatus.PENDING), loaded = _a[0], setLoaded = _a[1];
|
|
120
|
-
var imgProps = __assign(__assign({}, avatarProps.imgProps), { onError: function (event) {
|
|
121
|
-
var _a, _b;
|
|
122
|
-
setLoaded(LoadingStatus.ERROR);
|
|
123
|
-
(_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
124
|
-
}, onLoad: function (event) {
|
|
125
|
-
var _a, _b;
|
|
126
|
-
setLoaded(LoadingStatus.LOADED);
|
|
127
|
-
(_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
128
|
-
} });
|
|
129
|
-
return { imgProps: imgProps, loaded: loaded };
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
var getAvatarDimensions = function (theme, props) {
|
|
133
|
-
var factors = {
|
|
134
|
-
'extra-small': 3,
|
|
135
|
-
small: 4,
|
|
136
|
-
medium: 5,
|
|
137
|
-
large: 6,
|
|
138
|
-
'extra-large': 12.5,
|
|
139
|
-
};
|
|
140
|
-
var sizeFactor = factors[props.size || 'medium'];
|
|
141
|
-
return theme.spacing(sizeFactor);
|
|
142
|
-
};
|
|
143
|
-
var getAvatarFontSize = function (props) {
|
|
144
|
-
var fontSizes = {
|
|
145
|
-
'extra-small': '0.75rem',
|
|
146
|
-
small: '1rem',
|
|
147
|
-
medium: '1rem',
|
|
148
|
-
large: '1.25rem',
|
|
149
|
-
'extra-large': '3.5rem',
|
|
150
|
-
};
|
|
151
|
-
return fontSizes[props.size || 'medium'];
|
|
152
|
-
};
|
|
153
|
-
var getAvatarBackground = function (props) {
|
|
154
|
-
var src = props.src, loaded = props.loaded;
|
|
155
|
-
var background = props.background;
|
|
156
|
-
if (src && loaded === LoadingStatus.LOADED) {
|
|
157
|
-
background = 'transparent';
|
|
158
|
-
}
|
|
159
|
-
return background;
|
|
160
|
-
};
|
|
161
|
-
var useAvatarStyles = makeStyles(function (theme) { return ({
|
|
162
|
-
root: {
|
|
163
|
-
width: function (props) { return getAvatarDimensions(theme, props); },
|
|
164
|
-
height: function (props) { return getAvatarDimensions(theme, props); },
|
|
165
|
-
fontSize: function (props) { return getAvatarFontSize(props); },
|
|
166
|
-
backgroundColor: function (props) { return getAvatarBackground(props); },
|
|
167
|
-
color: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
|
|
168
|
-
objectFit: function (props) { return props.fit; },
|
|
169
|
-
},
|
|
170
|
-
silhouette: {
|
|
171
|
-
'& path': {
|
|
172
|
-
fill: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
}); });
|
|
176
|
-
|
|
177
|
-
var _path$2;
|
|
178
|
-
|
|
179
|
-
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); }
|
|
180
|
-
|
|
181
|
-
function SvgSilhouetteFemale(props) {
|
|
182
|
-
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
183
|
-
viewBox: "0 0 300 300",
|
|
184
|
-
fill: "none",
|
|
185
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
186
|
-
}, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
|
|
187
|
-
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",
|
|
188
|
-
fill: "#2E3042"
|
|
189
|
-
})));
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
var _path$1;
|
|
193
|
-
|
|
194
|
-
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); }
|
|
195
|
-
|
|
196
|
-
function SvgSilhouetteMale(props) {
|
|
197
|
-
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
198
|
-
viewBox: "0 0 300 300",
|
|
199
|
-
fill: "none",
|
|
200
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
201
|
-
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
202
|
-
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",
|
|
203
|
-
fill: "#2E3042"
|
|
204
|
-
})));
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
var _path;
|
|
208
|
-
|
|
209
|
-
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); }
|
|
210
|
-
|
|
211
|
-
function SvgSilhouetteNeutral(props) {
|
|
212
|
-
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
213
|
-
viewBox: "0 0 300 300",
|
|
214
|
-
fill: "none",
|
|
215
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
216
|
-
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
217
|
-
fillRule: "evenodd",
|
|
218
|
-
clipRule: "evenodd",
|
|
219
|
-
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",
|
|
220
|
-
fill: "#2E3042"
|
|
221
|
-
})));
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
var silhouettes = {
|
|
225
|
-
female: SvgSilhouetteFemale,
|
|
226
|
-
male: SvgSilhouetteMale,
|
|
227
|
-
neutral: SvgSilhouetteNeutral,
|
|
228
|
-
};
|
|
229
|
-
var Avatar = forwardRef(function (props, ref) {
|
|
230
|
-
var children = props.children, _a = props.silhouette, silhouette = _a === void 0 ? 'neutral' : _a, muiProps = __rest(props, ["children", "silhouette"]);
|
|
231
|
-
var _b = useImgProps(props), imgProps = _b.imgProps, loaded = _b.loaded;
|
|
232
|
-
var classes = useAvatarStyles(__assign(__assign({}, props), { loaded: loaded }));
|
|
233
|
-
var Silhouette = silhouettes[silhouette];
|
|
234
|
-
var fallback = muiProps.src || silhouette === 'none' ? '' : React__default.createElement(Silhouette, { className: classes.silhouette });
|
|
235
|
-
return (React__default.createElement(MuiAvatar, __assign({ ref: ref, classes: { root: classes.root } }, muiProps, imgProps), children || fallback));
|
|
236
|
-
});
|
|
237
|
-
Avatar.defaultProps = {
|
|
238
|
-
size: 'medium',
|
|
239
|
-
fit: 'cover',
|
|
240
|
-
background: '#E0E0E0',
|
|
241
|
-
silhouette: 'neutral',
|
|
242
|
-
};
|
|
243
|
-
Avatar.displayName = 'Avatar';
|
|
244
|
-
|
|
245
107
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
246
108
|
|
|
247
109
|
var classnames = {exports: {}};
|
|
@@ -1486,56 +1348,682 @@ function style(options) {
|
|
|
1486
1348
|
return null;
|
|
1487
1349
|
}
|
|
1488
1350
|
|
|
1489
|
-
var propValue = props[prop];
|
|
1490
|
-
var theme = props.theme;
|
|
1491
|
-
var themeMapping = getPath(theme, themeKey) || {};
|
|
1351
|
+
var propValue = props[prop];
|
|
1352
|
+
var theme = props.theme;
|
|
1353
|
+
var themeMapping = getPath(theme, themeKey) || {};
|
|
1354
|
+
|
|
1355
|
+
var styleFromPropValue = function styleFromPropValue(propValueFinal) {
|
|
1356
|
+
var value;
|
|
1357
|
+
|
|
1358
|
+
if (typeof themeMapping === 'function') {
|
|
1359
|
+
value = themeMapping(propValueFinal);
|
|
1360
|
+
} else if (Array.isArray(themeMapping)) {
|
|
1361
|
+
value = themeMapping[propValueFinal] || propValueFinal;
|
|
1362
|
+
} else {
|
|
1363
|
+
value = getPath(themeMapping, propValueFinal) || propValueFinal;
|
|
1364
|
+
|
|
1365
|
+
if (transform) {
|
|
1366
|
+
value = transform(value);
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
if (cssProperty === false) {
|
|
1371
|
+
return value;
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
return _defineProperty({}, cssProperty, value);
|
|
1375
|
+
};
|
|
1376
|
+
|
|
1377
|
+
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
1378
|
+
};
|
|
1379
|
+
|
|
1380
|
+
fn.propTypes = process.env.NODE_ENV !== 'production' ? _defineProperty({}, prop, responsivePropType) : {};
|
|
1381
|
+
fn.filterProps = [prop];
|
|
1382
|
+
return fn;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
var gap = style({
|
|
1386
|
+
prop: 'gap',
|
|
1387
|
+
themeKey: 'spacing',
|
|
1388
|
+
});
|
|
1389
|
+
var useBoxStyles = makeStyles(function (theme) { return ({
|
|
1390
|
+
root: function (props) { return gap(__assign(__assign({}, props), { theme: theme })); },
|
|
1391
|
+
}); });
|
|
1392
|
+
|
|
1393
|
+
var Box = function (props) {
|
|
1394
|
+
var className = props.className; props.gap; var restProps = __rest(props, ["className", "gap"]);
|
|
1395
|
+
var root = useBoxStyles(props).root;
|
|
1396
|
+
return React__default.createElement(Box$1, __assign({ className: classNames(root, className) }, restProps));
|
|
1397
|
+
};
|
|
1398
|
+
Box.displayName = 'Box';
|
|
1399
|
+
|
|
1400
|
+
var useIconStyles = makeStyles(function (_a) {
|
|
1401
|
+
var spacing = _a.spacing, palette = _a.palette;
|
|
1402
|
+
var getFontSize = function (_a) {
|
|
1403
|
+
var size = _a.size;
|
|
1404
|
+
var sizes = {
|
|
1405
|
+
inherit: 'inherit',
|
|
1406
|
+
small: spacing(1.5),
|
|
1407
|
+
medium: spacing(2),
|
|
1408
|
+
large: spacing(2.5),
|
|
1409
|
+
'extra-large': spacing(3),
|
|
1410
|
+
};
|
|
1411
|
+
return size ? sizes[size] : 'inherit';
|
|
1412
|
+
};
|
|
1413
|
+
var getColor = function (props) {
|
|
1414
|
+
var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
|
|
1415
|
+
var value = 'inherit';
|
|
1416
|
+
if (props.color) {
|
|
1417
|
+
if (semanticColors.includes(props.color.split('.')[0])) {
|
|
1418
|
+
var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
|
|
1419
|
+
value = palette[color][variant];
|
|
1420
|
+
}
|
|
1421
|
+
else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {
|
|
1422
|
+
value = props.color;
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
return value;
|
|
1426
|
+
};
|
|
1427
|
+
return {
|
|
1428
|
+
root: {
|
|
1429
|
+
color: getColor,
|
|
1430
|
+
fontSize: getFontSize,
|
|
1431
|
+
strokeWidth: '1.3px',
|
|
1432
|
+
},
|
|
1433
|
+
};
|
|
1434
|
+
});
|
|
1435
|
+
|
|
1436
|
+
var iconStaticClassName = 'pop-icon';
|
|
1437
|
+
var Icon = function (props) {
|
|
1438
|
+
var icon = props.icon, className = props.className, restProps = __rest(props, ["icon", "className"]);
|
|
1439
|
+
var classes = useIconStyles(props);
|
|
1440
|
+
var isValid = true;
|
|
1441
|
+
if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {
|
|
1442
|
+
isValid = false;
|
|
1443
|
+
}
|
|
1444
|
+
return isValid
|
|
1445
|
+
? createElement(icon, __assign({ className: classNames([classes.root, iconStaticClassName, className]) }, restProps))
|
|
1446
|
+
: null;
|
|
1447
|
+
};
|
|
1448
|
+
Icon.defaultProps = {
|
|
1449
|
+
size: 'inherit',
|
|
1450
|
+
color: 'inherit',
|
|
1451
|
+
};
|
|
1452
|
+
Icon.displayName = 'Icon';
|
|
1453
|
+
|
|
1454
|
+
var IconButton = forwardRef(function (props, ref) {
|
|
1455
|
+
return React__default.createElement(MuiIconButton, __assign({ ref: ref }, props));
|
|
1456
|
+
});
|
|
1457
|
+
IconButton.displayName = 'IconButton';
|
|
1458
|
+
IconButton.defaultProps = {
|
|
1459
|
+
color: 'secondary',
|
|
1460
|
+
};
|
|
1461
|
+
|
|
1462
|
+
var useTypographyStyles = makeStyles$1(function () {
|
|
1463
|
+
var _a;
|
|
1464
|
+
return ({
|
|
1465
|
+
root: (_a = {},
|
|
1466
|
+
_a["& ." + iconStaticClassName] = {
|
|
1467
|
+
position: 'relative',
|
|
1468
|
+
top: '0.125em',
|
|
1469
|
+
padding: '0 0.125em',
|
|
1470
|
+
boxSizing: 'content-box',
|
|
1471
|
+
},
|
|
1472
|
+
_a),
|
|
1473
|
+
caption: {
|
|
1474
|
+
display: 'inline',
|
|
1475
|
+
},
|
|
1476
|
+
overline: {
|
|
1477
|
+
display: 'inline',
|
|
1478
|
+
},
|
|
1479
|
+
});
|
|
1480
|
+
});
|
|
1481
|
+
|
|
1482
|
+
var Typography = forwardRef(function (props, ref) {
|
|
1483
|
+
var classes = useTypographyStyles(props);
|
|
1484
|
+
return React__default.createElement(MuiTypography, __assign({ ref: ref, classes: classes }, props));
|
|
1485
|
+
});
|
|
1486
|
+
Typography.displayName = 'Typography';
|
|
1487
|
+
|
|
1488
|
+
var useStyles$1 = makeStyles(function (_a) {
|
|
1489
|
+
var spacing = _a.spacing;
|
|
1490
|
+
return ({
|
|
1491
|
+
root: {
|
|
1492
|
+
'&:last-child': {
|
|
1493
|
+
marginBottom: 0,
|
|
1494
|
+
},
|
|
1495
|
+
marginBottom: spacing(4),
|
|
1496
|
+
padding: spacing(4),
|
|
1497
|
+
},
|
|
1498
|
+
});
|
|
1499
|
+
});
|
|
1500
|
+
var Paper = forwardRef(function (props, ref) {
|
|
1501
|
+
var legacyStyles = props.legacyStyles, restProps = __rest(props, ["legacyStyles"]);
|
|
1502
|
+
var classes = useStyles$1(props);
|
|
1503
|
+
return React__default.createElement(Paper$1, __assign({}, ref, { classes: __assign({}, (legacyStyles && classes)) }, restProps));
|
|
1504
|
+
});
|
|
1505
|
+
Paper.displayName = 'Paper';
|
|
1506
|
+
Paper.defaultProps = {
|
|
1507
|
+
legacyStyles: false,
|
|
1508
|
+
};
|
|
1509
|
+
|
|
1510
|
+
var AUDIO_PLAYER_EVENT_TYPES;
|
|
1511
|
+
(function (AUDIO_PLAYER_EVENT_TYPES) {
|
|
1512
|
+
AUDIO_PLAYER_EVENT_TYPES["TOGGLE_PLAYBACK"] = "TOGGLE_PLAYBACK";
|
|
1513
|
+
AUDIO_PLAYER_EVENT_TYPES["TOGGLE_VOLUME_CONTROL"] = "TOGGLE_VOLUME_CONTROL";
|
|
1514
|
+
AUDIO_PLAYER_EVENT_TYPES["TOGGLE_MUTE"] = "TOGGLE_MUTE";
|
|
1515
|
+
AUDIO_PLAYER_EVENT_TYPES["VOLUME_CHANGE"] = "VOLUME_CHANGE";
|
|
1516
|
+
AUDIO_PLAYER_EVENT_TYPES["TIME_CHANGE"] = "TIME_CHANGE";
|
|
1517
|
+
AUDIO_PLAYER_EVENT_TYPES["DURATION_CHANGE"] = "DURATION_CHANGE";
|
|
1518
|
+
AUDIO_PLAYER_EVENT_TYPES["SET_TIME"] = "SET_TIME";
|
|
1519
|
+
AUDIO_PLAYER_EVENT_TYPES["CAN_PLAY"] = "CAN_PLAY";
|
|
1520
|
+
})(AUDIO_PLAYER_EVENT_TYPES || (AUDIO_PLAYER_EVENT_TYPES = {}));
|
|
1521
|
+
var PLAYBACK_STATES;
|
|
1522
|
+
(function (PLAYBACK_STATES) {
|
|
1523
|
+
PLAYBACK_STATES["NONE"] = "NONE";
|
|
1524
|
+
PLAYBACK_STATES["PLAYABLE"] = "PLAYABLE";
|
|
1525
|
+
PLAYBACK_STATES["PAUSED"] = "PAUSED";
|
|
1526
|
+
PLAYBACK_STATES["PLAYING"] = "PLAYING";
|
|
1527
|
+
})(PLAYBACK_STATES || (PLAYBACK_STATES = {}));
|
|
1528
|
+
var CONTROL_LABELS;
|
|
1529
|
+
(function (CONTROL_LABELS) {
|
|
1530
|
+
CONTROL_LABELS["PAUSE"] = "PAUSE";
|
|
1531
|
+
CONTROL_LABELS["PLAY"] = "PLAY";
|
|
1532
|
+
CONTROL_LABELS["MUTE"] = "MUTE";
|
|
1533
|
+
CONTROL_LABELS["UNMUTE"] = "UNMUTE";
|
|
1534
|
+
})(CONTROL_LABELS || (CONTROL_LABELS = {}));
|
|
1535
|
+
var VOLUME_CONTROL_STATES;
|
|
1536
|
+
(function (VOLUME_CONTROL_STATES) {
|
|
1537
|
+
VOLUME_CONTROL_STATES["SHOW"] = "SHOW";
|
|
1538
|
+
VOLUME_CONTROL_STATES["HIDE"] = "HIDE";
|
|
1539
|
+
})(VOLUME_CONTROL_STATES || (VOLUME_CONTROL_STATES = {}));
|
|
1540
|
+
|
|
1541
|
+
var initialAudioPlayerState = {
|
|
1542
|
+
playback: PLAYBACK_STATES.NONE,
|
|
1543
|
+
volumeControls: VOLUME_CONTROL_STATES.HIDE,
|
|
1544
|
+
context: {
|
|
1545
|
+
volume: 100,
|
|
1546
|
+
playbackButtonLabel: CONTROL_LABELS.PLAY,
|
|
1547
|
+
volumeButtonLabel: CONTROL_LABELS.MUTE,
|
|
1548
|
+
},
|
|
1549
|
+
};
|
|
1550
|
+
var audioPlayerReducer = function (state, event) {
|
|
1551
|
+
var _a, _b;
|
|
1552
|
+
console.log(event.type);
|
|
1553
|
+
var audioRef = state.context.audioRef;
|
|
1554
|
+
var nextState = __assign({}, state);
|
|
1555
|
+
switch (state.playback) {
|
|
1556
|
+
case PLAYBACK_STATES.NONE:
|
|
1557
|
+
if (event.type === AUDIO_PLAYER_EVENT_TYPES.CAN_PLAY) {
|
|
1558
|
+
nextState.playback = PLAYBACK_STATES.PAUSED;
|
|
1559
|
+
return nextState;
|
|
1560
|
+
}
|
|
1561
|
+
break;
|
|
1562
|
+
case PLAYBACK_STATES.PAUSED:
|
|
1563
|
+
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK) {
|
|
1564
|
+
(_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
1565
|
+
nextState.playback = PLAYBACK_STATES.PLAYING;
|
|
1566
|
+
nextState.context.playbackButtonLabel = CONTROL_LABELS.PAUSE;
|
|
1567
|
+
return nextState;
|
|
1568
|
+
}
|
|
1569
|
+
break;
|
|
1570
|
+
case PLAYBACK_STATES.PLAYING:
|
|
1571
|
+
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK) {
|
|
1572
|
+
(_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.pause();
|
|
1573
|
+
nextState.playback = PLAYBACK_STATES.PAUSED;
|
|
1574
|
+
nextState.context.playbackButtonLabel = CONTROL_LABELS.PLAY;
|
|
1575
|
+
return nextState;
|
|
1576
|
+
}
|
|
1577
|
+
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TIME_CHANGE) {
|
|
1578
|
+
// time change is managed by audioRef automatically, return state to force re-render so ui stays synced
|
|
1579
|
+
return nextState;
|
|
1580
|
+
}
|
|
1581
|
+
break;
|
|
1582
|
+
}
|
|
1583
|
+
switch (state.volumeControls) {
|
|
1584
|
+
case VOLUME_CONTROL_STATES.SHOW:
|
|
1585
|
+
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL) {
|
|
1586
|
+
nextState.volumeControls = VOLUME_CONTROL_STATES.HIDE;
|
|
1587
|
+
return nextState;
|
|
1588
|
+
}
|
|
1589
|
+
if (event.type === AUDIO_PLAYER_EVENT_TYPES.VOLUME_CHANGE) {
|
|
1590
|
+
if (nextState.context.volume !== event.context.volume) {
|
|
1591
|
+
nextState.context.volume = event.context.volume;
|
|
1592
|
+
if (audioRef.current) {
|
|
1593
|
+
audioRef.current.volume = event.context.volume;
|
|
1594
|
+
}
|
|
1595
|
+
return nextState;
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
break;
|
|
1599
|
+
case VOLUME_CONTROL_STATES.HIDE:
|
|
1600
|
+
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL) {
|
|
1601
|
+
nextState.volumeControls = VOLUME_CONTROL_STATES.SHOW;
|
|
1602
|
+
return nextState;
|
|
1603
|
+
}
|
|
1604
|
+
break;
|
|
1605
|
+
}
|
|
1606
|
+
switch (event.type) {
|
|
1607
|
+
case AUDIO_PLAYER_EVENT_TYPES.TOGGLE_MUTE:
|
|
1608
|
+
if (audioRef.current) {
|
|
1609
|
+
audioRef.current.muted = !audioRef.current.muted;
|
|
1610
|
+
return nextState;
|
|
1611
|
+
}
|
|
1612
|
+
break;
|
|
1613
|
+
case AUDIO_PLAYER_EVENT_TYPES.SET_TIME:
|
|
1614
|
+
if (audioRef.current) {
|
|
1615
|
+
audioRef.current.currentTime = event.context.time;
|
|
1616
|
+
return nextState;
|
|
1617
|
+
}
|
|
1618
|
+
break;
|
|
1619
|
+
}
|
|
1620
|
+
return state;
|
|
1621
|
+
};
|
|
1622
|
+
|
|
1623
|
+
var _path$3K;
|
|
1624
|
+
|
|
1625
|
+
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); }
|
|
1626
|
+
|
|
1627
|
+
function SvgMore(props) {
|
|
1628
|
+
return /*#__PURE__*/React.createElement("svg", _extends$3$({
|
|
1629
|
+
viewBox: "0 0 16 16",
|
|
1630
|
+
strokeLinecap: "round",
|
|
1631
|
+
strokeLinejoin: "round",
|
|
1632
|
+
stroke: "currentColor",
|
|
1633
|
+
width: "1em",
|
|
1634
|
+
height: "1em",
|
|
1635
|
+
fill: "none"
|
|
1636
|
+
}, props), _path$3K || (_path$3K = /*#__PURE__*/React.createElement("path", {
|
|
1637
|
+
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"
|
|
1638
|
+
})));
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
var _path$2X;
|
|
1642
|
+
|
|
1643
|
+
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); }
|
|
1644
|
+
|
|
1645
|
+
function SvgChevronDown(props) {
|
|
1646
|
+
return /*#__PURE__*/React.createElement("svg", _extends$3b({
|
|
1647
|
+
viewBox: "0 0 16 16",
|
|
1648
|
+
strokeLinecap: "round",
|
|
1649
|
+
strokeLinejoin: "round",
|
|
1650
|
+
stroke: "currentColor",
|
|
1651
|
+
width: "1em",
|
|
1652
|
+
height: "1em",
|
|
1653
|
+
fill: "none"
|
|
1654
|
+
}, props), _path$2X || (_path$2X = /*#__PURE__*/React.createElement("path", {
|
|
1655
|
+
d: "M4 6l4 4 4-4"
|
|
1656
|
+
})));
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
var _path$2W;
|
|
1660
|
+
|
|
1661
|
+
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); }
|
|
1662
|
+
|
|
1663
|
+
function SvgChevronUp(props) {
|
|
1664
|
+
return /*#__PURE__*/React.createElement("svg", _extends$3a({
|
|
1665
|
+
viewBox: "0 0 16 16",
|
|
1666
|
+
strokeLinecap: "round",
|
|
1667
|
+
strokeLinejoin: "round",
|
|
1668
|
+
stroke: "currentColor",
|
|
1669
|
+
width: "1em",
|
|
1670
|
+
height: "1em",
|
|
1671
|
+
fill: "none"
|
|
1672
|
+
}, props), _path$2W || (_path$2W = /*#__PURE__*/React.createElement("path", {
|
|
1673
|
+
d: "M12 10L8 6l-4 4"
|
|
1674
|
+
})));
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
var _path$1f;
|
|
1678
|
+
|
|
1679
|
+
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); }
|
|
1680
|
+
|
|
1681
|
+
function SvgPause(props) {
|
|
1682
|
+
return /*#__PURE__*/React.createElement("svg", _extends$1p({
|
|
1683
|
+
viewBox: "0 0 16 16",
|
|
1684
|
+
strokeLinecap: "round",
|
|
1685
|
+
strokeLinejoin: "round",
|
|
1686
|
+
stroke: "currentColor",
|
|
1687
|
+
width: "1em",
|
|
1688
|
+
height: "1em",
|
|
1689
|
+
fill: "none"
|
|
1690
|
+
}, props), _path$1f || (_path$1f = /*#__PURE__*/React.createElement("path", {
|
|
1691
|
+
d: "M6.667 2.667H4v10.666h2.667V2.667zm5.333 0H9.333v10.666H12V2.667z"
|
|
1692
|
+
})));
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
var _path$1d;
|
|
1696
|
+
|
|
1697
|
+
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); }
|
|
1698
|
+
|
|
1699
|
+
function SvgPlay(props) {
|
|
1700
|
+
return /*#__PURE__*/React.createElement("svg", _extends$1n({
|
|
1701
|
+
viewBox: "0 0 16 16",
|
|
1702
|
+
strokeLinecap: "round",
|
|
1703
|
+
strokeLinejoin: "round",
|
|
1704
|
+
stroke: "currentColor",
|
|
1705
|
+
width: "1em",
|
|
1706
|
+
height: "1em",
|
|
1707
|
+
fill: "none"
|
|
1708
|
+
}, props), _path$1d || (_path$1d = /*#__PURE__*/React.createElement("path", {
|
|
1709
|
+
d: "M3.333 2l9.334 6-9.334 6V2z"
|
|
1710
|
+
})));
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
var _path$10;
|
|
1714
|
+
|
|
1715
|
+
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); }
|
|
1716
|
+
|
|
1717
|
+
function SvgVolumeDown(props) {
|
|
1718
|
+
return /*#__PURE__*/React.createElement("svg", _extends$1a({
|
|
1719
|
+
viewBox: "0 0 16 16",
|
|
1720
|
+
strokeLinecap: "round",
|
|
1721
|
+
strokeLinejoin: "round",
|
|
1722
|
+
stroke: "currentColor",
|
|
1723
|
+
width: "1em",
|
|
1724
|
+
height: "1em",
|
|
1725
|
+
fill: "none"
|
|
1726
|
+
}, props), _path$10 || (_path$10 = /*#__PURE__*/React.createElement("path", {
|
|
1727
|
+
d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.713"
|
|
1728
|
+
})));
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
var _path$$;
|
|
1732
|
+
|
|
1733
|
+
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); }
|
|
1734
|
+
|
|
1735
|
+
function SvgVolumeMute(props) {
|
|
1736
|
+
return /*#__PURE__*/React.createElement("svg", _extends$19({
|
|
1737
|
+
viewBox: "0 0 16 16",
|
|
1738
|
+
strokeLinecap: "round",
|
|
1739
|
+
strokeLinejoin: "round",
|
|
1740
|
+
stroke: "currentColor",
|
|
1741
|
+
width: "1em",
|
|
1742
|
+
height: "1em",
|
|
1743
|
+
fill: "none"
|
|
1744
|
+
}, props), _path$$ || (_path$$ = /*#__PURE__*/React.createElement("path", {
|
|
1745
|
+
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333z"
|
|
1746
|
+
})));
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
var _path$_;
|
|
1750
|
+
|
|
1751
|
+
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); }
|
|
1752
|
+
|
|
1753
|
+
function SvgVolumeOff(props) {
|
|
1754
|
+
return /*#__PURE__*/React.createElement("svg", _extends$18({
|
|
1755
|
+
viewBox: "0 0 16 16",
|
|
1756
|
+
strokeLinecap: "round",
|
|
1757
|
+
strokeLinejoin: "round",
|
|
1758
|
+
stroke: "currentColor",
|
|
1759
|
+
width: "1em",
|
|
1760
|
+
height: "1em",
|
|
1761
|
+
fill: "none"
|
|
1762
|
+
}, props), _path$_ || (_path$_ = /*#__PURE__*/React.createElement("path", {
|
|
1763
|
+
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm8 2.667l-4 4m0-4l4 4"
|
|
1764
|
+
})));
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
var _path$Z;
|
|
1768
|
+
|
|
1769
|
+
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); }
|
|
1770
|
+
|
|
1771
|
+
function SvgVolumeUp(props) {
|
|
1772
|
+
return /*#__PURE__*/React.createElement("svg", _extends$17({
|
|
1773
|
+
viewBox: "0 0 16 16",
|
|
1774
|
+
strokeLinecap: "round",
|
|
1775
|
+
strokeLinejoin: "round",
|
|
1776
|
+
stroke: "currentColor",
|
|
1777
|
+
width: "1em",
|
|
1778
|
+
height: "1em",
|
|
1779
|
+
fill: "none"
|
|
1780
|
+
}, props), _path$Z || (_path$Z = /*#__PURE__*/React.createElement("path", {
|
|
1781
|
+
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"
|
|
1782
|
+
})));
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
var usePlaybackIcon = function (state) {
|
|
1786
|
+
var _a;
|
|
1787
|
+
var options = (_a = {},
|
|
1788
|
+
_a[PLAYBACK_STATES.PAUSED] = SvgPlay,
|
|
1789
|
+
_a[PLAYBACK_STATES.PLAYING] = SvgPause,
|
|
1790
|
+
_a[PLAYBACK_STATES.NONE] = SvgPlay,
|
|
1791
|
+
_a[PLAYBACK_STATES.PLAYABLE] = SvgPlay,
|
|
1792
|
+
_a);
|
|
1793
|
+
return options[state.playback];
|
|
1794
|
+
};
|
|
1795
|
+
|
|
1796
|
+
var useVolumeIcon = function (state) {
|
|
1797
|
+
var volumeIcon = SvgVolumeUp;
|
|
1798
|
+
if (state.context.volume >= 0.5) {
|
|
1799
|
+
volumeIcon = SvgVolumeUp;
|
|
1800
|
+
}
|
|
1801
|
+
else if (state.context.volume < 0.5 && state.context.volume > 0) {
|
|
1802
|
+
volumeIcon = SvgVolumeDown;
|
|
1803
|
+
}
|
|
1804
|
+
else if (state.context.volume === 0) {
|
|
1805
|
+
volumeIcon = SvgVolumeMute;
|
|
1806
|
+
}
|
|
1807
|
+
if (state.context.audioRef.current) {
|
|
1808
|
+
if (state.context.audioRef.current.muted) {
|
|
1809
|
+
volumeIcon = SvgVolumeOff;
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
return volumeIcon;
|
|
1813
|
+
};
|
|
1814
|
+
|
|
1815
|
+
var appendZero = function (num) { return (num < 10 ? "0" + num : num); };
|
|
1816
|
+
var formatTime = function (time, remaning) {
|
|
1817
|
+
if (remaning === void 0) { remaning = false; }
|
|
1818
|
+
var dateTime = new Date(0, 0, 0, 0, 0, time, 0);
|
|
1819
|
+
var dateTimeH = appendZero(dateTime.getHours());
|
|
1820
|
+
var dateTimeM = appendZero(dateTime.getMinutes());
|
|
1821
|
+
var dateTimeS = appendZero(dateTime.getSeconds());
|
|
1822
|
+
var minus = remaning ? '-' : '';
|
|
1823
|
+
return dateTimeH > 0 ? "" + minus + dateTimeH + ":" + dateTimeM + ":" + dateTimeS : "" + minus + dateTimeM + ":" + dateTimeS;
|
|
1824
|
+
};
|
|
1825
|
+
|
|
1826
|
+
var setupAudioRef = function (config) { return function () {
|
|
1827
|
+
var _a, _b, _c;
|
|
1828
|
+
var audioRef = config.audioRef, send = config.send;
|
|
1829
|
+
var handleDurationChange = function (event) {
|
|
1830
|
+
var duration = event.target.duration;
|
|
1831
|
+
send({ type: AUDIO_PLAYER_EVENT_TYPES.DURATION_CHANGE, context: { duration: duration } });
|
|
1832
|
+
};
|
|
1833
|
+
var handleTimeUpdate = function (event) {
|
|
1834
|
+
var currentTime = event.target.currentTime;
|
|
1835
|
+
send({ type: AUDIO_PLAYER_EVENT_TYPES.TIME_CHANGE, context: { currentTime: currentTime } });
|
|
1836
|
+
};
|
|
1837
|
+
var handleCanPlay = function () {
|
|
1838
|
+
send({ type: AUDIO_PLAYER_EVENT_TYPES.CAN_PLAY });
|
|
1839
|
+
};
|
|
1840
|
+
(_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('durationchange', handleDurationChange);
|
|
1841
|
+
(_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('timeupdate', handleTimeUpdate);
|
|
1842
|
+
(_c = audioRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('canplay', handleCanPlay);
|
|
1843
|
+
return function () {
|
|
1844
|
+
var _a, _b, _c;
|
|
1845
|
+
(_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('durationchange', handleDurationChange);
|
|
1846
|
+
(_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('timeupdate', handleTimeUpdate);
|
|
1847
|
+
(_c = audioRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('canplay', handleCanPlay);
|
|
1848
|
+
};
|
|
1849
|
+
}; };
|
|
1850
|
+
|
|
1851
|
+
var AudioPlayer = function (props) {
|
|
1852
|
+
var _a, _b, _c, _d;
|
|
1853
|
+
var src = props.src;
|
|
1854
|
+
var volumeRef = useRef(null);
|
|
1855
|
+
var audioRef = useRef(null);
|
|
1856
|
+
var _f = useState(false), disableRipple = _f[0], setDisableRipple = _f[1];
|
|
1857
|
+
var _g = useReducer(audioPlayerReducer, __assign(__assign({}, initialAudioPlayerState), { context: __assign(__assign({}, initialAudioPlayerState.context), { audioRef: audioRef }) })), state = _g[0], send = _g[1];
|
|
1858
|
+
useEffect(setupAudioRef({ audioRef: audioRef, send: send }), [audioRef]);
|
|
1859
|
+
var PlaybackIcon = usePlaybackIcon(state);
|
|
1860
|
+
var VolumeIcon = useVolumeIcon(state);
|
|
1861
|
+
var togglePlayback = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK }); };
|
|
1862
|
+
var toggleVolumeControl = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL }); };
|
|
1863
|
+
var toggleMute = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_MUTE }); };
|
|
1864
|
+
var setTime = function (_e, time) { return send({ type: AUDIO_PLAYER_EVENT_TYPES.SET_TIME, context: { time: time } }); };
|
|
1865
|
+
var setVolume = function (_e, volume) { return send({ type: AUDIO_PLAYER_EVENT_TYPES.VOLUME_CHANGE, context: { volume: volume } }); };
|
|
1866
|
+
return (React__default.createElement(Box, { display: "flex", alignItems: "center", gap: 1 },
|
|
1867
|
+
React__default.createElement("audio", { ref: audioRef, src: src }),
|
|
1868
|
+
React__default.createElement(Box, null,
|
|
1869
|
+
React__default.createElement(IconButton, { "aria-label": state.context.playbackButtonLabel, disabled: state.playback === PLAYBACK_STATES.NONE, onClick: togglePlayback },
|
|
1870
|
+
React__default.createElement(Icon, { icon: PlaybackIcon })),
|
|
1871
|
+
React__default.createElement(IconButton, { "aria-label": state.context.volumeButtonLabel, ref: volumeRef, onClick: toggleMute, onMouseEnter: toggleVolumeControl, onMouseLeave: toggleVolumeControl, disableRipple: disableRipple },
|
|
1872
|
+
React__default.createElement(Icon, { icon: VolumeIcon }),
|
|
1873
|
+
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" }, function (_a) {
|
|
1874
|
+
var TransitionProps = _a.TransitionProps;
|
|
1875
|
+
return (React__default.createElement(Grow, __assign({}, TransitionProps),
|
|
1876
|
+
React__default.createElement(Paper, { elevation: 1 },
|
|
1877
|
+
React__default.createElement(Box, { py: 1, height: 80 },
|
|
1878
|
+
React__default.createElement(Slider, { color: "secondary", orientation: "vertical", value: state.context.volume, onChange: setVolume, max: 1, step: 0.01 })))));
|
|
1879
|
+
}))),
|
|
1880
|
+
React__default.createElement(Box, { display: "flex", flexGrow: 1, alignItems: "center", gap: 1 },
|
|
1881
|
+
React__default.createElement(Box, { flexBasis: 60 },
|
|
1882
|
+
React__default.createElement(Typography, null, formatTime(((_a = state.context.audioRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) || 0))),
|
|
1883
|
+
React__default.createElement(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 }),
|
|
1884
|
+
React__default.createElement(Box, { flexBasis: 60, textAlign: "end" },
|
|
1885
|
+
React__default.createElement(Typography, null, formatTime(((_d = state.context.audioRef.current) === null || _d === void 0 ? void 0 : _d.duration) || 0))))));
|
|
1886
|
+
};
|
|
1887
|
+
|
|
1888
|
+
var LoadingStatus;
|
|
1889
|
+
(function (LoadingStatus) {
|
|
1890
|
+
LoadingStatus["ERROR"] = "ERROR";
|
|
1891
|
+
LoadingStatus["LOADED"] = "LOADED";
|
|
1892
|
+
LoadingStatus["PENDING"] = "PENDING";
|
|
1893
|
+
})(LoadingStatus || (LoadingStatus = {}));
|
|
1894
|
+
/**
|
|
1895
|
+
* Hook returns [imgProps, loaded]
|
|
1896
|
+
* ref: Merged default and provided imgProp object. Includes load and error events for img tag. To be passed to MuiAvatar.
|
|
1897
|
+
* loaded: Indicates whether the src supplied to an img within Avatar results in loaded or error
|
|
1898
|
+
*/
|
|
1899
|
+
var useImgProps = function (avatarProps) {
|
|
1900
|
+
var _a = React__default.useState(LoadingStatus.PENDING), loaded = _a[0], setLoaded = _a[1];
|
|
1901
|
+
var imgProps = __assign(__assign({}, avatarProps.imgProps), { onError: function (event) {
|
|
1902
|
+
var _a, _b;
|
|
1903
|
+
setLoaded(LoadingStatus.ERROR);
|
|
1904
|
+
(_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
1905
|
+
}, onLoad: function (event) {
|
|
1906
|
+
var _a, _b;
|
|
1907
|
+
setLoaded(LoadingStatus.LOADED);
|
|
1908
|
+
(_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
1909
|
+
} });
|
|
1910
|
+
return { imgProps: imgProps, loaded: loaded };
|
|
1911
|
+
};
|
|
1912
|
+
|
|
1913
|
+
var getAvatarDimensions = function (theme, props) {
|
|
1914
|
+
var factors = {
|
|
1915
|
+
'extra-small': 3,
|
|
1916
|
+
small: 4,
|
|
1917
|
+
medium: 5,
|
|
1918
|
+
large: 6,
|
|
1919
|
+
'extra-large': 12.5,
|
|
1920
|
+
};
|
|
1921
|
+
var sizeFactor = factors[props.size || 'medium'];
|
|
1922
|
+
return theme.spacing(sizeFactor);
|
|
1923
|
+
};
|
|
1924
|
+
var getAvatarFontSize = function (props) {
|
|
1925
|
+
var fontSizes = {
|
|
1926
|
+
'extra-small': '0.75rem',
|
|
1927
|
+
small: '1rem',
|
|
1928
|
+
medium: '1rem',
|
|
1929
|
+
large: '1.25rem',
|
|
1930
|
+
'extra-large': '3.5rem',
|
|
1931
|
+
};
|
|
1932
|
+
return fontSizes[props.size || 'medium'];
|
|
1933
|
+
};
|
|
1934
|
+
var getAvatarBackground = function (props) {
|
|
1935
|
+
var src = props.src, loaded = props.loaded;
|
|
1936
|
+
var background = props.background;
|
|
1937
|
+
if (src && loaded === LoadingStatus.LOADED) {
|
|
1938
|
+
background = 'transparent';
|
|
1939
|
+
}
|
|
1940
|
+
return background;
|
|
1941
|
+
};
|
|
1942
|
+
var useAvatarStyles = makeStyles$1(function (theme) { return ({
|
|
1943
|
+
root: {
|
|
1944
|
+
width: function (props) { return getAvatarDimensions(theme, props); },
|
|
1945
|
+
height: function (props) { return getAvatarDimensions(theme, props); },
|
|
1946
|
+
fontSize: function (props) { return getAvatarFontSize(props); },
|
|
1947
|
+
backgroundColor: function (props) { return getAvatarBackground(props); },
|
|
1948
|
+
color: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
|
|
1949
|
+
objectFit: function (props) { return props.fit; },
|
|
1950
|
+
},
|
|
1951
|
+
silhouette: {
|
|
1952
|
+
'& path': {
|
|
1953
|
+
fill: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
|
|
1954
|
+
},
|
|
1955
|
+
},
|
|
1956
|
+
}); });
|
|
1957
|
+
|
|
1958
|
+
var _path$2;
|
|
1492
1959
|
|
|
1493
|
-
|
|
1494
|
-
var value;
|
|
1960
|
+
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); }
|
|
1495
1961
|
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1962
|
+
function SvgSilhouetteFemale(props) {
|
|
1963
|
+
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
1964
|
+
viewBox: "0 0 300 300",
|
|
1965
|
+
fill: "none",
|
|
1966
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1967
|
+
}, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
|
|
1968
|
+
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",
|
|
1969
|
+
fill: "#2E3042"
|
|
1970
|
+
})));
|
|
1971
|
+
}
|
|
1502
1972
|
|
|
1503
|
-
|
|
1504
|
-
value = transform(value);
|
|
1505
|
-
}
|
|
1506
|
-
}
|
|
1973
|
+
var _path$1;
|
|
1507
1974
|
|
|
1508
|
-
|
|
1509
|
-
return value;
|
|
1510
|
-
}
|
|
1975
|
+
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); }
|
|
1511
1976
|
|
|
1512
|
-
|
|
1513
|
-
|
|
1977
|
+
function SvgSilhouetteMale(props) {
|
|
1978
|
+
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
1979
|
+
viewBox: "0 0 300 300",
|
|
1980
|
+
fill: "none",
|
|
1981
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1982
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
1983
|
+
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",
|
|
1984
|
+
fill: "#2E3042"
|
|
1985
|
+
})));
|
|
1986
|
+
}
|
|
1514
1987
|
|
|
1515
|
-
|
|
1516
|
-
};
|
|
1988
|
+
var _path;
|
|
1517
1989
|
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1990
|
+
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); }
|
|
1991
|
+
|
|
1992
|
+
function SvgSilhouetteNeutral(props) {
|
|
1993
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
1994
|
+
viewBox: "0 0 300 300",
|
|
1995
|
+
fill: "none",
|
|
1996
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1997
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
1998
|
+
fillRule: "evenodd",
|
|
1999
|
+
clipRule: "evenodd",
|
|
2000
|
+
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",
|
|
2001
|
+
fill: "#2E3042"
|
|
2002
|
+
})));
|
|
1521
2003
|
}
|
|
1522
2004
|
|
|
1523
|
-
var
|
|
1524
|
-
|
|
1525
|
-
|
|
2005
|
+
var silhouettes = {
|
|
2006
|
+
female: SvgSilhouetteFemale,
|
|
2007
|
+
male: SvgSilhouetteMale,
|
|
2008
|
+
neutral: SvgSilhouetteNeutral,
|
|
2009
|
+
};
|
|
2010
|
+
var Avatar = forwardRef(function (props, ref) {
|
|
2011
|
+
var children = props.children, _a = props.silhouette, silhouette = _a === void 0 ? 'neutral' : _a, muiProps = __rest(props, ["children", "silhouette"]);
|
|
2012
|
+
var _b = useImgProps(props), imgProps = _b.imgProps, loaded = _b.loaded;
|
|
2013
|
+
var classes = useAvatarStyles(__assign(__assign({}, props), { loaded: loaded }));
|
|
2014
|
+
var Silhouette = silhouettes[silhouette];
|
|
2015
|
+
var fallback = muiProps.src || silhouette === 'none' ? '' : React__default.createElement(Silhouette, { className: classes.silhouette });
|
|
2016
|
+
return (React__default.createElement(MuiAvatar, __assign({ ref: ref, classes: { root: classes.root } }, muiProps, imgProps), children || fallback));
|
|
1526
2017
|
});
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
var className = props.className; props.gap; var restProps = __rest(props, ["className", "gap"]);
|
|
1533
|
-
var root = useBoxStyles(props).root;
|
|
1534
|
-
return React__default.createElement(Box$1, __assign({ className: classNames(root, className) }, restProps));
|
|
2018
|
+
Avatar.defaultProps = {
|
|
2019
|
+
size: 'medium',
|
|
2020
|
+
fit: 'cover',
|
|
2021
|
+
background: '#E0E0E0',
|
|
2022
|
+
silhouette: 'neutral',
|
|
1535
2023
|
};
|
|
1536
|
-
|
|
2024
|
+
Avatar.displayName = 'Avatar';
|
|
1537
2025
|
|
|
1538
|
-
var useButtonStyles = makeStyles(function () { return ({
|
|
2026
|
+
var useButtonStyles = makeStyles$1(function () { return ({
|
|
1539
2027
|
root: {
|
|
1540
2028
|
minWidth: 'unset',
|
|
1541
2029
|
},
|
|
@@ -1567,93 +2055,13 @@ var Checkbox = forwardRef(function (props, ref) {
|
|
|
1567
2055
|
});
|
|
1568
2056
|
Checkbox.displayName = 'Checkbox';
|
|
1569
2057
|
|
|
1570
|
-
var useIconStyles = makeStyles$1(function (_a) {
|
|
1571
|
-
var spacing = _a.spacing, palette = _a.palette;
|
|
1572
|
-
var getFontSize = function (_a) {
|
|
1573
|
-
var size = _a.size;
|
|
1574
|
-
var sizes = {
|
|
1575
|
-
inherit: 'inherit',
|
|
1576
|
-
small: spacing(1.5),
|
|
1577
|
-
medium: spacing(2),
|
|
1578
|
-
large: spacing(2.5),
|
|
1579
|
-
'extra-large': spacing(3),
|
|
1580
|
-
};
|
|
1581
|
-
return size ? sizes[size] : 'inherit';
|
|
1582
|
-
};
|
|
1583
|
-
var getColor = function (props) {
|
|
1584
|
-
var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
|
|
1585
|
-
var value = 'inherit';
|
|
1586
|
-
if (props.color) {
|
|
1587
|
-
if (semanticColors.includes(props.color.split('.')[0])) {
|
|
1588
|
-
var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
|
|
1589
|
-
value = palette[color][variant];
|
|
1590
|
-
}
|
|
1591
|
-
else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {
|
|
1592
|
-
value = props.color;
|
|
1593
|
-
}
|
|
1594
|
-
}
|
|
1595
|
-
return value;
|
|
1596
|
-
};
|
|
1597
|
-
return {
|
|
1598
|
-
root: {
|
|
1599
|
-
color: getColor,
|
|
1600
|
-
fontSize: getFontSize,
|
|
1601
|
-
strokeWidth: '1.3px',
|
|
1602
|
-
},
|
|
1603
|
-
};
|
|
1604
|
-
});
|
|
1605
|
-
|
|
1606
|
-
var iconStaticClassName = 'pop-icon';
|
|
1607
|
-
var Icon = function (props) {
|
|
1608
|
-
var icon = props.icon, className = props.className, restProps = __rest(props, ["icon", "className"]);
|
|
1609
|
-
var classes = useIconStyles(props);
|
|
1610
|
-
var isValid = true;
|
|
1611
|
-
if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {
|
|
1612
|
-
isValid = false;
|
|
1613
|
-
}
|
|
1614
|
-
return isValid
|
|
1615
|
-
? createElement(icon, __assign({ className: classNames([classes.root, iconStaticClassName, className]) }, restProps))
|
|
1616
|
-
: null;
|
|
1617
|
-
};
|
|
1618
|
-
Icon.defaultProps = {
|
|
1619
|
-
size: 'inherit',
|
|
1620
|
-
color: 'inherit',
|
|
1621
|
-
};
|
|
1622
|
-
Icon.displayName = 'Icon';
|
|
1623
|
-
|
|
1624
|
-
var useTypographyStyles = makeStyles(function () {
|
|
1625
|
-
var _a;
|
|
1626
|
-
return ({
|
|
1627
|
-
root: (_a = {},
|
|
1628
|
-
_a["& ." + iconStaticClassName] = {
|
|
1629
|
-
position: 'relative',
|
|
1630
|
-
top: '0.125em',
|
|
1631
|
-
padding: '0 0.125em',
|
|
1632
|
-
boxSizing: 'content-box',
|
|
1633
|
-
},
|
|
1634
|
-
_a),
|
|
1635
|
-
caption: {
|
|
1636
|
-
display: 'inline',
|
|
1637
|
-
},
|
|
1638
|
-
overline: {
|
|
1639
|
-
display: 'inline',
|
|
1640
|
-
},
|
|
1641
|
-
});
|
|
1642
|
-
});
|
|
1643
|
-
|
|
1644
|
-
var Typography = forwardRef(function (props, ref) {
|
|
1645
|
-
var classes = useTypographyStyles(props);
|
|
1646
|
-
return React__default.createElement(MuiTypography, __assign({ ref: ref, classes: classes }, props));
|
|
1647
|
-
});
|
|
1648
|
-
Typography.displayName = 'Typography';
|
|
1649
|
-
|
|
1650
2058
|
var getFadeStop = function (_a, typographyVariant) {
|
|
1651
2059
|
var typography = _a.typography;
|
|
1652
2060
|
return !isNaN(Number(typography[typographyVariant].lineHeight))
|
|
1653
2061
|
? typography[typographyVariant].lineHeight + "rem"
|
|
1654
2062
|
: typography[typographyVariant].lineHeight;
|
|
1655
2063
|
};
|
|
1656
|
-
var useCollapsibleTextStyles = makeStyles
|
|
2064
|
+
var useCollapsibleTextStyles = makeStyles(function (theme) { return ({
|
|
1657
2065
|
overlay: {
|
|
1658
2066
|
position: 'absolute',
|
|
1659
2067
|
top: 0,
|
|
@@ -1703,7 +2111,7 @@ var SemanticColors;
|
|
|
1703
2111
|
SemanticColors["SECONDARY_DARK"] = "secondary.dark";
|
|
1704
2112
|
SemanticColors["SECONDARY_LIGHT"] = "secondary.light";
|
|
1705
2113
|
})(SemanticColors || (SemanticColors = {}));
|
|
1706
|
-
var useStyles
|
|
2114
|
+
var useStyles = makeStyles(function (theme) { return ({
|
|
1707
2115
|
dividerRoot: {
|
|
1708
2116
|
gap: theme.spacing(2),
|
|
1709
2117
|
},
|
|
@@ -1741,7 +2149,7 @@ var useStyles$1 = makeStyles$1(function (theme) { return ({
|
|
|
1741
2149
|
}); });
|
|
1742
2150
|
var Divider = function (props) {
|
|
1743
2151
|
var className = props.className, text = props.text, textTransform = props.textTransform, TypographyProps = props.TypographyProps;
|
|
1744
|
-
var classes = useStyles
|
|
2152
|
+
var classes = useStyles(props);
|
|
1745
2153
|
var casingOffset = textTransform === 'lowercase' ? '.25rem' : 'unset';
|
|
1746
2154
|
return (React__default.createElement(Box, { className: classNames([classes.dividerRoot, className]), display: "flex", alignItems: "center" },
|
|
1747
2155
|
React__default.createElement(Box, { className: classes.dividerLine, display: "flex", flexGrow: 1, height: "1px", marginTop: casingOffset }),
|
|
@@ -1754,14 +2162,6 @@ Divider.defaultProps = {
|
|
|
1754
2162
|
textTransform: 'lowercase',
|
|
1755
2163
|
};
|
|
1756
2164
|
|
|
1757
|
-
var IconButton = forwardRef(function (props, ref) {
|
|
1758
|
-
return React__default.createElement(MuiIconButton, __assign({ ref: ref }, props));
|
|
1759
|
-
});
|
|
1760
|
-
IconButton.displayName = 'IconButton';
|
|
1761
|
-
IconButton.defaultProps = {
|
|
1762
|
-
color: 'secondary',
|
|
1763
|
-
};
|
|
1764
|
-
|
|
1765
2165
|
var getLinkColor = function (_a, _b) {
|
|
1766
2166
|
var palette = _a.palette;
|
|
1767
2167
|
var _c = _b.color, color = _c === void 0 ? 'info' : _c;
|
|
@@ -1777,7 +2177,7 @@ var getLinkColor = function (_a, _b) {
|
|
|
1777
2177
|
}
|
|
1778
2178
|
return resolved;
|
|
1779
2179
|
};
|
|
1780
|
-
var useLinkStyles = makeStyles(function (theme) {
|
|
2180
|
+
var useLinkStyles = makeStyles$1(function (theme) {
|
|
1781
2181
|
var _a;
|
|
1782
2182
|
return ({
|
|
1783
2183
|
root: (_a = {
|
|
@@ -1802,28 +2202,6 @@ Link.defaultProps = {
|
|
|
1802
2202
|
};
|
|
1803
2203
|
Link.displayName = 'Link';
|
|
1804
2204
|
|
|
1805
|
-
var useStyles = makeStyles$1(function (_a) {
|
|
1806
|
-
var spacing = _a.spacing;
|
|
1807
|
-
return ({
|
|
1808
|
-
root: {
|
|
1809
|
-
'&:last-child': {
|
|
1810
|
-
marginBottom: 0,
|
|
1811
|
-
},
|
|
1812
|
-
marginBottom: spacing(4),
|
|
1813
|
-
padding: spacing(4),
|
|
1814
|
-
},
|
|
1815
|
-
});
|
|
1816
|
-
});
|
|
1817
|
-
var Paper = forwardRef(function (props, ref) {
|
|
1818
|
-
var legacyStyles = props.legacyStyles, restProps = __rest(props, ["legacyStyles"]);
|
|
1819
|
-
var classes = useStyles(props);
|
|
1820
|
-
return React__default.createElement(Paper$1, __assign({}, ref, { classes: __assign({}, (legacyStyles && classes)) }, restProps));
|
|
1821
|
-
});
|
|
1822
|
-
Paper.displayName = 'Paper';
|
|
1823
|
-
Paper.defaultProps = {
|
|
1824
|
-
legacyStyles: false,
|
|
1825
|
-
};
|
|
1826
|
-
|
|
1827
2205
|
var PaperContent = function (props) {
|
|
1828
2206
|
var children = props.children;
|
|
1829
2207
|
return React__default.createElement(Box, { padding: 4 }, children);
|
|
@@ -1836,7 +2214,7 @@ var Radio = forwardRef(function (props, ref) {
|
|
|
1836
2214
|
});
|
|
1837
2215
|
Radio.displayName = 'Radio';
|
|
1838
2216
|
|
|
1839
|
-
var useSplitInputStyles = makeStyles(function () { return ({
|
|
2217
|
+
var useSplitInputStyles = makeStyles$1(function () { return ({
|
|
1840
2218
|
textfield: {
|
|
1841
2219
|
background: function (props) { return (props.backgroundTransparency ? '#FFFFFF44' : 'none'); },
|
|
1842
2220
|
borderTopLeftRadius: 4,
|
|
@@ -1874,7 +2252,7 @@ SplitInput.defaultProps = {
|
|
|
1874
2252
|
color: 'primary',
|
|
1875
2253
|
};
|
|
1876
2254
|
|
|
1877
|
-
var useSwitchStyles = makeStyles(function (theme) { return ({
|
|
2255
|
+
var useSwitchStyles = makeStyles$1(function (theme) { return ({
|
|
1878
2256
|
checked: {
|
|
1879
2257
|
'& $thumb': {
|
|
1880
2258
|
background: theme.palette.success.main,
|
|
@@ -6506,7 +6884,7 @@ var getWidth = function (props) {
|
|
|
6506
6884
|
}
|
|
6507
6885
|
return width;
|
|
6508
6886
|
};
|
|
6509
|
-
var useTableHeaderCellStyles = makeStyles
|
|
6887
|
+
var useTableHeaderCellStyles = makeStyles(function (theme) { return ({
|
|
6510
6888
|
root: function (props) {
|
|
6511
6889
|
var width = getWidth(props);
|
|
6512
6890
|
return {
|
|
@@ -6521,60 +6899,6 @@ var useTableHeaderCellStyles = makeStyles$1(function (theme) { return ({
|
|
|
6521
6899
|
},
|
|
6522
6900
|
}); });
|
|
6523
6901
|
|
|
6524
|
-
var _path$3K;
|
|
6525
|
-
|
|
6526
|
-
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); }
|
|
6527
|
-
|
|
6528
|
-
function SvgMore(props) {
|
|
6529
|
-
return /*#__PURE__*/React.createElement("svg", _extends$3$({
|
|
6530
|
-
viewBox: "0 0 16 16",
|
|
6531
|
-
strokeLinecap: "round",
|
|
6532
|
-
strokeLinejoin: "round",
|
|
6533
|
-
stroke: "currentColor",
|
|
6534
|
-
width: "1em",
|
|
6535
|
-
height: "1em",
|
|
6536
|
-
fill: "none"
|
|
6537
|
-
}, props), _path$3K || (_path$3K = /*#__PURE__*/React.createElement("path", {
|
|
6538
|
-
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"
|
|
6539
|
-
})));
|
|
6540
|
-
}
|
|
6541
|
-
|
|
6542
|
-
var _path$2X;
|
|
6543
|
-
|
|
6544
|
-
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); }
|
|
6545
|
-
|
|
6546
|
-
function SvgChevronDown(props) {
|
|
6547
|
-
return /*#__PURE__*/React.createElement("svg", _extends$3b({
|
|
6548
|
-
viewBox: "0 0 16 16",
|
|
6549
|
-
strokeLinecap: "round",
|
|
6550
|
-
strokeLinejoin: "round",
|
|
6551
|
-
stroke: "currentColor",
|
|
6552
|
-
width: "1em",
|
|
6553
|
-
height: "1em",
|
|
6554
|
-
fill: "none"
|
|
6555
|
-
}, props), _path$2X || (_path$2X = /*#__PURE__*/React.createElement("path", {
|
|
6556
|
-
d: "M4 6l4 4 4-4"
|
|
6557
|
-
})));
|
|
6558
|
-
}
|
|
6559
|
-
|
|
6560
|
-
var _path$2W;
|
|
6561
|
-
|
|
6562
|
-
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); }
|
|
6563
|
-
|
|
6564
|
-
function SvgChevronUp(props) {
|
|
6565
|
-
return /*#__PURE__*/React.createElement("svg", _extends$3a({
|
|
6566
|
-
viewBox: "0 0 16 16",
|
|
6567
|
-
strokeLinecap: "round",
|
|
6568
|
-
strokeLinejoin: "round",
|
|
6569
|
-
stroke: "currentColor",
|
|
6570
|
-
width: "1em",
|
|
6571
|
-
height: "1em",
|
|
6572
|
-
fill: "none"
|
|
6573
|
-
}, props), _path$2W || (_path$2W = /*#__PURE__*/React.createElement("path", {
|
|
6574
|
-
d: "M12 10L8 6l-4 4"
|
|
6575
|
-
})));
|
|
6576
|
-
}
|
|
6577
|
-
|
|
6578
6902
|
var TableHeaderCell = function (props) {
|
|
6579
6903
|
var children = props.children, column = props.column; props.tableProps; var restProps = __rest(props, ["children", "column", "tableProps"]);
|
|
6580
6904
|
var root = useTableHeaderCellStyles(props).root;
|
|
@@ -6593,7 +6917,7 @@ var TableHeaderRow = function (props) {
|
|
|
6593
6917
|
return React__default.createElement("tr", __assign({}, restProps), children);
|
|
6594
6918
|
};
|
|
6595
6919
|
|
|
6596
|
-
var useTableRowStyles = makeStyles
|
|
6920
|
+
var useTableRowStyles = makeStyles(function (theme) { return ({
|
|
6597
6921
|
root: function () { return ({
|
|
6598
6922
|
'&:nth-child(even)': {
|
|
6599
6923
|
backgroundColor: theme.palette.grey[100],
|
|
@@ -6612,7 +6936,7 @@ var TableBody = function (props) {
|
|
|
6612
6936
|
return React__default.createElement("tbody", __assign({}, restProps), children);
|
|
6613
6937
|
};
|
|
6614
6938
|
|
|
6615
|
-
var useTableCellStyles = makeStyles
|
|
6939
|
+
var useTableCellStyles = makeStyles(function (theme) { return ({
|
|
6616
6940
|
root: function () { return ({
|
|
6617
6941
|
padding: theme.spacing(2),
|
|
6618
6942
|
}); },
|
|
@@ -6624,7 +6948,7 @@ var TableCell = function (props) {
|
|
|
6624
6948
|
return (React__default.createElement("td", __assign({ className: root }, restProps), children));
|
|
6625
6949
|
};
|
|
6626
6950
|
|
|
6627
|
-
var useTableStyles = makeStyles
|
|
6951
|
+
var useTableStyles = makeStyles(function (_a) {
|
|
6628
6952
|
var typography = _a.typography;
|
|
6629
6953
|
return ({
|
|
6630
6954
|
root: function (_a) {
|
|
@@ -6726,7 +7050,7 @@ Table.defaultProps = {
|
|
|
6726
7050
|
emptyMessage: 'No results.',
|
|
6727
7051
|
};
|
|
6728
7052
|
|
|
6729
|
-
var useToggleButtonStyles = makeStyles(function (theme) { return ({
|
|
7053
|
+
var useToggleButtonStyles = makeStyles$1(function (theme) { return ({
|
|
6730
7054
|
root: {
|
|
6731
7055
|
color: theme.palette.text.primary,
|
|
6732
7056
|
},
|
|
@@ -6754,7 +7078,7 @@ ToggleButton.defaultProps = {
|
|
|
6754
7078
|
};
|
|
6755
7079
|
ToggleButton.displayName = 'ToggleButton';
|
|
6756
7080
|
|
|
6757
|
-
var useToggleButtonGroupStyles = makeStyles(function (theme) { return ({
|
|
7081
|
+
var useToggleButtonGroupStyles = makeStyles$1(function (theme) { return ({
|
|
6758
7082
|
root: {
|
|
6759
7083
|
'&&': {
|
|
6760
7084
|
backgroundColor: theme.palette.grey[300],
|
|
@@ -6775,7 +7099,7 @@ var ToggleButtonGroup = forwardRef(function (props, ref) {
|
|
|
6775
7099
|
});
|
|
6776
7100
|
ToggleButtonGroup.displayName = 'ToggleButtonGroup';
|
|
6777
7101
|
|
|
6778
|
-
var useTooltipStyles = makeStyles(function (_a) {
|
|
7102
|
+
var useTooltipStyles = makeStyles$1(function (_a) {
|
|
6779
7103
|
var typography = _a.typography;
|
|
6780
7104
|
return ({
|
|
6781
7105
|
tooltip: {
|
|
@@ -6804,5 +7128,5 @@ var useCollapsibleText = function () {
|
|
|
6804
7128
|
};
|
|
6805
7129
|
};
|
|
6806
7130
|
|
|
6807
|
-
export { Avatar, Box, Button, Checkbox, CollapsibleText, Divider, Icon, IconButton, Link, Paper, PaperContent, Radio, SplitInput, Switch, Table, ToggleButton, ToggleButtonGroup, Tooltip, Typography, useCollapsibleText };
|
|
7131
|
+
export { AudioPlayer, Avatar, Box, Button, Checkbox, CollapsibleText, Divider, Icon, IconButton, Link, Paper, PaperContent, Radio, SplitInput, Switch, Table, ToggleButton, ToggleButtonGroup, Tooltip, Typography, useCollapsibleText };
|
|
6808
7132
|
//# sourceMappingURL=index.es.js.map
|