@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.js
CHANGED
|
@@ -147,50 +147,60 @@ var Button$1 = React.forwardRef(function (props, ref) {
|
|
|
147
147
|
});
|
|
148
148
|
Button$1.displayName = 'Button';
|
|
149
149
|
|
|
150
|
-
var useDishCardStyles = styles.makeStyles(function (theme) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
150
|
+
var useDishCardStyles = styles.makeStyles(function (theme) {
|
|
151
|
+
var _a, _b;
|
|
152
|
+
return ({
|
|
153
|
+
cardActionArea: (_a = {
|
|
154
|
+
display: 'flex',
|
|
155
|
+
gridGap: 16,
|
|
156
|
+
height: '100%'
|
|
157
|
+
},
|
|
158
|
+
_a[theme.breakpoints.up('lg')] = {
|
|
159
|
+
border: '1px solid #E0E0E0',
|
|
160
|
+
borderRadius: theme.spacing(2),
|
|
161
|
+
padding: theme.spacing(2),
|
|
162
|
+
},
|
|
163
|
+
_a),
|
|
164
|
+
card: (_b = {},
|
|
165
|
+
_b[theme.breakpoints.down('md')] = {
|
|
166
|
+
'&:after': {
|
|
167
|
+
content: '""',
|
|
168
|
+
position: 'absolute',
|
|
169
|
+
backgroundColor: '#E0E0E0',
|
|
170
|
+
width: '100%',
|
|
171
|
+
height: 1,
|
|
172
|
+
bottom: -16,
|
|
173
|
+
left: 0,
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
_b.height = 185,
|
|
177
|
+
_b.position = 'relative',
|
|
178
|
+
_b.overflow = 'visible',
|
|
179
|
+
_b),
|
|
180
|
+
cardTitle: {
|
|
181
|
+
fontWeight: 500,
|
|
182
|
+
fontSize: 18,
|
|
183
|
+
lineHeight: '27px',
|
|
184
|
+
color: theme.palette.grey[900],
|
|
185
|
+
'-webkit-line-clamp': 2,
|
|
186
|
+
display: '-webkit-box',
|
|
187
|
+
'-webkit-box-orient': 'vertical',
|
|
188
|
+
textOverflow: 'ellipsis',
|
|
189
|
+
overflow: 'hidden',
|
|
166
190
|
},
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
overflow: 'hidden',
|
|
181
|
-
},
|
|
182
|
-
cardDescription: {
|
|
183
|
-
fontWeight: 400,
|
|
184
|
-
fontSize: 14,
|
|
185
|
-
lineHeight: '20px',
|
|
186
|
-
color: theme.palette.grey[700],
|
|
187
|
-
'-webkit-line-clamp': 2,
|
|
188
|
-
display: '-webkit-box',
|
|
189
|
-
'-webkit-box-orient': 'vertical',
|
|
190
|
-
textOverflow: 'ellipsis',
|
|
191
|
-
overflow: 'hidden',
|
|
192
|
-
},
|
|
193
|
-
}); });
|
|
191
|
+
cardDescription: {
|
|
192
|
+
fontWeight: 400,
|
|
193
|
+
fontSize: 14,
|
|
194
|
+
lineHeight: '20px',
|
|
195
|
+
color: theme.palette.grey[700],
|
|
196
|
+
'-webkit-line-clamp': 2,
|
|
197
|
+
display: '-webkit-box',
|
|
198
|
+
'-webkit-box-orient': 'vertical',
|
|
199
|
+
textOverflow: 'ellipsis',
|
|
200
|
+
overflow: 'hidden',
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
});
|
|
194
204
|
|
|
195
205
|
var useStyles$6 = core.makeStyles(function () { return ({
|
|
196
206
|
img: {
|
|
@@ -355,6 +365,27 @@ function SvgHeart(props) {
|
|
|
355
365
|
})));
|
|
356
366
|
}
|
|
357
367
|
|
|
368
|
+
var _g$1c;
|
|
369
|
+
|
|
370
|
+
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); }
|
|
371
|
+
|
|
372
|
+
function SvgLock(props) {
|
|
373
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2d({
|
|
374
|
+
viewBox: "0 0 16 16",
|
|
375
|
+
fill: "none",
|
|
376
|
+
strokeLinecap: "round",
|
|
377
|
+
strokeLinejoin: "round",
|
|
378
|
+
width: "1em",
|
|
379
|
+
height: "1em"
|
|
380
|
+
}, props), _g$1c || (_g$1c = /*#__PURE__*/React__namespace.createElement("g", {
|
|
381
|
+
stroke: "currentColor"
|
|
382
|
+
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
383
|
+
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"
|
|
384
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
385
|
+
d: "M4.667 7.333V4.668a3.333 3.333 0 116.666 0v2.667"
|
|
386
|
+
}))));
|
|
387
|
+
}
|
|
388
|
+
|
|
358
389
|
var _g$19, _defs$C;
|
|
359
390
|
|
|
360
391
|
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); }
|
|
@@ -777,12 +808,12 @@ var Button = React.forwardRef(function (props, ref) {
|
|
|
777
808
|
});
|
|
778
809
|
Button.displayName = 'Button';
|
|
779
810
|
|
|
780
|
-
var Checkbox = React.forwardRef(function (props, ref) {
|
|
811
|
+
var Checkbox$1 = React.forwardRef(function (props, ref) {
|
|
781
812
|
var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
|
|
782
813
|
var control = React__default['default'].createElement(MuiCheckbox__default['default'], __assign({ disabled: label ? undefined : disabled }, muiProps));
|
|
783
814
|
return label ? (React__default['default'].createElement(FormControlLabel__default['default'], __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
|
|
784
815
|
});
|
|
785
|
-
Checkbox.displayName = 'Checkbox';
|
|
816
|
+
Checkbox$1.displayName = 'Checkbox';
|
|
786
817
|
|
|
787
818
|
var getBackground = function (theme) { return function (props) {
|
|
788
819
|
var variant = props.variant, severity = props.severity;
|
|
@@ -1052,12 +1083,12 @@ Paper.defaultProps = {
|
|
|
1052
1083
|
legacyStyles: false,
|
|
1053
1084
|
};
|
|
1054
1085
|
|
|
1055
|
-
var Radio = React.forwardRef(function (props, ref) {
|
|
1086
|
+
var Radio$1 = React.forwardRef(function (props, ref) {
|
|
1056
1087
|
var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
|
|
1057
1088
|
var control = React__default['default'].createElement(MuiRadio__default['default'], __assign({ disabled: label ? undefined : disabled }, muiProps));
|
|
1058
1089
|
return label ? (React__default['default'].createElement(FormControlLabel__default['default'], __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
|
|
1059
1090
|
});
|
|
1060
|
-
Radio.displayName = 'Radio';
|
|
1091
|
+
Radio$1.displayName = 'Radio';
|
|
1061
1092
|
|
|
1062
1093
|
styles.makeStyles(function () { return ({
|
|
1063
1094
|
textfield: {
|
|
@@ -1097,13 +1128,13 @@ var useSwitchStyles = styles.makeStyles(function (theme) { return ({
|
|
|
1097
1128
|
track: {},
|
|
1098
1129
|
}); });
|
|
1099
1130
|
|
|
1100
|
-
var Switch = React.forwardRef(function (props, ref) {
|
|
1131
|
+
var Switch$1 = React.forwardRef(function (props, ref) {
|
|
1101
1132
|
var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
|
|
1102
1133
|
var classes = useSwitchStyles(props);
|
|
1103
1134
|
var control = React__default['default'].createElement(MuiSwitch__default['default'], __assign({ classes: classes, disabled: label ? undefined : disabled }, muiProps));
|
|
1104
1135
|
return label ? (React__default['default'].createElement(FormControlLabel__default['default'], __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
|
|
1105
1136
|
});
|
|
1106
|
-
Switch.displayName = 'Switch';
|
|
1137
|
+
Switch$1.displayName = 'Switch';
|
|
1107
1138
|
|
|
1108
1139
|
var useToggleButtonStyles = styles.makeStyles(function (theme) { return ({
|
|
1109
1140
|
root: {
|
|
@@ -1224,18 +1255,18 @@ var useStyles$4 = core.makeStyles(function (_a) {
|
|
|
1224
1255
|
plusIcon: {
|
|
1225
1256
|
height: '100%',
|
|
1226
1257
|
padding: spacing(0.25),
|
|
1227
|
-
background: palette.info.main,
|
|
1228
|
-
color: palette.info.contrastText,
|
|
1258
|
+
background: function (props) { return (props.available ? palette.info.main : 'none'); },
|
|
1259
|
+
color: function (props) { return (props.available ? palette.info.contrastText : palette.warning.main); },
|
|
1229
1260
|
borderRadius: '30px',
|
|
1230
1261
|
marginRight: spacing(1),
|
|
1231
1262
|
},
|
|
1232
1263
|
});
|
|
1233
1264
|
});
|
|
1234
1265
|
var MenuItemPrice = function (props) {
|
|
1235
|
-
var classes = useStyles$4();
|
|
1266
|
+
var classes = useStyles$4(props);
|
|
1236
1267
|
return (React__default['default'].createElement(core.Box, { display: "flex", alignItems: "center" },
|
|
1237
1268
|
React__default['default'].createElement(core.Box, { display: "flex", className: classes.plusIcon },
|
|
1238
|
-
React__default['default'].createElement(Icon, { icon: SvgPlus, size: "medium" })),
|
|
1269
|
+
React__default['default'].createElement(Icon, { icon: props.available ? SvgPlus : SvgLock, size: "medium" })),
|
|
1239
1270
|
React__default['default'].createElement(core.Typography, null, props.price)));
|
|
1240
1271
|
};
|
|
1241
1272
|
|
|
@@ -1277,8 +1308,112 @@ var MenuItemTags = function (props) {
|
|
|
1277
1308
|
return (React__default['default'].createElement(ItemTagGroup, null, itemTags === null || itemTags === void 0 ? void 0 : itemTags.slice(0, 5).map(function (itemTag) { return (React__default['default'].createElement(ItemTag, { key: itemTag.name, alt: itemTag.name, color: itemTag.color }, itemTag.abbr)); })));
|
|
1278
1309
|
};
|
|
1279
1310
|
|
|
1311
|
+
var useStatusTagStyles = styles.makeStyles(function (theme) { return ({
|
|
1312
|
+
root: {
|
|
1313
|
+
borderRadius: '5px',
|
|
1314
|
+
display: 'flex',
|
|
1315
|
+
padding: theme.spacing(1),
|
|
1316
|
+
alignItems: 'center',
|
|
1317
|
+
justifyContent: 'center',
|
|
1318
|
+
width: 'fit-content',
|
|
1319
|
+
},
|
|
1320
|
+
filled: {
|
|
1321
|
+
backgroundColor: theme.palette.grey[100],
|
|
1322
|
+
color: theme.palette.grey[900],
|
|
1323
|
+
},
|
|
1324
|
+
outlined: {
|
|
1325
|
+
border: "1px solid var(--surfaces-card-stroke, " + theme.palette.grey[900] + ")",
|
|
1326
|
+
},
|
|
1327
|
+
small: {
|
|
1328
|
+
padding: theme.spacing(0.25, 0.75),
|
|
1329
|
+
},
|
|
1330
|
+
default: {
|
|
1331
|
+
color: theme.palette.grey[900],
|
|
1332
|
+
},
|
|
1333
|
+
warning: {
|
|
1334
|
+
borderColor: theme.palette.warning.dark,
|
|
1335
|
+
color: theme.palette.warning.dark,
|
|
1336
|
+
},
|
|
1337
|
+
error: {
|
|
1338
|
+
borderColor: theme.palette.error.main,
|
|
1339
|
+
color: theme.palette.error.main,
|
|
1340
|
+
},
|
|
1341
|
+
}); });
|
|
1342
|
+
|
|
1343
|
+
var classnames = {exports: {}};
|
|
1344
|
+
|
|
1345
|
+
/*!
|
|
1346
|
+
Copyright (c) 2018 Jed Watson.
|
|
1347
|
+
Licensed under the MIT License (MIT), see
|
|
1348
|
+
http://jedwatson.github.io/classnames
|
|
1349
|
+
*/
|
|
1350
|
+
|
|
1351
|
+
(function (module) {
|
|
1352
|
+
/* global define */
|
|
1353
|
+
|
|
1354
|
+
(function () {
|
|
1355
|
+
|
|
1356
|
+
var hasOwn = {}.hasOwnProperty;
|
|
1357
|
+
|
|
1358
|
+
function classNames() {
|
|
1359
|
+
var classes = [];
|
|
1360
|
+
|
|
1361
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
1362
|
+
var arg = arguments[i];
|
|
1363
|
+
if (!arg) continue;
|
|
1364
|
+
|
|
1365
|
+
var argType = typeof arg;
|
|
1366
|
+
|
|
1367
|
+
if (argType === 'string' || argType === 'number') {
|
|
1368
|
+
classes.push(arg);
|
|
1369
|
+
} else if (Array.isArray(arg)) {
|
|
1370
|
+
if (arg.length) {
|
|
1371
|
+
var inner = classNames.apply(null, arg);
|
|
1372
|
+
if (inner) {
|
|
1373
|
+
classes.push(inner);
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
} else if (argType === 'object') {
|
|
1377
|
+
if (arg.toString === Object.prototype.toString) {
|
|
1378
|
+
for (var key in arg) {
|
|
1379
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1380
|
+
classes.push(key);
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
} else {
|
|
1384
|
+
classes.push(arg.toString());
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
return classes.join(' ');
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
if (module.exports) {
|
|
1393
|
+
classNames.default = classNames;
|
|
1394
|
+
module.exports = classNames;
|
|
1395
|
+
} else {
|
|
1396
|
+
window.classNames = classNames;
|
|
1397
|
+
}
|
|
1398
|
+
}());
|
|
1399
|
+
}(classnames));
|
|
1400
|
+
|
|
1401
|
+
var classNames = classnames.exports;
|
|
1402
|
+
|
|
1403
|
+
var StatusTag = function (props) {
|
|
1404
|
+
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;
|
|
1405
|
+
var classes = useStatusTagStyles(props);
|
|
1406
|
+
return (React__default['default'].createElement(core.Box, { className: classNames([classes.root, classes[color], classes[variant], size === 'sm' ? classes.small : '']) },
|
|
1407
|
+
React__default['default'].createElement(Typography, { variant: "caption" }, label)));
|
|
1408
|
+
};
|
|
1409
|
+
StatusTag.defaultProps = {
|
|
1410
|
+
color: 'default',
|
|
1411
|
+
error: false,
|
|
1412
|
+
};
|
|
1413
|
+
StatusTag.displayName = 'StatusTag';
|
|
1414
|
+
|
|
1280
1415
|
var MenuItem = React.forwardRef(function (props, ref) {
|
|
1281
|
-
var onClick = props.onClick, id = props.id, title = props.title, description = props.description;
|
|
1416
|
+
var onClick = props.onClick, id = props.id, title = props.title, description = props.description, isOutOfStock = props.isOutOfStock;
|
|
1282
1417
|
var classes = useDishCardStyles(props);
|
|
1283
1418
|
var handleClick = function (event) {
|
|
1284
1419
|
onClick(id, event);
|
|
@@ -1286,11 +1421,13 @@ var MenuItem = React.forwardRef(function (props, ref) {
|
|
|
1286
1421
|
return (React__default['default'].createElement(core.Card, { className: classes.card, ref: ref, elevation: 0, "data-component-type": "menu-item" },
|
|
1287
1422
|
React__default['default'].createElement(core.CardActionArea, { className: classes.cardActionArea, onClick: handleClick },
|
|
1288
1423
|
React__default['default'].createElement(MenuItemInfo, null,
|
|
1289
|
-
React__default['default'].createElement(core.
|
|
1424
|
+
React__default['default'].createElement(core.Box, { display: "flex", gridGap: 8, alignItems: "center" },
|
|
1425
|
+
React__default['default'].createElement(core.Typography, { className: classes.cardTitle }, title),
|
|
1426
|
+
isOutOfStock && React__default['default'].createElement(StatusTag, { color: "warning", label: "Out of stock", variant: "outlined", size: "sm" })),
|
|
1290
1427
|
React__default['default'].createElement(core.Typography, { className: classes.cardDescription, paragraph: true }, description),
|
|
1291
1428
|
React__default['default'].createElement(MenuItemReactions, { likeCount: props.likeCount, reviewCount: props.reviewCount }),
|
|
1292
1429
|
React__default['default'].createElement(core.Box, { display: "flex", justifyContent: "space-between", alignItems: "end", flexGrow: 1 },
|
|
1293
|
-
React__default['default'].createElement(MenuItemPrice, { price: props.price }),
|
|
1430
|
+
React__default['default'].createElement(MenuItemPrice, { price: props.price, available: props.available }),
|
|
1294
1431
|
React__default['default'].createElement(MenuItemTags, { itemTags: props.itemTags }))),
|
|
1295
1432
|
React__default['default'].createElement(MenuItemImg, { image: props.image }))));
|
|
1296
1433
|
});
|
|
@@ -1479,117 +1616,21 @@ var useLabelStyles = styles.makeStyles(function (theme) { return ({
|
|
|
1479
1616
|
label: {
|
|
1480
1617
|
margin: theme.spacing(0.5, 0),
|
|
1481
1618
|
},
|
|
1482
|
-
|
|
1483
|
-
color: theme.palette.grey[700],
|
|
1484
|
-
},
|
|
1485
|
-
}); });
|
|
1486
|
-
|
|
1487
|
-
var useStatusTagStyles = styles.makeStyles(function (theme) { return ({
|
|
1488
|
-
root: {
|
|
1489
|
-
borderRadius: '5px',
|
|
1490
|
-
display: 'flex',
|
|
1491
|
-
padding: theme.spacing(1),
|
|
1492
|
-
alignItems: 'center',
|
|
1493
|
-
justifyContent: 'center',
|
|
1494
|
-
width: 'fit-content',
|
|
1495
|
-
},
|
|
1496
|
-
filled: {
|
|
1497
|
-
backgroundColor: theme.palette.grey[100],
|
|
1498
|
-
color: theme.palette.grey[900],
|
|
1499
|
-
},
|
|
1500
|
-
outlined: {
|
|
1501
|
-
border: "1px solid var(--surfaces-card-stroke, " + theme.palette.grey[900] + ")",
|
|
1502
|
-
},
|
|
1503
|
-
default: {
|
|
1504
|
-
color: theme.palette.grey[900],
|
|
1505
|
-
},
|
|
1506
|
-
warning: {
|
|
1507
|
-
borderColor: theme.palette.warning.dark,
|
|
1619
|
+
outOfStock: {
|
|
1508
1620
|
color: theme.palette.warning.dark,
|
|
1509
1621
|
},
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
color: theme.palette.error.main,
|
|
1622
|
+
price: {
|
|
1623
|
+
color: theme.palette.grey[700],
|
|
1513
1624
|
},
|
|
1514
1625
|
}); });
|
|
1515
1626
|
|
|
1516
|
-
var classnames = {exports: {}};
|
|
1517
|
-
|
|
1518
|
-
/*!
|
|
1519
|
-
Copyright (c) 2018 Jed Watson.
|
|
1520
|
-
Licensed under the MIT License (MIT), see
|
|
1521
|
-
http://jedwatson.github.io/classnames
|
|
1522
|
-
*/
|
|
1523
|
-
|
|
1524
|
-
(function (module) {
|
|
1525
|
-
/* global define */
|
|
1526
|
-
|
|
1527
|
-
(function () {
|
|
1528
|
-
|
|
1529
|
-
var hasOwn = {}.hasOwnProperty;
|
|
1530
|
-
|
|
1531
|
-
function classNames() {
|
|
1532
|
-
var classes = [];
|
|
1533
|
-
|
|
1534
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
1535
|
-
var arg = arguments[i];
|
|
1536
|
-
if (!arg) continue;
|
|
1537
|
-
|
|
1538
|
-
var argType = typeof arg;
|
|
1539
|
-
|
|
1540
|
-
if (argType === 'string' || argType === 'number') {
|
|
1541
|
-
classes.push(arg);
|
|
1542
|
-
} else if (Array.isArray(arg)) {
|
|
1543
|
-
if (arg.length) {
|
|
1544
|
-
var inner = classNames.apply(null, arg);
|
|
1545
|
-
if (inner) {
|
|
1546
|
-
classes.push(inner);
|
|
1547
|
-
}
|
|
1548
|
-
}
|
|
1549
|
-
} else if (argType === 'object') {
|
|
1550
|
-
if (arg.toString === Object.prototype.toString) {
|
|
1551
|
-
for (var key in arg) {
|
|
1552
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1553
|
-
classes.push(key);
|
|
1554
|
-
}
|
|
1555
|
-
}
|
|
1556
|
-
} else {
|
|
1557
|
-
classes.push(arg.toString());
|
|
1558
|
-
}
|
|
1559
|
-
}
|
|
1560
|
-
}
|
|
1561
|
-
|
|
1562
|
-
return classes.join(' ');
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
if (module.exports) {
|
|
1566
|
-
classNames.default = classNames;
|
|
1567
|
-
module.exports = classNames;
|
|
1568
|
-
} else {
|
|
1569
|
-
window.classNames = classNames;
|
|
1570
|
-
}
|
|
1571
|
-
}());
|
|
1572
|
-
}(classnames));
|
|
1573
|
-
|
|
1574
|
-
var classNames = classnames.exports;
|
|
1575
|
-
|
|
1576
|
-
var StatusTag = function (props) {
|
|
1577
|
-
var variant = props.variant, label = props.label, _a = props.color, color = _a === void 0 ? 'default' : _a;
|
|
1578
|
-
var classes = useStatusTagStyles(props);
|
|
1579
|
-
return (React__default['default'].createElement(core.Box, { className: classNames([classes.root, classes[color], classes[variant]]) },
|
|
1580
|
-
React__default['default'].createElement(Typography, { variant: "caption" }, label)));
|
|
1581
|
-
};
|
|
1582
|
-
StatusTag.defaultProps = {
|
|
1583
|
-
color: 'default',
|
|
1584
|
-
error: false,
|
|
1585
|
-
};
|
|
1586
|
-
StatusTag.displayName = 'StatusTag';
|
|
1587
|
-
|
|
1588
1627
|
var Label = function (props) {
|
|
1589
|
-
var name = props.name, price = props.price, disabled = props.disabled;
|
|
1628
|
+
var name = props.name, price = props.price, disabled = props.disabled, isOutOfStock = props.isOutOfStock;
|
|
1590
1629
|
var classes = useLabelStyles();
|
|
1591
1630
|
return (React__default['default'].createElement(core.Box, { display: "flex", flexDirection: "column", className: classes.label },
|
|
1592
|
-
React__default['default'].createElement(core.
|
|
1631
|
+
React__default['default'].createElement(core.Box, { display: "flex", alignItems: "center", gridGap: 8 },
|
|
1632
|
+
React__default['default'].createElement(core.Typography, null, name),
|
|
1633
|
+
!isOutOfStock && disabled && (React__default['default'].createElement(core.Typography, { variant: "caption", className: classes.outOfStock }, "Out of stock"))),
|
|
1593
1634
|
price && React__default['default'].createElement(core.Typography, { className: !disabled ? classes.price : '' },
|
|
1594
1635
|
"+ ",
|
|
1595
1636
|
price)));
|
|
@@ -1611,9 +1652,9 @@ var CheckboxGroup = function (props) {
|
|
|
1611
1652
|
};
|
|
1612
1653
|
return (React__default['default'].createElement(core.Box, { display: "flex", flexDirection: "column" }, modifiers.map(function (modifier, index) {
|
|
1613
1654
|
var targetValue = value === null || value === void 0 ? void 0 : value.find(function (v) { return v.id == modifier.id; });
|
|
1614
|
-
return (React__default['default'].createElement(core.FormControlLabel, { key: index, value: modifier.id, control: React__default['default'].createElement(core.Checkbox, { className: classes.radio, disabled: (!targetValue && disableNewSelections) || isOutOfStock }), label: React__default['default'].createElement(Label, { name: modifier.name, price: modifier.price
|
|
1655
|
+
return (React__default['default'].createElement(core.FormControlLabel, { key: index, value: modifier.id, control: React__default['default'].createElement(core.Checkbox, { className: classes.radio, disabled: (!targetValue && disableNewSelections) || isOutOfStock || modifier.outOfStock }), label: React__default['default'].createElement(Label, { name: modifier.name, price: modifier.price
|
|
1615
1656
|
? "" + (appContext && appContext.currencySymbol) + Number(modifier.price).toFixed(2)
|
|
1616
|
-
: null, disabled: isOutOfStock }), className: classes.root, checked: !!targetValue, onChange: handleChange }));
|
|
1657
|
+
: null, disabled: isOutOfStock || modifier.outOfStock, isOutOfStock: isOutOfStock }), className: classes.root, checked: !!targetValue, onChange: handleChange }));
|
|
1617
1658
|
})));
|
|
1618
1659
|
};
|
|
1619
1660
|
var RadioGroup = function (props) {
|
|
@@ -1631,7 +1672,7 @@ var RadioGroup = function (props) {
|
|
|
1631
1672
|
},
|
|
1632
1673
|
]);
|
|
1633
1674
|
};
|
|
1634
|
-
return (React__default['default'].createElement(MuiRadioGroup__default['default'], { name: "selectedModifiers", value: value ? value[0].id : '', onChange: handleChange }, modifiers.map(function (modifier, index) { return (React__default['default'].createElement(core.FormControlLabel, { key: index, value: modifier.id, control: React__default['default'].createElement(core.Radio, { className: classes.radio, disabled: isOutOfStock }), label: React__default['default'].createElement(Label, { name: modifier.name, price: modifier.price ? "" + (appContext && appContext.currencySymbol) + Number(modifier.price).toFixed(2) : null, disabled: isOutOfStock }) })); })));
|
|
1675
|
+
return (React__default['default'].createElement(MuiRadioGroup__default['default'], { name: "selectedModifiers", value: value ? value[0].id : '', onChange: handleChange }, modifiers.map(function (modifier, index) { return (React__default['default'].createElement(core.FormControlLabel, { key: index, value: modifier.id, control: React__default['default'].createElement(core.Radio, { className: classes.radio, disabled: isOutOfStock || modifier.outOfStock }), label: React__default['default'].createElement(Label, { name: modifier.name, price: modifier.price ? "" + (appContext && appContext.currencySymbol) + Number(modifier.price).toFixed(2) : null, disabled: isOutOfStock || modifier.outOfStock, isOutOfStock: isOutOfStock }) })); })));
|
|
1635
1676
|
};
|
|
1636
1677
|
|
|
1637
1678
|
var ModifierOptionsControl = function (props) {
|
|
@@ -1649,17 +1690,18 @@ var ModifierOptionsControl = function (props) {
|
|
|
1649
1690
|
var DishModifierCard = function (props) {
|
|
1650
1691
|
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;
|
|
1651
1692
|
var optionalText = messages.optionalText, outOfStockText = messages.outOfStockText, requiredText = messages.requiredText, helperText = messages.helperText;
|
|
1693
|
+
var isFullyOutOfStock = isOutOfStock || !modifiers.some(function (modifier) { return !modifier.outOfStock; });
|
|
1652
1694
|
var classes = useDishModifierCardStyles();
|
|
1653
1695
|
var color = 'default';
|
|
1654
1696
|
switch (true) {
|
|
1655
1697
|
case error:
|
|
1656
1698
|
color = 'error';
|
|
1657
|
-
case
|
|
1699
|
+
case isFullyOutOfStock:
|
|
1658
1700
|
color = 'warning';
|
|
1659
1701
|
}
|
|
1660
1702
|
var label = optionalText;
|
|
1661
1703
|
switch (true) {
|
|
1662
|
-
case
|
|
1704
|
+
case isFullyOutOfStock:
|
|
1663
1705
|
label = outOfStockText;
|
|
1664
1706
|
break;
|
|
1665
1707
|
case isRequired:
|
|
@@ -1671,11 +1713,11 @@ var DishModifierCard = function (props) {
|
|
|
1671
1713
|
React__default['default'].createElement(core.Box, { className: classes.nameContainer },
|
|
1672
1714
|
React__default['default'].createElement(Typography, { className: classes.name }, name),
|
|
1673
1715
|
React__default['default'].createElement(core.Box, { className: classes.statusTagContainer },
|
|
1674
|
-
React__default['default'].createElement(StatusTag, { variant: isRequired ||
|
|
1675
|
-
React__default['default'].createElement(Typography, { variant: "subtitle1", className: error ? classes.error : undefined }, helperText)),
|
|
1716
|
+
React__default['default'].createElement(StatusTag, { variant: isRequired || isFullyOutOfStock ? 'outlined' : 'filled', label: label, color: color }))),
|
|
1717
|
+
!isFullyOutOfStock && (React__default['default'].createElement(Typography, { variant: "subtitle1", className: error ? classes.error : undefined }, helperText))),
|
|
1676
1718
|
React__default['default'].createElement(core.Box, null,
|
|
1677
1719
|
React__default['default'].createElement(core.FormControl, null,
|
|
1678
|
-
React__default['default'].createElement(ModifierOptionsControl, { type: type, modifiers: modifiers, value: value, onChange: onChange, disableNewSelections: disableNewSelections, isOutOfStock:
|
|
1720
|
+
React__default['default'].createElement(ModifierOptionsControl, { type: type, modifiers: modifiers, value: value, onChange: onChange, disableNewSelections: disableNewSelections, isOutOfStock: isFullyOutOfStock })))));
|
|
1679
1721
|
};
|
|
1680
1722
|
DishModifierCard.displayName = 'DishModifierCard';
|
|
1681
1723
|
|
|
@@ -1787,21 +1829,29 @@ function SvgRestaurantMenuIcon(props) {
|
|
|
1787
1829
|
})))));
|
|
1788
1830
|
}
|
|
1789
1831
|
|
|
1790
|
-
var useMenuDropdownStyles = styles.makeStyles(function (theme) {
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1832
|
+
var useMenuDropdownStyles = styles.makeStyles(function (theme) {
|
|
1833
|
+
var _a;
|
|
1834
|
+
return ({
|
|
1835
|
+
formControl: (_a = {},
|
|
1836
|
+
_a[theme.breakpoints.up('lg')] = {
|
|
1837
|
+
alignSelf: 'start',
|
|
1838
|
+
},
|
|
1839
|
+
_a),
|
|
1840
|
+
select: {
|
|
1841
|
+
'& .MuiSelect-root': {
|
|
1842
|
+
color: '#212121',
|
|
1843
|
+
padding: theme.spacing(1, 0.5, 1, 0.5),
|
|
1844
|
+
zIndex: 10,
|
|
1845
|
+
},
|
|
1796
1846
|
},
|
|
1797
|
-
}
|
|
1798
|
-
});
|
|
1847
|
+
});
|
|
1848
|
+
});
|
|
1799
1849
|
|
|
1800
1850
|
var MenuDropdown = function (props) {
|
|
1801
1851
|
var menuOptions = props.menuOptions, onSelect = props.onSelect, selectedOptionId = props.selectedOptionId;
|
|
1802
1852
|
var classes = useMenuDropdownStyles(props);
|
|
1803
1853
|
var _a = React.useState(false), open = _a[0], setOpen = _a[1];
|
|
1804
|
-
return (React__default['default'].createElement(core.FormControl, { hiddenLabel: true },
|
|
1854
|
+
return (React__default['default'].createElement(core.FormControl, { hiddenLabel: true, classes: { root: classes.formControl } },
|
|
1805
1855
|
React__default['default'].createElement(core.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['default'].createElement(core.InputAdornment, { position: "start" },
|
|
1806
1856
|
React__default['default'].createElement(Icon, { icon: SvgRestaurantMenuIcon, size: "large" })), IconComponent: function () { return (React__default['default'].createElement(core.InputAdornment, { position: "end" },
|
|
1807
1857
|
React__default['default'].createElement(Icon, { color: "#0076CB", icon: open ? SvgChevronUp : SvgChevronDown, size: "large" }))); }, MenuProps: {
|
|
@@ -1967,25 +2017,29 @@ var SelectableChip = function (props) {
|
|
|
1967
2017
|
} }, props)));
|
|
1968
2018
|
};
|
|
1969
2019
|
|
|
1970
|
-
var useSelectableChipGroupStyles = styles.makeStyles(function (
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
2020
|
+
var useSelectableChipGroupStyles = styles.makeStyles(function (_a) {
|
|
2021
|
+
var _b;
|
|
2022
|
+
var breakpoints = _a.breakpoints, spacing = _a.spacing;
|
|
2023
|
+
return ({
|
|
2024
|
+
flexContainer: (_b = {},
|
|
2025
|
+
_b[breakpoints.down('md')] = {
|
|
2026
|
+
padding: spacing(0, 2),
|
|
2027
|
+
},
|
|
2028
|
+
_b[breakpoints.up('lg')] = {
|
|
2029
|
+
alignItems: 'flex-start',
|
|
2030
|
+
flexDirection: 'column',
|
|
2031
|
+
},
|
|
2032
|
+
_b.gridGap = spacing(1.5),
|
|
2033
|
+
_b),
|
|
2034
|
+
});
|
|
2035
|
+
});
|
|
1979
2036
|
|
|
1980
2037
|
var SelectableChipGroup = function (props) {
|
|
1981
2038
|
var children = props.children, muiProps = __rest$1(props, ["children"]);
|
|
1982
2039
|
var classes = useSelectableChipGroupStyles(props);
|
|
1983
2040
|
return (React__default['default'].createElement(core.Tabs, __assign$1({ TabIndicatorProps: {
|
|
1984
2041
|
hidden: true,
|
|
1985
|
-
}, variant: "scrollable", scrollButtons: "off", classes: classes }, muiProps),
|
|
1986
|
-
React__default['default'].createElement(core.Box, { minWidth: "1px" }),
|
|
1987
|
-
children,
|
|
1988
|
-
React__default['default'].createElement(core.Box, { minWidth: "1px" })));
|
|
2042
|
+
}, variant: "scrollable", scrollButtons: "off", classes: classes }, muiProps), children));
|
|
1989
2043
|
};
|
|
1990
2044
|
|
|
1991
2045
|
var useStyles$3 = core.makeStyles(function (_a) {
|
|
@@ -2036,14 +2090,22 @@ var MenuSection = React.forwardRef(function (props, ref) {
|
|
|
2036
2090
|
});
|
|
2037
2091
|
MenuSection.displayName = 'MenuSection';
|
|
2038
2092
|
|
|
2039
|
-
var useStyles$1 = core.makeStyles(function () {
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
}
|
|
2093
|
+
var useStyles$1 = core.makeStyles(function (_a) {
|
|
2094
|
+
var _b;
|
|
2095
|
+
var breakpoints = _a.breakpoints;
|
|
2096
|
+
return ({
|
|
2097
|
+
main: (_b = {},
|
|
2098
|
+
_b[breakpoints.down('md')] = {
|
|
2099
|
+
gridTemplateColumns: '1fr',
|
|
2100
|
+
},
|
|
2101
|
+
_b[breakpoints.up('lg')] = {
|
|
2102
|
+
gridTemplateColumns: 'repeat(2, minmax(280px, 1fr))',
|
|
2103
|
+
},
|
|
2104
|
+
_b.display = 'grid',
|
|
2105
|
+
_b.gridGap = 32,
|
|
2106
|
+
_b),
|
|
2107
|
+
});
|
|
2108
|
+
});
|
|
2047
2109
|
|
|
2048
2110
|
var MenuItemGroup = React.forwardRef(function (props, ref) {
|
|
2049
2111
|
var classes = useStyles$1();
|
|
@@ -2073,6 +2135,50 @@ var DialogSection = function (props) {
|
|
|
2073
2135
|
return (React__default['default'].createElement(core.Box, { paddingTop: 4, paddingBottom: props.borderBottom ? 4 : 0, paddingX: props.edgeToEdge ? 0 : 2, borderBottom: props.borderBottom ? '1px solid #E0E0E0' : undefined }, props.children));
|
|
2074
2136
|
};
|
|
2075
2137
|
|
|
2138
|
+
var Switch = core.withStyles(function (_a) {
|
|
2139
|
+
var palette = _a.palette;
|
|
2140
|
+
return ({
|
|
2141
|
+
checked: {
|
|
2142
|
+
'& $thumb': {
|
|
2143
|
+
backgroundColor: palette.success.main,
|
|
2144
|
+
},
|
|
2145
|
+
'&& + $track': {
|
|
2146
|
+
backgroundColor: palette.success.main,
|
|
2147
|
+
opacity: 0.5,
|
|
2148
|
+
},
|
|
2149
|
+
},
|
|
2150
|
+
switchBase: {
|
|
2151
|
+
color: palette.grey[300],
|
|
2152
|
+
},
|
|
2153
|
+
thumb: {},
|
|
2154
|
+
track: {},
|
|
2155
|
+
});
|
|
2156
|
+
})(core.Switch);
|
|
2157
|
+
|
|
2158
|
+
var Checkbox = core.withStyles(function (_a) {
|
|
2159
|
+
var palette = _a.palette;
|
|
2160
|
+
return ({
|
|
2161
|
+
checked: {},
|
|
2162
|
+
root: {
|
|
2163
|
+
'&$checked': {
|
|
2164
|
+
color: palette.info.main,
|
|
2165
|
+
},
|
|
2166
|
+
},
|
|
2167
|
+
});
|
|
2168
|
+
})(core.Checkbox);
|
|
2169
|
+
|
|
2170
|
+
var Radio = core.withStyles(function (_a) {
|
|
2171
|
+
var palette = _a.palette;
|
|
2172
|
+
return ({
|
|
2173
|
+
checked: {},
|
|
2174
|
+
root: {
|
|
2175
|
+
'&$checked': {
|
|
2176
|
+
color: palette.info.main,
|
|
2177
|
+
},
|
|
2178
|
+
},
|
|
2179
|
+
});
|
|
2180
|
+
})(core.Radio);
|
|
2181
|
+
|
|
2076
2182
|
var palette = {
|
|
2077
2183
|
primary: {
|
|
2078
2184
|
light: '#7B7FA3',
|
|
@@ -2117,6 +2223,9 @@ var overrides = {
|
|
|
2117
2223
|
outlined: {
|
|
2118
2224
|
padding: 'inherit',
|
|
2119
2225
|
},
|
|
2226
|
+
textPrimary: {
|
|
2227
|
+
color: '#0076CB',
|
|
2228
|
+
},
|
|
2120
2229
|
},
|
|
2121
2230
|
MuiDialogTitle: {
|
|
2122
2231
|
root: {
|
|
@@ -2144,6 +2253,17 @@ var overrides = {
|
|
|
2144
2253
|
boxShadow: '-4px 0px 8px 0px #0000001A',
|
|
2145
2254
|
},
|
|
2146
2255
|
},
|
|
2256
|
+
MuiDialog: {
|
|
2257
|
+
paper: {
|
|
2258
|
+
minWidth: 500,
|
|
2259
|
+
},
|
|
2260
|
+
paperWidthMd: {
|
|
2261
|
+
minWidth: 640,
|
|
2262
|
+
},
|
|
2263
|
+
paperFullScreen: {
|
|
2264
|
+
minWidth: 'unset',
|
|
2265
|
+
},
|
|
2266
|
+
},
|
|
2147
2267
|
};
|
|
2148
2268
|
|
|
2149
2269
|
var props = {
|
|
@@ -2221,6 +2341,7 @@ var orderingTheme = {
|
|
|
2221
2341
|
};
|
|
2222
2342
|
|
|
2223
2343
|
exports.Button = Button$1;
|
|
2344
|
+
exports.Checkbox = Checkbox;
|
|
2224
2345
|
exports.DialogSection = DialogSection;
|
|
2225
2346
|
exports.DialogTitle = DialogTitle;
|
|
2226
2347
|
exports.DishCheckoutCard = DishCheckoutCard;
|
|
@@ -2239,12 +2360,14 @@ exports.OrderingAppContext = OrderingAppContext;
|
|
|
2239
2360
|
exports.OrderingAppContextProvider = OrderingAppContextProvider;
|
|
2240
2361
|
exports.PageSection = PageSection;
|
|
2241
2362
|
exports.QuantityPicker = QuantityPicker;
|
|
2363
|
+
exports.Radio = Radio;
|
|
2242
2364
|
exports.ReactionCounter = ReactionCounter;
|
|
2243
2365
|
exports.ReactionCounterGroup = ReactionCounterGroup;
|
|
2244
2366
|
exports.SelectableChip = SelectableChip;
|
|
2245
2367
|
exports.SelectableChipGroup = SelectableChipGroup;
|
|
2246
2368
|
exports.SelectedMenuFiltersList = SelectedMenuFiltersList;
|
|
2247
2369
|
exports.StatusTag = StatusTag;
|
|
2370
|
+
exports.Switch = Switch;
|
|
2248
2371
|
exports.orderingTheme = orderingTheme;
|
|
2249
2372
|
exports.useOrderingAppContext = useOrderingAppContext;
|
|
2250
2373
|
Object.keys(core).forEach(function (k) {
|