@popmenu/common-ui 0.16.0-alpha.0 → 0.18.1

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.
Files changed (56) hide show
  1. package/build/components/Accordion/index.d.ts +1 -0
  2. package/build/components/AccordionActions/index.d.ts +1 -0
  3. package/build/components/AccordionDetails/index.d.ts +1 -0
  4. package/build/components/AccordionSummary/index.d.ts +1 -0
  5. package/build/components/AudioPlayer/AudioPlayer.d.ts +3 -0
  6. package/build/components/AudioPlayer/AudioPlayerProps.d.ts +4 -0
  7. package/build/components/AudioPlayer/index.d.ts +2 -0
  8. package/build/components/AudioPlayer/util/audioPlayerReducer.d.ts +11 -0
  9. package/build/components/AudioPlayer/util/formatTime.d.ts +1 -0
  10. package/build/components/AudioPlayer/util/index.d.ts +5 -0
  11. package/build/components/AudioPlayer/util/setupAudioRef.d.ts +8 -0
  12. package/build/components/AudioPlayer/util/types.d.ts +77 -0
  13. package/build/components/AudioPlayer/util/useVolumeIcon.d.ts +2 -0
  14. package/build/components/Box/index.d.ts +7 -2
  15. package/build/components/Breadcrumbs/index.d.ts +1 -0
  16. package/build/components/ButtonBase/index.d.ts +1 -0
  17. package/build/components/ClickAwayListener/index.d.ts +1 -0
  18. package/build/components/Fab/index.d.ts +1 -0
  19. package/build/components/GridList/index.d.ts +1 -0
  20. package/build/components/Hidden/index.d.ts +1 -0
  21. package/build/components/Modal/index.d.ts +1 -0
  22. package/build/components/Popover/index.d.ts +1 -0
  23. package/build/components/Popper/index.d.ts +1 -0
  24. package/build/components/Step/index.d.ts +1 -0
  25. package/build/components/StepButton/index.d.ts +1 -0
  26. package/build/components/StepConnector/index.d.ts +1 -0
  27. package/build/components/StepContent/index.d.ts +1 -0
  28. package/build/components/StepIcon/index.d.ts +1 -0
  29. package/build/components/StepLabel/index.d.ts +1 -0
  30. package/build/components/Stepper/index.d.ts +1 -0
  31. package/build/components/Table/TableProps.d.ts +2 -0
  32. package/build/components/Table/index.d.ts +0 -1
  33. package/build/components/Table/util/makeColumns.d.ts +1 -1
  34. package/build/components/TableHeaderCell/TableHeaderCellProps.d.ts +3 -1
  35. package/build/components/ThemeProvider/index.d.ts +1 -0
  36. package/build/components/Toolbar/index.d.ts +1 -0
  37. package/build/components/index.d.ts +23 -0
  38. package/build/index.d.ts +1 -0
  39. package/build/index.es.js +671 -1553
  40. package/build/index.es.js.map +1 -1
  41. package/build/index.js +896 -1576
  42. package/build/index.js.map +1 -1
  43. package/build/util/ServerStyleSheets.d.ts +1 -0
  44. package/build/util/colors/alpha.d.ts +1 -0
  45. package/build/util/colors/darken.d.ts +1 -0
  46. package/build/util/colors/decomposeColor.d.ts +1 -0
  47. package/build/util/colors/getLuminance.d.ts +1 -0
  48. package/build/util/colors/hexToRgb.d.ts +1 -0
  49. package/build/util/colors/index.d.ts +8 -0
  50. package/build/util/colors/lighten.d.ts +1 -0
  51. package/build/util/colors/recomposeColor.d.ts +1 -0
  52. package/build/util/colors/rgbToHex.d.ts +1 -0
  53. package/build/util/createTheme.d.ts +1 -0
  54. package/build/util/index.d.ts +4 -0
  55. package/build/util/makeStyles.d.ts +1 -0
  56. package/package.json +2 -2
package/build/index.es.js CHANGED
@@ -1,11 +1,15 @@
1
1
  export { default as Alert } from '@material-ui/lab/Alert';
2
+ import { makeStyles, Paper as Paper$1, useTheme, Box, Popper, Grow, Slider } from '@material-ui/core';
3
+ export { Accordion, AccordionActions, AccordionDetails, AccordionSummary, Box, 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';
2
4
  export { default as AppBar } from '@material-ui/core/AppBar';
3
5
  import * as React from 'react';
4
- import React__default, { forwardRef, createElement, useRef, useEffect, Fragment, useMemo, useState } from 'react';
6
+ import React__default, { createElement, forwardRef, useRef, useState, useReducer, useEffect, useMemo, Fragment } 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 as useTheme$1 } from '@material-ui/core/styles';
10
+ export { ServerStyleSheets } from '@material-ui/core/styles';
5
11
  import MuiAvatar from '@material-ui/core/Avatar';
6
- import { makeStyles, useTheme } from '@material-ui/core/styles';
7
12
  export { default as Badge } from '@material-ui/core/Badge';
8
- import { makeStyles as makeStyles$1, Box as Box$1, useTheme as useTheme$1, Paper as Paper$1 } from '@material-ui/core';
9
13
  import MuiButton from '@material-ui/core/Button';
10
14
  import CircularProgress from '@material-ui/core/CircularProgress';
11
15
  export { default as CircularProgress } from '@material-ui/core/CircularProgress';
@@ -21,7 +25,6 @@ import FormControlLabel from '@material-ui/core/FormControlLabel';
21
25
  export { default as FormControlLabel } from '@material-ui/core/FormControlLabel';
22
26
  export { default as Chip } from '@material-ui/core/Chip';
23
27
  import Collapse from '@material-ui/core/Collapse';
24
- import MuiTypography from '@material-ui/core/Typography';
25
28
  export { default as Dialog } from '@material-ui/core/Dialog';
26
29
  export { default as DialogActions } from '@material-ui/core/DialogActions';
27
30
  export { default as DialogContent } from '@material-ui/core/DialogContent';
@@ -29,7 +32,6 @@ export { default as DialogTitle } from '@material-ui/core/DialogTitle';
29
32
  export { default as Drawer } from '@material-ui/core/Drawer';
30
33
  export { default as FormControl } from '@material-ui/core/FormControl';
31
34
  export { default as Grid } from '@material-ui/core/Grid';
32
- import MuiIconButton from '@material-ui/core/IconButton';
33
35
  export { default as InputAdornment } from '@material-ui/core/InputAdornment';
34
36
  export { default as LinearProgress } from '@material-ui/core/LinearProgress';
35
37
  import MuiLink from '@material-ui/core/Link';
@@ -102,1438 +104,712 @@ function __spreadArray(to, from, pack) {
102
104
  return to.concat(ar || from);
103
105
  }
104
106
 
105
- var LoadingStatus;
106
- (function (LoadingStatus) {
107
- LoadingStatus["ERROR"] = "ERROR";
108
- LoadingStatus["LOADED"] = "LOADED";
109
- LoadingStatus["PENDING"] = "PENDING";
110
- })(LoadingStatus || (LoadingStatus = {}));
111
- /**
112
- * Hook returns [imgProps, loaded]
113
- * ref: Merged default and provided imgProp object. Includes load and error events for img tag. To be passed to MuiAvatar.
114
- * loaded: Indicates whether the src supplied to an img within Avatar results in loaded or error
115
- */
116
- var useImgProps = function (avatarProps) {
117
- var _a = React__default.useState(LoadingStatus.PENDING), loaded = _a[0], setLoaded = _a[1];
118
- var imgProps = __assign(__assign({}, avatarProps.imgProps), { onError: function (event) {
119
- var _a, _b;
120
- setLoaded(LoadingStatus.ERROR);
121
- (_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, event);
122
- }, onLoad: function (event) {
123
- var _a, _b;
124
- setLoaded(LoadingStatus.LOADED);
125
- (_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, event);
126
- } });
127
- return { imgProps: imgProps, loaded: loaded };
128
- };
129
-
130
- var getAvatarDimensions = function (theme, props) {
131
- var factors = {
132
- 'extra-small': 3,
133
- small: 4,
134
- medium: 5,
135
- large: 6,
136
- 'extra-large': 12.5,
137
- };
138
- var sizeFactor = factors[props.size || 'medium'];
139
- return theme.spacing(sizeFactor);
140
- };
141
- var getAvatarFontSize = function (props) {
142
- var fontSizes = {
143
- 'extra-small': '0.75rem',
144
- small: '1rem',
145
- medium: '1rem',
146
- large: '1.25rem',
147
- 'extra-large': '3.5rem',
148
- };
149
- return fontSizes[props.size || 'medium'];
150
- };
151
- var getAvatarBackground = function (props) {
152
- var src = props.src, loaded = props.loaded;
153
- var background = props.background;
154
- if (src && loaded === LoadingStatus.LOADED) {
155
- background = 'transparent';
156
- }
157
- return background;
158
- };
159
- var useAvatarStyles = makeStyles(function (theme) { return ({
160
- root: {
161
- width: function (props) { return getAvatarDimensions(theme, props); },
162
- height: function (props) { return getAvatarDimensions(theme, props); },
163
- fontSize: function (props) { return getAvatarFontSize(props); },
164
- backgroundColor: function (props) { return getAvatarBackground(props); },
165
- color: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
166
- objectFit: function (props) { return props.fit; },
167
- },
168
- silhouette: {
169
- '& path': {
170
- fill: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
171
- },
172
- },
173
- }); });
174
-
175
- var _path$2;
107
+ var _path$3K;
176
108
 
177
- 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); }
109
+ 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); }
178
110
 
179
- function SvgSilhouetteFemale(props) {
180
- return /*#__PURE__*/React.createElement("svg", _extends$2({
181
- viewBox: "0 0 300 300",
182
- fill: "none",
183
- xmlns: "http://www.w3.org/2000/svg"
184
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
185
- 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",
186
- fill: "#2E3042"
111
+ function SvgMore(props) {
112
+ return /*#__PURE__*/React.createElement("svg", _extends$3$({
113
+ viewBox: "0 0 16 16",
114
+ strokeLinecap: "round",
115
+ strokeLinejoin: "round",
116
+ stroke: "currentColor",
117
+ width: "1em",
118
+ height: "1em",
119
+ fill: "none"
120
+ }, props), _path$3K || (_path$3K = /*#__PURE__*/React.createElement("path", {
121
+ 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"
187
122
  })));
188
123
  }
189
124
 
190
- var _path$1;
125
+ var _path$2X;
191
126
 
192
- 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); }
127
+ 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); }
193
128
 
194
- function SvgSilhouetteMale(props) {
195
- return /*#__PURE__*/React.createElement("svg", _extends$1({
196
- viewBox: "0 0 300 300",
197
- fill: "none",
198
- xmlns: "http://www.w3.org/2000/svg"
199
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
200
- 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",
201
- fill: "#2E3042"
129
+ function SvgChevronDown(props) {
130
+ return /*#__PURE__*/React.createElement("svg", _extends$3b({
131
+ viewBox: "0 0 16 16",
132
+ strokeLinecap: "round",
133
+ strokeLinejoin: "round",
134
+ stroke: "currentColor",
135
+ width: "1em",
136
+ height: "1em",
137
+ fill: "none"
138
+ }, props), _path$2X || (_path$2X = /*#__PURE__*/React.createElement("path", {
139
+ d: "M4 6l4 4 4-4"
202
140
  })));
203
141
  }
204
142
 
205
- var _path;
143
+ var _path$2W;
206
144
 
207
- 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); }
145
+ 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); }
208
146
 
209
- function SvgSilhouetteNeutral(props) {
210
- return /*#__PURE__*/React.createElement("svg", _extends({
211
- viewBox: "0 0 300 300",
212
- fill: "none",
213
- xmlns: "http://www.w3.org/2000/svg"
214
- }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
215
- fillRule: "evenodd",
216
- clipRule: "evenodd",
217
- 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",
218
- fill: "#2E3042"
147
+ function SvgChevronUp(props) {
148
+ return /*#__PURE__*/React.createElement("svg", _extends$3a({
149
+ viewBox: "0 0 16 16",
150
+ strokeLinecap: "round",
151
+ strokeLinejoin: "round",
152
+ stroke: "currentColor",
153
+ width: "1em",
154
+ height: "1em",
155
+ fill: "none"
156
+ }, props), _path$2W || (_path$2W = /*#__PURE__*/React.createElement("path", {
157
+ d: "M12 10L8 6l-4 4"
219
158
  })));
220
159
  }
221
160
 
222
- var silhouettes = {
223
- female: SvgSilhouetteFemale,
224
- male: SvgSilhouetteMale,
225
- neutral: SvgSilhouetteNeutral,
226
- };
227
- var Avatar = forwardRef(function (props, ref) {
228
- var children = props.children, _a = props.silhouette, silhouette = _a === void 0 ? 'neutral' : _a, muiProps = __rest(props, ["children", "silhouette"]);
229
- var _b = useImgProps(props), imgProps = _b.imgProps, loaded = _b.loaded;
230
- var classes = useAvatarStyles(__assign(__assign({}, props), { loaded: loaded }));
231
- var Silhouette = silhouettes[silhouette];
232
- var fallback = muiProps.src || silhouette === 'none' ? '' : React__default.createElement(Silhouette, { className: classes.silhouette });
233
- return (React__default.createElement(MuiAvatar, __assign({ ref: ref, classes: { root: classes.root } }, muiProps, imgProps), children || fallback));
234
- });
235
- Avatar.defaultProps = {
236
- size: 'medium',
237
- fit: 'cover',
238
- background: '#E0E0E0',
239
- silhouette: 'neutral',
240
- };
241
- Avatar.displayName = 'Avatar';
242
-
243
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
244
-
245
- var classnames = {exports: {}};
246
-
247
- /*!
248
- Copyright (c) 2018 Jed Watson.
249
- Licensed under the MIT License (MIT), see
250
- http://jedwatson.github.io/classnames
251
- */
252
-
253
- (function (module) {
254
- /* global define */
161
+ var _path$1f;
255
162
 
256
- (function () {
163
+ 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); }
257
164
 
258
- var hasOwn = {}.hasOwnProperty;
165
+ function SvgPause(props) {
166
+ return /*#__PURE__*/React.createElement("svg", _extends$1p({
167
+ viewBox: "0 0 16 16",
168
+ strokeLinecap: "round",
169
+ strokeLinejoin: "round",
170
+ stroke: "currentColor",
171
+ width: "1em",
172
+ height: "1em",
173
+ fill: "none"
174
+ }, props), _path$1f || (_path$1f = /*#__PURE__*/React.createElement("path", {
175
+ d: "M6.667 2.667H4v10.666h2.667V2.667zm5.333 0H9.333v10.666H12V2.667z"
176
+ })));
177
+ }
259
178
 
260
- function classNames() {
261
- var classes = [];
179
+ var _path$1d;
262
180
 
263
- for (var i = 0; i < arguments.length; i++) {
264
- var arg = arguments[i];
265
- if (!arg) continue;
181
+ 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); }
266
182
 
267
- var argType = typeof arg;
183
+ function SvgPlay(props) {
184
+ return /*#__PURE__*/React.createElement("svg", _extends$1n({
185
+ viewBox: "0 0 16 16",
186
+ strokeLinecap: "round",
187
+ strokeLinejoin: "round",
188
+ stroke: "currentColor",
189
+ width: "1em",
190
+ height: "1em",
191
+ fill: "none"
192
+ }, props), _path$1d || (_path$1d = /*#__PURE__*/React.createElement("path", {
193
+ d: "M3.333 2l9.334 6-9.334 6V2z"
194
+ })));
195
+ }
268
196
 
269
- if (argType === 'string' || argType === 'number') {
270
- classes.push(arg);
271
- } else if (Array.isArray(arg)) {
272
- if (arg.length) {
273
- var inner = classNames.apply(null, arg);
274
- if (inner) {
275
- classes.push(inner);
276
- }
277
- }
278
- } else if (argType === 'object') {
279
- if (arg.toString === Object.prototype.toString) {
280
- for (var key in arg) {
281
- if (hasOwn.call(arg, key) && arg[key]) {
282
- classes.push(key);
283
- }
284
- }
285
- } else {
286
- classes.push(arg.toString());
287
- }
288
- }
289
- }
197
+ var _path$10;
290
198
 
291
- return classes.join(' ');
292
- }
199
+ 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); }
293
200
 
294
- if (module.exports) {
295
- classNames.default = classNames;
296
- module.exports = classNames;
297
- } else {
298
- window.classNames = classNames;
299
- }
300
- }());
301
- }(classnames));
201
+ function SvgVolumeDown(props) {
202
+ return /*#__PURE__*/React.createElement("svg", _extends$1a({
203
+ viewBox: "0 0 16 16",
204
+ strokeLinecap: "round",
205
+ strokeLinejoin: "round",
206
+ stroke: "currentColor",
207
+ width: "1em",
208
+ height: "1em",
209
+ fill: "none"
210
+ }, props), _path$10 || (_path$10 = /*#__PURE__*/React.createElement("path", {
211
+ d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.713"
212
+ })));
213
+ }
302
214
 
303
- var classNames = classnames.exports;
215
+ var _path$$;
304
216
 
305
- function _defineProperty(obj, key, value) {
306
- if (key in obj) {
307
- Object.defineProperty(obj, key, {
308
- value: value,
309
- enumerable: true,
310
- configurable: true,
311
- writable: true
312
- });
313
- } else {
314
- obj[key] = value;
315
- }
217
+ 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); }
316
218
 
317
- return obj;
219
+ function SvgVolumeMute(props) {
220
+ return /*#__PURE__*/React.createElement("svg", _extends$19({
221
+ viewBox: "0 0 16 16",
222
+ strokeLinecap: "round",
223
+ strokeLinejoin: "round",
224
+ stroke: "currentColor",
225
+ width: "1em",
226
+ height: "1em",
227
+ fill: "none"
228
+ }, props), _path$$ || (_path$$ = /*#__PURE__*/React.createElement("path", {
229
+ d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333z"
230
+ })));
318
231
  }
319
232
 
320
- var propTypes = {exports: {}};
321
-
322
- var reactIs = {exports: {}};
323
-
324
- var reactIs_production_min = {};
325
-
326
- /** @license React v16.13.1
327
- * react-is.production.min.js
328
- *
329
- * Copyright (c) Facebook, Inc. and its affiliates.
330
- *
331
- * This source code is licensed under the MIT license found in the
332
- * LICENSE file in the root directory of this source tree.
333
- */
334
- var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
335
- Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
336
- function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
337
- reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
338
- reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
339
- reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
340
-
341
- var reactIs_development = {};
342
-
343
- /** @license React v16.13.1
344
- * react-is.development.js
345
- *
346
- * Copyright (c) Facebook, Inc. and its affiliates.
347
- *
348
- * This source code is licensed under the MIT license found in the
349
- * LICENSE file in the root directory of this source tree.
350
- */
351
-
352
-
353
-
354
- if (process.env.NODE_ENV !== "production") {
355
- (function() {
356
-
357
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
358
- // nor polyfill, then a plain number is used for performance.
359
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
360
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
361
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
362
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
363
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
364
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
365
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
366
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
367
- // (unstable) APIs that have been removed. Can we remove the symbols?
368
-
369
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
370
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
371
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
372
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
373
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
374
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
375
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
376
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
377
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
378
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
379
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
380
-
381
- function isValidElementType(type) {
382
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
383
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
384
- }
233
+ var _path$_;
385
234
 
386
- function typeOf(object) {
387
- if (typeof object === 'object' && object !== null) {
388
- var $$typeof = object.$$typeof;
389
-
390
- switch ($$typeof) {
391
- case REACT_ELEMENT_TYPE:
392
- var type = object.type;
393
-
394
- switch (type) {
395
- case REACT_ASYNC_MODE_TYPE:
396
- case REACT_CONCURRENT_MODE_TYPE:
397
- case REACT_FRAGMENT_TYPE:
398
- case REACT_PROFILER_TYPE:
399
- case REACT_STRICT_MODE_TYPE:
400
- case REACT_SUSPENSE_TYPE:
401
- return type;
402
-
403
- default:
404
- var $$typeofType = type && type.$$typeof;
405
-
406
- switch ($$typeofType) {
407
- case REACT_CONTEXT_TYPE:
408
- case REACT_FORWARD_REF_TYPE:
409
- case REACT_LAZY_TYPE:
410
- case REACT_MEMO_TYPE:
411
- case REACT_PROVIDER_TYPE:
412
- return $$typeofType;
413
-
414
- default:
415
- return $$typeof;
416
- }
235
+ 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); }
417
236
 
418
- }
419
-
420
- case REACT_PORTAL_TYPE:
421
- return $$typeof;
422
- }
423
- }
424
-
425
- return undefined;
426
- } // AsyncMode is deprecated along with isAsyncMode
427
-
428
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
429
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
430
- var ContextConsumer = REACT_CONTEXT_TYPE;
431
- var ContextProvider = REACT_PROVIDER_TYPE;
432
- var Element = REACT_ELEMENT_TYPE;
433
- var ForwardRef = REACT_FORWARD_REF_TYPE;
434
- var Fragment = REACT_FRAGMENT_TYPE;
435
- var Lazy = REACT_LAZY_TYPE;
436
- var Memo = REACT_MEMO_TYPE;
437
- var Portal = REACT_PORTAL_TYPE;
438
- var Profiler = REACT_PROFILER_TYPE;
439
- var StrictMode = REACT_STRICT_MODE_TYPE;
440
- var Suspense = REACT_SUSPENSE_TYPE;
441
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
442
-
443
- function isAsyncMode(object) {
444
- {
445
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
446
- hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
447
-
448
- console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
449
- }
450
- }
451
-
452
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
453
- }
454
- function isConcurrentMode(object) {
455
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
456
- }
457
- function isContextConsumer(object) {
458
- return typeOf(object) === REACT_CONTEXT_TYPE;
459
- }
460
- function isContextProvider(object) {
461
- return typeOf(object) === REACT_PROVIDER_TYPE;
462
- }
463
- function isElement(object) {
464
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
465
- }
466
- function isForwardRef(object) {
467
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
468
- }
469
- function isFragment(object) {
470
- return typeOf(object) === REACT_FRAGMENT_TYPE;
471
- }
472
- function isLazy(object) {
473
- return typeOf(object) === REACT_LAZY_TYPE;
474
- }
475
- function isMemo(object) {
476
- return typeOf(object) === REACT_MEMO_TYPE;
477
- }
478
- function isPortal(object) {
479
- return typeOf(object) === REACT_PORTAL_TYPE;
480
- }
481
- function isProfiler(object) {
482
- return typeOf(object) === REACT_PROFILER_TYPE;
483
- }
484
- function isStrictMode(object) {
485
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
486
- }
487
- function isSuspense(object) {
488
- return typeOf(object) === REACT_SUSPENSE_TYPE;
237
+ function SvgVolumeOff(props) {
238
+ return /*#__PURE__*/React.createElement("svg", _extends$18({
239
+ viewBox: "0 0 16 16",
240
+ strokeLinecap: "round",
241
+ strokeLinejoin: "round",
242
+ stroke: "currentColor",
243
+ width: "1em",
244
+ height: "1em",
245
+ fill: "none"
246
+ }, props), _path$_ || (_path$_ = /*#__PURE__*/React.createElement("path", {
247
+ d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm8 2.667l-4 4m0-4l4 4"
248
+ })));
489
249
  }
490
250
 
491
- reactIs_development.AsyncMode = AsyncMode;
492
- reactIs_development.ConcurrentMode = ConcurrentMode;
493
- reactIs_development.ContextConsumer = ContextConsumer;
494
- reactIs_development.ContextProvider = ContextProvider;
495
- reactIs_development.Element = Element;
496
- reactIs_development.ForwardRef = ForwardRef;
497
- reactIs_development.Fragment = Fragment;
498
- reactIs_development.Lazy = Lazy;
499
- reactIs_development.Memo = Memo;
500
- reactIs_development.Portal = Portal;
501
- reactIs_development.Profiler = Profiler;
502
- reactIs_development.StrictMode = StrictMode;
503
- reactIs_development.Suspense = Suspense;
504
- reactIs_development.isAsyncMode = isAsyncMode;
505
- reactIs_development.isConcurrentMode = isConcurrentMode;
506
- reactIs_development.isContextConsumer = isContextConsumer;
507
- reactIs_development.isContextProvider = isContextProvider;
508
- reactIs_development.isElement = isElement;
509
- reactIs_development.isForwardRef = isForwardRef;
510
- reactIs_development.isFragment = isFragment;
511
- reactIs_development.isLazy = isLazy;
512
- reactIs_development.isMemo = isMemo;
513
- reactIs_development.isPortal = isPortal;
514
- reactIs_development.isProfiler = isProfiler;
515
- reactIs_development.isStrictMode = isStrictMode;
516
- reactIs_development.isSuspense = isSuspense;
517
- reactIs_development.isValidElementType = isValidElementType;
518
- reactIs_development.typeOf = typeOf;
519
- })();
520
- }
251
+ var _path$Z;
521
252
 
522
- if (process.env.NODE_ENV === 'production') {
523
- reactIs.exports = reactIs_production_min;
524
- } else {
525
- reactIs.exports = reactIs_development;
526
- }
253
+ 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); }
527
254
 
528
- /*
529
- object-assign
530
- (c) Sindre Sorhus
531
- @license MIT
532
- */
533
- /* eslint-disable no-unused-vars */
534
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
535
- var hasOwnProperty = Object.prototype.hasOwnProperty;
536
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
537
-
538
- function toObject(val) {
539
- if (val === null || val === undefined) {
540
- throw new TypeError('Object.assign cannot be called with null or undefined');
541
- }
542
-
543
- return Object(val);
255
+ function SvgVolumeUp(props) {
256
+ return /*#__PURE__*/React.createElement("svg", _extends$17({
257
+ viewBox: "0 0 16 16",
258
+ strokeLinecap: "round",
259
+ strokeLinejoin: "round",
260
+ stroke: "currentColor",
261
+ width: "1em",
262
+ height: "1em",
263
+ fill: "none"
264
+ }, props), _path$Z || (_path$Z = /*#__PURE__*/React.createElement("path", {
265
+ 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"
266
+ })));
544
267
  }
545
268
 
546
- function shouldUseNative() {
547
- try {
548
- if (!Object.assign) {
549
- return false;
550
- }
269
+ var useIconStyles = makeStyles(function (_a) {
270
+ var spacing = _a.spacing, palette = _a.palette;
271
+ var getFontSize = function (_a) {
272
+ var size = _a.size;
273
+ var sizes = {
274
+ inherit: 'inherit',
275
+ small: spacing(1.5),
276
+ medium: spacing(2),
277
+ large: spacing(2.5),
278
+ 'extra-large': spacing(3),
279
+ };
280
+ return size ? sizes[size] : 'inherit';
281
+ };
282
+ var getColor = function (props) {
283
+ var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
284
+ var value = 'inherit';
285
+ if (props.color) {
286
+ if (semanticColors.includes(props.color.split('.')[0])) {
287
+ var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
288
+ value = palette[color][variant];
289
+ }
290
+ else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {
291
+ value = props.color;
292
+ }
293
+ }
294
+ return value;
295
+ };
296
+ return {
297
+ root: {
298
+ color: getColor,
299
+ fontSize: getFontSize,
300
+ strokeWidth: '1.3px',
301
+ },
302
+ };
303
+ });
551
304
 
552
- // Detect buggy property enumeration order in older V8 versions.
305
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
553
306
 
554
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
555
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
556
- test1[5] = 'de';
557
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
558
- return false;
559
- }
307
+ var classnames = {exports: {}};
560
308
 
561
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
562
- var test2 = {};
563
- for (var i = 0; i < 10; i++) {
564
- test2['_' + String.fromCharCode(i)] = i;
565
- }
566
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
567
- return test2[n];
568
- });
569
- if (order2.join('') !== '0123456789') {
570
- return false;
571
- }
309
+ /*!
310
+ Copyright (c) 2018 Jed Watson.
311
+ Licensed under the MIT License (MIT), see
312
+ http://jedwatson.github.io/classnames
313
+ */
572
314
 
573
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
574
- var test3 = {};
575
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
576
- test3[letter] = letter;
577
- });
578
- if (Object.keys(Object.assign({}, test3)).join('') !==
579
- 'abcdefghijklmnopqrst') {
580
- return false;
581
- }
315
+ (function (module) {
316
+ /* global define */
582
317
 
583
- return true;
584
- } catch (err) {
585
- // We don't expect any of the above to throw, but better to be safe.
586
- return false;
587
- }
588
- }
318
+ (function () {
589
319
 
590
- var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
591
- var from;
592
- var to = toObject(target);
593
- var symbols;
320
+ var hasOwn = {}.hasOwnProperty;
594
321
 
595
- for (var s = 1; s < arguments.length; s++) {
596
- from = Object(arguments[s]);
322
+ function classNames() {
323
+ var classes = [];
597
324
 
598
- for (var key in from) {
599
- if (hasOwnProperty.call(from, key)) {
600
- to[key] = from[key];
601
- }
602
- }
325
+ for (var i = 0; i < arguments.length; i++) {
326
+ var arg = arguments[i];
327
+ if (!arg) continue;
603
328
 
604
- if (getOwnPropertySymbols) {
605
- symbols = getOwnPropertySymbols(from);
606
- for (var i = 0; i < symbols.length; i++) {
607
- if (propIsEnumerable.call(from, symbols[i])) {
608
- to[symbols[i]] = from[symbols[i]];
329
+ var argType = typeof arg;
330
+
331
+ if (argType === 'string' || argType === 'number') {
332
+ classes.push(arg);
333
+ } else if (Array.isArray(arg)) {
334
+ if (arg.length) {
335
+ var inner = classNames.apply(null, arg);
336
+ if (inner) {
337
+ classes.push(inner);
338
+ }
339
+ }
340
+ } else if (argType === 'object') {
341
+ if (arg.toString === Object.prototype.toString) {
342
+ for (var key in arg) {
343
+ if (hasOwn.call(arg, key) && arg[key]) {
344
+ classes.push(key);
345
+ }
346
+ }
347
+ } else {
348
+ classes.push(arg.toString());
609
349
  }
610
350
  }
611
351
  }
612
- }
613
-
614
- return to;
615
- };
616
352
 
617
- /**
618
- * Copyright (c) 2013-present, Facebook, Inc.
619
- *
620
- * This source code is licensed under the MIT license found in the
621
- * LICENSE file in the root directory of this source tree.
622
- */
623
-
624
- var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
625
-
626
- var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
627
-
628
- /**
629
- * Copyright (c) 2013-present, Facebook, Inc.
630
- *
631
- * This source code is licensed under the MIT license found in the
632
- * LICENSE file in the root directory of this source tree.
633
- */
634
-
635
- var printWarning$1 = function() {};
636
-
637
- if (process.env.NODE_ENV !== 'production') {
638
- var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
639
- var loggedTypeFailures = {};
640
- var has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
641
-
642
- printWarning$1 = function(text) {
643
- var message = 'Warning: ' + text;
644
- if (typeof console !== 'undefined') {
645
- console.error(message);
646
- }
647
- try {
648
- // --- Welcome to debugging React ---
649
- // This error was thrown as a convenience so that you can use this stack
650
- // to find the callsite that caused this warning to fire.
651
- throw new Error(message);
652
- } catch (x) {}
653
- };
654
- }
353
+ return classes.join(' ');
354
+ }
655
355
 
656
- /**
657
- * Assert that the values match with the type specs.
658
- * Error messages are memorized and will only be shown once.
659
- *
660
- * @param {object} typeSpecs Map of name to a ReactPropType
661
- * @param {object} values Runtime values that need to be type-checked
662
- * @param {string} location e.g. "prop", "context", "child context"
663
- * @param {string} componentName Name of the component for error messages.
664
- * @param {?Function} getStack Returns the component stack.
665
- * @private
666
- */
667
- function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
668
- if (process.env.NODE_ENV !== 'production') {
669
- for (var typeSpecName in typeSpecs) {
670
- if (has$1(typeSpecs, typeSpecName)) {
671
- var error;
672
- // Prop type validation may throw. In case they do, we don't want to
673
- // fail the render phase where it didn't fail before. So we log it.
674
- // After these have been cleaned up, we'll let them throw.
675
- try {
676
- // This is intentionally an invariant that gets caught. It's the same
677
- // behavior as without this statement except with a better message.
678
- if (typeof typeSpecs[typeSpecName] !== 'function') {
679
- var err = Error(
680
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
681
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
682
- );
683
- err.name = 'Invariant Violation';
684
- throw err;
685
- }
686
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$2);
687
- } catch (ex) {
688
- error = ex;
689
- }
690
- if (error && !(error instanceof Error)) {
691
- printWarning$1(
692
- (componentName || 'React class') + ': type specification of ' +
693
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
694
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
695
- 'You may have forgotten to pass an argument to the type checker ' +
696
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
697
- 'shape all require an argument).'
698
- );
699
- }
700
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
701
- // Only monitor this failure once because there tends to be a lot of the
702
- // same error.
703
- loggedTypeFailures[error.message] = true;
356
+ if (module.exports) {
357
+ classNames.default = classNames;
358
+ module.exports = classNames;
359
+ } else {
360
+ window.classNames = classNames;
361
+ }
362
+ }());
363
+ }(classnames));
704
364
 
705
- var stack = getStack ? getStack() : '';
365
+ var classNames = classnames.exports;
706
366
 
707
- printWarning$1(
708
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
709
- );
710
- }
711
- }
712
- }
713
- }
714
- }
367
+ var iconStaticClassName = 'pop-icon';
368
+ var Icon = function (props) {
369
+ var icon = props.icon, className = props.className, restProps = __rest(props, ["icon", "className"]);
370
+ var classes = useIconStyles(props);
371
+ var isValid = true;
372
+ if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {
373
+ isValid = false;
374
+ }
375
+ return isValid
376
+ ? createElement(icon, __assign({ className: classNames([classes.root, iconStaticClassName, className]) }, restProps))
377
+ : null;
378
+ };
379
+ Icon.defaultProps = {
380
+ size: 'inherit',
381
+ color: 'inherit',
382
+ };
383
+ Icon.displayName = 'Icon';
715
384
 
716
- /**
717
- * Resets warning cache when testing.
718
- *
719
- * @private
720
- */
721
- checkPropTypes$1.resetWarningCache = function() {
722
- if (process.env.NODE_ENV !== 'production') {
723
- loggedTypeFailures = {};
724
- }
385
+ var IconButton = forwardRef(function (props, ref) {
386
+ return React__default.createElement(MuiIconButton, __assign({ ref: ref }, props));
387
+ });
388
+ IconButton.displayName = 'IconButton';
389
+ IconButton.defaultProps = {
390
+ color: 'secondary',
725
391
  };
726
392
 
727
- var checkPropTypes_1 = checkPropTypes$1;
728
-
729
- /**
730
- * Copyright (c) 2013-present, Facebook, Inc.
731
- *
732
- * This source code is licensed under the MIT license found in the
733
- * LICENSE file in the root directory of this source tree.
734
- */
735
-
736
- var ReactIs$1 = reactIs.exports;
737
- var assign = objectAssign;
738
-
739
- var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
740
- var checkPropTypes = checkPropTypes_1;
741
-
742
- var has = Function.call.bind(Object.prototype.hasOwnProperty);
743
- var printWarning = function() {};
744
-
745
- if (process.env.NODE_ENV !== 'production') {
746
- printWarning = function(text) {
747
- var message = 'Warning: ' + text;
748
- if (typeof console !== 'undefined') {
749
- console.error(message);
750
- }
751
- try {
752
- // --- Welcome to debugging React ---
753
- // This error was thrown as a convenience so that you can use this stack
754
- // to find the callsite that caused this warning to fire.
755
- throw new Error(message);
756
- } catch (x) {}
757
- };
758
- }
759
-
760
- function emptyFunctionThatReturnsNull() {
761
- return null;
762
- }
763
-
764
- var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
765
- /* global Symbol */
766
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
767
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
768
-
769
- /**
770
- * Returns the iterator method function contained on the iterable object.
771
- *
772
- * Be sure to invoke the function with the iterable as context:
773
- *
774
- * var iteratorFn = getIteratorFn(myIterable);
775
- * if (iteratorFn) {
776
- * var iterator = iteratorFn.call(myIterable);
777
- * ...
778
- * }
779
- *
780
- * @param {?object} maybeIterable
781
- * @return {?function}
782
- */
783
- function getIteratorFn(maybeIterable) {
784
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
785
- if (typeof iteratorFn === 'function') {
786
- return iteratorFn;
787
- }
788
- }
789
-
790
- /**
791
- * Collection of methods that allow declaration and validation of props that are
792
- * supplied to React components. Example usage:
793
- *
794
- * var Props = require('ReactPropTypes');
795
- * var MyArticle = React.createClass({
796
- * propTypes: {
797
- * // An optional string prop named "description".
798
- * description: Props.string,
799
- *
800
- * // A required enum prop named "category".
801
- * category: Props.oneOf(['News','Photos']).isRequired,
802
- *
803
- * // A prop named "dialog" that requires an instance of Dialog.
804
- * dialog: Props.instanceOf(Dialog).isRequired
805
- * },
806
- * render: function() { ... }
807
- * });
808
- *
809
- * A more formal specification of how these methods are used:
810
- *
811
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
812
- * decl := ReactPropTypes.{type}(.isRequired)?
813
- *
814
- * Each and every declaration produces a function with the same signature. This
815
- * allows the creation of custom validation functions. For example:
816
- *
817
- * var MyLink = React.createClass({
818
- * propTypes: {
819
- * // An optional string or URI prop named "href".
820
- * href: function(props, propName, componentName) {
821
- * var propValue = props[propName];
822
- * if (propValue != null && typeof propValue !== 'string' &&
823
- * !(propValue instanceof URI)) {
824
- * return new Error(
825
- * 'Expected a string or an URI for ' + propName + ' in ' +
826
- * componentName
827
- * );
828
- * }
829
- * }
830
- * },
831
- * render: function() {...}
832
- * });
833
- *
834
- * @internal
835
- */
836
-
837
- var ANONYMOUS = '<<anonymous>>';
838
-
839
- // Important!
840
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
841
- var ReactPropTypes = {
842
- array: createPrimitiveTypeChecker('array'),
843
- bool: createPrimitiveTypeChecker('boolean'),
844
- func: createPrimitiveTypeChecker('function'),
845
- number: createPrimitiveTypeChecker('number'),
846
- object: createPrimitiveTypeChecker('object'),
847
- string: createPrimitiveTypeChecker('string'),
848
- symbol: createPrimitiveTypeChecker('symbol'),
849
-
850
- any: createAnyTypeChecker(),
851
- arrayOf: createArrayOfTypeChecker,
852
- element: createElementTypeChecker(),
853
- elementType: createElementTypeTypeChecker(),
854
- instanceOf: createInstanceTypeChecker,
855
- node: createNodeChecker(),
856
- objectOf: createObjectOfTypeChecker,
857
- oneOf: createEnumTypeChecker,
858
- oneOfType: createUnionTypeChecker,
859
- shape: createShapeTypeChecker,
860
- exact: createStrictShapeTypeChecker,
861
- };
862
-
863
- /**
864
- * inlined Object.is polyfill to avoid requiring consumers ship their own
865
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
866
- */
867
- /*eslint-disable no-self-compare*/
868
- function is(x, y) {
869
- // SameValue algorithm
870
- if (x === y) {
871
- // Steps 1-5, 7-10
872
- // Steps 6.b-6.e: +0 != -0
873
- return x !== 0 || 1 / x === 1 / y;
874
- } else {
875
- // Step 6.a: NaN == NaN
876
- return x !== x && y !== y;
877
- }
878
- }
879
- /*eslint-enable no-self-compare*/
880
-
881
- /**
882
- * We use an Error-like object for backward compatibility as people may call
883
- * PropTypes directly and inspect their output. However, we don't use real
884
- * Errors anymore. We don't inspect their stack anyway, and creating them
885
- * is prohibitively expensive if they are created too often, such as what
886
- * happens in oneOfType() for any type before the one that matched.
887
- */
888
- function PropTypeError(message) {
889
- this.message = message;
890
- this.stack = '';
891
- }
892
- // Make `instanceof Error` still work for returned errors.
893
- PropTypeError.prototype = Error.prototype;
894
-
895
- function createChainableTypeChecker(validate) {
896
- if (process.env.NODE_ENV !== 'production') {
897
- var manualPropTypeCallCache = {};
898
- var manualPropTypeWarningCount = 0;
899
- }
900
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
901
- componentName = componentName || ANONYMOUS;
902
- propFullName = propFullName || propName;
903
-
904
- if (secret !== ReactPropTypesSecret$1) {
905
- if (throwOnDirectAccess) {
906
- // New behavior only for users of `prop-types` package
907
- var err = new Error(
908
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
909
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
910
- 'Read more at http://fb.me/use-check-prop-types'
911
- );
912
- err.name = 'Invariant Violation';
913
- throw err;
914
- } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
915
- // Old behavior for people using React.PropTypes
916
- var cacheKey = componentName + ':' + propName;
917
- if (
918
- !manualPropTypeCallCache[cacheKey] &&
919
- // Avoid spamming the console because they are often not actionable except for lib authors
920
- manualPropTypeWarningCount < 3
921
- ) {
922
- printWarning(
923
- 'You are manually calling a React.PropTypes validation ' +
924
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
925
- 'and will throw in the standalone `prop-types` package. ' +
926
- 'You may be seeing this warning due to a third-party PropTypes ' +
927
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
928
- );
929
- manualPropTypeCallCache[cacheKey] = true;
930
- manualPropTypeWarningCount++;
931
- }
932
- }
933
- }
934
- if (props[propName] == null) {
935
- if (isRequired) {
936
- if (props[propName] === null) {
937
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
938
- }
939
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
940
- }
941
- return null;
942
- } else {
943
- return validate(props, propName, componentName, location, propFullName);
944
- }
945
- }
946
-
947
- var chainedCheckType = checkType.bind(null, false);
948
- chainedCheckType.isRequired = checkType.bind(null, true);
949
-
950
- return chainedCheckType;
951
- }
952
-
953
- function createPrimitiveTypeChecker(expectedType) {
954
- function validate(props, propName, componentName, location, propFullName, secret) {
955
- var propValue = props[propName];
956
- var propType = getPropType(propValue);
957
- if (propType !== expectedType) {
958
- // `propValue` being instance of, say, date/regexp, pass the 'object'
959
- // check, but we can offer a more precise error message here rather than
960
- // 'of type `object`'.
961
- var preciseType = getPreciseType(propValue);
962
-
963
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
964
- }
965
- return null;
966
- }
967
- return createChainableTypeChecker(validate);
968
- }
969
-
970
- function createAnyTypeChecker() {
971
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
972
- }
973
-
974
- function createArrayOfTypeChecker(typeChecker) {
975
- function validate(props, propName, componentName, location, propFullName) {
976
- if (typeof typeChecker !== 'function') {
977
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
978
- }
979
- var propValue = props[propName];
980
- if (!Array.isArray(propValue)) {
981
- var propType = getPropType(propValue);
982
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
983
- }
984
- for (var i = 0; i < propValue.length; i++) {
985
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$1);
986
- if (error instanceof Error) {
987
- return error;
988
- }
989
- }
990
- return null;
991
- }
992
- return createChainableTypeChecker(validate);
993
- }
994
-
995
- function createElementTypeChecker() {
996
- function validate(props, propName, componentName, location, propFullName) {
997
- var propValue = props[propName];
998
- if (!isValidElement(propValue)) {
999
- var propType = getPropType(propValue);
1000
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
1001
- }
1002
- return null;
1003
- }
1004
- return createChainableTypeChecker(validate);
1005
- }
1006
-
1007
- function createElementTypeTypeChecker() {
1008
- function validate(props, propName, componentName, location, propFullName) {
1009
- var propValue = props[propName];
1010
- if (!ReactIs$1.isValidElementType(propValue)) {
1011
- var propType = getPropType(propValue);
1012
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
1013
- }
1014
- return null;
1015
- }
1016
- return createChainableTypeChecker(validate);
1017
- }
1018
-
1019
- function createInstanceTypeChecker(expectedClass) {
1020
- function validate(props, propName, componentName, location, propFullName) {
1021
- if (!(props[propName] instanceof expectedClass)) {
1022
- var expectedClassName = expectedClass.name || ANONYMOUS;
1023
- var actualClassName = getClassName(props[propName]);
1024
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
1025
- }
1026
- return null;
1027
- }
1028
- return createChainableTypeChecker(validate);
1029
- }
1030
-
1031
- function createEnumTypeChecker(expectedValues) {
1032
- if (!Array.isArray(expectedValues)) {
1033
- if (process.env.NODE_ENV !== 'production') {
1034
- if (arguments.length > 1) {
1035
- printWarning(
1036
- 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
1037
- 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
1038
- );
1039
- } else {
1040
- printWarning('Invalid argument supplied to oneOf, expected an array.');
1041
- }
1042
- }
1043
- return emptyFunctionThatReturnsNull;
1044
- }
1045
-
1046
- function validate(props, propName, componentName, location, propFullName) {
1047
- var propValue = props[propName];
1048
- for (var i = 0; i < expectedValues.length; i++) {
1049
- if (is(propValue, expectedValues[i])) {
1050
- return null;
1051
- }
1052
- }
1053
-
1054
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
1055
- var type = getPreciseType(value);
1056
- if (type === 'symbol') {
1057
- return String(value);
1058
- }
1059
- return value;
1060
- });
1061
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
1062
- }
1063
- return createChainableTypeChecker(validate);
1064
- }
1065
-
1066
- function createObjectOfTypeChecker(typeChecker) {
1067
- function validate(props, propName, componentName, location, propFullName) {
1068
- if (typeof typeChecker !== 'function') {
1069
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
1070
- }
1071
- var propValue = props[propName];
1072
- var propType = getPropType(propValue);
1073
- if (propType !== 'object') {
1074
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
1075
- }
1076
- for (var key in propValue) {
1077
- if (has(propValue, key)) {
1078
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
1079
- if (error instanceof Error) {
1080
- return error;
1081
- }
1082
- }
1083
- }
1084
- return null;
1085
- }
1086
- return createChainableTypeChecker(validate);
1087
- }
1088
-
1089
- function createUnionTypeChecker(arrayOfTypeCheckers) {
1090
- if (!Array.isArray(arrayOfTypeCheckers)) {
1091
- process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
1092
- return emptyFunctionThatReturnsNull;
1093
- }
1094
-
1095
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1096
- var checker = arrayOfTypeCheckers[i];
1097
- if (typeof checker !== 'function') {
1098
- printWarning(
1099
- 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
1100
- 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
1101
- );
1102
- return emptyFunctionThatReturnsNull;
1103
- }
1104
- }
1105
-
1106
- function validate(props, propName, componentName, location, propFullName) {
1107
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1108
- var checker = arrayOfTypeCheckers[i];
1109
- if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1) == null) {
1110
- return null;
1111
- }
1112
- }
1113
-
1114
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
1115
- }
1116
- return createChainableTypeChecker(validate);
1117
- }
1118
-
1119
- function createNodeChecker() {
1120
- function validate(props, propName, componentName, location, propFullName) {
1121
- if (!isNode(props[propName])) {
1122
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
1123
- }
1124
- return null;
1125
- }
1126
- return createChainableTypeChecker(validate);
1127
- }
1128
-
1129
- function createShapeTypeChecker(shapeTypes) {
1130
- function validate(props, propName, componentName, location, propFullName) {
1131
- var propValue = props[propName];
1132
- var propType = getPropType(propValue);
1133
- if (propType !== 'object') {
1134
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1135
- }
1136
- for (var key in shapeTypes) {
1137
- var checker = shapeTypes[key];
1138
- if (!checker) {
1139
- continue;
1140
- }
1141
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
1142
- if (error) {
1143
- return error;
1144
- }
1145
- }
1146
- return null;
1147
- }
1148
- return createChainableTypeChecker(validate);
1149
- }
1150
-
1151
- function createStrictShapeTypeChecker(shapeTypes) {
1152
- function validate(props, propName, componentName, location, propFullName) {
1153
- var propValue = props[propName];
1154
- var propType = getPropType(propValue);
1155
- if (propType !== 'object') {
1156
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1157
- }
1158
- // We need to check all keys in case some are required but missing from
1159
- // props.
1160
- var allKeys = assign({}, props[propName], shapeTypes);
1161
- for (var key in allKeys) {
1162
- var checker = shapeTypes[key];
1163
- if (!checker) {
1164
- return new PropTypeError(
1165
- 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
1166
- '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
1167
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
1168
- );
1169
- }
1170
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
1171
- if (error) {
1172
- return error;
1173
- }
1174
- }
1175
- return null;
1176
- }
1177
-
1178
- return createChainableTypeChecker(validate);
1179
- }
1180
-
1181
- function isNode(propValue) {
1182
- switch (typeof propValue) {
1183
- case 'number':
1184
- case 'string':
1185
- case 'undefined':
1186
- return true;
1187
- case 'boolean':
1188
- return !propValue;
1189
- case 'object':
1190
- if (Array.isArray(propValue)) {
1191
- return propValue.every(isNode);
1192
- }
1193
- if (propValue === null || isValidElement(propValue)) {
1194
- return true;
1195
- }
1196
-
1197
- var iteratorFn = getIteratorFn(propValue);
1198
- if (iteratorFn) {
1199
- var iterator = iteratorFn.call(propValue);
1200
- var step;
1201
- if (iteratorFn !== propValue.entries) {
1202
- while (!(step = iterator.next()).done) {
1203
- if (!isNode(step.value)) {
1204
- return false;
1205
- }
1206
- }
1207
- } else {
1208
- // Iterator will provide entry [k,v] tuples rather than values.
1209
- while (!(step = iterator.next()).done) {
1210
- var entry = step.value;
1211
- if (entry) {
1212
- if (!isNode(entry[1])) {
1213
- return false;
1214
- }
1215
- }
1216
- }
1217
- }
1218
- } else {
1219
- return false;
1220
- }
1221
-
1222
- return true;
1223
- default:
1224
- return false;
1225
- }
1226
- }
1227
-
1228
- function isSymbol(propType, propValue) {
1229
- // Native Symbol.
1230
- if (propType === 'symbol') {
1231
- return true;
1232
- }
1233
-
1234
- // falsy value can't be a Symbol
1235
- if (!propValue) {
1236
- return false;
1237
- }
1238
-
1239
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1240
- if (propValue['@@toStringTag'] === 'Symbol') {
1241
- return true;
1242
- }
1243
-
1244
- // Fallback for non-spec compliant Symbols which are polyfilled.
1245
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1246
- return true;
1247
- }
1248
-
1249
- return false;
1250
- }
1251
-
1252
- // Equivalent of `typeof` but with special handling for array and regexp.
1253
- function getPropType(propValue) {
1254
- var propType = typeof propValue;
1255
- if (Array.isArray(propValue)) {
1256
- return 'array';
1257
- }
1258
- if (propValue instanceof RegExp) {
1259
- // Old webkits (at least until Android 4.0) return 'function' rather than
1260
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1261
- // passes PropTypes.object.
1262
- return 'object';
1263
- }
1264
- if (isSymbol(propType, propValue)) {
1265
- return 'symbol';
1266
- }
1267
- return propType;
1268
- }
1269
-
1270
- // This handles more types than `getPropType`. Only used for error messages.
1271
- // See `createPrimitiveTypeChecker`.
1272
- function getPreciseType(propValue) {
1273
- if (typeof propValue === 'undefined' || propValue === null) {
1274
- return '' + propValue;
1275
- }
1276
- var propType = getPropType(propValue);
1277
- if (propType === 'object') {
1278
- if (propValue instanceof Date) {
1279
- return 'date';
1280
- } else if (propValue instanceof RegExp) {
1281
- return 'regexp';
1282
- }
1283
- }
1284
- return propType;
1285
- }
1286
-
1287
- // Returns a string that is postfixed to a warning about an invalid type.
1288
- // For example, "undefined" or "of type array"
1289
- function getPostfixForTypeWarning(value) {
1290
- var type = getPreciseType(value);
1291
- switch (type) {
1292
- case 'array':
1293
- case 'object':
1294
- return 'an ' + type;
1295
- case 'boolean':
1296
- case 'date':
1297
- case 'regexp':
1298
- return 'a ' + type;
1299
- default:
1300
- return type;
1301
- }
1302
- }
1303
-
1304
- // Returns class name of the object, if any.
1305
- function getClassName(propValue) {
1306
- if (!propValue.constructor || !propValue.constructor.name) {
1307
- return ANONYMOUS;
1308
- }
1309
- return propValue.constructor.name;
1310
- }
393
+ var useTypographyStyles = makeStyles$1(function () {
394
+ var _a;
395
+ return ({
396
+ root: (_a = {},
397
+ _a["& ." + iconStaticClassName] = {
398
+ position: 'relative',
399
+ top: '0.125em',
400
+ padding: '0 0.125em',
401
+ boxSizing: 'content-box',
402
+ },
403
+ _a),
404
+ caption: {
405
+ display: 'inline',
406
+ },
407
+ overline: {
408
+ display: 'inline',
409
+ },
410
+ });
411
+ });
1311
412
 
1312
- ReactPropTypes.checkPropTypes = checkPropTypes;
1313
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1314
- ReactPropTypes.PropTypes = ReactPropTypes;
413
+ var Typography = forwardRef(function (props, ref) {
414
+ var classes = useTypographyStyles(props);
415
+ return React__default.createElement(MuiTypography, __assign({ ref: ref, classes: classes }, props));
416
+ });
417
+ Typography.displayName = 'Typography';
1315
418
 
1316
- return ReactPropTypes;
419
+ var useStyles$1 = makeStyles(function (_a) {
420
+ var spacing = _a.spacing;
421
+ return ({
422
+ root: {
423
+ '&:last-child': {
424
+ marginBottom: 0,
425
+ },
426
+ marginBottom: spacing(4),
427
+ padding: spacing(4),
428
+ },
429
+ });
430
+ });
431
+ var Paper = forwardRef(function (props, ref) {
432
+ var legacyStyles = props.legacyStyles, restProps = __rest(props, ["legacyStyles"]);
433
+ var classes = useStyles$1(props);
434
+ return React__default.createElement(Paper$1, __assign({}, ref, { classes: __assign({}, (legacyStyles && classes)) }, restProps));
435
+ });
436
+ Paper.displayName = 'Paper';
437
+ Paper.defaultProps = {
438
+ legacyStyles: false,
1317
439
  };
1318
440
 
1319
- /**
1320
- * Copyright (c) 2013-present, Facebook, Inc.
1321
- *
1322
- * This source code is licensed under the MIT license found in the
1323
- * LICENSE file in the root directory of this source tree.
1324
- */
1325
-
1326
- var ReactPropTypesSecret = ReactPropTypesSecret_1;
1327
-
1328
- function emptyFunction() {}
1329
- function emptyFunctionWithReset() {}
1330
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
1331
-
1332
- var factoryWithThrowingShims = function() {
1333
- function shim(props, propName, componentName, location, propFullName, secret) {
1334
- if (secret === ReactPropTypesSecret) {
1335
- // It is still safe when called from React.
1336
- return;
1337
- }
1338
- var err = new Error(
1339
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1340
- 'Use PropTypes.checkPropTypes() to call them. ' +
1341
- 'Read more at http://fb.me/use-check-prop-types'
1342
- );
1343
- err.name = 'Invariant Violation';
1344
- throw err;
1345
- } shim.isRequired = shim;
1346
- function getShim() {
1347
- return shim;
1348
- } // Important!
1349
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1350
- var ReactPropTypes = {
1351
- array: shim,
1352
- bool: shim,
1353
- func: shim,
1354
- number: shim,
1355
- object: shim,
1356
- string: shim,
1357
- symbol: shim,
1358
-
1359
- any: shim,
1360
- arrayOf: getShim,
1361
- element: shim,
1362
- elementType: shim,
1363
- instanceOf: getShim,
1364
- node: shim,
1365
- objectOf: getShim,
1366
- oneOf: getShim,
1367
- oneOfType: getShim,
1368
- shape: getShim,
1369
- exact: getShim,
1370
-
1371
- checkPropTypes: emptyFunctionWithReset,
1372
- resetWarningCache: emptyFunction
1373
- };
1374
-
1375
- ReactPropTypes.PropTypes = ReactPropTypes;
1376
-
1377
- return ReactPropTypes;
441
+ var AUDIO_PLAYER_EVENT_TYPES;
442
+ (function (AUDIO_PLAYER_EVENT_TYPES) {
443
+ AUDIO_PLAYER_EVENT_TYPES["TOGGLE_PLAYBACK"] = "TOGGLE_PLAYBACK";
444
+ AUDIO_PLAYER_EVENT_TYPES["TOGGLE_VOLUME_CONTROL"] = "TOGGLE_VOLUME_CONTROL";
445
+ AUDIO_PLAYER_EVENT_TYPES["TOGGLE_MUTE"] = "TOGGLE_MUTE";
446
+ AUDIO_PLAYER_EVENT_TYPES["VOLUME_CHANGE"] = "VOLUME_CHANGE";
447
+ AUDIO_PLAYER_EVENT_TYPES["TIME_CHANGE"] = "TIME_CHANGE";
448
+ AUDIO_PLAYER_EVENT_TYPES["DURATION_CHANGE"] = "DURATION_CHANGE";
449
+ AUDIO_PLAYER_EVENT_TYPES["SET_TIME"] = "SET_TIME";
450
+ AUDIO_PLAYER_EVENT_TYPES["CAN_PLAY"] = "CAN_PLAY";
451
+ AUDIO_PLAYER_EVENT_TYPES["RESET"] = "RESET";
452
+ })(AUDIO_PLAYER_EVENT_TYPES || (AUDIO_PLAYER_EVENT_TYPES = {}));
453
+ var PLAYBACK_STATES;
454
+ (function (PLAYBACK_STATES) {
455
+ PLAYBACK_STATES["NONE"] = "NONE";
456
+ PLAYBACK_STATES["PAUSED"] = "PAUSED";
457
+ PLAYBACK_STATES["PLAYING"] = "PLAYING";
458
+ })(PLAYBACK_STATES || (PLAYBACK_STATES = {}));
459
+ var CONTROL_LABELS;
460
+ (function (CONTROL_LABELS) {
461
+ CONTROL_LABELS["PAUSE"] = "PAUSE";
462
+ CONTROL_LABELS["PLAY"] = "PLAY";
463
+ CONTROL_LABELS["MUTE"] = "MUTE";
464
+ CONTROL_LABELS["UNMUTE"] = "UNMUTE";
465
+ })(CONTROL_LABELS || (CONTROL_LABELS = {}));
466
+ var VOLUME_CONTROL_STATES;
467
+ (function (VOLUME_CONTROL_STATES) {
468
+ VOLUME_CONTROL_STATES["SHOW"] = "SHOW";
469
+ VOLUME_CONTROL_STATES["HIDE"] = "HIDE";
470
+ })(VOLUME_CONTROL_STATES || (VOLUME_CONTROL_STATES = {}));
471
+
472
+ var initialAudioPlayerState = {
473
+ playback: PLAYBACK_STATES.NONE,
474
+ volumeControls: VOLUME_CONTROL_STATES.HIDE,
475
+ context: {
476
+ volume: 100,
477
+ playbackButtonLabel: CONTROL_LABELS.PLAY,
478
+ volumeButtonLabel: CONTROL_LABELS.MUTE,
479
+ },
480
+ };
481
+ var getPlayback = function (_a) {
482
+ var audio = _a.current;
483
+ var playback = PLAYBACK_STATES.NONE;
484
+ if (audio) {
485
+ var paused = audio.paused, readyState = audio.readyState;
486
+ if (readyState === 0) {
487
+ playback = PLAYBACK_STATES.NONE;
488
+ }
489
+ else if (paused) {
490
+ playback = PLAYBACK_STATES.PAUSED;
491
+ }
492
+ else {
493
+ playback = PLAYBACK_STATES.PLAYING;
494
+ }
495
+ }
496
+ return playback;
497
+ };
498
+ var audioPlayerReducer = function (state, event) {
499
+ var _a, _b;
500
+ var audioRef = state.context.audioRef;
501
+ var nextState = __assign({}, state);
502
+ switch (state.playback) {
503
+ case PLAYBACK_STATES.NONE:
504
+ if (event.type === AUDIO_PLAYER_EVENT_TYPES.CAN_PLAY) {
505
+ nextState.playback = getPlayback(audioRef);
506
+ return nextState;
507
+ }
508
+ break;
509
+ case PLAYBACK_STATES.PAUSED:
510
+ if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK) {
511
+ (_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.play();
512
+ nextState.playback = getPlayback(audioRef);
513
+ nextState.context.playbackButtonLabel = CONTROL_LABELS.PAUSE;
514
+ return nextState;
515
+ }
516
+ break;
517
+ case PLAYBACK_STATES.PLAYING:
518
+ if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK) {
519
+ (_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.pause();
520
+ nextState.playback = getPlayback(audioRef);
521
+ nextState.context.playbackButtonLabel = CONTROL_LABELS.PLAY;
522
+ return nextState;
523
+ }
524
+ if (event.type === AUDIO_PLAYER_EVENT_TYPES.TIME_CHANGE) {
525
+ return nextState;
526
+ }
527
+ break;
528
+ }
529
+ switch (state.volumeControls) {
530
+ case VOLUME_CONTROL_STATES.SHOW:
531
+ if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL) {
532
+ nextState.volumeControls = VOLUME_CONTROL_STATES.HIDE;
533
+ return nextState;
534
+ }
535
+ if (event.type === AUDIO_PLAYER_EVENT_TYPES.VOLUME_CHANGE) {
536
+ if (nextState.context.volume !== event.context.volume) {
537
+ nextState.context.volume = event.context.volume;
538
+ if (audioRef.current) {
539
+ audioRef.current.volume = event.context.volume;
540
+ }
541
+ return nextState;
542
+ }
543
+ }
544
+ break;
545
+ case VOLUME_CONTROL_STATES.HIDE:
546
+ if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL) {
547
+ nextState.volumeControls = VOLUME_CONTROL_STATES.SHOW;
548
+ return nextState;
549
+ }
550
+ break;
551
+ }
552
+ switch (event.type) {
553
+ case AUDIO_PLAYER_EVENT_TYPES.TOGGLE_MUTE:
554
+ if (audioRef.current) {
555
+ audioRef.current.muted = !audioRef.current.muted;
556
+ return nextState;
557
+ }
558
+ break;
559
+ case AUDIO_PLAYER_EVENT_TYPES.SET_TIME:
560
+ if (audioRef.current) {
561
+ audioRef.current.currentTime = event.context.time;
562
+ return nextState;
563
+ }
564
+ break;
565
+ case AUDIO_PLAYER_EVENT_TYPES.RESET:
566
+ if (audioRef.current) {
567
+ audioRef.current.currentTime = 0;
568
+ nextState.playback = getPlayback(audioRef);
569
+ return nextState;
570
+ }
571
+ break;
572
+ }
573
+ return state;
1378
574
  };
1379
575
 
1380
- /**
1381
- * Copyright (c) 2013-present, Facebook, Inc.
1382
- *
1383
- * This source code is licensed under the MIT license found in the
1384
- * LICENSE file in the root directory of this source tree.
1385
- */
576
+ var useVolumeIcon = function (state) {
577
+ var volumeIcon = SvgVolumeUp;
578
+ if (state.context.volume >= 0.5) {
579
+ volumeIcon = SvgVolumeUp;
580
+ }
581
+ else if (state.context.volume < 0.5 && state.context.volume > 0) {
582
+ volumeIcon = SvgVolumeDown;
583
+ }
584
+ else if (state.context.volume === 0) {
585
+ volumeIcon = SvgVolumeMute;
586
+ }
587
+ if (state.context.audioRef.current) {
588
+ if (state.context.audioRef.current.muted) {
589
+ volumeIcon = SvgVolumeOff;
590
+ }
591
+ }
592
+ return volumeIcon;
593
+ };
1386
594
 
1387
- if (process.env.NODE_ENV !== 'production') {
1388
- var ReactIs = reactIs.exports;
595
+ var appendZero = function (num) { return (num < 10 ? "0" + num : num); };
596
+ var formatTime = function (time, remaning) {
597
+ if (remaning === void 0) { remaning = false; }
598
+ var dateTime = new Date(0, 0, 0, 0, 0, time, 0);
599
+ var dateTimeH = appendZero(dateTime.getHours());
600
+ var dateTimeM = appendZero(dateTime.getMinutes());
601
+ var dateTimeS = appendZero(dateTime.getSeconds());
602
+ var minus = remaning ? '-' : '';
603
+ return dateTimeH > 0 ? "" + minus + dateTimeH + ":" + dateTimeM + ":" + dateTimeS : "" + minus + dateTimeM + ":" + dateTimeS;
604
+ };
1389
605
 
1390
- // By explicitly using `prop-types` you are opting into new development behavior.
1391
- // http://fb.me/prop-types-in-prod
1392
- var throwOnDirectAccess = true;
1393
- propTypes.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
1394
- } else {
1395
- // By explicitly using `prop-types` you are opting into new production behavior.
1396
- // http://fb.me/prop-types-in-prod
1397
- propTypes.exports = factoryWithThrowingShims();
1398
- }
606
+ var setupAudioRef = function (config) { return function () {
607
+ var _a, _b, _c, _d;
608
+ var audioRef = config.audioRef, send = config.send;
609
+ var handleDurationChange = function (event) {
610
+ var duration = event.target.duration;
611
+ send({ type: AUDIO_PLAYER_EVENT_TYPES.DURATION_CHANGE, context: { duration: duration } });
612
+ };
613
+ var handleTimeUpdate = function (event) {
614
+ var currentTime = event.target.currentTime;
615
+ send({ type: AUDIO_PLAYER_EVENT_TYPES.TIME_CHANGE, context: { currentTime: currentTime } });
616
+ };
617
+ var handleCanPlay = function () {
618
+ send({ type: AUDIO_PLAYER_EVENT_TYPES.CAN_PLAY });
619
+ };
620
+ var handleEnded = function () {
621
+ send({ type: AUDIO_PLAYER_EVENT_TYPES.RESET });
622
+ };
623
+ (_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('durationchange', handleDurationChange);
624
+ (_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('timeupdate', handleTimeUpdate);
625
+ (_c = audioRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('canplay', handleCanPlay);
626
+ (_d = audioRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('ended', handleEnded);
627
+ return function () {
628
+ var _a, _b, _c, _d;
629
+ (_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('durationchange', handleDurationChange);
630
+ (_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('timeupdate', handleTimeUpdate);
631
+ (_c = audioRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('canplay', handleCanPlay);
632
+ (_d = audioRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('ended', handleEnded);
633
+ };
634
+ }; };
635
+
636
+ var AudioPlayer = function (props) {
637
+ var _a, _b, _c, _d, _f;
638
+ var src = props.src;
639
+ var volumeRef = useRef(null);
640
+ var audioRef = useRef(null);
641
+ var spacing = useTheme().spacing;
642
+ var _g = useState(false), disableRipple = _g[0], setDisableRipple = _g[1];
643
+ var _h = useReducer(audioPlayerReducer, __assign(__assign({}, initialAudioPlayerState), { context: __assign(__assign({}, initialAudioPlayerState.context), { audioRef: audioRef }) })), state = _h[0], send = _h[1];
644
+ useEffect(setupAudioRef({ audioRef: audioRef, send: send }), [audioRef]);
645
+ var PlaybackIcon = state.playback !== PLAYBACK_STATES.PAUSED ? SvgPause : SvgPlay;
646
+ var VolumeIcon = useMemo(function () { return useVolumeIcon(state); }, [state.context.volume, (_a = state.context.audioRef.current) === null || _a === void 0 ? void 0 : _a.muted]);
647
+ var togglePlayback = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK }); };
648
+ var toggleVolumeControl = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL }); };
649
+ var toggleMute = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_MUTE }); };
650
+ var setTime = function (_e, time) { return send({ type: AUDIO_PLAYER_EVENT_TYPES.SET_TIME, context: { time: time } }); };
651
+ var setVolume = function (_e, volume) { return send({ type: AUDIO_PLAYER_EVENT_TYPES.VOLUME_CHANGE, context: { volume: volume } }); };
652
+ return (React__default.createElement(Box, { display: "flex", alignItems: "center", gridGap: spacing(1) },
653
+ React__default.createElement("audio", { ref: audioRef, src: src }),
654
+ React__default.createElement(Box, null,
655
+ React__default.createElement(IconButton, { "aria-label": state.context.playbackButtonLabel, disabled: state.playback === PLAYBACK_STATES.NONE, onClick: togglePlayback },
656
+ React__default.createElement(Icon, { icon: PlaybackIcon })),
657
+ React__default.createElement(IconButton, { "aria-label": state.context.volumeButtonLabel, ref: volumeRef, onClick: toggleMute, onMouseEnter: toggleVolumeControl, onMouseLeave: toggleVolumeControl, disableRipple: disableRipple },
658
+ React__default.createElement(Icon, { icon: VolumeIcon }),
659
+ 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) {
660
+ var TransitionProps = _a.TransitionProps;
661
+ return (React__default.createElement(Grow, __assign({}, TransitionProps),
662
+ React__default.createElement(Paper, { elevation: 1 },
663
+ React__default.createElement(Box, { py: 1, height: 80 },
664
+ React__default.createElement(Slider, { color: "secondary", orientation: "vertical", value: state.context.volume, onChange: setVolume, max: 1, step: 0.01 })))));
665
+ }))),
666
+ React__default.createElement(Box, { display: "flex", flexGrow: 1, alignItems: "center", gridGap: spacing(1) },
667
+ React__default.createElement(Box, { flexBasis: 60, flexShrink: 0 },
668
+ React__default.createElement(Typography, null, formatTime(((_b = state.context.audioRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0))),
669
+ React__default.createElement(Slider, { color: "secondary", value: ((_c = state.context.audioRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) || 0, max: ((_d = state.context.audioRef.current) === null || _d === void 0 ? void 0 : _d.duration) || 1, onChange: setTime, disabled: state.playback === PLAYBACK_STATES.NONE }),
670
+ React__default.createElement(Box, { flexBasis: 60, flexShrink: 0, textAlign: "end" },
671
+ React__default.createElement(Typography, null, formatTime(((_f = state.context.audioRef.current) === null || _f === void 0 ? void 0 : _f.duration) || 0))))));
672
+ };
1399
673
 
1400
- var PropTypes = propTypes.exports;
674
+ var LoadingStatus;
675
+ (function (LoadingStatus) {
676
+ LoadingStatus["ERROR"] = "ERROR";
677
+ LoadingStatus["LOADED"] = "LOADED";
678
+ LoadingStatus["PENDING"] = "PENDING";
679
+ })(LoadingStatus || (LoadingStatus = {}));
680
+ /**
681
+ * Hook returns [imgProps, loaded]
682
+ * ref: Merged default and provided imgProp object. Includes load and error events for img tag. To be passed to MuiAvatar.
683
+ * loaded: Indicates whether the src supplied to an img within Avatar results in loaded or error
684
+ */
685
+ var useImgProps = function (avatarProps) {
686
+ var _a = React__default.useState(LoadingStatus.PENDING), loaded = _a[0], setLoaded = _a[1];
687
+ var imgProps = __assign(__assign({}, avatarProps.imgProps), { onError: function (event) {
688
+ var _a, _b;
689
+ setLoaded(LoadingStatus.ERROR);
690
+ (_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, event);
691
+ }, onLoad: function (event) {
692
+ var _a, _b;
693
+ setLoaded(LoadingStatus.LOADED);
694
+ (_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, event);
695
+ } });
696
+ return { imgProps: imgProps, loaded: loaded };
697
+ };
1401
698
 
1402
- var responsivePropType = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object, PropTypes.array]) : {};
699
+ var getAvatarDimensions = function (theme, props) {
700
+ var factors = {
701
+ 'extra-small': 3,
702
+ small: 4,
703
+ medium: 5,
704
+ large: 6,
705
+ 'extra-large': 12.5,
706
+ };
707
+ var sizeFactor = factors[props.size || 'medium'];
708
+ return theme.spacing(sizeFactor);
709
+ };
710
+ var getAvatarFontSize = function (props) {
711
+ var fontSizes = {
712
+ 'extra-small': '0.75rem',
713
+ small: '1rem',
714
+ medium: '1rem',
715
+ large: '1.25rem',
716
+ 'extra-large': '3.5rem',
717
+ };
718
+ return fontSizes[props.size || 'medium'];
719
+ };
720
+ var getAvatarBackground = function (props) {
721
+ var src = props.src, loaded = props.loaded;
722
+ var background = props.background;
723
+ if (src && loaded === LoadingStatus.LOADED) {
724
+ background = 'transparent';
725
+ }
726
+ return background;
727
+ };
728
+ var useAvatarStyles = makeStyles$1(function (theme) { return ({
729
+ root: {
730
+ width: function (props) { return getAvatarDimensions(theme, props); },
731
+ height: function (props) { return getAvatarDimensions(theme, props); },
732
+ fontSize: function (props) { return getAvatarFontSize(props); },
733
+ backgroundColor: function (props) { return getAvatarBackground(props); },
734
+ color: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
735
+ objectFit: function (props) { return props.fit; },
736
+ },
737
+ silhouette: {
738
+ '& path': {
739
+ fill: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
740
+ },
741
+ },
742
+ }); });
1403
743
 
1404
- function _typeof(obj) {
1405
- "@babel/helpers - typeof";
744
+ var _path$2;
1406
745
 
1407
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
1408
- _typeof = function _typeof(obj) {
1409
- return typeof obj;
1410
- };
1411
- } else {
1412
- _typeof = function _typeof(obj) {
1413
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1414
- };
1415
- }
746
+ 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); }
1416
747
 
1417
- return _typeof(obj);
748
+ function SvgSilhouetteFemale(props) {
749
+ return /*#__PURE__*/React.createElement("svg", _extends$2({
750
+ viewBox: "0 0 300 300",
751
+ fill: "none",
752
+ xmlns: "http://www.w3.org/2000/svg"
753
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
754
+ 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",
755
+ fill: "#2E3042"
756
+ })));
1418
757
  }
1419
758
 
1420
- // For instance with the first breakpoint xs: [xs, sm[.
1421
-
1422
- var values = {
1423
- xs: 0,
1424
- sm: 600,
1425
- md: 960,
1426
- lg: 1280,
1427
- xl: 1920
1428
- };
1429
- var defaultBreakpoints = {
1430
- // Sorted ASC by size. That's important.
1431
- // It can't be configured as it's used statically for propTypes.
1432
- keys: ['xs', 'sm', 'md', 'lg', 'xl'],
1433
- up: function up(key) {
1434
- return "@media (min-width:".concat(values[key], "px)");
1435
- }
1436
- };
1437
- function handleBreakpoints(props, propValue, styleFromPropValue) {
1438
- if (process.env.NODE_ENV !== 'production') {
1439
- if (!props.theme) {
1440
- console.error('Material-UI: You are calling a style function without a theme value.');
1441
- }
1442
- }
1443
-
1444
- if (Array.isArray(propValue)) {
1445
- var themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;
1446
- return propValue.reduce(function (acc, item, index) {
1447
- acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);
1448
- return acc;
1449
- }, {});
1450
- }
1451
-
1452
- if (_typeof(propValue) === 'object') {
1453
- var _themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;
1454
-
1455
- return Object.keys(propValue).reduce(function (acc, breakpoint) {
1456
- acc[_themeBreakpoints.up(breakpoint)] = styleFromPropValue(propValue[breakpoint]);
1457
- return acc;
1458
- }, {});
1459
- }
1460
-
1461
- var output = styleFromPropValue(propValue);
1462
- return output;
1463
- }
759
+ var _path$1;
1464
760
 
1465
- function getPath(obj, path) {
1466
- if (!path || typeof path !== 'string') {
1467
- return null;
1468
- }
761
+ 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); }
1469
762
 
1470
- return path.split('.').reduce(function (acc, item) {
1471
- return acc && acc[item] ? acc[item] : null;
1472
- }, obj);
763
+ function SvgSilhouetteMale(props) {
764
+ return /*#__PURE__*/React.createElement("svg", _extends$1({
765
+ viewBox: "0 0 300 300",
766
+ fill: "none",
767
+ xmlns: "http://www.w3.org/2000/svg"
768
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
769
+ 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",
770
+ fill: "#2E3042"
771
+ })));
1473
772
  }
1474
773
 
1475
- function style(options) {
1476
- var prop = options.prop,
1477
- _options$cssProperty = options.cssProperty,
1478
- cssProperty = _options$cssProperty === void 0 ? options.prop : _options$cssProperty,
1479
- themeKey = options.themeKey,
1480
- transform = options.transform;
1481
-
1482
- var fn = function fn(props) {
1483
- if (props[prop] == null) {
1484
- return null;
1485
- }
1486
-
1487
- var propValue = props[prop];
1488
- var theme = props.theme;
1489
- var themeMapping = getPath(theme, themeKey) || {};
1490
-
1491
- var styleFromPropValue = function styleFromPropValue(propValueFinal) {
1492
- var value;
1493
-
1494
- if (typeof themeMapping === 'function') {
1495
- value = themeMapping(propValueFinal);
1496
- } else if (Array.isArray(themeMapping)) {
1497
- value = themeMapping[propValueFinal] || propValueFinal;
1498
- } else {
1499
- value = getPath(themeMapping, propValueFinal) || propValueFinal;
1500
-
1501
- if (transform) {
1502
- value = transform(value);
1503
- }
1504
- }
1505
-
1506
- if (cssProperty === false) {
1507
- return value;
1508
- }
1509
-
1510
- return _defineProperty({}, cssProperty, value);
1511
- };
774
+ var _path;
1512
775
 
1513
- return handleBreakpoints(props, propValue, styleFromPropValue);
1514
- };
776
+ 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); }
1515
777
 
1516
- fn.propTypes = process.env.NODE_ENV !== 'production' ? _defineProperty({}, prop, responsivePropType) : {};
1517
- fn.filterProps = [prop];
1518
- return fn;
778
+ function SvgSilhouetteNeutral(props) {
779
+ return /*#__PURE__*/React.createElement("svg", _extends({
780
+ viewBox: "0 0 300 300",
781
+ fill: "none",
782
+ xmlns: "http://www.w3.org/2000/svg"
783
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
784
+ fillRule: "evenodd",
785
+ clipRule: "evenodd",
786
+ 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",
787
+ fill: "#2E3042"
788
+ })));
1519
789
  }
1520
790
 
1521
- var gap = style({
1522
- prop: 'gap',
1523
- themeKey: 'spacing',
791
+ var silhouettes = {
792
+ female: SvgSilhouetteFemale,
793
+ male: SvgSilhouetteMale,
794
+ neutral: SvgSilhouetteNeutral,
795
+ };
796
+ var Avatar = forwardRef(function (props, ref) {
797
+ var children = props.children, _a = props.silhouette, silhouette = _a === void 0 ? 'neutral' : _a, muiProps = __rest(props, ["children", "silhouette"]);
798
+ var _b = useImgProps(props), imgProps = _b.imgProps, loaded = _b.loaded;
799
+ var classes = useAvatarStyles(__assign(__assign({}, props), { loaded: loaded }));
800
+ var Silhouette = silhouettes[silhouette];
801
+ var fallback = muiProps.src || silhouette === 'none' ? '' : React__default.createElement(Silhouette, { className: classes.silhouette });
802
+ return (React__default.createElement(MuiAvatar, __assign({ ref: ref, classes: { root: classes.root } }, muiProps, imgProps), children || fallback));
1524
803
  });
1525
- var useBoxStyles = makeStyles$1(function (theme) { return ({
1526
- root: function (props) { return gap(__assign(__assign({}, props), { theme: theme })); },
1527
- }); });
1528
-
1529
- var Box = function (props) {
1530
- var className = props.className; props.gap; var restProps = __rest(props, ["className", "gap"]);
1531
- var root = useBoxStyles(props).root;
1532
- return React__default.createElement(Box$1, __assign({ className: classNames(root, className) }, restProps));
804
+ Avatar.defaultProps = {
805
+ size: 'medium',
806
+ fit: 'cover',
807
+ background: '#E0E0E0',
808
+ silhouette: 'neutral',
1533
809
  };
1534
- Box.displayName = 'Box';
810
+ Avatar.displayName = 'Avatar';
1535
811
 
1536
- var useButtonStyles = makeStyles(function () { return ({
812
+ var useButtonStyles = makeStyles$1(function () { return ({
1537
813
  root: {
1538
814
  minWidth: 'unset',
1539
815
  },
@@ -1549,7 +825,7 @@ var Button = forwardRef(function (props, ref) {
1549
825
  props.textTransform; var loading = props.loading, classesOverride = props.classes, className = props.className, muiProps = __rest(props, ["textTransform", "loading", "classes", "className"]);
1550
826
  props.classes; var styleProps = __rest(props, ["classes"]);
1551
827
  var classes = useButtonStyles(styleProps);
1552
- var typography = useTheme().typography;
828
+ var typography = useTheme$1().typography;
1553
829
  var loadingIndicator = {
1554
830
  startIcon: React__default.createElement(CircularProgress, { color: "inherit", size: typography.button.fontSize }),
1555
831
  disabled: true,
@@ -1565,93 +841,13 @@ var Checkbox = forwardRef(function (props, ref) {
1565
841
  });
1566
842
  Checkbox.displayName = 'Checkbox';
1567
843
 
1568
- var useIconStyles = makeStyles$1(function (_a) {
1569
- var spacing = _a.spacing, palette = _a.palette;
1570
- var getFontSize = function (_a) {
1571
- var size = _a.size;
1572
- var sizes = {
1573
- inherit: 'inherit',
1574
- small: spacing(1.5),
1575
- medium: spacing(2),
1576
- large: spacing(2.5),
1577
- 'extra-large': spacing(3),
1578
- };
1579
- return size ? sizes[size] : 'inherit';
1580
- };
1581
- var getColor = function (props) {
1582
- var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
1583
- var value = 'inherit';
1584
- if (props.color) {
1585
- if (semanticColors.includes(props.color.split('.')[0])) {
1586
- var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
1587
- value = palette[color][variant];
1588
- }
1589
- else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {
1590
- value = props.color;
1591
- }
1592
- }
1593
- return value;
1594
- };
1595
- return {
1596
- root: {
1597
- color: getColor,
1598
- fontSize: getFontSize,
1599
- strokeWidth: '1.3px',
1600
- },
1601
- };
1602
- });
1603
-
1604
- var iconStaticClassName = 'pop-icon';
1605
- var Icon = function (props) {
1606
- var icon = props.icon, className = props.className, restProps = __rest(props, ["icon", "className"]);
1607
- var classes = useIconStyles(props);
1608
- var isValid = true;
1609
- if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {
1610
- isValid = false;
1611
- }
1612
- return isValid
1613
- ? createElement(icon, __assign({ className: classNames([classes.root, iconStaticClassName, className]) }, restProps))
1614
- : null;
1615
- };
1616
- Icon.defaultProps = {
1617
- size: 'inherit',
1618
- color: 'inherit',
1619
- };
1620
- Icon.displayName = 'Icon';
1621
-
1622
- var useTypographyStyles = makeStyles(function () {
1623
- var _a;
1624
- return ({
1625
- root: (_a = {},
1626
- _a["& ." + iconStaticClassName] = {
1627
- position: 'relative',
1628
- top: '0.125em',
1629
- padding: '0 0.125em',
1630
- boxSizing: 'content-box',
1631
- },
1632
- _a),
1633
- caption: {
1634
- display: 'inline',
1635
- },
1636
- overline: {
1637
- display: 'inline',
1638
- },
1639
- });
1640
- });
1641
-
1642
- var Typography = forwardRef(function (props, ref) {
1643
- var classes = useTypographyStyles(props);
1644
- return React__default.createElement(MuiTypography, __assign({ ref: ref, classes: classes }, props));
1645
- });
1646
- Typography.displayName = 'Typography';
1647
-
1648
844
  var getFadeStop = function (_a, typographyVariant) {
1649
845
  var typography = _a.typography;
1650
846
  return !isNaN(Number(typography[typographyVariant].lineHeight))
1651
847
  ? typography[typographyVariant].lineHeight + "rem"
1652
848
  : typography[typographyVariant].lineHeight;
1653
849
  };
1654
- var useCollapsibleTextStyles = makeStyles$1(function (theme) { return ({
850
+ var useCollapsibleTextStyles = makeStyles(function (theme) { return ({
1655
851
  overlay: {
1656
852
  position: 'absolute',
1657
853
  top: 0,
@@ -1666,7 +862,7 @@ var CollapsibleText = function (props) {
1666
862
  var _a = props, text = _a.text, open = _a.open, previewLines = _a.previewLines, _b = _a.typographyVariant, typographyVariant = _b === void 0 ? 'body1' : _b, collapsible = _a.collapsible, setCollapsible = _a.setCollapsible;
1667
863
  var classes = useCollapsibleTextStyles(props);
1668
864
  var typographyRef = useRef(null);
1669
- var typography = useTheme$1().typography;
865
+ var typography = useTheme().typography;
1670
866
  var collapsedSize = previewLines * parseFloat(typography[typographyVariant].lineHeight);
1671
867
  useEffect(function () {
1672
868
  var typographyNode = typographyRef.current;
@@ -1701,7 +897,7 @@ var SemanticColors;
1701
897
  SemanticColors["SECONDARY_DARK"] = "secondary.dark";
1702
898
  SemanticColors["SECONDARY_LIGHT"] = "secondary.light";
1703
899
  })(SemanticColors || (SemanticColors = {}));
1704
- var useStyles$1 = makeStyles$1(function (theme) { return ({
900
+ var useStyles = makeStyles(function (theme) { return ({
1705
901
  dividerRoot: {
1706
902
  gap: theme.spacing(2),
1707
903
  },
@@ -1739,7 +935,7 @@ var useStyles$1 = makeStyles$1(function (theme) { return ({
1739
935
  }); });
1740
936
  var Divider = function (props) {
1741
937
  var className = props.className, text = props.text, textTransform = props.textTransform, TypographyProps = props.TypographyProps;
1742
- var classes = useStyles$1(props);
938
+ var classes = useStyles(props);
1743
939
  var casingOffset = textTransform === 'lowercase' ? '.25rem' : 'unset';
1744
940
  return (React__default.createElement(Box, { className: classNames([classes.dividerRoot, className]), display: "flex", alignItems: "center" },
1745
941
  React__default.createElement(Box, { className: classes.dividerLine, display: "flex", flexGrow: 1, height: "1px", marginTop: casingOffset }),
@@ -1752,14 +948,6 @@ Divider.defaultProps = {
1752
948
  textTransform: 'lowercase',
1753
949
  };
1754
950
 
1755
- var IconButton = forwardRef(function (props, ref) {
1756
- return React__default.createElement(MuiIconButton, __assign({ ref: ref }, props));
1757
- });
1758
- IconButton.displayName = 'IconButton';
1759
- IconButton.defaultProps = {
1760
- color: 'secondary',
1761
- };
1762
-
1763
951
  var getLinkColor = function (_a, _b) {
1764
952
  var palette = _a.palette;
1765
953
  var _c = _b.color, color = _c === void 0 ? 'info' : _c;
@@ -1775,7 +963,7 @@ var getLinkColor = function (_a, _b) {
1775
963
  }
1776
964
  return resolved;
1777
965
  };
1778
- var useLinkStyles = makeStyles(function (theme) {
966
+ var useLinkStyles = makeStyles$1(function (theme) {
1779
967
  var _a;
1780
968
  return ({
1781
969
  root: (_a = {
@@ -1800,28 +988,6 @@ Link.defaultProps = {
1800
988
  };
1801
989
  Link.displayName = 'Link';
1802
990
 
1803
- var useStyles = makeStyles$1(function (_a) {
1804
- var spacing = _a.spacing;
1805
- return ({
1806
- root: {
1807
- '&:last-child': {
1808
- marginBottom: 0,
1809
- },
1810
- marginBottom: spacing(4),
1811
- padding: spacing(4),
1812
- },
1813
- });
1814
- });
1815
- var Paper = forwardRef(function (props, ref) {
1816
- var legacyStyles = props.legacyStyles, restProps = __rest(props, ["legacyStyles"]);
1817
- var classes = useStyles(props);
1818
- return React__default.createElement(Paper$1, __assign({}, ref, { classes: __assign({}, (legacyStyles && classes)) }, restProps));
1819
- });
1820
- Paper.displayName = 'Paper';
1821
- Paper.defaultProps = {
1822
- legacyStyles: false,
1823
- };
1824
-
1825
991
  var PaperContent = function (props) {
1826
992
  var children = props.children;
1827
993
  return React__default.createElement(Box, { padding: 4 }, children);
@@ -1834,7 +1000,7 @@ var Radio = forwardRef(function (props, ref) {
1834
1000
  });
1835
1001
  Radio.displayName = 'Radio';
1836
1002
 
1837
- var useSplitInputStyles = makeStyles(function () { return ({
1003
+ var useSplitInputStyles = makeStyles$1(function () { return ({
1838
1004
  textfield: {
1839
1005
  background: function (props) { return (props.backgroundTransparency ? '#FFFFFF44' : 'none'); },
1840
1006
  borderTopLeftRadius: 4,
@@ -1872,7 +1038,7 @@ SplitInput.defaultProps = {
1872
1038
  color: 'primary',
1873
1039
  };
1874
1040
 
1875
- var useSwitchStyles = makeStyles(function (theme) { return ({
1041
+ var useSwitchStyles = makeStyles$1(function (theme) { return ({
1876
1042
  checked: {
1877
1043
  '& $thumb': {
1878
1044
  background: theme.palette.success.main,
@@ -6488,8 +5654,7 @@ var TableHeader = function (props) {
6488
5654
  };
6489
5655
 
6490
5656
  var getWidth = function (props) {
6491
- var column = props.column, fullWidth = props.tableProps.fullWidth;
6492
- var isActionColumn = column.id === actionColumnId;
5657
+ var isActionColumn = props.column.isActionColumn, fullWidth = props.tableProps.fullWidth;
6493
5658
  var width;
6494
5659
  if (fullWidth && isActionColumn) {
6495
5660
  width = '0.0000000001%';
@@ -6505,7 +5670,7 @@ var getWidth = function (props) {
6505
5670
  }
6506
5671
  return width;
6507
5672
  };
6508
- var useTableHeaderCellStyles = makeStyles$1(function (theme) { return ({
5673
+ var useTableHeaderCellStyles = makeStyles(function (theme) { return ({
6509
5674
  root: function (props) {
6510
5675
  var width = getWidth(props);
6511
5676
  return {
@@ -6520,69 +5685,15 @@ var useTableHeaderCellStyles = makeStyles$1(function (theme) { return ({
6520
5685
  },
6521
5686
  }); });
6522
5687
 
6523
- var _path$3K;
6524
-
6525
- 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); }
6526
-
6527
- function SvgMore(props) {
6528
- return /*#__PURE__*/React.createElement("svg", _extends$3$({
6529
- viewBox: "0 0 16 16",
6530
- strokeLinecap: "round",
6531
- strokeLinejoin: "round",
6532
- stroke: "currentColor",
6533
- width: "1em",
6534
- height: "1em",
6535
- fill: "none"
6536
- }, props), _path$3K || (_path$3K = /*#__PURE__*/React.createElement("path", {
6537
- 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"
6538
- })));
6539
- }
6540
-
6541
- var _path$2X;
6542
-
6543
- 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); }
6544
-
6545
- function SvgChevronDown(props) {
6546
- return /*#__PURE__*/React.createElement("svg", _extends$3b({
6547
- viewBox: "0 0 16 16",
6548
- strokeLinecap: "round",
6549
- strokeLinejoin: "round",
6550
- stroke: "currentColor",
6551
- width: "1em",
6552
- height: "1em",
6553
- fill: "none"
6554
- }, props), _path$2X || (_path$2X = /*#__PURE__*/React.createElement("path", {
6555
- d: "M4 6l4 4 4-4"
6556
- })));
6557
- }
6558
-
6559
- var _path$2W;
6560
-
6561
- 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); }
6562
-
6563
- function SvgChevronUp(props) {
6564
- return /*#__PURE__*/React.createElement("svg", _extends$3a({
6565
- viewBox: "0 0 16 16",
6566
- strokeLinecap: "round",
6567
- strokeLinejoin: "round",
6568
- stroke: "currentColor",
6569
- width: "1em",
6570
- height: "1em",
6571
- fill: "none"
6572
- }, props), _path$2W || (_path$2W = /*#__PURE__*/React.createElement("path", {
6573
- d: "M12 10L8 6l-4 4"
6574
- })));
6575
- }
6576
-
6577
5688
  var TableHeaderCell = function (props) {
6578
5689
  var children = props.children, column = props.column; props.tableProps; var restProps = __rest(props, ["children", "column", "tableProps"]);
6579
5690
  var root = useTableHeaderCellStyles(props).root;
6580
- var palette = useTheme$1().palette;
5691
+ var _a = useTheme(), palette = _a.palette, spacing = _a.spacing;
6581
5692
  //@ts-expect-error @types/react-table issue
6582
- var canSort = column.canSort, isSorted = column.isSorted, isSortedDesc = column.isSortedDesc;
6583
- var showSortIndicator = canSort && column.id !== actionColumnId;
5693
+ var canSort = column.canSort, isSorted = column.isSorted, isSortedDesc = column.isSortedDesc, isActionColumn = column.isActionColumn;
5694
+ var showSortIndicator = canSort && !isActionColumn;
6584
5695
  return (React__default.createElement("th", __assign({ className: root }, restProps),
6585
- React__default.createElement(Box, { display: "flex", alignItems: "center", gap: 1 },
5696
+ React__default.createElement(Box, { display: "flex", alignItems: "center", gridGap: spacing(1) },
6586
5697
  children,
6587
5698
  showSortIndicator && (React__default.createElement(Icon, { icon: isSortedDesc ? SvgChevronDown : SvgChevronUp, color: isSorted ? palette.text.primary : palette.text.disabled, size: "large" })))));
6588
5699
  };
@@ -6592,7 +5703,7 @@ var TableHeaderRow = function (props) {
6592
5703
  return React__default.createElement("tr", __assign({}, restProps), children);
6593
5704
  };
6594
5705
 
6595
- var useTableRowStyles = makeStyles$1(function (theme) { return ({
5706
+ var useTableRowStyles = makeStyles(function (theme) { return ({
6596
5707
  root: function () { return ({
6597
5708
  '&:nth-child(even)': {
6598
5709
  backgroundColor: theme.palette.grey[100],
@@ -6611,7 +5722,7 @@ var TableBody = function (props) {
6611
5722
  return React__default.createElement("tbody", __assign({}, restProps), children);
6612
5723
  };
6613
5724
 
6614
- var useTableCellStyles = makeStyles$1(function (theme) { return ({
5725
+ var useTableCellStyles = makeStyles(function (theme) { return ({
6615
5726
  root: function () { return ({
6616
5727
  padding: theme.spacing(2),
6617
5728
  }); },
@@ -6623,7 +5734,7 @@ var TableCell = function (props) {
6623
5734
  return (React__default.createElement("td", __assign({ className: root }, restProps), children));
6624
5735
  };
6625
5736
 
6626
- var useTableStyles = makeStyles$1(function (_a) {
5737
+ var useTableStyles = makeStyles(function (_a) {
6627
5738
  var typography = _a.typography;
6628
5739
  return ({
6629
5740
  root: function (_a) {
@@ -6639,14 +5750,16 @@ var useTableStyles = makeStyles$1(function (_a) {
6639
5750
  },
6640
5751
  tableWrap: function () { return ({
6641
5752
  maxWidth: '100%',
6642
- overflowX: 'scroll',
5753
+ overflowX: 'auto',
6643
5754
  overflowY: 'hidden',
6644
5755
  }); },
6645
5756
  });
6646
5757
  });
6647
5758
 
6648
5759
  var TableActionsCell = function (props) {
6649
- var _a = props.actions, primary = _a.primary, secondary = _a.secondary, restActions = __rest(_a, ["primary", "secondary"]);
5760
+ var _a = props.actions, primary = _a.primary, secondary = _a.secondary, intermediate = __rest(_a, ["primary", "secondary"]);
5761
+ var tertiary = intermediate.tertiary, restActions = __rest(intermediate, ["tertiary"]);
5762
+ var overflow = Object.keys(props.actions).length > 3;
6650
5763
  var _b = React__default.useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
6651
5764
  var openMenu = function (event) {
6652
5765
  setAnchorEl(event.currentTarget);
@@ -6663,18 +5776,21 @@ var TableActionsCell = function (props) {
6663
5776
  React__default.createElement(Icon, { icon: primary.icon }))),
6664
5777
  secondary && secondary.icon && (React__default.createElement(IconButton, { size: "small", onClick: function () { return secondary.action(props.cell); } },
6665
5778
  React__default.createElement(Icon, { icon: secondary.icon }))),
6666
- restActions && (React__default.createElement(React__default.Fragment, null,
5779
+ !overflow && tertiary && tertiary.icon && (React__default.createElement(IconButton, { size: "small", onClick: function () { return tertiary.action(props.cell); } },
5780
+ React__default.createElement(Icon, { icon: tertiary.icon }))),
5781
+ overflow && restActions && (React__default.createElement(React__default.Fragment, null,
6667
5782
  React__default.createElement(IconButton, { size: "small", onClick: openMenu },
6668
5783
  React__default.createElement(Icon, { icon: SvgMore })),
6669
- React__default.createElement(Menu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: closeMenu }, Object.values(restActions).map(function (_a, i) {
5784
+ React__default.createElement(Menu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: closeMenu }, Object.values(__assign({ tertiary: tertiary }, restActions))
5785
+ .filter(function (value) { return value; })
5786
+ .map(function (_a, i) {
6670
5787
  var label = _a.label, action = _a.action;
6671
5788
  return (React__default.createElement(MenuItem, { key: i, onClick: function () { return handleItemClick(action); } }, label));
6672
5789
  }))))));
6673
5790
  };
6674
5791
 
6675
- var actionColumnId = 'table-actions-column';
6676
5792
  var makeColumns = function (config) {
6677
- var columns = config.columns, actions = config.actions;
5793
+ var columns = config.columns, actions = config.actions, actionColumnId = config.actionColumnId;
6678
5794
  var actionColumn;
6679
5795
  var memoizedColumns = __spreadArray([], columns);
6680
5796
  if (actions) {
@@ -6691,9 +5807,10 @@ var makeColumns = function (config) {
6691
5807
 
6692
5808
  /* eslint-disable react/jsx-key */
6693
5809
  var Table = function (props) {
6694
- var rawColumns = props.columns, data = props.data, actions = props.actions, sortable = props.sortable, emptyMessage = props.emptyMessage, EmptyImage = props.EmptyImage, isLoading = props.loading;
5810
+ var actionColumnId = 'table-actions-column';
5811
+ var rawColumns = props.columns, data = props.data, actions = props.actions, sortable = props.sortable, emptyMessage = props.emptyMessage, EmptyImage = props.EmptyImage, isLoading = props.loading, enableMinHeight = props.enableMinHeight;
6695
5812
  var classes = useTableStyles(props);
6696
- var columns = useMemo(function () { return makeColumns({ columns: rawColumns, actions: actions }); }, [rawColumns, actions]);
5813
+ var columns = useMemo(function () { return makeColumns({ columns: rawColumns, actions: actions, actionColumnId: actionColumnId }); }, [rawColumns, actions]);
6697
5814
  // @ts-expect-error @types/react-table issue
6698
5815
  var instance = reactTable.exports.useTable({ columns: columns, data: data, disableSortBy: !sortable }, reactTable.exports.useSortBy, reactTable.exports.usePagination);
6699
5816
  // @ts-expect-error @types/react-table issue
@@ -6703,12 +5820,12 @@ var Table = function (props) {
6703
5820
  var handlePagination = function (_e, pageNumber) {
6704
5821
  gotoPage(pageNumber - 1);
6705
5822
  };
6706
- return (React__default.createElement(Box, { className: classes.root, minHeight: 706 },
6707
- React__default.createElement(Box, { className: classes.tableWrap },
5823
+ return (React__default.createElement(Box, { className: classes.root, minHeight: (isLoading || isEmpty) && enableMinHeight ? 618 : 'unset' },
5824
+ React__default.createElement(Box, { className: classes.tableWrap, minHeight: page.length > 0 && !isLoading && enableMinHeight ? 618 : 'unset' },
6708
5825
  React__default.createElement("table", __assign({ className: classes.table }, getTableProps()),
6709
5826
  React__default.createElement(TableHeader, null, headerGroups.map(function (headerGroup) { return (React__default.createElement(TableHeaderRow, __assign({}, headerGroup.getHeaderGroupProps()), headerGroup.headers.map(function (column) { return (React__default.createElement(TableHeaderCell
6710
5827
  // @ts-expect-error @types/react-table issue
6711
- , __assign({}, column.getHeaderProps(column.getSortByToggleProps()), { column: column, tableProps: props }), column.render('Header'))); }))); })),
5828
+ , __assign({}, column.getHeaderProps(column.getSortByToggleProps()), { column: __assign(__assign({}, column), { isActionColumn: column.id === actionColumnId }), tableProps: props }), column.render('Header'))); }))); })),
6712
5829
  !isEmpty && !isLoading && (React__default.createElement(TableBody, __assign({}, getTableBodyProps()), page.map(function (row) {
6713
5830
  prepareRow(row);
6714
5831
  return (React__default.createElement(TableRow, __assign({}, row.getRowProps()), row.cells.map(function (cell) { return (React__default.createElement(TableCell, __assign({}, cell.getCellProps()), cell.render('Cell'))); })));
@@ -6723,9 +5840,10 @@ var Table = function (props) {
6723
5840
  };
6724
5841
  Table.defaultProps = {
6725
5842
  emptyMessage: 'No results.',
5843
+ enableMinHeight: true,
6726
5844
  };
6727
5845
 
6728
- var useToggleButtonStyles = makeStyles(function (theme) { return ({
5846
+ var useToggleButtonStyles = makeStyles$1(function (theme) { return ({
6729
5847
  root: {
6730
5848
  color: theme.palette.text.primary,
6731
5849
  },
@@ -6753,7 +5871,7 @@ ToggleButton.defaultProps = {
6753
5871
  };
6754
5872
  ToggleButton.displayName = 'ToggleButton';
6755
5873
 
6756
- var useToggleButtonGroupStyles = makeStyles(function (theme) { return ({
5874
+ var useToggleButtonGroupStyles = makeStyles$1(function (theme) { return ({
6757
5875
  root: {
6758
5876
  '&&': {
6759
5877
  backgroundColor: theme.palette.grey[300],
@@ -6774,7 +5892,7 @@ var ToggleButtonGroup = forwardRef(function (props, ref) {
6774
5892
  });
6775
5893
  ToggleButtonGroup.displayName = 'ToggleButtonGroup';
6776
5894
 
6777
- var useTooltipStyles = makeStyles(function (_a) {
5895
+ var useTooltipStyles = makeStyles$1(function (_a) {
6778
5896
  var typography = _a.typography;
6779
5897
  return ({
6780
5898
  tooltip: {
@@ -6803,5 +5921,5 @@ var useCollapsibleText = function () {
6803
5921
  };
6804
5922
  };
6805
5923
 
6806
- export { Avatar, Box, Button, Checkbox, CollapsibleText, Divider, Icon, IconButton, Link, Paper, PaperContent, Radio, SplitInput, Switch, Table, ToggleButton, ToggleButtonGroup, Tooltip, Typography, useCollapsibleText };
5924
+ export { AudioPlayer, Avatar, Button, Checkbox, CollapsibleText, Divider, Icon, IconButton, Link, Paper, PaperContent, Radio, SplitInput, Switch, Table, ToggleButton, ToggleButtonGroup, Tooltip, Typography, useCollapsibleText };
6807
5925
  //# sourceMappingURL=index.es.js.map