@popmenu/ordering-ui 0.85.0 → 0.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/Checkbox/Checkbox.d.ts +2 -0
- package/build/components/Checkbox/index.d.ts +1 -0
- package/build/components/DishModifierCard/DishModifierCardProps.d.ts +1 -0
- package/build/components/MenuItem/MenuItemPrice.d.ts +1 -1
- package/build/components/MenuItem/MenuItemProps.d.ts +4 -2
- package/build/components/Radio/Radio.d.ts +2 -0
- package/build/components/Radio/index.d.ts +1 -0
- package/build/components/StatusTag/StatusTagProps.d.ts +2 -0
- package/build/components/Switch/Switch.d.ts +2 -0
- package/build/components/Switch/index.d.ts +1 -0
- package/build/components/index.d.ts +3 -0
- package/build/index.es.js +319 -199
- package/build/index.es.js.map +1 -1
- package/build/index.js +320 -197
- package/build/index.js.map +1 -1
- package/build/theme/palette.d.ts +33 -2
- package/package.json +2 -2
package/build/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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
|
+
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$2, Radio as Radio$2, Menu, TextField, Tabs, Chip, DialogTitle as DialogTitle$1, IconButton as IconButton$1, withStyles, Switch as Switch$2 } 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, createContext, useContext, useState } from 'react';
|
|
@@ -104,50 +104,60 @@ var Button$1 = forwardRef(function (props, ref) {
|
|
|
104
104
|
});
|
|
105
105
|
Button$1.displayName = 'Button';
|
|
106
106
|
|
|
107
|
-
var useDishCardStyles = makeStyles(function (theme) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
107
|
+
var useDishCardStyles = makeStyles(function (theme) {
|
|
108
|
+
var _a, _b;
|
|
109
|
+
return ({
|
|
110
|
+
cardActionArea: (_a = {
|
|
111
|
+
display: 'flex',
|
|
112
|
+
gridGap: 16,
|
|
113
|
+
height: '100%'
|
|
114
|
+
},
|
|
115
|
+
_a[theme.breakpoints.up('lg')] = {
|
|
116
|
+
border: '1px solid #E0E0E0',
|
|
117
|
+
borderRadius: theme.spacing(2),
|
|
118
|
+
padding: theme.spacing(2),
|
|
119
|
+
},
|
|
120
|
+
_a),
|
|
121
|
+
card: (_b = {},
|
|
122
|
+
_b[theme.breakpoints.down('md')] = {
|
|
123
|
+
'&:after': {
|
|
124
|
+
content: '""',
|
|
125
|
+
position: 'absolute',
|
|
126
|
+
backgroundColor: '#E0E0E0',
|
|
127
|
+
width: '100%',
|
|
128
|
+
height: 1,
|
|
129
|
+
bottom: -16,
|
|
130
|
+
left: 0,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
_b.height = 185,
|
|
134
|
+
_b.position = 'relative',
|
|
135
|
+
_b.overflow = 'visible',
|
|
136
|
+
_b),
|
|
137
|
+
cardTitle: {
|
|
138
|
+
fontWeight: 500,
|
|
139
|
+
fontSize: 18,
|
|
140
|
+
lineHeight: '27px',
|
|
141
|
+
color: theme.palette.grey[900],
|
|
142
|
+
'-webkit-line-clamp': 2,
|
|
143
|
+
display: '-webkit-box',
|
|
144
|
+
'-webkit-box-orient': 'vertical',
|
|
145
|
+
textOverflow: 'ellipsis',
|
|
146
|
+
overflow: 'hidden',
|
|
123
147
|
},
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
}); });
|
|
148
|
+
cardDescription: {
|
|
149
|
+
fontWeight: 400,
|
|
150
|
+
fontSize: 14,
|
|
151
|
+
lineHeight: '20px',
|
|
152
|
+
color: theme.palette.grey[700],
|
|
153
|
+
'-webkit-line-clamp': 2,
|
|
154
|
+
display: '-webkit-box',
|
|
155
|
+
'-webkit-box-orient': 'vertical',
|
|
156
|
+
textOverflow: 'ellipsis',
|
|
157
|
+
overflow: 'hidden',
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
});
|
|
151
161
|
|
|
152
162
|
var useStyles$6 = makeStyles$1(function () { return ({
|
|
153
163
|
img: {
|
|
@@ -312,6 +322,27 @@ function SvgHeart(props) {
|
|
|
312
322
|
})));
|
|
313
323
|
}
|
|
314
324
|
|
|
325
|
+
var _g$1c;
|
|
326
|
+
|
|
327
|
+
function _extends$2d() { _extends$2d = 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$2d.apply(this, arguments); }
|
|
328
|
+
|
|
329
|
+
function SvgLock(props) {
|
|
330
|
+
return /*#__PURE__*/React.createElement("svg", _extends$2d({
|
|
331
|
+
viewBox: "0 0 16 16",
|
|
332
|
+
fill: "none",
|
|
333
|
+
strokeLinecap: "round",
|
|
334
|
+
strokeLinejoin: "round",
|
|
335
|
+
width: "1em",
|
|
336
|
+
height: "1em"
|
|
337
|
+
}, props), _g$1c || (_g$1c = /*#__PURE__*/React.createElement("g", {
|
|
338
|
+
stroke: "currentColor"
|
|
339
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
340
|
+
d: "M12.667 7.333H3.333C2.597 7.333 2 7.93 2 8.668v4.667c0 .736.597 1.333 1.333 1.333h9.334c.736 0 1.333-.597 1.333-1.333V8.667c0-.737-.597-1.333-1.333-1.333z"
|
|
341
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
342
|
+
d: "M4.667 7.333V4.668a3.333 3.333 0 116.666 0v2.667"
|
|
343
|
+
}))));
|
|
344
|
+
}
|
|
345
|
+
|
|
315
346
|
var _g$19, _defs$C;
|
|
316
347
|
|
|
317
348
|
function _extends$24() { _extends$24 = 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$24.apply(this, arguments); }
|
|
@@ -734,12 +765,12 @@ var Button = forwardRef(function (props, ref) {
|
|
|
734
765
|
});
|
|
735
766
|
Button.displayName = 'Button';
|
|
736
767
|
|
|
737
|
-
var Checkbox = forwardRef(function (props, ref) {
|
|
768
|
+
var Checkbox$1 = forwardRef(function (props, ref) {
|
|
738
769
|
var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
|
|
739
770
|
var control = React__default.createElement(MuiCheckbox, __assign({ disabled: label ? undefined : disabled }, muiProps));
|
|
740
771
|
return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
|
|
741
772
|
});
|
|
742
|
-
Checkbox.displayName = 'Checkbox';
|
|
773
|
+
Checkbox$1.displayName = 'Checkbox';
|
|
743
774
|
|
|
744
775
|
var getBackground = function (theme) { return function (props) {
|
|
745
776
|
var variant = props.variant, severity = props.severity;
|
|
@@ -1009,12 +1040,12 @@ Paper.defaultProps = {
|
|
|
1009
1040
|
legacyStyles: false,
|
|
1010
1041
|
};
|
|
1011
1042
|
|
|
1012
|
-
var Radio = forwardRef(function (props, ref) {
|
|
1043
|
+
var Radio$1 = forwardRef(function (props, ref) {
|
|
1013
1044
|
var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
|
|
1014
1045
|
var control = React__default.createElement(MuiRadio, __assign({ disabled: label ? undefined : disabled }, muiProps));
|
|
1015
1046
|
return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
|
|
1016
1047
|
});
|
|
1017
|
-
Radio.displayName = 'Radio';
|
|
1048
|
+
Radio$1.displayName = 'Radio';
|
|
1018
1049
|
|
|
1019
1050
|
makeStyles(function () { return ({
|
|
1020
1051
|
textfield: {
|
|
@@ -1054,13 +1085,13 @@ var useSwitchStyles = makeStyles(function (theme) { return ({
|
|
|
1054
1085
|
track: {},
|
|
1055
1086
|
}); });
|
|
1056
1087
|
|
|
1057
|
-
var Switch = forwardRef(function (props, ref) {
|
|
1088
|
+
var Switch$1 = forwardRef(function (props, ref) {
|
|
1058
1089
|
var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
|
|
1059
1090
|
var classes = useSwitchStyles(props);
|
|
1060
1091
|
var control = React__default.createElement(MuiSwitch, __assign({ classes: classes, disabled: label ? undefined : disabled }, muiProps));
|
|
1061
1092
|
return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
|
|
1062
1093
|
});
|
|
1063
|
-
Switch.displayName = 'Switch';
|
|
1094
|
+
Switch$1.displayName = 'Switch';
|
|
1064
1095
|
|
|
1065
1096
|
var useToggleButtonStyles = makeStyles(function (theme) { return ({
|
|
1066
1097
|
root: {
|
|
@@ -1181,18 +1212,18 @@ var useStyles$4 = makeStyles$1(function (_a) {
|
|
|
1181
1212
|
plusIcon: {
|
|
1182
1213
|
height: '100%',
|
|
1183
1214
|
padding: spacing(0.25),
|
|
1184
|
-
background: palette.info.main,
|
|
1185
|
-
color: palette.info.contrastText,
|
|
1215
|
+
background: function (props) { return (props.available ? palette.info.main : 'none'); },
|
|
1216
|
+
color: function (props) { return (props.available ? palette.info.contrastText : palette.warning.main); },
|
|
1186
1217
|
borderRadius: '30px',
|
|
1187
1218
|
marginRight: spacing(1),
|
|
1188
1219
|
},
|
|
1189
1220
|
});
|
|
1190
1221
|
});
|
|
1191
1222
|
var MenuItemPrice = function (props) {
|
|
1192
|
-
var classes = useStyles$4();
|
|
1223
|
+
var classes = useStyles$4(props);
|
|
1193
1224
|
return (React__default.createElement(Box, { display: "flex", alignItems: "center" },
|
|
1194
1225
|
React__default.createElement(Box, { display: "flex", className: classes.plusIcon },
|
|
1195
|
-
React__default.createElement(Icon, { icon: SvgPlus, size: "medium" })),
|
|
1226
|
+
React__default.createElement(Icon, { icon: props.available ? SvgPlus : SvgLock, size: "medium" })),
|
|
1196
1227
|
React__default.createElement(Typography$1, null, props.price)));
|
|
1197
1228
|
};
|
|
1198
1229
|
|
|
@@ -1234,8 +1265,112 @@ var MenuItemTags = function (props) {
|
|
|
1234
1265
|
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)); })));
|
|
1235
1266
|
};
|
|
1236
1267
|
|
|
1268
|
+
var useStatusTagStyles = makeStyles(function (theme) { return ({
|
|
1269
|
+
root: {
|
|
1270
|
+
borderRadius: '5px',
|
|
1271
|
+
display: 'flex',
|
|
1272
|
+
padding: theme.spacing(1),
|
|
1273
|
+
alignItems: 'center',
|
|
1274
|
+
justifyContent: 'center',
|
|
1275
|
+
width: 'fit-content',
|
|
1276
|
+
},
|
|
1277
|
+
filled: {
|
|
1278
|
+
backgroundColor: theme.palette.grey[100],
|
|
1279
|
+
color: theme.palette.grey[900],
|
|
1280
|
+
},
|
|
1281
|
+
outlined: {
|
|
1282
|
+
border: "1px solid var(--surfaces-card-stroke, " + theme.palette.grey[900] + ")",
|
|
1283
|
+
},
|
|
1284
|
+
small: {
|
|
1285
|
+
padding: theme.spacing(0.25, 0.75),
|
|
1286
|
+
},
|
|
1287
|
+
default: {
|
|
1288
|
+
color: theme.palette.grey[900],
|
|
1289
|
+
},
|
|
1290
|
+
warning: {
|
|
1291
|
+
borderColor: theme.palette.warning.dark,
|
|
1292
|
+
color: theme.palette.warning.dark,
|
|
1293
|
+
},
|
|
1294
|
+
error: {
|
|
1295
|
+
borderColor: theme.palette.error.main,
|
|
1296
|
+
color: theme.palette.error.main,
|
|
1297
|
+
},
|
|
1298
|
+
}); });
|
|
1299
|
+
|
|
1300
|
+
var classnames = {exports: {}};
|
|
1301
|
+
|
|
1302
|
+
/*!
|
|
1303
|
+
Copyright (c) 2018 Jed Watson.
|
|
1304
|
+
Licensed under the MIT License (MIT), see
|
|
1305
|
+
http://jedwatson.github.io/classnames
|
|
1306
|
+
*/
|
|
1307
|
+
|
|
1308
|
+
(function (module) {
|
|
1309
|
+
/* global define */
|
|
1310
|
+
|
|
1311
|
+
(function () {
|
|
1312
|
+
|
|
1313
|
+
var hasOwn = {}.hasOwnProperty;
|
|
1314
|
+
|
|
1315
|
+
function classNames() {
|
|
1316
|
+
var classes = [];
|
|
1317
|
+
|
|
1318
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
1319
|
+
var arg = arguments[i];
|
|
1320
|
+
if (!arg) continue;
|
|
1321
|
+
|
|
1322
|
+
var argType = typeof arg;
|
|
1323
|
+
|
|
1324
|
+
if (argType === 'string' || argType === 'number') {
|
|
1325
|
+
classes.push(arg);
|
|
1326
|
+
} else if (Array.isArray(arg)) {
|
|
1327
|
+
if (arg.length) {
|
|
1328
|
+
var inner = classNames.apply(null, arg);
|
|
1329
|
+
if (inner) {
|
|
1330
|
+
classes.push(inner);
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
} else if (argType === 'object') {
|
|
1334
|
+
if (arg.toString === Object.prototype.toString) {
|
|
1335
|
+
for (var key in arg) {
|
|
1336
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1337
|
+
classes.push(key);
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
} else {
|
|
1341
|
+
classes.push(arg.toString());
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
return classes.join(' ');
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
if (module.exports) {
|
|
1350
|
+
classNames.default = classNames;
|
|
1351
|
+
module.exports = classNames;
|
|
1352
|
+
} else {
|
|
1353
|
+
window.classNames = classNames;
|
|
1354
|
+
}
|
|
1355
|
+
}());
|
|
1356
|
+
}(classnames));
|
|
1357
|
+
|
|
1358
|
+
var classNames = classnames.exports;
|
|
1359
|
+
|
|
1360
|
+
var StatusTag = function (props) {
|
|
1361
|
+
var variant = props.variant, label = props.label, _a = props.size, size = _a === void 0 ? 'md' : _a, _b = props.color, color = _b === void 0 ? 'default' : _b;
|
|
1362
|
+
var classes = useStatusTagStyles(props);
|
|
1363
|
+
return (React__default.createElement(Box, { className: classNames([classes.root, classes[color], classes[variant], size === 'sm' ? classes.small : '']) },
|
|
1364
|
+
React__default.createElement(Typography, { variant: "caption" }, label)));
|
|
1365
|
+
};
|
|
1366
|
+
StatusTag.defaultProps = {
|
|
1367
|
+
color: 'default',
|
|
1368
|
+
error: false,
|
|
1369
|
+
};
|
|
1370
|
+
StatusTag.displayName = 'StatusTag';
|
|
1371
|
+
|
|
1237
1372
|
var MenuItem = forwardRef(function (props, ref) {
|
|
1238
|
-
var onClick = props.onClick, id = props.id, title = props.title, description = props.description;
|
|
1373
|
+
var onClick = props.onClick, id = props.id, title = props.title, description = props.description, isOutOfStock = props.isOutOfStock;
|
|
1239
1374
|
var classes = useDishCardStyles(props);
|
|
1240
1375
|
var handleClick = function (event) {
|
|
1241
1376
|
onClick(id, event);
|
|
@@ -1243,11 +1378,13 @@ var MenuItem = forwardRef(function (props, ref) {
|
|
|
1243
1378
|
return (React__default.createElement(Card, { className: classes.card, ref: ref, elevation: 0, "data-component-type": "menu-item" },
|
|
1244
1379
|
React__default.createElement(CardActionArea, { className: classes.cardActionArea, onClick: handleClick },
|
|
1245
1380
|
React__default.createElement(MenuItemInfo, null,
|
|
1246
|
-
React__default.createElement(
|
|
1381
|
+
React__default.createElement(Box, { display: "flex", gridGap: 8, alignItems: "center" },
|
|
1382
|
+
React__default.createElement(Typography$1, { className: classes.cardTitle }, title),
|
|
1383
|
+
isOutOfStock && React__default.createElement(StatusTag, { color: "warning", label: "Out of stock", variant: "outlined", size: "sm" })),
|
|
1247
1384
|
React__default.createElement(Typography$1, { className: classes.cardDescription, paragraph: true }, description),
|
|
1248
1385
|
React__default.createElement(MenuItemReactions, { likeCount: props.likeCount, reviewCount: props.reviewCount }),
|
|
1249
1386
|
React__default.createElement(Box, { display: "flex", justifyContent: "space-between", alignItems: "end", flexGrow: 1 },
|
|
1250
|
-
React__default.createElement(MenuItemPrice, { price: props.price }),
|
|
1387
|
+
React__default.createElement(MenuItemPrice, { price: props.price, available: props.available }),
|
|
1251
1388
|
React__default.createElement(MenuItemTags, { itemTags: props.itemTags }))),
|
|
1252
1389
|
React__default.createElement(MenuItemImg, { image: props.image }))));
|
|
1253
1390
|
});
|
|
@@ -1436,117 +1573,21 @@ var useLabelStyles = makeStyles(function (theme) { return ({
|
|
|
1436
1573
|
label: {
|
|
1437
1574
|
margin: theme.spacing(0.5, 0),
|
|
1438
1575
|
},
|
|
1439
|
-
|
|
1440
|
-
color: theme.palette.grey[700],
|
|
1441
|
-
},
|
|
1442
|
-
}); });
|
|
1443
|
-
|
|
1444
|
-
var useStatusTagStyles = makeStyles(function (theme) { return ({
|
|
1445
|
-
root: {
|
|
1446
|
-
borderRadius: '5px',
|
|
1447
|
-
display: 'flex',
|
|
1448
|
-
padding: theme.spacing(1),
|
|
1449
|
-
alignItems: 'center',
|
|
1450
|
-
justifyContent: 'center',
|
|
1451
|
-
width: 'fit-content',
|
|
1452
|
-
},
|
|
1453
|
-
filled: {
|
|
1454
|
-
backgroundColor: theme.palette.grey[100],
|
|
1455
|
-
color: theme.palette.grey[900],
|
|
1456
|
-
},
|
|
1457
|
-
outlined: {
|
|
1458
|
-
border: "1px solid var(--surfaces-card-stroke, " + theme.palette.grey[900] + ")",
|
|
1459
|
-
},
|
|
1460
|
-
default: {
|
|
1461
|
-
color: theme.palette.grey[900],
|
|
1462
|
-
},
|
|
1463
|
-
warning: {
|
|
1464
|
-
borderColor: theme.palette.warning.dark,
|
|
1576
|
+
outOfStock: {
|
|
1465
1577
|
color: theme.palette.warning.dark,
|
|
1466
1578
|
},
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
color: theme.palette.error.main,
|
|
1579
|
+
price: {
|
|
1580
|
+
color: theme.palette.grey[700],
|
|
1470
1581
|
},
|
|
1471
1582
|
}); });
|
|
1472
1583
|
|
|
1473
|
-
var classnames = {exports: {}};
|
|
1474
|
-
|
|
1475
|
-
/*!
|
|
1476
|
-
Copyright (c) 2018 Jed Watson.
|
|
1477
|
-
Licensed under the MIT License (MIT), see
|
|
1478
|
-
http://jedwatson.github.io/classnames
|
|
1479
|
-
*/
|
|
1480
|
-
|
|
1481
|
-
(function (module) {
|
|
1482
|
-
/* global define */
|
|
1483
|
-
|
|
1484
|
-
(function () {
|
|
1485
|
-
|
|
1486
|
-
var hasOwn = {}.hasOwnProperty;
|
|
1487
|
-
|
|
1488
|
-
function classNames() {
|
|
1489
|
-
var classes = [];
|
|
1490
|
-
|
|
1491
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
1492
|
-
var arg = arguments[i];
|
|
1493
|
-
if (!arg) continue;
|
|
1494
|
-
|
|
1495
|
-
var argType = typeof arg;
|
|
1496
|
-
|
|
1497
|
-
if (argType === 'string' || argType === 'number') {
|
|
1498
|
-
classes.push(arg);
|
|
1499
|
-
} else if (Array.isArray(arg)) {
|
|
1500
|
-
if (arg.length) {
|
|
1501
|
-
var inner = classNames.apply(null, arg);
|
|
1502
|
-
if (inner) {
|
|
1503
|
-
classes.push(inner);
|
|
1504
|
-
}
|
|
1505
|
-
}
|
|
1506
|
-
} else if (argType === 'object') {
|
|
1507
|
-
if (arg.toString === Object.prototype.toString) {
|
|
1508
|
-
for (var key in arg) {
|
|
1509
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1510
|
-
classes.push(key);
|
|
1511
|
-
}
|
|
1512
|
-
}
|
|
1513
|
-
} else {
|
|
1514
|
-
classes.push(arg.toString());
|
|
1515
|
-
}
|
|
1516
|
-
}
|
|
1517
|
-
}
|
|
1518
|
-
|
|
1519
|
-
return classes.join(' ');
|
|
1520
|
-
}
|
|
1521
|
-
|
|
1522
|
-
if (module.exports) {
|
|
1523
|
-
classNames.default = classNames;
|
|
1524
|
-
module.exports = classNames;
|
|
1525
|
-
} else {
|
|
1526
|
-
window.classNames = classNames;
|
|
1527
|
-
}
|
|
1528
|
-
}());
|
|
1529
|
-
}(classnames));
|
|
1530
|
-
|
|
1531
|
-
var classNames = classnames.exports;
|
|
1532
|
-
|
|
1533
|
-
var StatusTag = function (props) {
|
|
1534
|
-
var variant = props.variant, label = props.label, _a = props.color, color = _a === void 0 ? 'default' : _a;
|
|
1535
|
-
var classes = useStatusTagStyles(props);
|
|
1536
|
-
return (React__default.createElement(Box, { className: classNames([classes.root, classes[color], classes[variant]]) },
|
|
1537
|
-
React__default.createElement(Typography, { variant: "caption" }, label)));
|
|
1538
|
-
};
|
|
1539
|
-
StatusTag.defaultProps = {
|
|
1540
|
-
color: 'default',
|
|
1541
|
-
error: false,
|
|
1542
|
-
};
|
|
1543
|
-
StatusTag.displayName = 'StatusTag';
|
|
1544
|
-
|
|
1545
1584
|
var Label = function (props) {
|
|
1546
|
-
var name = props.name, price = props.price, disabled = props.disabled;
|
|
1585
|
+
var name = props.name, price = props.price, disabled = props.disabled, isOutOfStock = props.isOutOfStock;
|
|
1547
1586
|
var classes = useLabelStyles();
|
|
1548
1587
|
return (React__default.createElement(Box, { display: "flex", flexDirection: "column", className: classes.label },
|
|
1549
|
-
React__default.createElement(
|
|
1588
|
+
React__default.createElement(Box, { display: "flex", alignItems: "center", gridGap: 8 },
|
|
1589
|
+
React__default.createElement(Typography$1, null, name),
|
|
1590
|
+
!isOutOfStock && disabled && (React__default.createElement(Typography$1, { variant: "caption", className: classes.outOfStock }, "Out of stock"))),
|
|
1550
1591
|
price && React__default.createElement(Typography$1, { className: !disabled ? classes.price : '' },
|
|
1551
1592
|
"+ ",
|
|
1552
1593
|
price)));
|
|
@@ -1568,9 +1609,9 @@ var CheckboxGroup = function (props) {
|
|
|
1568
1609
|
};
|
|
1569
1610
|
return (React__default.createElement(Box, { display: "flex", flexDirection: "column" }, modifiers.map(function (modifier, index) {
|
|
1570
1611
|
var targetValue = value === null || value === void 0 ? void 0 : value.find(function (v) { return v.id == modifier.id; });
|
|
1571
|
-
return (React__default.createElement(FormControlLabel$1, { key: index, value: modifier.id, control: React__default.createElement(Checkbox$
|
|
1612
|
+
return (React__default.createElement(FormControlLabel$1, { key: index, value: modifier.id, control: React__default.createElement(Checkbox$2, { className: classes.radio, disabled: (!targetValue && disableNewSelections) || isOutOfStock || modifier.outOfStock }), label: React__default.createElement(Label, { name: modifier.name, price: modifier.price
|
|
1572
1613
|
? "" + (appContext && appContext.currencySymbol) + Number(modifier.price).toFixed(2)
|
|
1573
|
-
: null, disabled: isOutOfStock }), className: classes.root, checked: !!targetValue, onChange: handleChange }));
|
|
1614
|
+
: null, disabled: isOutOfStock || modifier.outOfStock, isOutOfStock: isOutOfStock }), className: classes.root, checked: !!targetValue, onChange: handleChange }));
|
|
1574
1615
|
})));
|
|
1575
1616
|
};
|
|
1576
1617
|
var RadioGroup = function (props) {
|
|
@@ -1588,7 +1629,7 @@ var RadioGroup = function (props) {
|
|
|
1588
1629
|
},
|
|
1589
1630
|
]);
|
|
1590
1631
|
};
|
|
1591
|
-
return (React__default.createElement(MuiRadioGroup, { name: "selectedModifiers", value: value ? value[0].id : '', onChange: handleChange }, modifiers.map(function (modifier, index) { return (React__default.createElement(FormControlLabel$1, { key: index, value: modifier.id, control: React__default.createElement(Radio$
|
|
1632
|
+
return (React__default.createElement(MuiRadioGroup, { name: "selectedModifiers", value: value ? value[0].id : '', onChange: handleChange }, modifiers.map(function (modifier, index) { return (React__default.createElement(FormControlLabel$1, { key: index, value: modifier.id, control: React__default.createElement(Radio$2, { className: classes.radio, disabled: isOutOfStock || modifier.outOfStock }), label: React__default.createElement(Label, { name: modifier.name, price: modifier.price ? "" + (appContext && appContext.currencySymbol) + Number(modifier.price).toFixed(2) : null, disabled: isOutOfStock || modifier.outOfStock, isOutOfStock: isOutOfStock }) })); })));
|
|
1592
1633
|
};
|
|
1593
1634
|
|
|
1594
1635
|
var ModifierOptionsControl = function (props) {
|
|
@@ -1606,17 +1647,18 @@ var ModifierOptionsControl = function (props) {
|
|
|
1606
1647
|
var DishModifierCard = function (props) {
|
|
1607
1648
|
var name = props.name, disableNewSelections = props.disableNewSelections, modifiers = props.modifiers, value = props.value, messages = props.messages, onChange = props.onChange, type = props.type, error = props.error, isRequired = props.isRequired, isOutOfStock = props.isOutOfStock;
|
|
1608
1649
|
var optionalText = messages.optionalText, outOfStockText = messages.outOfStockText, requiredText = messages.requiredText, helperText = messages.helperText;
|
|
1650
|
+
var isFullyOutOfStock = isOutOfStock || !modifiers.some(function (modifier) { return !modifier.outOfStock; });
|
|
1609
1651
|
var classes = useDishModifierCardStyles();
|
|
1610
1652
|
var color = 'default';
|
|
1611
1653
|
switch (true) {
|
|
1612
1654
|
case error:
|
|
1613
1655
|
color = 'error';
|
|
1614
|
-
case
|
|
1656
|
+
case isFullyOutOfStock:
|
|
1615
1657
|
color = 'warning';
|
|
1616
1658
|
}
|
|
1617
1659
|
var label = optionalText;
|
|
1618
1660
|
switch (true) {
|
|
1619
|
-
case
|
|
1661
|
+
case isFullyOutOfStock:
|
|
1620
1662
|
label = outOfStockText;
|
|
1621
1663
|
break;
|
|
1622
1664
|
case isRequired:
|
|
@@ -1628,11 +1670,11 @@ var DishModifierCard = function (props) {
|
|
|
1628
1670
|
React__default.createElement(Box, { className: classes.nameContainer },
|
|
1629
1671
|
React__default.createElement(Typography, { className: classes.name }, name),
|
|
1630
1672
|
React__default.createElement(Box, { className: classes.statusTagContainer },
|
|
1631
|
-
React__default.createElement(StatusTag, { variant: isRequired ||
|
|
1632
|
-
React__default.createElement(Typography, { variant: "subtitle1", className: error ? classes.error : undefined }, helperText)),
|
|
1673
|
+
React__default.createElement(StatusTag, { variant: isRequired || isFullyOutOfStock ? 'outlined' : 'filled', label: label, color: color }))),
|
|
1674
|
+
!isFullyOutOfStock && (React__default.createElement(Typography, { variant: "subtitle1", className: error ? classes.error : undefined }, helperText))),
|
|
1633
1675
|
React__default.createElement(Box, null,
|
|
1634
1676
|
React__default.createElement(FormControl, null,
|
|
1635
|
-
React__default.createElement(ModifierOptionsControl, { type: type, modifiers: modifiers, value: value, onChange: onChange, disableNewSelections: disableNewSelections, isOutOfStock:
|
|
1677
|
+
React__default.createElement(ModifierOptionsControl, { type: type, modifiers: modifiers, value: value, onChange: onChange, disableNewSelections: disableNewSelections, isOutOfStock: isFullyOutOfStock })))));
|
|
1636
1678
|
};
|
|
1637
1679
|
DishModifierCard.displayName = 'DishModifierCard';
|
|
1638
1680
|
|
|
@@ -1744,21 +1786,29 @@ function SvgRestaurantMenuIcon(props) {
|
|
|
1744
1786
|
})))));
|
|
1745
1787
|
}
|
|
1746
1788
|
|
|
1747
|
-
var useMenuDropdownStyles = makeStyles(function (theme) {
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1789
|
+
var useMenuDropdownStyles = makeStyles(function (theme) {
|
|
1790
|
+
var _a;
|
|
1791
|
+
return ({
|
|
1792
|
+
formControl: (_a = {},
|
|
1793
|
+
_a[theme.breakpoints.up('lg')] = {
|
|
1794
|
+
alignSelf: 'start',
|
|
1795
|
+
},
|
|
1796
|
+
_a),
|
|
1797
|
+
select: {
|
|
1798
|
+
'& .MuiSelect-root': {
|
|
1799
|
+
color: '#212121',
|
|
1800
|
+
padding: theme.spacing(1, 0.5, 1, 0.5),
|
|
1801
|
+
zIndex: 10,
|
|
1802
|
+
},
|
|
1753
1803
|
},
|
|
1754
|
-
}
|
|
1755
|
-
});
|
|
1804
|
+
});
|
|
1805
|
+
});
|
|
1756
1806
|
|
|
1757
1807
|
var MenuDropdown = function (props) {
|
|
1758
1808
|
var menuOptions = props.menuOptions, onSelect = props.onSelect, selectedOptionId = props.selectedOptionId;
|
|
1759
1809
|
var classes = useMenuDropdownStyles(props);
|
|
1760
1810
|
var _a = useState(false), open = _a[0], setOpen = _a[1];
|
|
1761
|
-
return (React__default.createElement(FormControl, { hiddenLabel: true },
|
|
1811
|
+
return (React__default.createElement(FormControl, { hiddenLabel: true, classes: { root: classes.formControl } },
|
|
1762
1812
|
React__default.createElement(Select, { open: open, value: selectedOptionId, labelId: "menu-dropdown-select", onClick: function () { return setOpen(!open); }, disableUnderline: true, onChange: function (event) { return onSelect(event.target.value); }, fullWidth: true, startAdornment: React__default.createElement(InputAdornment, { position: "start" },
|
|
1763
1813
|
React__default.createElement(Icon, { icon: SvgRestaurantMenuIcon, size: "large" })), IconComponent: function () { return (React__default.createElement(InputAdornment, { position: "end" },
|
|
1764
1814
|
React__default.createElement(Icon, { color: "#0076CB", icon: open ? SvgChevronUp : SvgChevronDown, size: "large" }))); }, MenuProps: {
|
|
@@ -1924,25 +1974,29 @@ var SelectableChip = function (props) {
|
|
|
1924
1974
|
} }, props)));
|
|
1925
1975
|
};
|
|
1926
1976
|
|
|
1927
|
-
var useSelectableChipGroupStyles = makeStyles(function (
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1977
|
+
var useSelectableChipGroupStyles = makeStyles(function (_a) {
|
|
1978
|
+
var _b;
|
|
1979
|
+
var breakpoints = _a.breakpoints, spacing = _a.spacing;
|
|
1980
|
+
return ({
|
|
1981
|
+
flexContainer: (_b = {},
|
|
1982
|
+
_b[breakpoints.down('md')] = {
|
|
1983
|
+
padding: spacing(0, 2),
|
|
1984
|
+
},
|
|
1985
|
+
_b[breakpoints.up('lg')] = {
|
|
1986
|
+
alignItems: 'flex-start',
|
|
1987
|
+
flexDirection: 'column',
|
|
1988
|
+
},
|
|
1989
|
+
_b.gridGap = spacing(1.5),
|
|
1990
|
+
_b),
|
|
1991
|
+
});
|
|
1992
|
+
});
|
|
1936
1993
|
|
|
1937
1994
|
var SelectableChipGroup = function (props) {
|
|
1938
1995
|
var children = props.children, muiProps = __rest$1(props, ["children"]);
|
|
1939
1996
|
var classes = useSelectableChipGroupStyles(props);
|
|
1940
1997
|
return (React__default.createElement(Tabs, __assign$1({ TabIndicatorProps: {
|
|
1941
1998
|
hidden: true,
|
|
1942
|
-
}, variant: "scrollable", scrollButtons: "off", classes: classes }, muiProps),
|
|
1943
|
-
React__default.createElement(Box, { minWidth: "1px" }),
|
|
1944
|
-
children,
|
|
1945
|
-
React__default.createElement(Box, { minWidth: "1px" })));
|
|
1999
|
+
}, variant: "scrollable", scrollButtons: "off", classes: classes }, muiProps), children));
|
|
1946
2000
|
};
|
|
1947
2001
|
|
|
1948
2002
|
var useStyles$3 = makeStyles$1(function (_a) {
|
|
@@ -1993,14 +2047,22 @@ var MenuSection = forwardRef(function (props, ref) {
|
|
|
1993
2047
|
});
|
|
1994
2048
|
MenuSection.displayName = 'MenuSection';
|
|
1995
2049
|
|
|
1996
|
-
var useStyles$1 = makeStyles$1(function () {
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
}
|
|
2050
|
+
var useStyles$1 = makeStyles$1(function (_a) {
|
|
2051
|
+
var _b;
|
|
2052
|
+
var breakpoints = _a.breakpoints;
|
|
2053
|
+
return ({
|
|
2054
|
+
main: (_b = {},
|
|
2055
|
+
_b[breakpoints.down('md')] = {
|
|
2056
|
+
gridTemplateColumns: '1fr',
|
|
2057
|
+
},
|
|
2058
|
+
_b[breakpoints.up('lg')] = {
|
|
2059
|
+
gridTemplateColumns: 'repeat(2, minmax(280px, 1fr))',
|
|
2060
|
+
},
|
|
2061
|
+
_b.display = 'grid',
|
|
2062
|
+
_b.gridGap = 32,
|
|
2063
|
+
_b),
|
|
2064
|
+
});
|
|
2065
|
+
});
|
|
2004
2066
|
|
|
2005
2067
|
var MenuItemGroup = forwardRef(function (props, ref) {
|
|
2006
2068
|
var classes = useStyles$1();
|
|
@@ -2030,6 +2092,50 @@ var DialogSection = function (props) {
|
|
|
2030
2092
|
return (React__default.createElement(Box, { paddingTop: 4, paddingBottom: props.borderBottom ? 4 : 0, paddingX: props.edgeToEdge ? 0 : 2, borderBottom: props.borderBottom ? '1px solid #E0E0E0' : undefined }, props.children));
|
|
2031
2093
|
};
|
|
2032
2094
|
|
|
2095
|
+
var Switch = withStyles(function (_a) {
|
|
2096
|
+
var palette = _a.palette;
|
|
2097
|
+
return ({
|
|
2098
|
+
checked: {
|
|
2099
|
+
'& $thumb': {
|
|
2100
|
+
backgroundColor: palette.success.main,
|
|
2101
|
+
},
|
|
2102
|
+
'&& + $track': {
|
|
2103
|
+
backgroundColor: palette.success.main,
|
|
2104
|
+
opacity: 0.5,
|
|
2105
|
+
},
|
|
2106
|
+
},
|
|
2107
|
+
switchBase: {
|
|
2108
|
+
color: palette.grey[300],
|
|
2109
|
+
},
|
|
2110
|
+
thumb: {},
|
|
2111
|
+
track: {},
|
|
2112
|
+
});
|
|
2113
|
+
})(Switch$2);
|
|
2114
|
+
|
|
2115
|
+
var Checkbox = withStyles(function (_a) {
|
|
2116
|
+
var palette = _a.palette;
|
|
2117
|
+
return ({
|
|
2118
|
+
checked: {},
|
|
2119
|
+
root: {
|
|
2120
|
+
'&$checked': {
|
|
2121
|
+
color: palette.info.main,
|
|
2122
|
+
},
|
|
2123
|
+
},
|
|
2124
|
+
});
|
|
2125
|
+
})(Checkbox$2);
|
|
2126
|
+
|
|
2127
|
+
var Radio = withStyles(function (_a) {
|
|
2128
|
+
var palette = _a.palette;
|
|
2129
|
+
return ({
|
|
2130
|
+
checked: {},
|
|
2131
|
+
root: {
|
|
2132
|
+
'&$checked': {
|
|
2133
|
+
color: palette.info.main,
|
|
2134
|
+
},
|
|
2135
|
+
},
|
|
2136
|
+
});
|
|
2137
|
+
})(Radio$2);
|
|
2138
|
+
|
|
2033
2139
|
var palette = {
|
|
2034
2140
|
primary: {
|
|
2035
2141
|
light: '#7B7FA3',
|
|
@@ -2074,6 +2180,9 @@ var overrides = {
|
|
|
2074
2180
|
outlined: {
|
|
2075
2181
|
padding: 'inherit',
|
|
2076
2182
|
},
|
|
2183
|
+
textPrimary: {
|
|
2184
|
+
color: '#0076CB',
|
|
2185
|
+
},
|
|
2077
2186
|
},
|
|
2078
2187
|
MuiDialogTitle: {
|
|
2079
2188
|
root: {
|
|
@@ -2101,6 +2210,17 @@ var overrides = {
|
|
|
2101
2210
|
boxShadow: '-4px 0px 8px 0px #0000001A',
|
|
2102
2211
|
},
|
|
2103
2212
|
},
|
|
2213
|
+
MuiDialog: {
|
|
2214
|
+
paper: {
|
|
2215
|
+
minWidth: 500,
|
|
2216
|
+
},
|
|
2217
|
+
paperWidthMd: {
|
|
2218
|
+
minWidth: 640,
|
|
2219
|
+
},
|
|
2220
|
+
paperFullScreen: {
|
|
2221
|
+
minWidth: 'unset',
|
|
2222
|
+
},
|
|
2223
|
+
},
|
|
2104
2224
|
};
|
|
2105
2225
|
|
|
2106
2226
|
var props = {
|
|
@@ -2177,5 +2297,5 @@ var orderingTheme = {
|
|
|
2177
2297
|
props: props,
|
|
2178
2298
|
};
|
|
2179
2299
|
|
|
2180
|
-
export { Button$1 as Button, DialogSection, DialogTitle, DishCheckoutCard, DishDetailsReview, DishModifierCard, ItemTag, ItemTagGroup, LocationCard, MenuDropdown, MenuFilter, MenuItem, MenuItemGroup, MenuSection, MenuSectionGroup, OrderingAppContext, OrderingAppContextProvider, PageSection, QuantityPicker, ReactionCounter, ReactionCounterGroup, SelectableChip, SelectableChipGroup, SelectedMenuFiltersList, StatusTag, orderingTheme, useOrderingAppContext };
|
|
2300
|
+
export { Button$1 as Button, Checkbox, DialogSection, DialogTitle, DishCheckoutCard, DishDetailsReview, DishModifierCard, ItemTag, ItemTagGroup, LocationCard, MenuDropdown, MenuFilter, MenuItem, MenuItemGroup, MenuSection, MenuSectionGroup, OrderingAppContext, OrderingAppContextProvider, PageSection, QuantityPicker, Radio, ReactionCounter, ReactionCounterGroup, SelectableChip, SelectableChipGroup, SelectedMenuFiltersList, StatusTag, Switch, orderingTheme, useOrderingAppContext };
|
|
2181
2301
|
//# sourceMappingURL=index.es.js.map
|