@popmenu/ordering-ui 0.78.0 → 0.79.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.es.js CHANGED
@@ -1,17 +1,17 @@
1
- import { Button as Button$2, makeStyles, Typography as Typography$1, Link as Link$1, Paper as Paper$1, Box, Avatar as Avatar$1, useTheme as useTheme$1, FormControl, Select, InputAdornment, MenuItem, FormControlLabel as FormControlLabel$1, Checkbox as Checkbox$1, Radio as Radio$1, Menu, TextField, Chip } from '@material-ui/core';
1
+ import { Button as Button$2, makeStyles as makeStyles$1, Box, Typography as Typography$1, Link as Link$1, Paper as Paper$1, Avatar as Avatar$1, Card, CardActionArea, FormControl, Select, InputAdornment, MenuItem as MenuItem$1, FormControlLabel as FormControlLabel$1, Checkbox as Checkbox$1, Radio as Radio$1, Menu, TextField, Tabs, Chip } from '@material-ui/core';
2
2
  export * from '@material-ui/core';
3
3
  import * as React from 'react';
4
4
  import React__default, { forwardRef, createElement, useState } from 'react';
5
+ import { makeStyles, useTheme, lighten } from '@material-ui/core/styles';
5
6
  import '@material-ui/lab/Alert';
6
7
  import '@material-ui/core/AppBar';
7
8
  import MuiAvatar from '@material-ui/core/Avatar';
8
- import { makeStyles as makeStyles$1, useTheme, lighten } from '@material-ui/core/styles';
9
9
  import '@material-ui/core/Badge';
10
10
  import MuiButton from '@material-ui/core/Button';
11
11
  import CircularProgress from '@material-ui/core/CircularProgress';
12
12
  import '@material-ui/core/ButtonGroup';
13
- import Card from '@material-ui/core/Card';
14
- import CardActionArea from '@material-ui/core/CardActionArea';
13
+ import Card$1 from '@material-ui/core/Card';
14
+ import CardActionArea$1 from '@material-ui/core/CardActionArea';
15
15
  import '@material-ui/core/CardActions';
16
16
  import CardContent from '@material-ui/core/CardContent';
17
17
  import '@material-ui/core/CardHeader';
@@ -43,7 +43,7 @@ import MuiRadio from '@material-ui/core/Radio';
43
43
  import '@material-ui/core/TextField';
44
44
  import MuiSwitch from '@material-ui/core/Switch';
45
45
  import Tab from '@material-ui/core/Tab';
46
- import Tabs from '@material-ui/core/Tabs';
46
+ import '@material-ui/core/Tabs';
47
47
  import MuiToggleButton from '@material-ui/lab/ToggleButton';
48
48
  import MuiToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';
49
49
  import MuiTooltip from '@material-ui/core/Tooltip';
@@ -104,1031 +104,1037 @@ var Button$1 = forwardRef(function (props, ref) {
104
104
  });
105
105
  Button$1.displayName = 'Button';
106
106
 
107
- /*! *****************************************************************************
108
- Copyright (c) Microsoft Corporation.
109
-
110
- Permission to use, copy, modify, and/or distribute this software for any
111
- purpose with or without fee is hereby granted.
112
-
113
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
114
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
115
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
116
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
117
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
118
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
119
- PERFORMANCE OF THIS SOFTWARE.
120
- ***************************************************************************** */
121
-
122
- var __assign = function() {
123
- __assign = Object.assign || function __assign(t) {
124
- for (var s, i = 1, n = arguments.length; i < n; i++) {
125
- s = arguments[i];
126
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
127
- }
128
- return t;
129
- };
130
- return __assign.apply(this, arguments);
131
- };
132
-
133
- function __rest(s, e) {
134
- var t = {};
135
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
136
- t[p] = s[p];
137
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
138
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
139
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
140
- t[p[i]] = s[p[i]];
141
- }
142
- return t;
143
- }
107
+ var useDishCardStyles = makeStyles(function (theme) { return ({
108
+ cardActionArea: {
109
+ display: 'flex',
110
+ gridGap: 16,
111
+ height: '100%',
112
+ },
113
+ card: {
114
+ // TODO: https://app.shortcut.com/popmenu/story/92467/hide-menuitem-borders-in-2-column-view-widths
115
+ '&:after': {
116
+ content: '""',
117
+ position: 'absolute',
118
+ backgroundColor: '#E0E0E0',
119
+ width: '100%',
120
+ height: 1,
121
+ bottom: -16,
122
+ left: 0,
123
+ },
124
+ height: 185,
125
+ position: 'relative',
126
+ overflow: 'visible',
127
+ },
128
+ cardTitle: {
129
+ fontWeight: 500,
130
+ fontSize: 18,
131
+ lineHeight: '27px',
132
+ color: theme.palette.grey[900],
133
+ '-webkit-line-clamp': 2,
134
+ display: '-webkit-box',
135
+ '-webkit-box-orient': 'vertical',
136
+ textOverflow: 'ellipsis',
137
+ overflow: 'hidden',
138
+ },
139
+ cardDescription: {
140
+ fontWeight: 400,
141
+ fontSize: 14,
142
+ lineHeight: '20px',
143
+ color: theme.palette.grey[700],
144
+ '-webkit-line-clamp': 2,
145
+ display: '-webkit-box',
146
+ '-webkit-box-orient': 'vertical',
147
+ textOverflow: 'ellipsis',
148
+ overflow: 'hidden',
149
+ },
150
+ }); });
144
151
 
145
- var _path$M;
152
+ var useStyles$5 = makeStyles$1(function () { return ({
153
+ img: {
154
+ objectFit: 'cover',
155
+ width: '100%',
156
+ height: '100%',
157
+ },
158
+ }); });
159
+ var MenuItemImg = function (props) {
160
+ var _a = props.image, image = _a === void 0 ? {} : _a;
161
+ var src = image.src, alt = image.alt;
162
+ var classes = useStyles$5();
163
+ if (!src || !alt) {
164
+ return null;
165
+ }
166
+ return (React__default.createElement(Box, { width: 125, height: "100%", borderRadius: 16, overflow: "hidden", flexShrink: 0 }, React__default.createElement("img", { src: src, alt: alt, className: classes.img })));
167
+ };
146
168
 
147
- function _extends$1L() { _extends$1L = 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$1L.apply(this, arguments); }
169
+ var MenuItemInfo = function (props) {
170
+ return (React__default.createElement(Box, { display: "flex", flexGrow: 1, flexDirection: "column", height: "100%" }, props.children));
171
+ };
148
172
 
149
- function SvgUser(props) {
150
- return /*#__PURE__*/React.createElement("svg", _extends$1L({
173
+ var _path$1f;
174
+
175
+ function _extends$2M() { _extends$2M = 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$2M.apply(this, arguments); }
176
+
177
+ function SvgChevronDown(props) {
178
+ return /*#__PURE__*/React.createElement("svg", _extends$2M({
151
179
  viewBox: "0 0 16 16",
152
180
  fill: "none",
153
181
  strokeLinecap: "round",
154
182
  strokeLinejoin: "round",
155
183
  width: "1em",
156
184
  height: "1em"
157
- }, props), _path$M || (_path$M = /*#__PURE__*/React.createElement("path", {
158
- d: "M13.333 14v-1.333A2.667 2.667 0 0010.667 10H5.333a2.667 2.667 0 00-2.666 2.667V14M8 7.333A2.667 2.667 0 108 2a2.667 2.667 0 000 5.333z",
185
+ }, props), _path$1f || (_path$1f = /*#__PURE__*/React.createElement("path", {
186
+ d: "M4 6l4 4 4-4",
159
187
  stroke: "currentColor"
160
188
  })));
161
189
  }
162
190
 
163
- var useIconStyles = makeStyles(function (_a) {
164
- var spacing = _a.spacing, palette = _a.palette;
165
- var getFontSize = function (_a) {
166
- var size = _a.size;
167
- var sizes = {
168
- inherit: 'inherit',
169
- small: spacing(1.5),
170
- medium: spacing(2),
171
- large: spacing(2.5),
172
- 'extra-large': spacing(3),
173
- };
174
- return size ? sizes[size] : 'inherit';
175
- };
176
- var getColor = function (props) {
177
- var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
178
- var value = 'inherit';
179
- if (props.color) {
180
- if (semanticColors.includes(props.color.split('.')[0])) {
181
- var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
182
- value = palette[color][variant];
183
- }
184
- else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {
185
- value = props.color;
186
- }
187
- }
188
- return value;
189
- };
190
- return {
191
- root: {
192
- color: getColor,
193
- fontSize: getFontSize,
194
- strokeWidth: '1.3px',
195
- },
196
- };
197
- });
191
+ var _path$1e;
198
192
 
199
- var classnames$1 = {exports: {}};
193
+ function _extends$2L() { _extends$2L = 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$2L.apply(this, arguments); }
200
194
 
201
- /*!
202
- Copyright (c) 2018 Jed Watson.
203
- Licensed under the MIT License (MIT), see
204
- http://jedwatson.github.io/classnames
205
- */
195
+ function SvgChevronUp(props) {
196
+ return /*#__PURE__*/React.createElement("svg", _extends$2L({
197
+ viewBox: "0 0 16 16",
198
+ fill: "none",
199
+ strokeLinecap: "round",
200
+ strokeLinejoin: "round",
201
+ width: "1em",
202
+ height: "1em"
203
+ }, props), _path$1e || (_path$1e = /*#__PURE__*/React.createElement("path", {
204
+ d: "M12 10L8 6l-4 4",
205
+ stroke: "currentColor"
206
+ })));
207
+ }
206
208
 
207
- (function (module) {
208
- /* global define */
209
+ var _path$13;
209
210
 
210
- (function () {
211
+ function _extends$2s() { _extends$2s = 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$2s.apply(this, arguments); }
211
212
 
212
- var hasOwn = {}.hasOwnProperty;
213
+ function SvgCheck(props) {
214
+ return /*#__PURE__*/React.createElement("svg", _extends$2s({
215
+ viewBox: "0 0 16 16",
216
+ fill: "none",
217
+ strokeLinecap: "round",
218
+ strokeLinejoin: "round",
219
+ width: "1em",
220
+ height: "1em"
221
+ }, props), _path$13 || (_path$13 = /*#__PURE__*/React.createElement("path", {
222
+ d: "M13.333 4L6 11.333 2.667 8",
223
+ stroke: "currentColor"
224
+ })));
225
+ }
213
226
 
214
- function classNames() {
215
- var classes = [];
227
+ var _g$1m, _defs$K;
216
228
 
217
- for (var i = 0; i < arguments.length; i++) {
218
- var arg = arguments[i];
219
- if (!arg) continue;
229
+ function _extends$2q() { _extends$2q = 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$2q.apply(this, arguments); }
220
230
 
221
- var argType = typeof arg;
231
+ function SvgClock(props) {
232
+ return /*#__PURE__*/React.createElement("svg", _extends$2q({
233
+ viewBox: "0 0 16 16",
234
+ fill: "none",
235
+ strokeLinecap: "round",
236
+ strokeLinejoin: "round",
237
+ width: "1em",
238
+ height: "1em"
239
+ }, props), _g$1m || (_g$1m = /*#__PURE__*/React.createElement("g", {
240
+ clipPath: "url(#clock_svg__clip0_8_5092)",
241
+ stroke: "currentColor"
242
+ }, /*#__PURE__*/React.createElement("path", {
243
+ d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333z"
244
+ }), /*#__PURE__*/React.createElement("path", {
245
+ d: "M8 4v4l2.667 1.333"
246
+ }))), _defs$K || (_defs$K = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
247
+ id: "clock_svg__clip0_8_5092"
248
+ }, /*#__PURE__*/React.createElement("path", {
249
+ fill: "currentColor",
250
+ d: "M0 0h16v16H0z"
251
+ })))));
252
+ }
222
253
 
223
- if (argType === 'string' || argType === 'number') {
224
- classes.push(arg);
225
- } else if (Array.isArray(arg)) {
226
- if (arg.length) {
227
- var inner = classNames.apply(null, arg);
228
- if (inner) {
229
- classes.push(inner);
230
- }
231
- }
232
- } else if (argType === 'object') {
233
- if (arg.toString === Object.prototype.toString) {
234
- for (var key in arg) {
235
- if (hasOwn.call(arg, key) && arg[key]) {
236
- classes.push(key);
237
- }
238
- }
239
- } else {
240
- classes.push(arg.toString());
241
- }
242
- }
243
- }
254
+ var _g$1l, _defs$J;
244
255
 
245
- return classes.join(' ');
246
- }
256
+ function _extends$2o() { _extends$2o = 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$2o.apply(this, arguments); }
247
257
 
248
- if (module.exports) {
249
- classNames.default = classNames;
250
- module.exports = classNames;
251
- } else {
252
- window.classNames = classNames;
253
- }
254
- }());
255
- }(classnames$1));
258
+ function SvgXCircle(props) {
259
+ return /*#__PURE__*/React.createElement("svg", _extends$2o({
260
+ viewBox: "0 0 16 16",
261
+ fill: "none",
262
+ strokeLinecap: "round",
263
+ strokeLinejoin: "round",
264
+ width: "1em",
265
+ height: "1em"
266
+ }, props), _g$1l || (_g$1l = /*#__PURE__*/React.createElement("g", {
267
+ clipPath: "url(#x-circle_svg__clip0_8_6136)",
268
+ stroke: "currentColor"
269
+ }, /*#__PURE__*/React.createElement("path", {
270
+ d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zM10 6l-4 4m0-4l4 4"
271
+ }))), _defs$J || (_defs$J = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
272
+ id: "x-circle_svg__clip0_8_6136"
273
+ }, /*#__PURE__*/React.createElement("path", {
274
+ fill: "currentColor",
275
+ d: "M0 0h16v16H0z"
276
+ })))));
277
+ }
256
278
 
257
- var classNames$1 = classnames$1.exports;
279
+ var _path$$;
258
280
 
259
- var iconStaticClassName = 'pop-icon';
260
- var Icon = function (props) {
261
- var icon = props.icon, className = props.className, restProps = __rest(props, ["icon", "className"]);
262
- var classes = useIconStyles(props);
263
- var isValid = true;
264
- if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {
265
- isValid = false;
266
- }
267
- return isValid
268
- ? createElement(icon, __assign({ className: classNames$1([classes.root, iconStaticClassName, className]) }, restProps))
269
- : null;
270
- };
271
- Icon.defaultProps = {
272
- size: 'inherit',
273
- color: 'inherit',
274
- };
275
- Icon.displayName = 'Icon';
276
-
277
- var LoadingStatus;
278
- (function (LoadingStatus) {
279
- LoadingStatus["ERROR"] = "ERROR";
280
- LoadingStatus["LOADED"] = "LOADED";
281
- LoadingStatus["PENDING"] = "PENDING";
282
- })(LoadingStatus || (LoadingStatus = {}));
283
- var useImgProps = function (avatarProps) {
284
- var _a = React__default.useState(LoadingStatus.PENDING), loaded = _a[0], setLoaded = _a[1];
285
- var imgProps = __assign(__assign({}, avatarProps.imgProps), { onLoad: function (event) {
286
- var _a, _b;
287
- setLoaded(LoadingStatus.LOADED);
288
- (_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, event);
289
- } });
290
- return { imgProps: imgProps, loaded: loaded };
291
- };
292
-
293
- var getAvatarDimensions = function (theme, props) {
294
- var factors = {
295
- 'extra-small': 3,
296
- small: 4,
297
- medium: 5,
298
- large: 6,
299
- 'extra-large': 12.5,
300
- };
301
- var sizeFactor = factors[props.size || 'medium'];
302
- return theme.spacing(sizeFactor);
303
- };
304
- var getAvatarFontSize = function (props) {
305
- var fontSizes = {
306
- 'extra-small': '0.75rem',
307
- small: '1rem',
308
- medium: '1rem',
309
- large: '1.25rem',
310
- 'extra-large': '3.5rem',
311
- };
312
- return fontSizes[props.size];
313
- };
314
- var useAvatarStyles = makeStyles$1(function (theme) { return ({
315
- root: function (props) { return ({
316
- width: getAvatarDimensions(theme, props),
317
- height: getAvatarDimensions(theme, props),
318
- fontSize: getAvatarFontSize(props),
319
- backgroundColor: props.loaded === LoadingStatus.LOADED ? 'transparent' : props.background,
320
- color: theme.palette.getContrastText(props.background),
321
- objectFit: props.fit,
322
- }); },
323
- fallback: function (props) { return ({
324
- fontSize: getAvatarDimensions(theme, props),
325
- strokeWidth: 1,
326
- }); },
327
- }); });
328
-
329
- var Avatar = forwardRef(function (props, ref) {
330
- var children = props.children, src = props.src, alt = props.alt, fallback = props.fallback, muiProps = __rest(props, ["children", "src", "alt", "fallback"]);
331
- var _a = useImgProps(props), imgProps = _a.imgProps, loaded = _a.loaded;
332
- var classes = useAvatarStyles(__assign(__assign({}, props), { loaded: loaded }));
333
- var displayAltTextFallback = src && alt;
334
- var displayNoFallback = fallback === 'none';
335
- var displayCustomFallback = fallback !== 'none' && typeof fallback !== 'undefined';
336
- var Fallback;
337
- if (displayAltTextFallback) {
338
- Fallback = null;
339
- }
340
- else if (displayNoFallback) {
341
- Fallback = ' ';
342
- }
343
- else if (displayCustomFallback) {
344
- Fallback = fallback;
345
- }
346
- else {
347
- Fallback = React__default.createElement(Icon, { icon: SvgUser, className: classes.fallback });
348
- }
349
- return (React__default.createElement(MuiAvatar, __assign({ ref: ref, classes: { root: classes.root }, src: src, alt: alt }, muiProps, { imgProps: imgProps }), children || Fallback));
350
- });
351
- Avatar.defaultProps = {
352
- size: 'medium',
353
- fit: 'cover',
354
- background: '#E0E0E0',
355
- };
356
- Avatar.displayName = 'Avatar';
357
-
358
- makeStyles$1(function (theme) { return ({
359
- circle: {
360
- backgroundColor: theme.palette.grey[300],
361
- borderRadius: '50%',
362
- height: theme.spacing(0.65),
363
- width: theme.spacing(0.65),
364
- margin: theme.spacing(1) + "px 0 " + theme.spacing(1) + "px " + theme.spacing(1) + "px",
365
- },
366
- container: {
367
- border: "1px solid " + theme.palette.secondary.light,
368
- borderRadius: theme.spacing(0.5),
369
- flexGrow: 1,
370
- },
371
- titleBar: {
372
- display: 'flex',
373
- flexDirection: 'row',
374
- borderBottom: "1px solid " + theme.palette.secondary.light,
375
- width: '100%',
376
- },
377
- }); });
378
-
379
- var useButtonStyles = makeStyles$1(function () { return ({
380
- root: {
381
- minWidth: 'unset',
382
- },
383
- label: {
384
- textTransform: function (_a) {
385
- var textTransform = _a.textTransform;
386
- return textTransform;
387
- },
388
- },
389
- }); });
390
-
391
- var Button = forwardRef(function (props, ref) {
392
- props.textTransform; var loading = props.loading, classesOverride = props.classes, className = props.className, muiProps = __rest(props, ["textTransform", "loading", "classes", "className"]);
393
- props.classes; var styleProps = __rest(props, ["classes"]);
394
- var classes = useButtonStyles(styleProps);
395
- var typography = useTheme().typography;
396
- var loadingIndicator = {
397
- startIcon: React__default.createElement(CircularProgress, { color: "inherit", size: typography.button.fontSize }),
398
- disabled: true,
399
- };
400
- return (React__default.createElement(MuiButton, __assign({ ref: ref, classes: __assign(__assign({}, classes), classesOverride), className: classNames$1([className, 'pm-button']) }, muiProps, (loading && loadingIndicator))));
401
- });
402
- Button.displayName = 'Button';
403
-
404
- var Checkbox = forwardRef(function (props, ref) {
405
- var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
406
- var control = React__default.createElement(MuiCheckbox, __assign({ disabled: label ? undefined : disabled }, muiProps));
407
- return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
408
- });
409
- Checkbox.displayName = 'Checkbox';
410
-
411
- var getBackground = function (theme) { return function (props) {
412
- var variant = props.variant, severity = props.severity;
413
- var background = theme.palette.grey[100];
414
- var backgrounds = {
415
- outlined: 'none',
416
- error: 'error.main',
417
- warning: 'warning.main',
418
- info: 'info.light',
419
- success: 'success.light',
420
- };
421
- if (variant === 'outlined') {
422
- background = backgrounds[variant];
423
- }
424
- else if (severity) {
425
- var _a = backgrounds[severity].split('.'), color = _a[0], colorVariant = _a[1];
426
- background = theme.palette[color][colorVariant];
427
- }
428
- return background;
429
- }; };
430
- var getColor = function (theme) { return function (props) {
431
- var variant = props.variant, severity = props.severity;
432
- var textColor;
433
- if (variant === 'outlined' && severity) {
434
- var textColors = {
435
- error: theme.palette.error.main,
436
- info: theme.palette.info.main,
437
- warning: theme.palette.warning.dark,
438
- success: theme.palette.success.dark,
439
- };
440
- textColor = textColors[severity];
441
- }
442
- else if (variant === 'outlined' && !severity) {
443
- textColor = theme.palette.grey[700];
444
- }
445
- else if ((variant === 'default' || variant === undefined) && severity) {
446
- var textColors = {
447
- error: theme.palette.common.white,
448
- info: theme.palette.secondary.main,
449
- warning: theme.palette.secondary.main,
450
- success: theme.palette.secondary.main,
451
- };
452
- textColor = textColors[severity];
453
- }
454
- return textColor;
455
- }; };
456
- var getBorder = function (theme) { return function (props) {
457
- var variant = props.variant, severity = props.severity;
458
- var borderColor;
459
- if (variant === 'outlined' && severity) {
460
- var borderColors = {
461
- error: theme.palette.error.main,
462
- info: theme.palette.info.main,
463
- warning: theme.palette.warning.dark,
464
- success: theme.palette.success.dark,
465
- };
466
- borderColor = borderColors[severity];
467
- }
468
- return borderColor;
469
- }; };
470
- makeStyles$1(function (theme) { return ({
471
- root: {
472
- background: getBackground(theme),
473
- color: getColor(theme),
474
- borderColor: getBorder(theme),
475
- borderRadius: theme.spacing(0.5),
476
- },
477
- icon: {
478
- color: 'inherit',
479
- height: theme.spacing(2),
480
- width: theme.spacing(2),
481
- },
482
- deleteIcon: {
483
- color: theme.palette.grey[500],
484
- },
485
- }); });
486
-
487
- var defaultTypographyProps = {
488
- variant: 'body1',
489
- };
490
-
491
- var weights = {
492
- regular: 400,
493
- medium: 500,
494
- 'semi-bold': 600,
495
- bold: 700,
496
- };
497
- var getCustomColor = function (theme, color) {
498
- var isCommonColor = color && ['white', 'black'].includes(color);
499
- var isGreyColor = color && color.match(/^grey\.\d{3}/);
500
- var isSemanticColor = color && color.match(/(primary|secondary|info|success|error|warning).?(light|dark)?/);
501
- var isTextColor = color && ['textPrimary', 'textSecondary'].includes(color);
502
- switch (true) {
503
- case isCommonColor:
504
- return theme.palette.common[color];
505
- case Boolean(isGreyColor):
506
- var scale = color.split('.')[1];
507
- return theme.palette.grey[scale] || theme.palette.grey[900];
508
- case Boolean(isSemanticColor):
509
- var _a = color.split('.'), paletteKey = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
510
- return theme.palette[paletteKey][variant];
511
- case isTextColor:
512
- return theme.palette.text[color.slice(4).toLowerCase()];
513
- default:
514
- return undefined;
515
- }
516
- };
517
- var useTypographyStyles = makeStyles$1(function (theme) {
518
- var _a;
519
- return ({
520
- root: (_a = {},
521
- _a["& ." + iconStaticClassName] = {
522
- position: 'relative',
523
- top: '0.125em',
524
- padding: '0 0.125em',
525
- boxSizing: 'content-box',
526
- },
527
- _a.fontFamily = theme.typography.fontFamily,
528
- _a.fontWeight = function (_a) {
529
- var variant = _a.variant, weight = _a.weight;
530
- return (weight ? weights[weight] : theme.typography[variant].fontWeight);
531
- },
532
- _a.fontSize = function (_a) {
533
- var variant = _a.variant;
534
- return theme.typography[variant].fontSize;
535
- },
536
- _a.lineHeight = function (_a) {
537
- var variant = _a.variant;
538
- return theme.typography[variant].lineHeight;
539
- },
540
- _a.textTransform = function (_a) {
541
- var variant = _a.variant;
542
- return theme.typography[variant].textTransform;
543
- },
544
- _a.color = function (_a) {
545
- var color = _a.color, variant = _a.variant;
546
- return (color && getCustomColor(theme, color)) || theme.typography[variant].color;
547
- },
548
- _a),
549
- caption: {
550
- display: 'inline',
551
- },
552
- overline: {
553
- display: 'inline',
554
- },
555
- });
556
- });
557
-
558
- var Typography = forwardRef(function (props, ref) {
559
- props.weight; props.color; var restProps = __rest(props, ["weight", "color"]);
560
- var classes = useTypographyStyles(__assign({}, props));
561
- var variantMapping = { subtitle1: 'p' };
562
- return React__default.createElement(Typography$1, __assign({ ref: ref, classes: classes, variantMapping: variantMapping }, restProps));
563
- });
564
- Typography.displayName = 'Typography';
565
- Typography.defaultProps = defaultTypographyProps;
566
-
567
- var getFadeStop = function (_a, typographyVariant) {
568
- var typography = _a.typography;
569
- return !isNaN(Number(typography[typographyVariant].lineHeight))
570
- ? typography[typographyVariant].lineHeight + "rem"
571
- : typography[typographyVariant].lineHeight;
572
- };
573
- makeStyles(function (theme) { return ({
574
- overlay: {
575
- position: 'absolute',
576
- top: 0,
577
- left: 0,
578
- height: '100%',
579
- width: '100%',
580
- background: function (props) { return "linear-gradient(to top, white, #FFF0 " + getFadeStop(theme, props.typographyVariant) + ")"; },
581
- },
582
- }); });
583
-
584
- var SemanticColors;
585
- (function (SemanticColors) {
586
- SemanticColors["PRIMARY_MAIN"] = "primary.main";
587
- SemanticColors["PRIMARY_DARK"] = "primary.dark";
588
- SemanticColors["PRIMARY_LIGHT"] = "primary.light";
589
- SemanticColors["SECONDARY_MAIN"] = "secondary.main";
590
- SemanticColors["SECONDARY_DARK"] = "secondary.dark";
591
- SemanticColors["SECONDARY_LIGHT"] = "secondary.light";
592
- })(SemanticColors || (SemanticColors = {}));
593
- makeStyles(function (theme) { return ({
594
- dividerRoot: {
595
- gap: theme.spacing(2),
596
- },
597
- textRoot: {
598
- color: function (props) {
599
- var textColor = props.textColor;
600
- if (Object.values(SemanticColors).includes(textColor)) {
601
- var _a = textColor.split('.'), semanticColor = _a[0], shade = _a[1];
602
- return theme.palette[semanticColor][shade];
603
- }
604
- else if (textColor) {
605
- return textColor;
606
- }
607
- else {
608
- return 'black';
609
- }
610
- },
611
- textTransform: function (props) { return props.textTransform; },
612
- },
613
- dividerLine: {
614
- backgroundColor: function (props) {
615
- var dividerColor = props.dividerColor;
616
- if (Object.values(SemanticColors).includes(dividerColor)) {
617
- var _a = dividerColor.split('.'), semanticColor = _a[0], shade = _a[1];
618
- return theme.palette[semanticColor][shade];
619
- }
620
- else if (dividerColor) {
621
- return dividerColor;
622
- }
623
- else {
624
- return theme.palette.grey[500];
625
- }
626
- },
627
- },
628
- }); });
629
-
630
- var IconButton = forwardRef(function (props, ref) {
631
- return React__default.createElement(MuiIconButton, __assign({ ref: ref }, props));
632
- });
633
- IconButton.displayName = 'IconButton';
634
- IconButton.defaultProps = {
635
- color: 'secondary',
636
- };
637
-
638
- var useLinkStyles = makeStyles$1(function (theme) { return ({
639
- root: function (props) {
640
- var _a;
641
- return (__assign(__assign({ display: 'flex' }, (props.color === undefined && { color: theme.palette.info.main })), (_a = {}, _a["& ." + iconStaticClassName] = {
642
- alignSelf: 'center',
643
- }, _a)));
644
- },
645
- }); });
646
-
647
- var Link = forwardRef(function (props, ref) {
648
- var children = props.children, muiProps = __rest(props, ["children"]);
649
- var classes = useLinkStyles(props);
650
- return (React__default.createElement(Link$1, __assign({ ref: ref, classes: { root: classes.root } }, muiProps), children));
651
- });
652
- Link.defaultProps = {
653
- variant: 'body1',
654
- };
655
- Link.displayName = 'Link';
656
-
657
- var useStyles$1 = makeStyles(function (_a) {
658
- var spacing = _a.spacing;
659
- return ({
660
- root: {
661
- '&:last-child': {
662
- marginBottom: 0,
663
- },
664
- marginBottom: spacing(4),
665
- padding: spacing(4),
666
- },
667
- });
668
- });
669
- var Paper = forwardRef(function (props, ref) {
670
- var legacyStyles = props.legacyStyles, restProps = __rest(props, ["legacyStyles"]);
671
- var classes = useStyles$1(props);
672
- return React__default.createElement(Paper$1, __assign({}, ref, { classes: __assign({}, (legacyStyles && classes)) }, restProps));
673
- });
674
- Paper.displayName = 'Paper';
675
- Paper.defaultProps = {
676
- legacyStyles: false,
677
- };
678
-
679
- var Radio = forwardRef(function (props, ref) {
680
- var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
681
- var control = React__default.createElement(MuiRadio, __assign({ disabled: label ? undefined : disabled }, muiProps));
682
- return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
683
- });
684
- Radio.displayName = 'Radio';
685
-
686
- makeStyles$1(function () { return ({
687
- textfield: {
688
- background: function (props) { return (props.backgroundTransparency ? '#FFFFFF44' : 'none'); },
689
- borderTopLeftRadius: 4,
690
- borderBottomLeftRadius: 4,
691
- '& fieldset': {
692
- borderRight: 'none',
693
- borderTopRightRadius: 0,
694
- borderBottomRightRadius: 0,
695
- },
696
- },
697
- button: {
698
- borderTopLeftRadius: 0,
699
- borderBottomLeftRadius: 0,
700
- alignSelf: 'stretch',
701
- },
702
- input: {
703
- color: function (props) { return props.inputTextColor || 'inherit'; },
704
- '&$focused fieldset': {
705
- top: -4,
706
- },
707
- },
708
- focused: {},
709
- }); });
710
-
711
- var useSwitchStyles = makeStyles$1(function (theme) { return ({
712
- checked: {
713
- '& $thumb': {
714
- background: theme.palette.success.main,
715
- },
716
- '&& + $track': {
717
- backgroundColor: theme.palette.success.main,
718
- },
719
- },
720
- thumb: {},
721
- track: {},
722
- }); });
723
-
724
- var Switch = forwardRef(function (props, ref) {
725
- var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
726
- var classes = useSwitchStyles(props);
727
- var control = React__default.createElement(MuiSwitch, __assign({ classes: classes, disabled: label ? undefined : disabled }, muiProps));
728
- return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
729
- });
730
- Switch.displayName = 'Switch';
731
-
732
- var useToggleButtonStyles = makeStyles$1(function (theme) { return ({
733
- root: {
734
- color: theme.palette.text.primary,
735
- },
736
- selected: {
737
- '&&': {
738
- '&:hover': {
739
- backgroundColor: function (props) { return theme.palette[props.color || 'primary'].dark; },
740
- },
741
- backgroundColor: function (props) { return theme.palette[props.color || 'primary'].main; },
742
- color: 'white',
743
- },
744
- },
745
- }); });
746
-
747
- var ToggleButton = forwardRef(function (props, ref) {
748
- var children = props.children, muiProps = __rest(props, ["children"]);
749
- var classes = useToggleButtonStyles(props);
750
- return (React__default.createElement(MuiToggleButton, __assign({ ref: ref, classes: {
751
- root: classes.root,
752
- selected: classes.selected,
753
- } }, muiProps), children));
754
- });
755
- ToggleButton.defaultProps = {
756
- color: 'primary',
757
- };
758
- ToggleButton.displayName = 'ToggleButton';
759
-
760
- var useToggleButtonGroupStyles = makeStyles$1(function (theme) { return ({
761
- root: {
762
- '&&': {
763
- backgroundColor: theme.palette.grey[300],
764
- },
765
- },
766
- }); });
767
-
768
- var ToggleButtonGroup = forwardRef(function (props, ref) {
769
- var children = props.children, _a = props.color, color = _a === void 0 ? 'primary' : _a, muiProps = __rest(props, ["children", "color"]);
770
- var classes = useToggleButtonGroupStyles(props);
771
- var childrenWithProps = React__default.Children.map(children, function (child) {
772
- if (!React__default.isValidElement(child)) {
773
- return null;
774
- }
775
- return React__default.cloneElement(child, { color: color });
776
- });
777
- return (React__default.createElement(MuiToggleButtonGroup, __assign({ ref: ref, classes: { root: classes.root } }, muiProps), childrenWithProps));
778
- });
779
- ToggleButtonGroup.displayName = 'ToggleButtonGroup';
780
-
781
- var useTooltipStyles = makeStyles$1(function (_a) {
782
- var typography = _a.typography;
783
- return ({
784
- tooltip: {
785
- fontSize: typography.pxToRem(16),
786
- },
787
- });
788
- });
789
-
790
- var Tooltip = forwardRef(function (props, ref) {
791
- var classes = useTooltipStyles(props);
792
- return React__default.createElement(MuiTooltip, __assign({ ref: ref, classes: classes }, props));
793
- });
794
- Tooltip.displayName = 'Tooltip';
795
-
796
- makeStyles(function () { return ({
797
- root: {
798
- height: 56,
799
- },
800
- }); });
801
- makeStyles(function (theme) { return ({
802
- root: {
803
- height: '100%',
804
- width: 'min-content',
805
- borderRadius: theme.spacing(1),
806
- },
807
- input: {
808
- '&::-webkit-clear-button, &::-webkit-outer-spin-button, &::-webkit-inner-spin-button': {
809
- display: 'none',
810
- },
811
- '-moz-appearance': 'textfield',
812
- minWidth: 40,
813
- padding: 0,
814
- textAlign: 'center',
815
- },
816
- adornedStart: {
817
- padding: 0,
818
- },
819
- adornedEnd: {
820
- padding: 0,
821
- },
822
- }); });
823
-
824
- var _path$1f;
825
-
826
- function _extends$2M() { _extends$2M = 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$2M.apply(this, arguments); }
281
+ function _extends$2g() { _extends$2g = 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$2g.apply(this, arguments); }
827
282
 
828
- function SvgChevronDown(props) {
829
- return /*#__PURE__*/React.createElement("svg", _extends$2M({
283
+ function SvgHeart(props) {
284
+ return /*#__PURE__*/React.createElement("svg", _extends$2g({
830
285
  viewBox: "0 0 16 16",
831
286
  fill: "none",
832
287
  strokeLinecap: "round",
833
288
  strokeLinejoin: "round",
834
289
  width: "1em",
835
290
  height: "1em"
836
- }, props), _path$1f || (_path$1f = /*#__PURE__*/React.createElement("path", {
837
- d: "M4 6l4 4 4-4",
291
+ }, props), _path$$ || (_path$$ = /*#__PURE__*/React.createElement("path", {
292
+ d: "M13.893 3.074a3.667 3.667 0 00-5.186 0L8 3.78l-.707-.706A3.668 3.668 0 002.107 8.26l.706.707L8 14.154l5.187-5.187.706-.707a3.667 3.667 0 000-5.186v0z",
838
293
  stroke: "currentColor"
839
294
  })));
840
295
  }
841
296
 
842
- var _path$1e;
297
+ var _g$18, _defs$C;
843
298
 
844
- function _extends$2L() { _extends$2L = 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$2L.apply(this, arguments); }
299
+ function _extends$22() { _extends$22 = 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$22.apply(this, arguments); }
845
300
 
846
- function SvgChevronUp(props) {
847
- return /*#__PURE__*/React.createElement("svg", _extends$2L({
301
+ function SvgMinusCircle(props) {
302
+ return /*#__PURE__*/React.createElement("svg", _extends$22({
848
303
  viewBox: "0 0 16 16",
849
304
  fill: "none",
850
305
  strokeLinecap: "round",
851
306
  strokeLinejoin: "round",
852
307
  width: "1em",
853
308
  height: "1em"
854
- }, props), _path$1e || (_path$1e = /*#__PURE__*/React.createElement("path", {
855
- d: "M12 10L8 6l-4 4",
309
+ }, props), _g$18 || (_g$18 = /*#__PURE__*/React.createElement("g", {
310
+ clipPath: "url(#minus-circle_svg__clip0_8_5970)",
856
311
  stroke: "currentColor"
857
- })));
312
+ }, /*#__PURE__*/React.createElement("path", {
313
+ d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zM5.333 8h5.334"
314
+ }))), _defs$C || (_defs$C = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
315
+ id: "minus-circle_svg__clip0_8_5970"
316
+ }, /*#__PURE__*/React.createElement("path", {
317
+ fill: "currentColor",
318
+ d: "M0 0h16v16H0z"
319
+ })))));
858
320
  }
859
321
 
860
- var _path$13;
322
+ var _path$R;
861
323
 
862
- function _extends$2s() { _extends$2s = 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$2s.apply(this, arguments); }
324
+ 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); }
863
325
 
864
- function SvgCheck(props) {
865
- return /*#__PURE__*/React.createElement("svg", _extends$2s({
326
+ function SvgPlus(props) {
327
+ return /*#__PURE__*/React.createElement("svg", _extends$1_({
866
328
  viewBox: "0 0 16 16",
867
329
  fill: "none",
868
330
  strokeLinecap: "round",
869
331
  strokeLinejoin: "round",
870
332
  width: "1em",
871
333
  height: "1em"
872
- }, props), _path$13 || (_path$13 = /*#__PURE__*/React.createElement("path", {
873
- d: "M13.333 4L6 11.333 2.667 8",
334
+ }, props), _path$R || (_path$R = /*#__PURE__*/React.createElement("path", {
335
+ d: "M8 3.333v9.334M3.333 8h9.334",
874
336
  stroke: "currentColor"
875
337
  })));
876
338
  }
877
339
 
878
- var _g$1m, _defs$K;
340
+ var _g$17, _defs$B;
879
341
 
880
- function _extends$2q() { _extends$2q = 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$2q.apply(this, arguments); }
342
+ function _extends$1Z() { _extends$1Z = 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$1Z.apply(this, arguments); }
881
343
 
882
- function SvgClock(props) {
883
- return /*#__PURE__*/React.createElement("svg", _extends$2q({
344
+ function SvgPlusCircle(props) {
345
+ return /*#__PURE__*/React.createElement("svg", _extends$1Z({
884
346
  viewBox: "0 0 16 16",
885
347
  fill: "none",
886
348
  strokeLinecap: "round",
887
349
  strokeLinejoin: "round",
888
350
  width: "1em",
889
351
  height: "1em"
890
- }, props), _g$1m || (_g$1m = /*#__PURE__*/React.createElement("g", {
891
- clipPath: "url(#clock_svg__clip0_8_5092)",
352
+ }, props), _g$17 || (_g$17 = /*#__PURE__*/React.createElement("g", {
353
+ clipPath: "url(#plus-circle_svg__clip0_8_5870)",
892
354
  stroke: "currentColor"
893
355
  }, /*#__PURE__*/React.createElement("path", {
894
- d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333z"
895
- }), /*#__PURE__*/React.createElement("path", {
896
- d: "M8 4v4l2.667 1.333"
897
- }))), _defs$K || (_defs$K = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
898
- id: "clock_svg__clip0_8_5092"
356
+ d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zm0-9.334v5.334M5.333 8h5.334"
357
+ }))), _defs$B || (_defs$B = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
358
+ id: "plus-circle_svg__clip0_8_5870"
899
359
  }, /*#__PURE__*/React.createElement("path", {
900
360
  fill: "currentColor",
901
361
  d: "M0 0h16v16H0z"
902
362
  })))));
903
363
  }
904
364
 
905
- var _g$1l, _defs$J;
365
+ var _path$N;
906
366
 
907
- function _extends$2o() { _extends$2o = 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$2o.apply(this, arguments); }
367
+ function _extends$1R() { _extends$1R = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1R.apply(this, arguments); }
908
368
 
909
- function SvgXCircle(props) {
910
- return /*#__PURE__*/React.createElement("svg", _extends$2o({
369
+ function SvgTag(props) {
370
+ return /*#__PURE__*/React.createElement("svg", _extends$1R({
911
371
  viewBox: "0 0 16 16",
912
372
  fill: "none",
913
373
  strokeLinecap: "round",
914
374
  strokeLinejoin: "round",
915
375
  width: "1em",
916
376
  height: "1em"
917
- }, props), _g$1l || (_g$1l = /*#__PURE__*/React.createElement("g", {
918
- clipPath: "url(#x-circle_svg__clip0_8_6136)",
377
+ }, props), _path$N || (_path$N = /*#__PURE__*/React.createElement("path", {
378
+ d: "M13.727 8.94l-4.78 4.78a1.334 1.334 0 01-1.887 0L1.333 8V1.333H8l5.727 5.727a1.333 1.333 0 010 1.88v0zm-9.06-4.273h.007",
919
379
  stroke: "currentColor"
920
- }, /*#__PURE__*/React.createElement("path", {
921
- d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zM10 6l-4 4m0-4l4 4"
922
- }))), _defs$J || (_defs$J = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
923
- id: "x-circle_svg__clip0_8_6136"
924
- }, /*#__PURE__*/React.createElement("path", {
925
- fill: "currentColor",
926
- d: "M0 0h16v16H0z"
927
- })))));
380
+ })));
928
381
  }
929
382
 
930
- var _path$$;
383
+ var _path$y;
931
384
 
932
- function _extends$2g() { _extends$2g = 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$2g.apply(this, arguments); }
385
+ function _extends$1m() { _extends$1m = 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$1m.apply(this, arguments); }
933
386
 
934
- function SvgHeart(props) {
935
- return /*#__PURE__*/React.createElement("svg", _extends$2g({
387
+ function SvgTrash(props) {
388
+ return /*#__PURE__*/React.createElement("svg", _extends$1m({
936
389
  viewBox: "0 0 16 16",
937
390
  fill: "none",
938
391
  strokeLinecap: "round",
939
392
  strokeLinejoin: "round",
940
393
  width: "1em",
941
394
  height: "1em"
942
- }, props), _path$$ || (_path$$ = /*#__PURE__*/React.createElement("path", {
943
- d: "M13.893 3.074a3.667 3.667 0 00-5.186 0L8 3.78l-.707-.706A3.668 3.668 0 002.107 8.26l.706.707L8 14.154l5.187-5.187.706-.707a3.667 3.667 0 000-5.186v0z",
395
+ }, props), _path$y || (_path$y = /*#__PURE__*/React.createElement("path", {
396
+ d: "M2 4h12M5.333 4V2.667a1.333 1.333 0 011.334-1.333h2.666a1.333 1.333 0 011.334 1.333V4m2 0v9.334a1.333 1.333 0 01-1.334 1.333H4.667a1.333 1.333 0 01-1.334-1.333V4h9.334zm-6 3.333v4m2.666-4v4",
944
397
  stroke: "currentColor"
945
398
  })));
946
399
  }
947
400
 
948
- var _g$18, _defs$C;
401
+ var _path$d, _path2$1;
949
402
 
950
- function _extends$22() { _extends$22 = 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$22.apply(this, arguments); }
403
+ function _extends$w() { _extends$w = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$w.apply(this, arguments); }
951
404
 
952
- function SvgMinusCircle(props) {
953
- return /*#__PURE__*/React.createElement("svg", _extends$22({
405
+ function SvgReviews(props) {
406
+ return /*#__PURE__*/React.createElement("svg", _extends$w({
954
407
  viewBox: "0 0 16 16",
955
408
  fill: "none",
956
409
  strokeLinecap: "round",
957
410
  strokeLinejoin: "round",
958
411
  width: "1em",
959
412
  height: "1em"
960
- }, props), _g$18 || (_g$18 = /*#__PURE__*/React.createElement("g", {
961
- clipPath: "url(#minus-circle_svg__clip0_8_5970)",
413
+ }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
414
+ d: "M14 7.667a5.587 5.587 0 01-.6 2.533 5.666 5.666 0 01-5.067 3.133 5.588 5.588 0 01-2.533-.6L2 14l1.267-3.8a5.586 5.586 0 01-.6-2.533A5.667 5.667 0 015.8 2.6 5.587 5.587 0 018.333 2h.334A5.654 5.654 0 0114 7.333v.334z",
962
415
  stroke: "currentColor"
963
- }, /*#__PURE__*/React.createElement("path", {
964
- d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zM5.333 8h5.334"
965
- }))), _defs$C || (_defs$C = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
966
- id: "minus-circle_svg__clip0_8_5970"
967
- }, /*#__PURE__*/React.createElement("path", {
968
- fill: "currentColor",
969
- d: "M0 0h16v16H0z"
970
- })))));
416
+ })), _path2$1 || (_path2$1 = /*#__PURE__*/React.createElement("path", {
417
+ d: "M8.375 5.363a.2.2 0 01.358 0l.578 1.17a.2.2 0 00.15.11l1.292.189a.2.2 0 01.11.34l-.934.911a.2.2 0 00-.057.177l.22 1.286a.2.2 0 01-.29.21L8.647 9.15a.2.2 0 00-.186 0l-1.155.608a.2.2 0 01-.29-.211l.22-1.286a.2.2 0 00-.058-.177l-.934-.91a.2.2 0 01.11-.341l1.293-.19a.2.2 0 00.15-.109l.578-1.17z",
418
+ fill: "currentColor"
419
+ })));
420
+ }
421
+
422
+ /*! *****************************************************************************
423
+ Copyright (c) Microsoft Corporation.
424
+
425
+ Permission to use, copy, modify, and/or distribute this software for any
426
+ purpose with or without fee is hereby granted.
427
+
428
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
429
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
430
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
431
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
432
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
433
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
434
+ PERFORMANCE OF THIS SOFTWARE.
435
+ ***************************************************************************** */
436
+
437
+ var __assign = function() {
438
+ __assign = Object.assign || function __assign(t) {
439
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
440
+ s = arguments[i];
441
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
442
+ }
443
+ return t;
444
+ };
445
+ return __assign.apply(this, arguments);
446
+ };
447
+
448
+ function __rest(s, e) {
449
+ var t = {};
450
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
451
+ t[p] = s[p];
452
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
453
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
454
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
455
+ t[p[i]] = s[p[i]];
456
+ }
457
+ return t;
458
+ }
459
+
460
+ var _path$M;
461
+
462
+ function _extends$1L() { _extends$1L = 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$1L.apply(this, arguments); }
463
+
464
+ function SvgUser(props) {
465
+ return /*#__PURE__*/React.createElement("svg", _extends$1L({
466
+ viewBox: "0 0 16 16",
467
+ fill: "none",
468
+ strokeLinecap: "round",
469
+ strokeLinejoin: "round",
470
+ width: "1em",
471
+ height: "1em"
472
+ }, props), _path$M || (_path$M = /*#__PURE__*/React.createElement("path", {
473
+ d: "M13.333 14v-1.333A2.667 2.667 0 0010.667 10H5.333a2.667 2.667 0 00-2.666 2.667V14M8 7.333A2.667 2.667 0 108 2a2.667 2.667 0 000 5.333z",
474
+ stroke: "currentColor"
475
+ })));
971
476
  }
972
477
 
973
- var _path$R;
478
+ var useIconStyles = makeStyles$1(function (_a) {
479
+ var spacing = _a.spacing, palette = _a.palette;
480
+ var getFontSize = function (_a) {
481
+ var size = _a.size;
482
+ var sizes = {
483
+ inherit: 'inherit',
484
+ small: spacing(1.5),
485
+ medium: spacing(2),
486
+ large: spacing(2.5),
487
+ 'extra-large': spacing(3),
488
+ };
489
+ return size ? sizes[size] : 'inherit';
490
+ };
491
+ var getColor = function (props) {
492
+ var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
493
+ var value = 'inherit';
494
+ if (props.color) {
495
+ if (semanticColors.includes(props.color.split('.')[0])) {
496
+ var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
497
+ value = palette[color][variant];
498
+ }
499
+ else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {
500
+ value = props.color;
501
+ }
502
+ }
503
+ return value;
504
+ };
505
+ return {
506
+ root: {
507
+ color: getColor,
508
+ fontSize: getFontSize,
509
+ strokeWidth: '1.3px',
510
+ },
511
+ };
512
+ });
513
+
514
+ var classnames$1 = {exports: {}};
515
+
516
+ /*!
517
+ Copyright (c) 2018 Jed Watson.
518
+ Licensed under the MIT License (MIT), see
519
+ http://jedwatson.github.io/classnames
520
+ */
521
+
522
+ (function (module) {
523
+ /* global define */
524
+
525
+ (function () {
526
+
527
+ var hasOwn = {}.hasOwnProperty;
528
+
529
+ function classNames() {
530
+ var classes = [];
531
+
532
+ for (var i = 0; i < arguments.length; i++) {
533
+ var arg = arguments[i];
534
+ if (!arg) continue;
535
+
536
+ var argType = typeof arg;
537
+
538
+ if (argType === 'string' || argType === 'number') {
539
+ classes.push(arg);
540
+ } else if (Array.isArray(arg)) {
541
+ if (arg.length) {
542
+ var inner = classNames.apply(null, arg);
543
+ if (inner) {
544
+ classes.push(inner);
545
+ }
546
+ }
547
+ } else if (argType === 'object') {
548
+ if (arg.toString === Object.prototype.toString) {
549
+ for (var key in arg) {
550
+ if (hasOwn.call(arg, key) && arg[key]) {
551
+ classes.push(key);
552
+ }
553
+ }
554
+ } else {
555
+ classes.push(arg.toString());
556
+ }
557
+ }
558
+ }
559
+
560
+ return classes.join(' ');
561
+ }
562
+
563
+ if (module.exports) {
564
+ classNames.default = classNames;
565
+ module.exports = classNames;
566
+ } else {
567
+ window.classNames = classNames;
568
+ }
569
+ }());
570
+ }(classnames$1));
571
+
572
+ var classNames$1 = classnames$1.exports;
573
+
574
+ var iconStaticClassName = 'pop-icon';
575
+ var Icon = function (props) {
576
+ var icon = props.icon, className = props.className, restProps = __rest(props, ["icon", "className"]);
577
+ var classes = useIconStyles(props);
578
+ var isValid = true;
579
+ if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {
580
+ isValid = false;
581
+ }
582
+ return isValid
583
+ ? createElement(icon, __assign({ className: classNames$1([classes.root, iconStaticClassName, className]) }, restProps))
584
+ : null;
585
+ };
586
+ Icon.defaultProps = {
587
+ size: 'inherit',
588
+ color: 'inherit',
589
+ };
590
+ Icon.displayName = 'Icon';
591
+
592
+ var LoadingStatus;
593
+ (function (LoadingStatus) {
594
+ LoadingStatus["ERROR"] = "ERROR";
595
+ LoadingStatus["LOADED"] = "LOADED";
596
+ LoadingStatus["PENDING"] = "PENDING";
597
+ })(LoadingStatus || (LoadingStatus = {}));
598
+ var useImgProps = function (avatarProps) {
599
+ var _a = React__default.useState(LoadingStatus.PENDING), loaded = _a[0], setLoaded = _a[1];
600
+ var imgProps = __assign(__assign({}, avatarProps.imgProps), { onLoad: function (event) {
601
+ var _a, _b;
602
+ setLoaded(LoadingStatus.LOADED);
603
+ (_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, event);
604
+ } });
605
+ return { imgProps: imgProps, loaded: loaded };
606
+ };
607
+
608
+ var getAvatarDimensions = function (theme, props) {
609
+ var factors = {
610
+ 'extra-small': 3,
611
+ small: 4,
612
+ medium: 5,
613
+ large: 6,
614
+ 'extra-large': 12.5,
615
+ };
616
+ var sizeFactor = factors[props.size || 'medium'];
617
+ return theme.spacing(sizeFactor);
618
+ };
619
+ var getAvatarFontSize = function (props) {
620
+ var fontSizes = {
621
+ 'extra-small': '0.75rem',
622
+ small: '1rem',
623
+ medium: '1rem',
624
+ large: '1.25rem',
625
+ 'extra-large': '3.5rem',
626
+ };
627
+ return fontSizes[props.size];
628
+ };
629
+ var useAvatarStyles = makeStyles(function (theme) { return ({
630
+ root: function (props) { return ({
631
+ width: getAvatarDimensions(theme, props),
632
+ height: getAvatarDimensions(theme, props),
633
+ fontSize: getAvatarFontSize(props),
634
+ backgroundColor: props.loaded === LoadingStatus.LOADED ? 'transparent' : props.background,
635
+ color: theme.palette.getContrastText(props.background),
636
+ objectFit: props.fit,
637
+ }); },
638
+ fallback: function (props) { return ({
639
+ fontSize: getAvatarDimensions(theme, props),
640
+ strokeWidth: 1,
641
+ }); },
642
+ }); });
974
643
 
975
- 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); }
644
+ var Avatar = forwardRef(function (props, ref) {
645
+ var children = props.children, src = props.src, alt = props.alt, fallback = props.fallback, muiProps = __rest(props, ["children", "src", "alt", "fallback"]);
646
+ var _a = useImgProps(props), imgProps = _a.imgProps, loaded = _a.loaded;
647
+ var classes = useAvatarStyles(__assign(__assign({}, props), { loaded: loaded }));
648
+ var displayAltTextFallback = src && alt;
649
+ var displayNoFallback = fallback === 'none';
650
+ var displayCustomFallback = fallback !== 'none' && typeof fallback !== 'undefined';
651
+ var Fallback;
652
+ if (displayAltTextFallback) {
653
+ Fallback = null;
654
+ }
655
+ else if (displayNoFallback) {
656
+ Fallback = ' ';
657
+ }
658
+ else if (displayCustomFallback) {
659
+ Fallback = fallback;
660
+ }
661
+ else {
662
+ Fallback = React__default.createElement(Icon, { icon: SvgUser, className: classes.fallback });
663
+ }
664
+ return (React__default.createElement(MuiAvatar, __assign({ ref: ref, classes: { root: classes.root }, src: src, alt: alt }, muiProps, { imgProps: imgProps }), children || Fallback));
665
+ });
666
+ Avatar.defaultProps = {
667
+ size: 'medium',
668
+ fit: 'cover',
669
+ background: '#E0E0E0',
670
+ };
671
+ Avatar.displayName = 'Avatar';
976
672
 
977
- function SvgPlus(props) {
978
- return /*#__PURE__*/React.createElement("svg", _extends$1_({
979
- viewBox: "0 0 16 16",
980
- fill: "none",
981
- strokeLinecap: "round",
982
- strokeLinejoin: "round",
983
- width: "1em",
984
- height: "1em"
985
- }, props), _path$R || (_path$R = /*#__PURE__*/React.createElement("path", {
986
- d: "M8 3.333v9.334M3.333 8h9.334",
987
- stroke: "currentColor"
988
- })));
989
- }
673
+ makeStyles(function (theme) { return ({
674
+ circle: {
675
+ backgroundColor: theme.palette.grey[300],
676
+ borderRadius: '50%',
677
+ height: theme.spacing(0.65),
678
+ width: theme.spacing(0.65),
679
+ margin: theme.spacing(1) + "px 0 " + theme.spacing(1) + "px " + theme.spacing(1) + "px",
680
+ },
681
+ container: {
682
+ border: "1px solid " + theme.palette.secondary.light,
683
+ borderRadius: theme.spacing(0.5),
684
+ flexGrow: 1,
685
+ },
686
+ titleBar: {
687
+ display: 'flex',
688
+ flexDirection: 'row',
689
+ borderBottom: "1px solid " + theme.palette.secondary.light,
690
+ width: '100%',
691
+ },
692
+ }); });
990
693
 
991
- var _g$17, _defs$B;
694
+ var useButtonStyles = makeStyles(function () { return ({
695
+ root: {
696
+ minWidth: 'unset',
697
+ },
698
+ label: {
699
+ textTransform: function (_a) {
700
+ var textTransform = _a.textTransform;
701
+ return textTransform;
702
+ },
703
+ },
704
+ }); });
992
705
 
993
- function _extends$1Z() { _extends$1Z = 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$1Z.apply(this, arguments); }
706
+ var Button = forwardRef(function (props, ref) {
707
+ props.textTransform; var loading = props.loading, classesOverride = props.classes, className = props.className, muiProps = __rest(props, ["textTransform", "loading", "classes", "className"]);
708
+ props.classes; var styleProps = __rest(props, ["classes"]);
709
+ var classes = useButtonStyles(styleProps);
710
+ var typography = useTheme().typography;
711
+ var loadingIndicator = {
712
+ startIcon: React__default.createElement(CircularProgress, { color: "inherit", size: typography.button.fontSize }),
713
+ disabled: true,
714
+ };
715
+ return (React__default.createElement(MuiButton, __assign({ ref: ref, classes: __assign(__assign({}, classes), classesOverride), className: classNames$1([className, 'pm-button']) }, muiProps, (loading && loadingIndicator))));
716
+ });
717
+ Button.displayName = 'Button';
994
718
 
995
- function SvgPlusCircle(props) {
996
- return /*#__PURE__*/React.createElement("svg", _extends$1Z({
997
- viewBox: "0 0 16 16",
998
- fill: "none",
999
- strokeLinecap: "round",
1000
- strokeLinejoin: "round",
1001
- width: "1em",
1002
- height: "1em"
1003
- }, props), _g$17 || (_g$17 = /*#__PURE__*/React.createElement("g", {
1004
- clipPath: "url(#plus-circle_svg__clip0_8_5870)",
1005
- stroke: "currentColor"
1006
- }, /*#__PURE__*/React.createElement("path", {
1007
- d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zm0-9.334v5.334M5.333 8h5.334"
1008
- }))), _defs$B || (_defs$B = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
1009
- id: "plus-circle_svg__clip0_8_5870"
1010
- }, /*#__PURE__*/React.createElement("path", {
1011
- fill: "currentColor",
1012
- d: "M0 0h16v16H0z"
1013
- })))));
1014
- }
719
+ var Checkbox = forwardRef(function (props, ref) {
720
+ var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
721
+ var control = React__default.createElement(MuiCheckbox, __assign({ disabled: label ? undefined : disabled }, muiProps));
722
+ return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
723
+ });
724
+ Checkbox.displayName = 'Checkbox';
1015
725
 
1016
- var _path$N;
726
+ var getBackground = function (theme) { return function (props) {
727
+ var variant = props.variant, severity = props.severity;
728
+ var background = theme.palette.grey[100];
729
+ var backgrounds = {
730
+ outlined: 'none',
731
+ error: 'error.main',
732
+ warning: 'warning.main',
733
+ info: 'info.light',
734
+ success: 'success.light',
735
+ };
736
+ if (variant === 'outlined') {
737
+ background = backgrounds[variant];
738
+ }
739
+ else if (severity) {
740
+ var _a = backgrounds[severity].split('.'), color = _a[0], colorVariant = _a[1];
741
+ background = theme.palette[color][colorVariant];
742
+ }
743
+ return background;
744
+ }; };
745
+ var getColor = function (theme) { return function (props) {
746
+ var variant = props.variant, severity = props.severity;
747
+ var textColor;
748
+ if (variant === 'outlined' && severity) {
749
+ var textColors = {
750
+ error: theme.palette.error.main,
751
+ info: theme.palette.info.main,
752
+ warning: theme.palette.warning.dark,
753
+ success: theme.palette.success.dark,
754
+ };
755
+ textColor = textColors[severity];
756
+ }
757
+ else if (variant === 'outlined' && !severity) {
758
+ textColor = theme.palette.grey[700];
759
+ }
760
+ else if ((variant === 'default' || variant === undefined) && severity) {
761
+ var textColors = {
762
+ error: theme.palette.common.white,
763
+ info: theme.palette.secondary.main,
764
+ warning: theme.palette.secondary.main,
765
+ success: theme.palette.secondary.main,
766
+ };
767
+ textColor = textColors[severity];
768
+ }
769
+ return textColor;
770
+ }; };
771
+ var getBorder = function (theme) { return function (props) {
772
+ var variant = props.variant, severity = props.severity;
773
+ var borderColor;
774
+ if (variant === 'outlined' && severity) {
775
+ var borderColors = {
776
+ error: theme.palette.error.main,
777
+ info: theme.palette.info.main,
778
+ warning: theme.palette.warning.dark,
779
+ success: theme.palette.success.dark,
780
+ };
781
+ borderColor = borderColors[severity];
782
+ }
783
+ return borderColor;
784
+ }; };
785
+ makeStyles(function (theme) { return ({
786
+ root: {
787
+ background: getBackground(theme),
788
+ color: getColor(theme),
789
+ borderColor: getBorder(theme),
790
+ borderRadius: theme.spacing(0.5),
791
+ },
792
+ icon: {
793
+ color: 'inherit',
794
+ height: theme.spacing(2),
795
+ width: theme.spacing(2),
796
+ },
797
+ deleteIcon: {
798
+ color: theme.palette.grey[500],
799
+ },
800
+ }); });
1017
801
 
1018
- function _extends$1R() { _extends$1R = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1R.apply(this, arguments); }
802
+ var defaultTypographyProps = {
803
+ variant: 'body1',
804
+ };
1019
805
 
1020
- function SvgTag(props) {
1021
- return /*#__PURE__*/React.createElement("svg", _extends$1R({
1022
- viewBox: "0 0 16 16",
1023
- fill: "none",
1024
- strokeLinecap: "round",
1025
- strokeLinejoin: "round",
1026
- width: "1em",
1027
- height: "1em"
1028
- }, props), _path$N || (_path$N = /*#__PURE__*/React.createElement("path", {
1029
- d: "M13.727 8.94l-4.78 4.78a1.334 1.334 0 01-1.887 0L1.333 8V1.333H8l5.727 5.727a1.333 1.333 0 010 1.88v0zm-9.06-4.273h.007",
1030
- stroke: "currentColor"
1031
- })));
1032
- }
806
+ var weights = {
807
+ regular: 400,
808
+ medium: 500,
809
+ 'semi-bold': 600,
810
+ bold: 700,
811
+ };
812
+ var getCustomColor = function (theme, color) {
813
+ var isCommonColor = color && ['white', 'black'].includes(color);
814
+ var isGreyColor = color && color.match(/^grey\.\d{3}/);
815
+ var isSemanticColor = color && color.match(/(primary|secondary|info|success|error|warning).?(light|dark)?/);
816
+ var isTextColor = color && ['textPrimary', 'textSecondary'].includes(color);
817
+ switch (true) {
818
+ case isCommonColor:
819
+ return theme.palette.common[color];
820
+ case Boolean(isGreyColor):
821
+ var scale = color.split('.')[1];
822
+ return theme.palette.grey[scale] || theme.palette.grey[900];
823
+ case Boolean(isSemanticColor):
824
+ var _a = color.split('.'), paletteKey = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
825
+ return theme.palette[paletteKey][variant];
826
+ case isTextColor:
827
+ return theme.palette.text[color.slice(4).toLowerCase()];
828
+ default:
829
+ return undefined;
830
+ }
831
+ };
832
+ var useTypographyStyles = makeStyles(function (theme) {
833
+ var _a;
834
+ return ({
835
+ root: (_a = {},
836
+ _a["& ." + iconStaticClassName] = {
837
+ position: 'relative',
838
+ top: '0.125em',
839
+ padding: '0 0.125em',
840
+ boxSizing: 'content-box',
841
+ },
842
+ _a.fontFamily = theme.typography.fontFamily,
843
+ _a.fontWeight = function (_a) {
844
+ var variant = _a.variant, weight = _a.weight;
845
+ return (weight ? weights[weight] : theme.typography[variant].fontWeight);
846
+ },
847
+ _a.fontSize = function (_a) {
848
+ var variant = _a.variant;
849
+ return theme.typography[variant].fontSize;
850
+ },
851
+ _a.lineHeight = function (_a) {
852
+ var variant = _a.variant;
853
+ return theme.typography[variant].lineHeight;
854
+ },
855
+ _a.textTransform = function (_a) {
856
+ var variant = _a.variant;
857
+ return theme.typography[variant].textTransform;
858
+ },
859
+ _a.color = function (_a) {
860
+ var color = _a.color, variant = _a.variant;
861
+ return (color && getCustomColor(theme, color)) || theme.typography[variant].color;
862
+ },
863
+ _a),
864
+ caption: {
865
+ display: 'inline',
866
+ },
867
+ overline: {
868
+ display: 'inline',
869
+ },
870
+ });
871
+ });
1033
872
 
1034
- var _path$y;
873
+ var Typography = forwardRef(function (props, ref) {
874
+ props.weight; props.color; var restProps = __rest(props, ["weight", "color"]);
875
+ var classes = useTypographyStyles(__assign({}, props));
876
+ var variantMapping = { subtitle1: 'p' };
877
+ return React__default.createElement(Typography$1, __assign({ ref: ref, classes: classes, variantMapping: variantMapping }, restProps));
878
+ });
879
+ Typography.displayName = 'Typography';
880
+ Typography.defaultProps = defaultTypographyProps;
1035
881
 
1036
- function _extends$1m() { _extends$1m = 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$1m.apply(this, arguments); }
882
+ var getFadeStop = function (_a, typographyVariant) {
883
+ var typography = _a.typography;
884
+ return !isNaN(Number(typography[typographyVariant].lineHeight))
885
+ ? typography[typographyVariant].lineHeight + "rem"
886
+ : typography[typographyVariant].lineHeight;
887
+ };
888
+ makeStyles$1(function (theme) { return ({
889
+ overlay: {
890
+ position: 'absolute',
891
+ top: 0,
892
+ left: 0,
893
+ height: '100%',
894
+ width: '100%',
895
+ background: function (props) { return "linear-gradient(to top, white, #FFF0 " + getFadeStop(theme, props.typographyVariant) + ")"; },
896
+ },
897
+ }); });
1037
898
 
1038
- function SvgTrash(props) {
1039
- return /*#__PURE__*/React.createElement("svg", _extends$1m({
1040
- viewBox: "0 0 16 16",
1041
- fill: "none",
1042
- strokeLinecap: "round",
1043
- strokeLinejoin: "round",
1044
- width: "1em",
1045
- height: "1em"
1046
- }, props), _path$y || (_path$y = /*#__PURE__*/React.createElement("path", {
1047
- d: "M2 4h12M5.333 4V2.667a1.333 1.333 0 011.334-1.333h2.666a1.333 1.333 0 011.334 1.333V4m2 0v9.334a1.333 1.333 0 01-1.334 1.333H4.667a1.333 1.333 0 01-1.334-1.333V4h9.334zm-6 3.333v4m2.666-4v4",
1048
- stroke: "currentColor"
1049
- })));
1050
- }
899
+ var SemanticColors;
900
+ (function (SemanticColors) {
901
+ SemanticColors["PRIMARY_MAIN"] = "primary.main";
902
+ SemanticColors["PRIMARY_DARK"] = "primary.dark";
903
+ SemanticColors["PRIMARY_LIGHT"] = "primary.light";
904
+ SemanticColors["SECONDARY_MAIN"] = "secondary.main";
905
+ SemanticColors["SECONDARY_DARK"] = "secondary.dark";
906
+ SemanticColors["SECONDARY_LIGHT"] = "secondary.light";
907
+ })(SemanticColors || (SemanticColors = {}));
908
+ makeStyles$1(function (theme) { return ({
909
+ dividerRoot: {
910
+ gap: theme.spacing(2),
911
+ },
912
+ textRoot: {
913
+ color: function (props) {
914
+ var textColor = props.textColor;
915
+ if (Object.values(SemanticColors).includes(textColor)) {
916
+ var _a = textColor.split('.'), semanticColor = _a[0], shade = _a[1];
917
+ return theme.palette[semanticColor][shade];
918
+ }
919
+ else if (textColor) {
920
+ return textColor;
921
+ }
922
+ else {
923
+ return 'black';
924
+ }
925
+ },
926
+ textTransform: function (props) { return props.textTransform; },
927
+ },
928
+ dividerLine: {
929
+ backgroundColor: function (props) {
930
+ var dividerColor = props.dividerColor;
931
+ if (Object.values(SemanticColors).includes(dividerColor)) {
932
+ var _a = dividerColor.split('.'), semanticColor = _a[0], shade = _a[1];
933
+ return theme.palette[semanticColor][shade];
934
+ }
935
+ else if (dividerColor) {
936
+ return dividerColor;
937
+ }
938
+ else {
939
+ return theme.palette.grey[500];
940
+ }
941
+ },
942
+ },
943
+ }); });
1051
944
 
1052
- var _path$d, _path2$1;
945
+ var IconButton = forwardRef(function (props, ref) {
946
+ return React__default.createElement(MuiIconButton, __assign({ ref: ref }, props));
947
+ });
948
+ IconButton.displayName = 'IconButton';
949
+ IconButton.defaultProps = {
950
+ color: 'secondary',
951
+ };
1053
952
 
1054
- function _extends$w() { _extends$w = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$w.apply(this, arguments); }
953
+ var useLinkStyles = makeStyles(function (theme) { return ({
954
+ root: function (props) {
955
+ var _a;
956
+ return (__assign(__assign({ display: 'flex' }, (props.color === undefined && { color: theme.palette.info.main })), (_a = {}, _a["& ." + iconStaticClassName] = {
957
+ alignSelf: 'center',
958
+ }, _a)));
959
+ },
960
+ }); });
1055
961
 
1056
- function SvgReviews(props) {
1057
- return /*#__PURE__*/React.createElement("svg", _extends$w({
1058
- viewBox: "0 0 16 16",
1059
- fill: "none",
1060
- strokeLinecap: "round",
1061
- strokeLinejoin: "round",
1062
- width: "1em",
1063
- height: "1em"
1064
- }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
1065
- d: "M14 7.667a5.587 5.587 0 01-.6 2.533 5.666 5.666 0 01-5.067 3.133 5.588 5.588 0 01-2.533-.6L2 14l1.267-3.8a5.586 5.586 0 01-.6-2.533A5.667 5.667 0 015.8 2.6 5.587 5.587 0 018.333 2h.334A5.654 5.654 0 0114 7.333v.334z",
1066
- stroke: "currentColor"
1067
- })), _path2$1 || (_path2$1 = /*#__PURE__*/React.createElement("path", {
1068
- d: "M8.375 5.363a.2.2 0 01.358 0l.578 1.17a.2.2 0 00.15.11l1.292.189a.2.2 0 01.11.34l-.934.911a.2.2 0 00-.057.177l.22 1.286a.2.2 0 01-.29.21L8.647 9.15a.2.2 0 00-.186 0l-1.155.608a.2.2 0 01-.29-.211l.22-1.286a.2.2 0 00-.058-.177l-.934-.91a.2.2 0 01.11-.341l1.293-.19a.2.2 0 00.15-.109l.578-1.17z",
1069
- fill: "currentColor"
1070
- })));
1071
- }
962
+ var Link = forwardRef(function (props, ref) {
963
+ var children = props.children, muiProps = __rest(props, ["children"]);
964
+ var classes = useLinkStyles(props);
965
+ return (React__default.createElement(Link$1, __assign({ ref: ref, classes: { root: classes.root } }, muiProps), children));
966
+ });
967
+ Link.defaultProps = {
968
+ variant: 'body1',
969
+ };
970
+ Link.displayName = 'Link';
1072
971
 
1073
- var classnames = {exports: {}};
972
+ var useStyles$4 = makeStyles$1(function (_a) {
973
+ var spacing = _a.spacing;
974
+ return ({
975
+ root: {
976
+ '&:last-child': {
977
+ marginBottom: 0,
978
+ },
979
+ marginBottom: spacing(4),
980
+ padding: spacing(4),
981
+ },
982
+ });
983
+ });
984
+ var Paper = forwardRef(function (props, ref) {
985
+ var legacyStyles = props.legacyStyles, restProps = __rest(props, ["legacyStyles"]);
986
+ var classes = useStyles$4(props);
987
+ return React__default.createElement(Paper$1, __assign({}, ref, { classes: __assign({}, (legacyStyles && classes)) }, restProps));
988
+ });
989
+ Paper.displayName = 'Paper';
990
+ Paper.defaultProps = {
991
+ legacyStyles: false,
992
+ };
1074
993
 
1075
- /*!
1076
- Copyright (c) 2018 Jed Watson.
1077
- Licensed under the MIT License (MIT), see
1078
- http://jedwatson.github.io/classnames
1079
- */
994
+ var Radio = forwardRef(function (props, ref) {
995
+ var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
996
+ var control = React__default.createElement(MuiRadio, __assign({ disabled: label ? undefined : disabled }, muiProps));
997
+ return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
998
+ });
999
+ Radio.displayName = 'Radio';
1080
1000
 
1081
- (function (module) {
1082
- /* global define */
1001
+ makeStyles(function () { return ({
1002
+ textfield: {
1003
+ background: function (props) { return (props.backgroundTransparency ? '#FFFFFF44' : 'none'); },
1004
+ borderTopLeftRadius: 4,
1005
+ borderBottomLeftRadius: 4,
1006
+ '& fieldset': {
1007
+ borderRight: 'none',
1008
+ borderTopRightRadius: 0,
1009
+ borderBottomRightRadius: 0,
1010
+ },
1011
+ },
1012
+ button: {
1013
+ borderTopLeftRadius: 0,
1014
+ borderBottomLeftRadius: 0,
1015
+ alignSelf: 'stretch',
1016
+ },
1017
+ input: {
1018
+ color: function (props) { return props.inputTextColor || 'inherit'; },
1019
+ '&$focused fieldset': {
1020
+ top: -4,
1021
+ },
1022
+ },
1023
+ focused: {},
1024
+ }); });
1083
1025
 
1084
- (function () {
1026
+ var useSwitchStyles = makeStyles(function (theme) { return ({
1027
+ checked: {
1028
+ '& $thumb': {
1029
+ background: theme.palette.success.main,
1030
+ },
1031
+ '&& + $track': {
1032
+ backgroundColor: theme.palette.success.main,
1033
+ },
1034
+ },
1035
+ thumb: {},
1036
+ track: {},
1037
+ }); });
1085
1038
 
1086
- var hasOwn = {}.hasOwnProperty;
1039
+ var Switch = forwardRef(function (props, ref) {
1040
+ var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
1041
+ var classes = useSwitchStyles(props);
1042
+ var control = React__default.createElement(MuiSwitch, __assign({ classes: classes, disabled: label ? undefined : disabled }, muiProps));
1043
+ return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
1044
+ });
1045
+ Switch.displayName = 'Switch';
1087
1046
 
1088
- function classNames() {
1089
- var classes = [];
1047
+ var useToggleButtonStyles = makeStyles(function (theme) { return ({
1048
+ root: {
1049
+ color: theme.palette.text.primary,
1050
+ },
1051
+ selected: {
1052
+ '&&': {
1053
+ '&:hover': {
1054
+ backgroundColor: function (props) { return theme.palette[props.color || 'primary'].dark; },
1055
+ },
1056
+ backgroundColor: function (props) { return theme.palette[props.color || 'primary'].main; },
1057
+ color: 'white',
1058
+ },
1059
+ },
1060
+ }); });
1090
1061
 
1091
- for (var i = 0; i < arguments.length; i++) {
1092
- var arg = arguments[i];
1093
- if (!arg) continue;
1062
+ var ToggleButton = forwardRef(function (props, ref) {
1063
+ var children = props.children, muiProps = __rest(props, ["children"]);
1064
+ var classes = useToggleButtonStyles(props);
1065
+ return (React__default.createElement(MuiToggleButton, __assign({ ref: ref, classes: {
1066
+ root: classes.root,
1067
+ selected: classes.selected,
1068
+ } }, muiProps), children));
1069
+ });
1070
+ ToggleButton.defaultProps = {
1071
+ color: 'primary',
1072
+ };
1073
+ ToggleButton.displayName = 'ToggleButton';
1094
1074
 
1095
- var argType = typeof arg;
1075
+ var useToggleButtonGroupStyles = makeStyles(function (theme) { return ({
1076
+ root: {
1077
+ '&&': {
1078
+ backgroundColor: theme.palette.grey[300],
1079
+ },
1080
+ },
1081
+ }); });
1096
1082
 
1097
- if (argType === 'string' || argType === 'number') {
1098
- classes.push(arg);
1099
- } else if (Array.isArray(arg)) {
1100
- if (arg.length) {
1101
- var inner = classNames.apply(null, arg);
1102
- if (inner) {
1103
- classes.push(inner);
1104
- }
1105
- }
1106
- } else if (argType === 'object') {
1107
- if (arg.toString === Object.prototype.toString) {
1108
- for (var key in arg) {
1109
- if (hasOwn.call(arg, key) && arg[key]) {
1110
- classes.push(key);
1111
- }
1112
- }
1113
- } else {
1114
- classes.push(arg.toString());
1115
- }
1116
- }
1117
- }
1083
+ var ToggleButtonGroup = forwardRef(function (props, ref) {
1084
+ var children = props.children, _a = props.color, color = _a === void 0 ? 'primary' : _a, muiProps = __rest(props, ["children", "color"]);
1085
+ var classes = useToggleButtonGroupStyles(props);
1086
+ var childrenWithProps = React__default.Children.map(children, function (child) {
1087
+ if (!React__default.isValidElement(child)) {
1088
+ return null;
1089
+ }
1090
+ return React__default.cloneElement(child, { color: color });
1091
+ });
1092
+ return (React__default.createElement(MuiToggleButtonGroup, __assign({ ref: ref, classes: { root: classes.root } }, muiProps), childrenWithProps));
1093
+ });
1094
+ ToggleButtonGroup.displayName = 'ToggleButtonGroup';
1118
1095
 
1119
- return classes.join(' ');
1120
- }
1096
+ var useTooltipStyles = makeStyles(function (_a) {
1097
+ var typography = _a.typography;
1098
+ return ({
1099
+ tooltip: {
1100
+ fontSize: typography.pxToRem(16),
1101
+ },
1102
+ });
1103
+ });
1121
1104
 
1122
- if (module.exports) {
1123
- classNames.default = classNames;
1124
- module.exports = classNames;
1125
- } else {
1126
- window.classNames = classNames;
1127
- }
1128
- }());
1129
- }(classnames));
1105
+ var Tooltip = forwardRef(function (props, ref) {
1106
+ var classes = useTooltipStyles(props);
1107
+ return React__default.createElement(MuiTooltip, __assign({ ref: ref, classes: classes }, props));
1108
+ });
1109
+ Tooltip.displayName = 'Tooltip';
1130
1110
 
1131
- var classNames = classnames.exports;
1111
+ makeStyles$1(function () { return ({
1112
+ root: {
1113
+ height: 56,
1114
+ },
1115
+ }); });
1116
+ makeStyles$1(function (theme) { return ({
1117
+ root: {
1118
+ height: '100%',
1119
+ width: 'min-content',
1120
+ borderRadius: theme.spacing(1),
1121
+ },
1122
+ input: {
1123
+ '&::-webkit-clear-button, &::-webkit-outer-spin-button, &::-webkit-inner-spin-button': {
1124
+ display: 'none',
1125
+ },
1126
+ '-moz-appearance': 'textfield',
1127
+ minWidth: 40,
1128
+ padding: 0,
1129
+ textAlign: 'center',
1130
+ },
1131
+ adornedStart: {
1132
+ padding: 0,
1133
+ },
1134
+ adornedEnd: {
1135
+ padding: 0,
1136
+ },
1137
+ }); });
1132
1138
 
1133
1139
  var ReactionCounter = function (props) {
1134
1140
  var count = props.count, icon = props.icon;
@@ -1142,63 +1148,37 @@ var ReactionCounterGroup = function (props) {
1142
1148
  return (React__default.createElement(Box, { display: "flex", gridGap: 16 }, children));
1143
1149
  };
1144
1150
 
1145
- var useDishCardStyles = makeStyles$1(function (theme) { return ({
1146
- root: function (_a) {
1147
- var _b = _a.isMobile, isMobile = _b === void 0 ? false : _b;
1148
- return {
1149
- background: '#FFF',
1150
- borderRadius: isMobile ? '0px' : '30px',
1151
- border: isMobile ? '0px' : '1px solid var(--surfaces-card-stroke, #E0E0E0)',
1152
- display: 'flex',
1153
- height: '185px',
1154
- justifyContent: 'space-between',
1155
- padding: isMobile ? 0 : theme.spacing(2.5),
1156
- cursor: 'pointer',
1157
- color: theme.palette.grey[900],
1158
- };
1159
- },
1160
- description: {
1161
- color: '#616161',
1162
- marginTop: theme.spacing(0.25),
1163
- marginBottom: theme.spacing(1.5),
1164
- width: '100%',
1165
- },
1166
- image: {
1167
- borderRadius: '16px',
1168
- objectFit: 'cover',
1169
- marginLeft: theme.spacing(2),
1170
- width: '125px',
1171
- height: '100%',
1172
- },
1173
- plusIcon: {
1174
- height: '100%',
1175
- padding: theme.spacing(0.25),
1176
- background: '#0076CB',
1177
- color: theme.palette.common.white,
1178
- borderRadius: '30px',
1179
- marginRight: theme.spacing(1),
1180
- },
1181
- title: {
1182
- fontSize: '1.125rem',
1183
- },
1184
- truncate: {
1185
- '-webkit-line-clamp': 2,
1186
- display: '-webkit-box',
1187
- '-webkit-box-orient': 'vertical',
1188
- textOverflow: 'ellipsis',
1189
- overflow: 'hidden',
1190
- },
1191
- price: {
1192
- fontSize: '1.25rem',
1193
- },
1194
- }); });
1151
+ var MenuItemReactions = function (props) {
1152
+ var likeCount = props.likeCount, reviewCount = props.reviewCount;
1153
+ var showLikes = likeCount ? likeCount > 0 : false;
1154
+ var showReviews = reviewCount ? reviewCount > 0 : false;
1155
+ return (React__default.createElement(ReactionCounterGroup, null,
1156
+ showLikes && React__default.createElement(ReactionCounter, { icon: SvgHeart, count: likeCount !== null && likeCount !== void 0 ? likeCount : 0 }),
1157
+ showReviews && React__default.createElement(ReactionCounter, { icon: SvgReviews, count: reviewCount !== null && reviewCount !== void 0 ? reviewCount : 0 })));
1158
+ };
1195
1159
 
1196
- var ItemTagGroup = function (props) {
1197
- var children = props.children;
1198
- return (React__default.createElement(Box, { display: "flex", gridGap: 6, ml: 1, flexWrap: "wrap" }, children));
1160
+ var useStyles$3 = makeStyles$1(function (_a) {
1161
+ var palette = _a.palette, spacing = _a.spacing;
1162
+ return ({
1163
+ plusIcon: {
1164
+ height: '100%',
1165
+ padding: spacing(0.25),
1166
+ background: palette.info.main,
1167
+ color: palette.info.contrastText,
1168
+ borderRadius: '30px',
1169
+ marginRight: spacing(1),
1170
+ },
1171
+ });
1172
+ });
1173
+ var MenuItemPrice = function (props) {
1174
+ var classes = useStyles$3();
1175
+ return (React__default.createElement(Box, { display: "flex", alignItems: "center" },
1176
+ React__default.createElement(Box, { display: "flex", className: classes.plusIcon },
1177
+ React__default.createElement(Icon, { icon: SvgPlus, size: "medium" })),
1178
+ React__default.createElement(Typography$1, null, props.price)));
1199
1179
  };
1200
1180
 
1201
- var useItemtagStyles = makeStyles$1(function (theme) { return ({
1181
+ var useItemtagStyles = makeStyles(function (theme) { return ({
1202
1182
  root: function (_a) {
1203
1183
  var _b, _c;
1204
1184
  var _d = _a.color, color = _d === void 0 ? '' : _d;
@@ -1226,37 +1206,36 @@ var ItemTag = forwardRef(function (props, ref) {
1226
1206
  React__default.createElement(Typography, { variant: "caption", className: classes.text }, children)));
1227
1207
  });
1228
1208
 
1229
- var DishCard = function (props) {
1230
- var title = props.title, description = props.description, image = props.image, likeCount = props.likeCount, reviewCount = props.reviewCount, itemTags = props.itemTags, price = props.price, onClick = props.onClick, id = props.id;
1209
+ var ItemTagGroup = function (props) {
1210
+ var children = props.children;
1211
+ return (React__default.createElement(Box, { display: "flex", gridGap: 6, ml: 1, flexWrap: "wrap" }, children));
1212
+ };
1213
+
1214
+ var MenuItemTags = function (props) {
1215
+ var itemTags = props.itemTags;
1216
+ return (React__default.createElement(ItemTagGroup, null, itemTags === null || itemTags === void 0 ? void 0 : itemTags.slice(0, 5).map(function (itemTag) { return (React__default.createElement(ItemTag, { key: itemTag.name, alt: itemTag.name, color: itemTag.color }, itemTag.abbr)); })));
1217
+ };
1218
+
1219
+ var MenuItem = forwardRef(function (props, ref) {
1220
+ var onClick = props.onClick, id = props.id, title = props.title, description = props.description;
1231
1221
  var classes = useDishCardStyles(props);
1232
- var theme = useTheme$1();
1233
- var validImage = (image === null || image === void 0 ? void 0 : image.src) && (image === null || image === void 0 ? void 0 : image.alt);
1234
- var getTruncatedSizePx = function (typography) {
1235
- var lineHeightRem = parseFloat(theme.typography[typography].lineHeight);
1236
- var collapsedSizeRem = 2 * lineHeightRem;
1237
- var documentFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);
1238
- return collapsedSizeRem * documentFontSize;
1222
+ var handleClick = function (event) {
1223
+ onClick(id, event);
1239
1224
  };
1240
- return (React__default.createElement(Box, { className: classes.root, onClick: onClick, id: id },
1241
- React__default.createElement(Box, { display: "flex", flexDirection: "column", justifyContent: "space-between", width: "100%", marginRight: 1 },
1242
- React__default.createElement(Box, null,
1243
- React__default.createElement(Box, { maxHeight: getTruncatedSizePx('h6') + 'px' },
1244
- React__default.createElement(Typography, { variant: "h6", className: classNames([classes.title, classes.truncate]) }, title)),
1245
- React__default.createElement(Box, { maxHeight: getTruncatedSizePx('body2') + 'px' },
1246
- React__default.createElement(Typography, { variant: "body2", className: classNames([classes.description, classes.truncate]) }, description)),
1247
- React__default.createElement(ReactionCounterGroup, null,
1248
- React__default.createElement(ReactionCounter, { icon: SvgHeart, count: likeCount }),
1249
- React__default.createElement(ReactionCounter, { icon: SvgReviews, count: reviewCount }))),
1250
- React__default.createElement(Box, { display: "flex", justifyContent: "space-between", alignItems: "center" },
1251
- React__default.createElement(Box, { display: "flex", alignItems: "center", mr: 2 },
1252
- React__default.createElement(Box, { display: "flex", className: classes.plusIcon },
1253
- React__default.createElement(Icon, { icon: SvgPlus, size: "medium" })),
1254
- React__default.createElement(Typography, { className: classes.price }, price)),
1255
- React__default.createElement(ItemTagGroup, null, itemTags.map(function (itemTag, i) { return (React__default.createElement(ItemTag, { key: i, alt: itemTag.abbr, color: itemTag.color }, itemTag.abbr)); })))),
1256
- validImage && React__default.createElement("img", { src: image.src, alt: image.alt, className: classes.image })));
1257
- };
1225
+ return (React__default.createElement(Card, { className: classes.card, ref: ref, elevation: 0, "data-component-type": "menu-item" },
1226
+ React__default.createElement(CardActionArea, { className: classes.cardActionArea, onClick: handleClick },
1227
+ React__default.createElement(MenuItemInfo, null,
1228
+ React__default.createElement(Typography$1, { className: classes.cardTitle }, title),
1229
+ React__default.createElement(Typography$1, { className: classes.cardDescription, paragraph: true }, description),
1230
+ React__default.createElement(MenuItemReactions, { likeCount: props.likeCount, reviewCount: props.reviewCount }),
1231
+ React__default.createElement(Box, { display: "flex", justifyContent: "space-between", alignItems: "end", flexGrow: 1 },
1232
+ React__default.createElement(MenuItemPrice, { price: props.price }),
1233
+ React__default.createElement(MenuItemTags, { itemTags: props.itemTags }))),
1234
+ React__default.createElement(MenuItemImg, { image: props.image }))));
1235
+ });
1236
+ MenuItem.displayName = 'MenuItem';
1258
1237
 
1259
- var useDishCheckoutCardStyles = makeStyles$1(function (theme) { return ({
1238
+ var useDishCheckoutCardStyles = makeStyles(function (theme) { return ({
1260
1239
  root: {
1261
1240
  color: theme.palette.grey[900],
1262
1241
  padding: theme.spacing(2, 0),
@@ -1340,7 +1319,7 @@ var DishCheckoutCard = function (props) {
1340
1319
  },
1341
1320
  getContentAnchorEl: null,
1342
1321
  classes: { paper: classes.selectPaper },
1343
- }, className: classes.select }, Array.from({ length: 99 }, function (_, index) { return (React__default.createElement(MenuItem, { key: index + 1, value: index + 1 }, index + 1)); }))),
1322
+ }, className: classes.select }, Array.from({ length: 99 }, function (_, index) { return (React__default.createElement(MenuItem$1, { key: index + 1, value: index + 1 }, index + 1)); }))),
1344
1323
  React__default.createElement(Typography, { className: classes.price }, price))));
1345
1324
  };
1346
1325
 
@@ -1357,7 +1336,7 @@ var DishDetailsReview = forwardRef(function (props) {
1357
1336
  });
1358
1337
  DishDetailsReview.displayName = 'DishDetailsReview';
1359
1338
 
1360
- var useDishModifierCardStyles = makeStyles$1(function (theme) { return ({
1339
+ var useDishModifierCardStyles = makeStyles(function (theme) { return ({
1361
1340
  root: {
1362
1341
  borderRadius: '8px',
1363
1342
  border: '1px solid var(--surfaces-card-stroke, #E0E0E0)',
@@ -1381,7 +1360,7 @@ var useDishModifierCardStyles = makeStyles$1(function (theme) { return ({
1381
1360
  margin: theme.spacing(0, 2),
1382
1361
  },
1383
1362
  }); });
1384
- var useRadioModifierFormStyles = makeStyles$1(function (theme) { return ({
1363
+ var useRadioModifierFormStyles = makeStyles(function (theme) { return ({
1385
1364
  root: {
1386
1365
  '& .MuiFormControlLabel-label': {
1387
1366
  margin: theme.spacing(0.5, 0),
@@ -1399,7 +1378,7 @@ var useRadioModifierFormStyles = makeStyles$1(function (theme) { return ({
1399
1378
  },
1400
1379
  },
1401
1380
  }); });
1402
- var useCheckboxModifierFormStyles = makeStyles$1(function (theme) { return ({
1381
+ var useCheckboxModifierFormStyles = makeStyles(function (theme) { return ({
1403
1382
  root: {
1404
1383
  '& .MuiFormControlLabel-label': {
1405
1384
  margin: theme.spacing(0.5, 0),
@@ -1419,7 +1398,7 @@ var useCheckboxModifierFormStyles = makeStyles$1(function (theme) { return ({
1419
1398
  },
1420
1399
  }); });
1421
1400
 
1422
- var useStatusTagStyles = makeStyles$1(function (theme) { return ({
1401
+ var useStatusTagStyles = makeStyles(function (theme) { return ({
1423
1402
  root: {
1424
1403
  borderRadius: '5px',
1425
1404
  display: 'flex',
@@ -1448,6 +1427,66 @@ var useStatusTagStyles = makeStyles$1(function (theme) { return ({
1448
1427
  },
1449
1428
  }); });
1450
1429
 
1430
+ var classnames = {exports: {}};
1431
+
1432
+ /*!
1433
+ Copyright (c) 2018 Jed Watson.
1434
+ Licensed under the MIT License (MIT), see
1435
+ http://jedwatson.github.io/classnames
1436
+ */
1437
+
1438
+ (function (module) {
1439
+ /* global define */
1440
+
1441
+ (function () {
1442
+
1443
+ var hasOwn = {}.hasOwnProperty;
1444
+
1445
+ function classNames() {
1446
+ var classes = [];
1447
+
1448
+ for (var i = 0; i < arguments.length; i++) {
1449
+ var arg = arguments[i];
1450
+ if (!arg) continue;
1451
+
1452
+ var argType = typeof arg;
1453
+
1454
+ if (argType === 'string' || argType === 'number') {
1455
+ classes.push(arg);
1456
+ } else if (Array.isArray(arg)) {
1457
+ if (arg.length) {
1458
+ var inner = classNames.apply(null, arg);
1459
+ if (inner) {
1460
+ classes.push(inner);
1461
+ }
1462
+ }
1463
+ } else if (argType === 'object') {
1464
+ if (arg.toString === Object.prototype.toString) {
1465
+ for (var key in arg) {
1466
+ if (hasOwn.call(arg, key) && arg[key]) {
1467
+ classes.push(key);
1468
+ }
1469
+ }
1470
+ } else {
1471
+ classes.push(arg.toString());
1472
+ }
1473
+ }
1474
+ }
1475
+
1476
+ return classes.join(' ');
1477
+ }
1478
+
1479
+ if (module.exports) {
1480
+ classNames.default = classNames;
1481
+ module.exports = classNames;
1482
+ } else {
1483
+ window.classNames = classNames;
1484
+ }
1485
+ }());
1486
+ }(classnames));
1487
+
1488
+ var classNames = classnames.exports;
1489
+
1451
1490
  var StatusTag = function (props) {
1452
1491
  var variant = props.variant, label = props.label, _a = props.color, color = _a === void 0 ? 'default' : _a;
1453
1492
  var classes = useStatusTagStyles(props);
@@ -1531,7 +1570,7 @@ var DishModifierCard = function (props) {
1531
1570
  };
1532
1571
  DishModifierCard.displayName = 'DishModifierCard';
1533
1572
 
1534
- var useLocationCardStyles = makeStyles$1(function (theme) {
1573
+ var useLocationCardStyles = makeStyles(function (theme) {
1535
1574
  var _a = theme.palette, info = _a.info, grey = _a.grey, secondary = _a.secondary, spacing = theme.spacing;
1536
1575
  var selectedBackgroundColor = lighten(theme.palette.info.light, 0.9);
1537
1576
  var backgroundColor = theme.palette.background.default;
@@ -1593,8 +1632,8 @@ var LocationCard = function (props) {
1593
1632
  var handleClick = function () {
1594
1633
  onClick(value);
1595
1634
  };
1596
- return (React__default.createElement(Card, __assign$1({ className: classes.root }, muiProps),
1597
- React__default.createElement(CardActionArea, __assign$1({ onClick: handleClick, classes: { focusHighlight: classes.focusHighlight }, role: "checkbox", "aria-checked": selected, "aria-labelledby": labelId }, CardActionAreaProps),
1635
+ return (React__default.createElement(Card$1, __assign$1({ className: classes.root }, muiProps),
1636
+ React__default.createElement(CardActionArea$1, __assign$1({ onClick: handleClick, classes: { focusHighlight: classes.focusHighlight }, role: "checkbox", "aria-checked": selected, "aria-labelledby": labelId }, CardActionAreaProps),
1598
1637
  React__default.createElement(CardContent, { className: classes.content },
1599
1638
  React__default.createElement(Box, { className: classes.locationInfo },
1600
1639
  React__default.createElement(Box, { display: "flex", justifyContent: "space-between" },
@@ -1639,7 +1678,7 @@ function SvgRestaurantMenuIcon(props) {
1639
1678
  })))));
1640
1679
  }
1641
1680
 
1642
- var useMenuDropdownStyles = makeStyles$1(function (theme) { return ({
1681
+ var useMenuDropdownStyles = makeStyles(function (theme) { return ({
1643
1682
  select: {
1644
1683
  '& .MuiSelect-root': {
1645
1684
  color: '#212121',
@@ -1667,10 +1706,10 @@ var MenuDropdown = function (props) {
1667
1706
  horizontal: 'left',
1668
1707
  },
1669
1708
  getContentAnchorEl: null,
1670
- }, className: classes.select }, menuOptions.map(function (option, index) { return (React__default.createElement(MenuItem, { key: index, value: option.id }, option.name)); }))));
1709
+ }, className: classes.select }, menuOptions.map(function (option, index) { return (React__default.createElement(MenuItem$1, { key: index, value: option.id }, option.name)); }))));
1671
1710
  };
1672
1711
 
1673
- var useMenuFilterStyles = makeStyles$1(function () { return ({
1712
+ var useMenuFilterStyles = makeStyles(function () { return ({
1674
1713
  triggerLabel: {
1675
1714
  whiteSpace: 'nowrap',
1676
1715
  },
@@ -1718,22 +1757,22 @@ var MenuFilter = function (props) {
1718
1757
  React__default.createElement(Button$2, { id: triggerId, "aria-controls": popoverId, "aria-haspopup": "true", "aria-expanded": open, onClick: handleTriggerClick, size: "small", startIcon: React__default.createElement(SvgLeafIcon, null), classes: { label: classes.triggerLabel } }, triggerLabel),
1719
1758
  React__default.createElement(Menu, { id: popoverId, anchorEl: anchorEl, open: open, onClose: handleClose },
1720
1759
  availableFilters.map(function (option, index) {
1721
- return (React__default.createElement(MenuItem, { key: index, value: option.id, onClick: function (event) { return handleChange(option, event); } },
1760
+ return (React__default.createElement(MenuItem$1, { key: index, value: option.id, onClick: function (event) { return handleChange(option, event); } },
1722
1761
  React__default.createElement(ItemTag, { alt: option.abbr, color: option.color }, option.abbr),
1723
1762
  React__default.createElement(Box, { ml: 1 }, option.name)));
1724
1763
  }),
1725
- allFiltersSelected && (React__default.createElement(MenuItem, { onClick: handleClose },
1764
+ allFiltersSelected && (React__default.createElement(MenuItem$1, { onClick: handleClose },
1726
1765
  React__default.createElement(Box, { display: "flex", flexDirection: "column", alignItems: "center" },
1727
1766
  React__default.createElement(Icon, { icon: SvgTag, color: "#9E9E9E", size: "large" }),
1728
1767
  React__default.createElement(Typography, { variant: "body1", color: "grey.500" }, noOptionsLabel)))))));
1729
1768
  };
1730
1769
 
1731
- var useQuantityPickerStyles = makeStyles$1(function (theme) { return ({
1770
+ var useQuantityPickerStyles = makeStyles(function (theme) { return ({
1732
1771
  root: {
1733
1772
  height: theme.spacing(7),
1734
1773
  },
1735
1774
  }); });
1736
- var useQuantityInputStyles = makeStyles$1(function (theme) { return ({
1775
+ var useQuantityInputStyles = makeStyles(function (theme) { return ({
1737
1776
  root: {
1738
1777
  height: '100%',
1739
1778
  width: 'min-content',
@@ -1783,7 +1822,7 @@ var QuantityPicker = function (props) {
1783
1822
  } }));
1784
1823
  };
1785
1824
 
1786
- var useSelectableChipStyles = makeStyles$1(function (theme) { return ({
1825
+ var useSelectableChipStyles = makeStyles(function (theme) { return ({
1787
1826
  root: {
1788
1827
  border: '2px solid',
1789
1828
  borderColor: theme.palette.grey[100],
@@ -1818,15 +1857,13 @@ var SelectableChip = function (props) {
1818
1857
  } }, props)));
1819
1858
  };
1820
1859
 
1821
- var useSelectableChipGroupStyles = makeStyles$1(function (theme) { return ({
1860
+ var useSelectableChipGroupStyles = makeStyles(function (theme) { return ({
1822
1861
  root: {
1823
1862
  display: 'flex',
1824
1863
  alignItems: 'center',
1825
- '& div.MuiTabs-scroller': {
1826
- '& .MuiTabs-flexContainer': {
1827
- gridGap: theme.spacing(1.5),
1828
- },
1829
- },
1864
+ },
1865
+ flexContainer: {
1866
+ gridGap: theme.spacing(1.5),
1830
1867
  },
1831
1868
  }); });
1832
1869
 
@@ -1835,13 +1872,13 @@ var SelectableChipGroup = function (props) {
1835
1872
  var classes = useSelectableChipGroupStyles(props);
1836
1873
  return (React__default.createElement(Tabs, __assign$1({ TabIndicatorProps: {
1837
1874
  hidden: true,
1838
- }, variant: "scrollable", scrollButtons: "off", classes: { root: classes.root } }, muiProps),
1875
+ }, variant: "scrollable", scrollButtons: "off", classes: classes }, muiProps),
1839
1876
  React__default.createElement(Box, { minWidth: "1px" }),
1840
1877
  children,
1841
1878
  React__default.createElement(Box, { minWidth: "1px" })));
1842
1879
  };
1843
1880
 
1844
- var useStyles = makeStyles(function (_a) {
1881
+ var useStyles$2 = makeStyles$1(function (_a) {
1845
1882
  var spacing = _a.spacing;
1846
1883
  return ({
1847
1884
  root: {
@@ -1859,12 +1896,51 @@ var useStyles = makeStyles(function (_a) {
1859
1896
  });
1860
1897
  var SelectedMenuFiltersList = function (props) {
1861
1898
  var filters = props.filters, onChipClick = props.onChipClick;
1862
- var classes = useStyles();
1899
+ var classes = useStyles$2();
1863
1900
  return (React__default.createElement(React__default.Fragment, null, filters.map(function (filter, index) { return (React__default.createElement(Chip, { key: filter.name + "-" + index, classes: classes, deleteIcon: React__default.createElement(SvgXCircle, null), onDelete: function (event) { return onChipClick(filter, event); }, label: React__default.createElement(React__default.Fragment, null,
1864
1901
  React__default.createElement(ItemTag, { alt: filter.abbr, color: filter.color }, filter.abbr),
1865
1902
  React__default.createElement(Typography$1, { variant: "caption" }, filter.name)) })); })));
1866
1903
  };
1867
1904
 
1905
+ var MenuSectionGroup = forwardRef(function (props, ref) {
1906
+ var children = props.children, restProps = __rest$1(props, ["children"]);
1907
+ return (React__default.createElement(Box, __assign$1({ display: "flex", flexDirection: "column", gridGap: 40, marginBottom: 4 }, restProps, { ref: ref }, { "data-component-type": "menu-section-group" }), children));
1908
+ });
1909
+ MenuSectionGroup.displayName = 'MenuSectionGroup';
1910
+
1911
+ var useStyles$1 = makeStyles$1(function () { return ({
1912
+ title: {
1913
+ fontWeight: 400,
1914
+ fontSize: 20,
1915
+ lineHeight: '30px',
1916
+ },
1917
+ }); });
1918
+
1919
+ var MenuSection = forwardRef(function (props, ref) {
1920
+ var name = props.name, children = props.children, restProps = __rest$1(props, ["name", "children"]);
1921
+ var classes = useStyles$1();
1922
+ return (React__default.createElement(Box, __assign$1({}, restProps, { ref: ref }, { "data-component-type": "menu-section" }),
1923
+ React__default.createElement(Box, { marginTop: 1, marginBottom: 4 },
1924
+ React__default.createElement(Typography$1, { className: classes.title }, name)),
1925
+ children));
1926
+ });
1927
+ MenuSection.displayName = 'MenuSection';
1928
+
1929
+ var useStyles = makeStyles$1(function () { return ({
1930
+ main: {
1931
+ display: 'grid',
1932
+ // tune so that 2x columns hit at the md breakpoint
1933
+ gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))',
1934
+ gridGap: 32,
1935
+ },
1936
+ }); });
1937
+
1938
+ var MenuItemGroup = forwardRef(function (props, ref) {
1939
+ var classes = useStyles();
1940
+ return (React__default.createElement(Box, __assign$1({ className: classes.main }, { ref: ref }, { "data-component-type": "menu-item-group" }), props.children));
1941
+ });
1942
+ MenuItemGroup.displayName = 'MenuItemGroup';
1943
+
1868
1944
  var palette = {
1869
1945
  primary: {
1870
1946
  light: '#7B7FA3',
@@ -1979,5 +2055,5 @@ var orderingTheme = {
1979
2055
  props: props,
1980
2056
  };
1981
2057
 
1982
- export { Button$1 as Button, DishCard, DishCheckoutCard, DishDetailsReview, DishModifierCard, ItemTag, ItemTagGroup, LocationCard, MenuDropdown, MenuFilter, QuantityPicker, ReactionCounter, ReactionCounterGroup, SelectableChip, SelectableChipGroup, SelectedMenuFiltersList, StatusTag, orderingTheme };
2058
+ export { Button$1 as Button, DishCheckoutCard, DishDetailsReview, DishModifierCard, ItemTag, ItemTagGroup, LocationCard, MenuDropdown, MenuFilter, MenuItem, MenuItemGroup, MenuSection, MenuSectionGroup, QuantityPicker, ReactionCounter, ReactionCounterGroup, SelectableChip, SelectableChipGroup, SelectedMenuFiltersList, StatusTag, orderingTheme };
1983
2059
  //# sourceMappingURL=index.es.js.map