@popmenu/ordering-ui 0.127.0 → 0.127.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/components/Button/index.d.ts +1 -1
- package/build/cjs/components/Checkbox/Checkbox.d.ts +0 -1
- package/build/cjs/components/DishCheckoutCard/DishCheckoutCard.d.ts +0 -1
- package/build/cjs/components/DishCheckoutCard/DishCheckoutCardProps.d.ts +2 -2
- package/build/cjs/components/DishCheckoutCard/index.d.ts +2 -2
- package/build/cjs/components/DishDetailsReview/index.d.ts +2 -2
- package/build/cjs/components/DishModifierCard/DishModifierCard.d.ts +0 -1
- package/build/cjs/components/DishModifierCard/DishModifierCardProps.d.ts +7 -7
- package/build/cjs/components/DishModifierCard/ModifierControls.d.ts +0 -1
- package/build/cjs/components/DishModifierCard/ModifierForm.d.ts +0 -1
- package/build/cjs/components/DishModifierCard/index.d.ts +2 -2
- package/build/cjs/components/ItemTag/index.d.ts +2 -2
- package/build/cjs/components/ItemTagGroup/index.d.ts +1 -1
- package/build/cjs/components/LocationCard/LocationCard.d.ts +0 -1
- package/build/cjs/components/LocationCard/index.d.ts +2 -2
- package/build/cjs/components/MenuBanner/MenuBanner.d.ts +0 -1
- package/build/cjs/components/MenuBanner/MenuBannerIcons.d.ts +0 -1
- package/build/cjs/components/MenuBanner/MenuBannerProps.d.ts +1 -1
- package/build/cjs/components/MenuBanner/index.d.ts +1 -1
- package/build/cjs/components/MenuDropdown/MenuDropdown.d.ts +0 -1
- package/build/cjs/components/MenuDropdown/MenuDropdownProps.d.ts +1 -1
- package/build/cjs/components/MenuDropdown/index.d.ts +2 -2
- package/build/cjs/components/MenuFilter/MenuFilter.d.ts +0 -1
- package/build/cjs/components/MenuFilter/MenuFilterProps.d.ts +3 -4
- package/build/cjs/components/MenuFilter/index.d.ts +2 -2
- package/build/cjs/components/MenuItem/MenuItemImg.d.ts +1 -2
- package/build/cjs/components/MenuItem/MenuItemPrice.d.ts +1 -2
- package/build/cjs/components/MenuItem/MenuItemProps.d.ts +1 -1
- package/build/cjs/components/MenuItem/MenuItemReactions.d.ts +1 -2
- package/build/cjs/components/MenuItem/MenuItemTags.d.ts +1 -2
- package/build/cjs/components/MenuItem/index.d.ts +1 -1
- package/build/cjs/components/MenuItemGroup/MenuItemGroup.d.ts +1 -1
- package/build/cjs/components/MenuSection/MenuSectionProps.d.ts +0 -1
- package/build/cjs/components/MenuSection/index.d.ts +1 -1
- package/build/cjs/components/MenuTab/MenuTab.d.ts +0 -1
- package/build/cjs/components/MenuTab/MenuTabProps.d.ts +1 -1
- package/build/cjs/components/MenuTab/index.d.ts +2 -2
- package/build/cjs/components/MenuTabGroup/MenuTabGroup.d.ts +0 -1
- package/build/cjs/components/MenuTabGroup/MenuTabGroupProps.d.ts +1 -4
- package/build/cjs/components/MenuTabGroup/index.d.ts +2 -2
- package/build/cjs/components/OrderingAppContext/OrderingAppContext.d.ts +3 -3
- package/build/cjs/components/QuantityPicker/QuantityPicker.d.ts +0 -1
- package/build/cjs/components/QuantityPicker/QuantityPickerProps.d.ts +1 -1
- package/build/cjs/components/QuantityPicker/index.d.ts +2 -2
- package/build/cjs/components/Radio/Radio.d.ts +0 -1
- package/build/cjs/components/ReactionCounter/ReactionCounter.d.ts +0 -1
- package/build/cjs/components/ReactionCounter/index.d.ts +2 -2
- package/build/cjs/components/ReactionCounterGroup/ReactionCounterGroup.d.ts +1 -1
- package/build/cjs/components/ReactionCounterGroup/index.d.ts +1 -1
- package/build/cjs/components/SelectableChip/SelectableChip.d.ts +0 -1
- package/build/cjs/components/SelectableChip/SelectableChipProps.d.ts +1 -1
- package/build/cjs/components/SelectableChip/index.d.ts +2 -2
- package/build/cjs/components/SelectableChipGroup/SelectableChipGroup.d.ts +0 -1
- package/build/cjs/components/SelectableChipGroup/SelectableChipGroupProps.d.ts +1 -4
- package/build/cjs/components/SelectableChipGroup/index.d.ts +2 -2
- package/build/cjs/components/SelectedMenuFiltersList/SelectedMenuFiltersList.d.ts +0 -1
- package/build/cjs/components/SelectedMenuFiltersList/index.d.ts +1 -1
- package/build/cjs/components/StatusTag/StatusTag.d.ts +0 -1
- package/build/cjs/components/StatusTag/index.d.ts +2 -2
- package/build/cjs/components/Switch/Switch.d.ts +0 -1
- package/build/cjs/components/index.d.ts +41 -22
- package/build/cjs/index.js +526 -674
- package/build/cjs/index.js.map +1 -1
- package/build/esm/components/Button/Button.js +4 -5
- package/build/esm/components/Button/Button.js.map +1 -1
- package/build/esm/components/Button/index.d.ts +1 -1
- package/build/esm/components/Checkbox/Checkbox.d.ts +0 -1
- package/build/esm/components/Checkbox/Checkbox.js +7 -10
- package/build/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/build/esm/components/DialogSection/DialogSection.js +3 -4
- package/build/esm/components/DialogSection/DialogSection.js.map +1 -1
- package/build/esm/components/DialogTitle/DialogTitle.js +5 -5
- package/build/esm/components/DialogTitle/DialogTitle.js.map +1 -1
- package/build/esm/components/DishCheckoutCard/DishCheckoutCard.d.ts +0 -1
- package/build/esm/components/DishCheckoutCard/DishCheckoutCard.js +18 -28
- package/build/esm/components/DishCheckoutCard/DishCheckoutCard.js.map +1 -1
- package/build/esm/components/DishCheckoutCard/DishCheckoutCard.styles.js +3 -6
- package/build/esm/components/DishCheckoutCard/DishCheckoutCard.styles.js.map +1 -1
- package/build/esm/components/DishCheckoutCard/DishCheckoutCardProps.d.ts +2 -2
- package/build/esm/components/DishCheckoutCard/index.d.ts +2 -2
- package/build/esm/components/DishDetailsReview/DishDetailsReview.js +2 -2
- package/build/esm/components/DishDetailsReview/DishDetailsReview.js.map +1 -1
- package/build/esm/components/DishDetailsReview/index.d.ts +2 -2
- package/build/esm/components/DishModifierCard/DishModifierCard.d.ts +0 -1
- package/build/esm/components/DishModifierCard/DishModifierCard.js +15 -17
- package/build/esm/components/DishModifierCard/DishModifierCard.js.map +1 -1
- package/build/esm/components/DishModifierCard/DishModifierCard.styles.js +11 -11
- package/build/esm/components/DishModifierCard/DishModifierCard.styles.js.map +1 -1
- package/build/esm/components/DishModifierCard/DishModifierCardProps.d.ts +7 -7
- package/build/esm/components/DishModifierCard/ModifierControls.d.ts +0 -1
- package/build/esm/components/DishModifierCard/ModifierControls.js +44 -51
- package/build/esm/components/DishModifierCard/ModifierControls.js.map +1 -1
- package/build/esm/components/DishModifierCard/ModifierForm.d.ts +0 -1
- package/build/esm/components/DishModifierCard/index.d.ts +2 -2
- package/build/esm/components/ItemTag/ItemTag.js +3 -3
- package/build/esm/components/ItemTag/ItemTag.js.map +1 -1
- package/build/esm/components/ItemTag/index.d.ts +2 -2
- package/build/esm/components/ItemTag/itemTag.styles.js +2 -2
- package/build/esm/components/ItemTag/itemTag.styles.js.map +1 -1
- package/build/esm/components/ItemTagGroup/ItemTagGroup.js +2 -2
- package/build/esm/components/ItemTagGroup/ItemTagGroup.js.map +1 -1
- package/build/esm/components/ItemTagGroup/index.d.ts +1 -1
- package/build/esm/components/LocationCard/LocationCard.d.ts +0 -1
- package/build/esm/components/LocationCard/LocationCard.js +7 -8
- package/build/esm/components/LocationCard/LocationCard.js.map +1 -1
- package/build/esm/components/LocationCard/LocationCard.styles.js +6 -12
- package/build/esm/components/LocationCard/LocationCard.styles.js.map +1 -1
- package/build/esm/components/LocationCard/index.d.ts +2 -2
- package/build/esm/components/MenuBanner/MenuBanner.d.ts +0 -1
- package/build/esm/components/MenuBanner/MenuBanner.js +9 -10
- package/build/esm/components/MenuBanner/MenuBanner.js.map +1 -1
- package/build/esm/components/MenuBanner/MenuBanner.styles.js +12 -16
- package/build/esm/components/MenuBanner/MenuBanner.styles.js.map +1 -1
- package/build/esm/components/MenuBanner/MenuBannerIcons.d.ts +0 -1
- package/build/esm/components/MenuBanner/MenuBannerIcons.js +2 -2
- package/build/esm/components/MenuBanner/MenuBannerIcons.js.map +1 -1
- package/build/esm/components/MenuBanner/MenuBannerProps.d.ts +1 -1
- package/build/esm/components/MenuBanner/index.d.ts +1 -1
- package/build/esm/components/MenuDropdown/MenuDropdown.d.ts +0 -1
- package/build/esm/components/MenuDropdown/MenuDropdown.js +12 -15
- package/build/esm/components/MenuDropdown/MenuDropdown.js.map +1 -1
- package/build/esm/components/MenuDropdown/MenuDropdown.styles.js +29 -33
- package/build/esm/components/MenuDropdown/MenuDropdown.styles.js.map +1 -1
- package/build/esm/components/MenuDropdown/MenuDropdownProps.d.ts +1 -1
- package/build/esm/components/MenuDropdown/index.d.ts +2 -2
- package/build/esm/components/MenuFilter/MenuFilter.d.ts +0 -1
- package/build/esm/components/MenuFilter/MenuFilter.js +18 -18
- package/build/esm/components/MenuFilter/MenuFilter.js.map +1 -1
- package/build/esm/components/MenuFilter/MenuFilter.styles.js +2 -2
- package/build/esm/components/MenuFilter/MenuFilter.styles.js.map +1 -1
- package/build/esm/components/MenuFilter/MenuFilterProps.d.ts +3 -4
- package/build/esm/components/MenuFilter/index.d.ts +2 -2
- package/build/esm/components/MenuItem/MenuItem.js +10 -11
- package/build/esm/components/MenuItem/MenuItem.js.map +1 -1
- package/build/esm/components/MenuItem/MenuItem.styles.js +56 -60
- package/build/esm/components/MenuItem/MenuItem.styles.js.map +1 -1
- package/build/esm/components/MenuItem/MenuItemImg.d.ts +1 -2
- package/build/esm/components/MenuItem/MenuItemImg.js +6 -6
- package/build/esm/components/MenuItem/MenuItemImg.js.map +1 -1
- package/build/esm/components/MenuItem/MenuItemInfo.js +1 -1
- package/build/esm/components/MenuItem/MenuItemInfo.js.map +1 -1
- package/build/esm/components/MenuItem/MenuItemPrice.d.ts +1 -2
- package/build/esm/components/MenuItem/MenuItemPrice.js +12 -15
- package/build/esm/components/MenuItem/MenuItemPrice.js.map +1 -1
- package/build/esm/components/MenuItem/MenuItemProps.d.ts +1 -1
- package/build/esm/components/MenuItem/MenuItemReactions.d.ts +1 -2
- package/build/esm/components/MenuItem/MenuItemReactions.js +7 -7
- package/build/esm/components/MenuItem/MenuItemReactions.js.map +1 -1
- package/build/esm/components/MenuItem/MenuItemTags.d.ts +1 -2
- package/build/esm/components/MenuItem/MenuItemTags.js +3 -3
- package/build/esm/components/MenuItem/MenuItemTags.js.map +1 -1
- package/build/esm/components/MenuItem/index.d.ts +1 -1
- package/build/esm/components/MenuItemGroup/MenuItemGroup.d.ts +1 -1
- package/build/esm/components/MenuItemGroup/MenuItemGroup.js +5 -6
- package/build/esm/components/MenuItemGroup/MenuItemGroup.js.map +1 -1
- package/build/esm/components/MenuItemGroup/MenuItemGroupStyles.js +12 -16
- package/build/esm/components/MenuItemGroup/MenuItemGroupStyles.js.map +1 -1
- package/build/esm/components/MenuSection/MenuSection.js +4 -5
- package/build/esm/components/MenuSection/MenuSection.js.map +1 -1
- package/build/esm/components/MenuSection/MenuSectionProps.d.ts +0 -1
- package/build/esm/components/MenuSection/MenuSectionStyles.js +2 -2
- package/build/esm/components/MenuSection/MenuSectionStyles.js.map +1 -1
- package/build/esm/components/MenuSection/index.d.ts +1 -1
- package/build/esm/components/MenuSectionGroup/MenuSectionGroup.js +3 -4
- package/build/esm/components/MenuSectionGroup/MenuSectionGroup.js.map +1 -1
- package/build/esm/components/MenuTab/MenuTab.d.ts +0 -1
- package/build/esm/components/MenuTab/MenuTab.js +5 -6
- package/build/esm/components/MenuTab/MenuTab.js.map +1 -1
- package/build/esm/components/MenuTab/MenuTab.styles.js +13 -16
- package/build/esm/components/MenuTab/MenuTab.styles.js.map +1 -1
- package/build/esm/components/MenuTab/MenuTabProps.d.ts +1 -1
- package/build/esm/components/MenuTab/index.d.ts +2 -2
- package/build/esm/components/MenuTabGroup/MenuTabGroup.d.ts +0 -1
- package/build/esm/components/MenuTabGroup/MenuTabGroup.js +4 -5
- package/build/esm/components/MenuTabGroup/MenuTabGroup.js.map +1 -1
- package/build/esm/components/MenuTabGroup/MenuTabGroupProps.d.ts +1 -4
- package/build/esm/components/MenuTabGroup/index.d.ts +2 -2
- package/build/esm/components/OrderingAppContext/OrderingAppContext.d.ts +3 -3
- package/build/esm/components/OrderingAppContext/OrderingAppContext.js +6 -6
- package/build/esm/components/OrderingAppContext/OrderingAppContext.js.map +1 -1
- package/build/esm/components/PageSection/PageSection.js +1 -1
- package/build/esm/components/PageSection/PageSection.js.map +1 -1
- package/build/esm/components/QuantityPicker/QuantityPicker.d.ts +0 -1
- package/build/esm/components/QuantityPicker/QuantityPicker.js +16 -17
- package/build/esm/components/QuantityPicker/QuantityPicker.js.map +1 -1
- package/build/esm/components/QuantityPicker/QuantityPicker.styles.js +17 -17
- package/build/esm/components/QuantityPicker/QuantityPicker.styles.js.map +1 -1
- package/build/esm/components/QuantityPicker/QuantityPickerProps.d.ts +1 -1
- package/build/esm/components/QuantityPicker/index.d.ts +2 -2
- package/build/esm/components/Radio/Radio.d.ts +0 -1
- package/build/esm/components/Radio/Radio.js +7 -10
- package/build/esm/components/Radio/Radio.js.map +1 -1
- package/build/esm/components/ReactionCounter/ReactionCounter.d.ts +0 -1
- package/build/esm/components/ReactionCounter/ReactionCounter.js +2 -2
- package/build/esm/components/ReactionCounter/ReactionCounter.js.map +1 -1
- package/build/esm/components/ReactionCounter/index.d.ts +2 -2
- package/build/esm/components/ReactionCounterGroup/ReactionCounterGroup.d.ts +1 -1
- package/build/esm/components/ReactionCounterGroup/ReactionCounterGroup.js +2 -2
- package/build/esm/components/ReactionCounterGroup/ReactionCounterGroup.js.map +1 -1
- package/build/esm/components/ReactionCounterGroup/index.d.ts +1 -1
- package/build/esm/components/SelectableChip/SelectableChip.d.ts +0 -1
- package/build/esm/components/SelectableChip/SelectableChip.js +4 -5
- package/build/esm/components/SelectableChip/SelectableChip.js.map +1 -1
- package/build/esm/components/SelectableChip/SelectableChip.styles.js +2 -2
- package/build/esm/components/SelectableChip/SelectableChip.styles.js.map +1 -1
- package/build/esm/components/SelectableChip/SelectableChipProps.d.ts +1 -1
- package/build/esm/components/SelectableChip/index.d.ts +2 -2
- package/build/esm/components/SelectableChipGroup/SelectableChipGroup.d.ts +0 -1
- package/build/esm/components/SelectableChipGroup/SelectableChipGroup.js +5 -6
- package/build/esm/components/SelectableChipGroup/SelectableChipGroup.js.map +1 -1
- package/build/esm/components/SelectableChipGroup/SelectableChipGroup.styles.js +12 -16
- package/build/esm/components/SelectableChipGroup/SelectableChipGroup.styles.js.map +1 -1
- package/build/esm/components/SelectableChipGroup/SelectableChipGroupProps.d.ts +1 -4
- package/build/esm/components/SelectableChipGroup/index.d.ts +2 -2
- package/build/esm/components/SelectedMenuFiltersList/SelectedMenuFiltersList.d.ts +0 -1
- package/build/esm/components/SelectedMenuFiltersList/SelectedMenuFiltersList.js +20 -23
- package/build/esm/components/SelectedMenuFiltersList/SelectedMenuFiltersList.js.map +1 -1
- package/build/esm/components/SelectedMenuFiltersList/index.d.ts +1 -1
- package/build/esm/components/StatusTag/StatusTag.d.ts +0 -1
- package/build/esm/components/StatusTag/StatusTag.js +3 -4
- package/build/esm/components/StatusTag/StatusTag.js.map +1 -1
- package/build/esm/components/StatusTag/StatusTag.styles.js +3 -3
- package/build/esm/components/StatusTag/StatusTag.styles.js.map +1 -1
- package/build/esm/components/StatusTag/index.d.ts +2 -2
- package/build/esm/components/Switch/Switch.d.ts +0 -1
- package/build/esm/components/Switch/Switch.js +14 -17
- package/build/esm/components/Switch/Switch.js.map +1 -1
- package/build/esm/components/index.d.ts +41 -22
- package/build/esm/index.js +3 -3
- package/build/esm/theme/overrides.js +1 -1
- package/build/esm/theme/overrides.js.map +1 -1
- package/build/esm/theme/palette.js +1 -1
- package/build/esm/theme/palette.js.map +1 -1
- package/build/esm/theme/props.js +1 -1
- package/build/esm/theme/props.js.map +1 -1
- package/build/esm/theme/theme.js +5 -5
- package/build/esm/theme/theme.js.map +1 -1
- package/build/esm/theme/typography.js +2 -2
- package/build/esm/theme/typography.js.map +1 -1
- package/package.json +4 -4
- package/build/esm/_virtual/index.js +0 -4
- package/build/esm/_virtual/index.js.map +0 -1
- package/build/esm/node_modules/classnames/index.js +0 -81
- package/build/esm/node_modules/classnames/index.js.map +0 -1
package/build/cjs/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var core = require('@material-ui/core');
|
|
4
|
-
var tslib = require('tslib');
|
|
5
4
|
var React = require('react');
|
|
6
|
-
var webIcons = require('@popmenu/web-icons');
|
|
7
|
-
var commonUi = require('@popmenu/common-ui');
|
|
8
5
|
var lab = require('@material-ui/lab');
|
|
6
|
+
var classNames = require('classnames');
|
|
7
|
+
var commonUi = require('@popmenu/common-ui');
|
|
8
|
+
var webIcons = require('@popmenu/web-icons');
|
|
9
9
|
|
|
10
10
|
function _interopNamespaceDefault(e) {
|
|
11
11
|
var n = Object.create(null);
|
|
@@ -26,9 +26,9 @@ function _interopNamespaceDefault(e) {
|
|
|
26
26
|
|
|
27
27
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const Button = React.forwardRef((props, ref) => {
|
|
30
|
+
const { variation = 'primary', ...muiProps } = props;
|
|
31
|
+
const variationProps = {};
|
|
32
32
|
switch (variation) {
|
|
33
33
|
case 'primary':
|
|
34
34
|
variationProps.variant = 'contained';
|
|
@@ -39,137 +39,173 @@ var Button = React.forwardRef(function (props, ref) {
|
|
|
39
39
|
variationProps.color = 'primary';
|
|
40
40
|
break;
|
|
41
41
|
}
|
|
42
|
-
return React.createElement(core.Button,
|
|
42
|
+
return React.createElement(core.Button, { ...variationProps, ...muiProps, ref: ref });
|
|
43
43
|
});
|
|
44
44
|
Button.displayName = 'Button';
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
overflow: 'hidden',
|
|
46
|
+
const useStatusTagStyles = core.makeStyles((theme) => ({
|
|
47
|
+
root: {
|
|
48
|
+
borderRadius: '5px',
|
|
49
|
+
display: 'flex',
|
|
50
|
+
padding: theme.spacing(1),
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
justifyContent: 'center',
|
|
53
|
+
width: 'fit-content',
|
|
54
|
+
},
|
|
55
|
+
filled: {
|
|
56
|
+
backgroundColor: theme.palette.grey[100],
|
|
57
|
+
color: theme.palette.grey[900],
|
|
58
|
+
},
|
|
59
|
+
outlined: {
|
|
60
|
+
border: `1px solid var(--surfaces-card-stroke, ${theme.palette.grey[900]})`,
|
|
61
|
+
},
|
|
62
|
+
small: {
|
|
63
|
+
padding: theme.spacing(0.25, 0.75),
|
|
64
|
+
},
|
|
65
|
+
default: {
|
|
66
|
+
color: theme.palette.grey[900],
|
|
67
|
+
},
|
|
68
|
+
warning: {
|
|
69
|
+
borderColor: theme.palette.warning.dark,
|
|
70
|
+
color: theme.palette.warning.dark,
|
|
71
|
+
},
|
|
72
|
+
error: {
|
|
73
|
+
borderColor: theme.palette.error.main,
|
|
74
|
+
color: theme.palette.error.main,
|
|
75
|
+
},
|
|
76
|
+
highlight: {
|
|
77
|
+
backgroundColor: theme.palette.warning.light,
|
|
78
|
+
color: theme.palette.grey[900],
|
|
79
|
+
},
|
|
80
|
+
}));
|
|
81
|
+
|
|
82
|
+
const StatusTag = ({ color = 'default', label, size = 'md', variant }) => {
|
|
83
|
+
const classes = useStatusTagStyles();
|
|
84
|
+
return (React.createElement(commonUi.Box, { className: classNames([classes.root, classes[color], classes[variant], size === 'sm' ? classes.small : '']) },
|
|
85
|
+
React.createElement(commonUi.Typography, { variant: "caption" }, label)));
|
|
86
|
+
};
|
|
87
|
+
StatusTag.displayName = 'StatusTag';
|
|
88
|
+
|
|
89
|
+
const useMenuItemStyles = core.makeStyles((theme) => ({
|
|
90
|
+
cardActionArea: {
|
|
91
|
+
display: 'flex',
|
|
92
|
+
gridGap: 16,
|
|
93
|
+
height: '100%',
|
|
94
|
+
[theme.breakpoints.up('lg')]: {
|
|
95
|
+
border: '1px solid #E0E0E0',
|
|
96
|
+
borderRadius: theme.spacing(2),
|
|
97
|
+
padding: theme.spacing(2),
|
|
99
98
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
},
|
|
100
|
+
card: {
|
|
101
|
+
[theme.breakpoints.down('md')]: {
|
|
102
|
+
'&:after': {
|
|
103
|
+
content: '""',
|
|
104
|
+
position: 'absolute',
|
|
105
|
+
backgroundColor: '#E0E0E0',
|
|
106
|
+
width: '100%',
|
|
107
|
+
height: 1,
|
|
108
|
+
bottom: -16,
|
|
109
|
+
left: 0,
|
|
110
|
+
},
|
|
105
111
|
},
|
|
106
|
-
|
|
107
|
-
|
|
112
|
+
height: 185,
|
|
113
|
+
position: 'relative',
|
|
114
|
+
overflow: 'visible',
|
|
115
|
+
},
|
|
116
|
+
cardTitle: {
|
|
117
|
+
flexGrow: 1,
|
|
118
|
+
fontWeight: 500,
|
|
119
|
+
fontSize: 18,
|
|
120
|
+
lineHeight: '27px',
|
|
121
|
+
color: theme.palette.grey[900],
|
|
122
|
+
'-webkit-line-clamp': 2,
|
|
123
|
+
display: '-webkit-box',
|
|
124
|
+
'-webkit-box-orient': 'vertical',
|
|
125
|
+
textOverflow: 'ellipsis',
|
|
126
|
+
overflow: 'hidden',
|
|
127
|
+
},
|
|
128
|
+
cardDescription: {
|
|
129
|
+
fontWeight: 400,
|
|
130
|
+
fontSize: 14,
|
|
131
|
+
lineHeight: '20px',
|
|
132
|
+
margin: theme.spacing(0.5, 0, 1, 0),
|
|
133
|
+
color: theme.palette.grey[800],
|
|
134
|
+
'-webkit-line-clamp': 2,
|
|
135
|
+
display: '-webkit-box',
|
|
136
|
+
'-webkit-box-orient': 'vertical',
|
|
137
|
+
textOverflow: 'ellipsis',
|
|
138
|
+
overflow: 'hidden',
|
|
139
|
+
},
|
|
140
|
+
outOfStockTag: {
|
|
141
|
+
minWidth: '90px',
|
|
142
|
+
marginLeft: theme.spacing(1),
|
|
143
|
+
display: 'inline-block',
|
|
144
|
+
verticalAlign: 'bottom',
|
|
145
|
+
},
|
|
146
|
+
}));
|
|
108
147
|
|
|
109
|
-
|
|
148
|
+
const useStyles$6 = core.makeStyles(() => ({
|
|
110
149
|
img: {
|
|
111
150
|
objectFit: 'cover',
|
|
112
151
|
width: '100%',
|
|
113
152
|
height: '100%',
|
|
114
153
|
},
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
154
|
+
}));
|
|
155
|
+
const MenuItemImg = (props) => {
|
|
156
|
+
const { image = {} } = props;
|
|
157
|
+
const { src } = image;
|
|
158
|
+
const classes = useStyles$6();
|
|
120
159
|
if (!src) {
|
|
121
160
|
return null;
|
|
122
161
|
}
|
|
123
162
|
return (React.createElement(core.Box, { width: 125, height: "100%", borderRadius: 16, overflow: "hidden", flexShrink: 0 }, React.createElement("img", { src: src, alt: "", className: classes.img })));
|
|
124
163
|
};
|
|
125
164
|
|
|
126
|
-
|
|
165
|
+
const MenuItemInfo = (props) => {
|
|
127
166
|
return (React.createElement(core.Box, { display: "flex", flexGrow: 1, flexDirection: "column", height: "100%" }, props.children));
|
|
128
167
|
};
|
|
129
168
|
|
|
130
|
-
|
|
131
|
-
|
|
169
|
+
const useStyles$5 = core.makeStyles(({ palette, spacing }) => ({
|
|
170
|
+
plusIcon: {
|
|
171
|
+
height: '100%',
|
|
172
|
+
padding: spacing(0.25),
|
|
173
|
+
background: (props) => (props.available ? palette.info.main : 'none'),
|
|
174
|
+
color: (props) => (props.available ? palette.info.contrastText : palette.warning.main),
|
|
175
|
+
borderRadius: '30px',
|
|
176
|
+
marginRight: spacing(1),
|
|
177
|
+
},
|
|
178
|
+
}));
|
|
179
|
+
const MenuItemPrice = (props) => {
|
|
180
|
+
const classes = useStyles$5(props);
|
|
181
|
+
return (React.createElement(core.Box, { display: "flex", alignItems: "center" },
|
|
182
|
+
React.createElement(core.Box, { display: "flex", className: classes.plusIcon },
|
|
183
|
+
React.createElement(commonUi.Icon, { icon: props.available ? webIcons.Plus : webIcons.Lock, size: "medium" })),
|
|
184
|
+
React.createElement(core.Typography, null, props.price)));
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const ReactionCounter = (props) => {
|
|
188
|
+
const { count, icon, label } = props;
|
|
132
189
|
return (React.createElement(commonUi.Box, { display: "flex", alignItems: "center", gridGap: 6, color: "grey.900" },
|
|
133
190
|
React.createElement(commonUi.Icon, { icon: icon, size: "large", color: "inherit", "aria-label": label }),
|
|
134
191
|
React.createElement(commonUi.Typography, { variant: "body2", color: "grey.900" }, count)));
|
|
135
192
|
};
|
|
136
193
|
|
|
137
|
-
|
|
138
|
-
|
|
194
|
+
const ReactionCounterGroup = (props) => {
|
|
195
|
+
const { children } = props;
|
|
139
196
|
return (React.createElement(commonUi.Box, { display: "flex", gridGap: 16 }, children));
|
|
140
197
|
};
|
|
141
198
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
199
|
+
const MenuItemReactions = (props) => {
|
|
200
|
+
const { likeCount, reviewCount } = props;
|
|
201
|
+
const showLikes = likeCount ? likeCount > 0 : false;
|
|
202
|
+
const showReviews = reviewCount ? reviewCount > 0 : false;
|
|
146
203
|
return (React.createElement(ReactionCounterGroup, null,
|
|
147
|
-
showLikes && React.createElement(ReactionCounter, { icon: webIcons.Heart, count: likeCount
|
|
148
|
-
showReviews && React.createElement(ReactionCounter, { icon: webIcons.Reviews, count: reviewCount
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
var useStyles$5 = core.makeStyles(function (_a) {
|
|
152
|
-
var palette = _a.palette, spacing = _a.spacing;
|
|
153
|
-
return ({
|
|
154
|
-
plusIcon: {
|
|
155
|
-
height: '100%',
|
|
156
|
-
padding: spacing(0.25),
|
|
157
|
-
background: function (props) { return (props.available ? palette.info.main : 'none'); },
|
|
158
|
-
color: function (props) { return (props.available ? palette.info.contrastText : palette.warning.main); },
|
|
159
|
-
borderRadius: '30px',
|
|
160
|
-
marginRight: spacing(1),
|
|
161
|
-
},
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
var MenuItemPrice = function (props) {
|
|
165
|
-
var classes = useStyles$5(props);
|
|
166
|
-
return (React.createElement(core.Box, { display: "flex", alignItems: "center" },
|
|
167
|
-
React.createElement(core.Box, { display: "flex", className: classes.plusIcon },
|
|
168
|
-
React.createElement(commonUi.Icon, { icon: props.available ? webIcons.Plus : webIcons.Lock, size: "medium" })),
|
|
169
|
-
React.createElement(core.Typography, null, props.price)));
|
|
204
|
+
showLikes && React.createElement(ReactionCounter, { icon: webIcons.Heart, count: likeCount ?? 0, label: "likes" }),
|
|
205
|
+
showReviews && React.createElement(ReactionCounter, { icon: webIcons.Reviews, count: reviewCount ?? 0, label: "reviews" })));
|
|
170
206
|
};
|
|
171
207
|
|
|
172
|
-
|
|
208
|
+
const useItemTagStyles = core.makeStyles((theme) => ({
|
|
173
209
|
root: {
|
|
174
210
|
color: theme.palette.text.primary,
|
|
175
211
|
borderColor: theme.palette.text.primary,
|
|
@@ -183,156 +219,33 @@ var useItemTagStyles = core.makeStyles(function (theme) { return ({
|
|
|
183
219
|
text: {
|
|
184
220
|
lineHeight: 1.5,
|
|
185
221
|
},
|
|
186
|
-
})
|
|
222
|
+
}));
|
|
187
223
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
224
|
+
const ItemTag = React.forwardRef((props, ref) => {
|
|
225
|
+
const { alt, children } = props;
|
|
226
|
+
const classes = useItemTagStyles();
|
|
191
227
|
return (React.createElement(core.Avatar, { ref: ref, alt: alt, classes: { root: classes.root } },
|
|
192
228
|
React.createElement(commonUi.Typography, { variant: "caption", className: classes.text }, children)));
|
|
193
229
|
});
|
|
194
230
|
ItemTag.displayName = 'ItemTag';
|
|
195
231
|
|
|
196
|
-
|
|
197
|
-
|
|
232
|
+
const ItemTagGroup = (props) => {
|
|
233
|
+
const { children } = props;
|
|
198
234
|
return (React.createElement(core.Box, { display: "flex", gridGap: 6, ml: 1, flexWrap: "wrap" }, children));
|
|
199
235
|
};
|
|
200
236
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return (React.createElement(ItemTagGroup, null, itemTags
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
var useStatusTagStyles = core.makeStyles(function (theme) { return ({
|
|
207
|
-
root: {
|
|
208
|
-
borderRadius: '5px',
|
|
209
|
-
display: 'flex',
|
|
210
|
-
padding: theme.spacing(1),
|
|
211
|
-
alignItems: 'center',
|
|
212
|
-
justifyContent: 'center',
|
|
213
|
-
width: 'fit-content',
|
|
214
|
-
},
|
|
215
|
-
filled: {
|
|
216
|
-
backgroundColor: theme.palette.grey[100],
|
|
217
|
-
color: theme.palette.grey[900],
|
|
218
|
-
},
|
|
219
|
-
outlined: {
|
|
220
|
-
border: "1px solid var(--surfaces-card-stroke, " + theme.palette.grey[900] + ")",
|
|
221
|
-
},
|
|
222
|
-
small: {
|
|
223
|
-
padding: theme.spacing(0.25, 0.75),
|
|
224
|
-
},
|
|
225
|
-
default: {
|
|
226
|
-
color: theme.palette.grey[900],
|
|
227
|
-
},
|
|
228
|
-
warning: {
|
|
229
|
-
borderColor: theme.palette.warning.dark,
|
|
230
|
-
color: theme.palette.warning.dark,
|
|
231
|
-
},
|
|
232
|
-
error: {
|
|
233
|
-
borderColor: theme.palette.error.main,
|
|
234
|
-
color: theme.palette.error.main,
|
|
235
|
-
},
|
|
236
|
-
highlight: {
|
|
237
|
-
backgroundColor: theme.palette.warning.light,
|
|
238
|
-
color: theme.palette.grey[900],
|
|
239
|
-
},
|
|
240
|
-
}); });
|
|
241
|
-
|
|
242
|
-
var classnames = {exports: {}};
|
|
243
|
-
|
|
244
|
-
/*!
|
|
245
|
-
Copyright (c) 2018 Jed Watson.
|
|
246
|
-
Licensed under the MIT License (MIT), see
|
|
247
|
-
http://jedwatson.github.io/classnames
|
|
248
|
-
*/
|
|
249
|
-
|
|
250
|
-
(function (module) {
|
|
251
|
-
/* global define */
|
|
252
|
-
|
|
253
|
-
(function () {
|
|
254
|
-
|
|
255
|
-
var hasOwn = {}.hasOwnProperty;
|
|
256
|
-
|
|
257
|
-
function classNames () {
|
|
258
|
-
var classes = '';
|
|
259
|
-
|
|
260
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
261
|
-
var arg = arguments[i];
|
|
262
|
-
if (arg) {
|
|
263
|
-
classes = appendClass(classes, parseValue(arg));
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
return classes;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
function parseValue (arg) {
|
|
271
|
-
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
272
|
-
return arg;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
if (typeof arg !== 'object') {
|
|
276
|
-
return '';
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
if (Array.isArray(arg)) {
|
|
280
|
-
return classNames.apply(null, arg);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
284
|
-
return arg.toString();
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
var classes = '';
|
|
288
|
-
|
|
289
|
-
for (var key in arg) {
|
|
290
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
291
|
-
classes = appendClass(classes, key);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
return classes;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
function appendClass (value, newClass) {
|
|
299
|
-
if (!newClass) {
|
|
300
|
-
return value;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
if (value) {
|
|
304
|
-
return value + ' ' + newClass;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
return value + newClass;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
if (module.exports) {
|
|
311
|
-
classNames.default = classNames;
|
|
312
|
-
module.exports = classNames;
|
|
313
|
-
} else {
|
|
314
|
-
window.classNames = classNames;
|
|
315
|
-
}
|
|
316
|
-
}());
|
|
317
|
-
}(classnames));
|
|
318
|
-
|
|
319
|
-
var classNames = classnames.exports;
|
|
320
|
-
|
|
321
|
-
var StatusTag = function (_a) {
|
|
322
|
-
var _b = _a.color, color = _b === void 0 ? 'default' : _b, label = _a.label, _c = _a.size, size = _c === void 0 ? 'md' : _c, variant = _a.variant;
|
|
323
|
-
var classes = useStatusTagStyles();
|
|
324
|
-
return (React.createElement(commonUi.Box, { className: classNames([classes.root, classes[color], classes[variant], size === 'sm' ? classes.small : '']) },
|
|
325
|
-
React.createElement(commonUi.Typography, { variant: "caption" }, label)));
|
|
237
|
+
const MenuItemTags = (props) => {
|
|
238
|
+
const { itemTags } = props;
|
|
239
|
+
return (React.createElement(ItemTagGroup, null, itemTags?.slice(0, 5).map((itemTag) => (React.createElement(ItemTag, { key: itemTag.name, alt: itemTag.name, color: itemTag.color }, itemTag.abbr)))));
|
|
326
240
|
};
|
|
327
|
-
StatusTag.displayName = 'StatusTag';
|
|
328
241
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
242
|
+
const MenuItem = React.forwardRef((props, ref) => {
|
|
243
|
+
const { ariaLabel, onClick, id, description, isOutOfStock, title, loading, isFeatured, image, likeCount, reviewCount, price, available, itemTags, className, ...restProps } = props;
|
|
244
|
+
const classes = useMenuItemStyles(props);
|
|
245
|
+
const handleClick = (event) => {
|
|
333
246
|
onClick(id, event);
|
|
334
247
|
};
|
|
335
|
-
return (React.createElement(core.Card,
|
|
248
|
+
return (React.createElement(core.Card, { className: classNames(classes.card, className), ref: ref, elevation: 0, "data-component-type": "menu-item", ...restProps },
|
|
336
249
|
React.createElement(core.CardActionArea, { className: classes.cardActionArea, onClick: handleClick, disabled: loading, "aria-label": ariaLabel },
|
|
337
250
|
React.createElement(MenuItemInfo, null,
|
|
338
251
|
isFeatured && React.createElement(StatusTag, { color: "highlight", label: "Featured", variant: "filled", size: "sm" }),
|
|
@@ -351,20 +264,49 @@ var MenuItem = React.forwardRef(function (props, ref) {
|
|
|
351
264
|
});
|
|
352
265
|
MenuItem.displayName = 'MenuItem';
|
|
353
266
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
267
|
+
const useMenuTabStyles = core.makeStyles(({ palette, spacing }) => ({
|
|
268
|
+
root: {
|
|
269
|
+
'& > .MuiTab-wrapper': {
|
|
270
|
+
flexDirection: 'row-reverse',
|
|
271
|
+
gridGap: spacing(1),
|
|
272
|
+
textAlign: 'center',
|
|
273
|
+
'& > svg': {
|
|
274
|
+
marginBottom: '0 !important',
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
isUnavailable: {
|
|
279
|
+
color: palette.grey[700],
|
|
280
|
+
},
|
|
281
|
+
}));
|
|
282
|
+
|
|
283
|
+
const MenuTab = (props) => {
|
|
284
|
+
const { isUnavailable, value } = props;
|
|
285
|
+
const classes = useMenuTabStyles(props);
|
|
286
|
+
return (React.createElement(core.Tab, { "data-tab-for-section-id": value, classes: {
|
|
287
|
+
root: classes.root,
|
|
288
|
+
}, disabled: isUnavailable, icon: isUnavailable ? React.createElement(commonUi.Icon, { icon: webIcons.Clock, size: "large" }) : undefined, ...props }));
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
const MenuTabGroup = (props) => {
|
|
292
|
+
const { children, ...muiProps } = props;
|
|
293
|
+
return (React.createElement(core.Tabs, { scrollButtons: "on", variant: "scrollable", ...muiProps }, children));
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
const OrderingAppContext = React.createContext(null);
|
|
297
|
+
const useOrderingAppContext = () => {
|
|
298
|
+
const context = React.useContext(OrderingAppContext);
|
|
357
299
|
if (!context) {
|
|
358
300
|
throw new Error('useOrderingAppContext has to be used within <OrderingAppContext.Provider>');
|
|
359
301
|
}
|
|
360
302
|
return context;
|
|
361
303
|
};
|
|
362
|
-
|
|
363
|
-
|
|
304
|
+
const OrderingAppContextProvider = (props) => {
|
|
305
|
+
const context = React.useState(props.defaultContext);
|
|
364
306
|
return React.createElement(OrderingAppContext.Provider, { value: context }, props.children);
|
|
365
307
|
};
|
|
366
308
|
|
|
367
|
-
|
|
309
|
+
const useDishCheckoutCardStyles = core.makeStyles((theme) => ({
|
|
368
310
|
root: {
|
|
369
311
|
'&:first-of-type': {
|
|
370
312
|
paddingTop: 0,
|
|
@@ -379,10 +321,7 @@ var useDishCheckoutCardStyles = core.makeStyles(function (theme) { return ({
|
|
|
379
321
|
flexDirection: 'column',
|
|
380
322
|
width: '100%',
|
|
381
323
|
gridGap: theme.spacing(2),
|
|
382
|
-
borderBottom:
|
|
383
|
-
var borderBottom = _a.borderBottom;
|
|
384
|
-
return (borderBottom ? '1px solid #E0E0E0' : 'none');
|
|
385
|
-
},
|
|
324
|
+
borderBottom: ({ borderBottom }) => (borderBottom ? '1px solid #E0E0E0' : 'none'),
|
|
386
325
|
},
|
|
387
326
|
deleteButton: {
|
|
388
327
|
color: theme.palette.info.main,
|
|
@@ -443,45 +382,35 @@ var useDishCheckoutCardStyles = core.makeStyles(function (theme) { return ({
|
|
|
443
382
|
display: 'flex',
|
|
444
383
|
gridGap: theme.spacing(0.825),
|
|
445
384
|
},
|
|
446
|
-
})
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
var handleQuantityChange = function (event) {
|
|
457
|
-
return onQuantityChange(id, parseInt(event.target.value, 10));
|
|
458
|
-
};
|
|
459
|
-
var labelString = function (label) {
|
|
385
|
+
}));
|
|
386
|
+
|
|
387
|
+
const DishCheckoutCard = ({ id, borderBottom, name, quantity, modifierGroups, onDelete, onEdit, onQuantityChange, price, specialInstructions, disabled, warningMessage, image = {}, messages, maxQuantity = 99, minQuantity = 1, }) => {
|
|
388
|
+
const { src } = image;
|
|
389
|
+
const classes = useDishCheckoutCardStyles({ borderBottom });
|
|
390
|
+
const [appContext] = useOrderingAppContext();
|
|
391
|
+
const [open, setOpen] = React.useState(false);
|
|
392
|
+
const formattedPrice = typeof price === 'number' ? `${appContext.currencySymbol ?? ''}${price.toFixed(2)}` : price;
|
|
393
|
+
const handleQuantityChange = (event) => onQuantityChange(id, parseInt(event.target.value, 10));
|
|
394
|
+
const labelString = (label) => {
|
|
460
395
|
return label.replace(/[^a-zA-Z\s]/g, '').toLowerCase();
|
|
461
396
|
};
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
return groups.map(function (group) {
|
|
397
|
+
const formatModifiers = (groups, nested = false) => {
|
|
398
|
+
return groups.map((group) => {
|
|
465
399
|
// Get all selected modifiers for this group
|
|
466
|
-
|
|
467
|
-
.map(
|
|
468
|
-
return modifier.quantity > 1 ? modifier.modifierName + " \u00D7 " + modifier.quantity : modifier.modifierName;
|
|
469
|
-
})
|
|
400
|
+
const modifiers = group.selectedModifiers
|
|
401
|
+
.map((modifier) => modifier.quantity > 1 ? `${modifier.modifierName} × ${modifier.quantity}` : modifier.modifierName)
|
|
470
402
|
.join(', ');
|
|
471
403
|
// Render nested groups recursively
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
? formatModifiers(modifier.selectedModifierGroups, true)
|
|
476
|
-
: [];
|
|
477
|
-
});
|
|
404
|
+
const nestedGroups = group.selectedModifiers.flatMap((modifier) => modifier?.selectedModifierGroups && modifier?.selectedModifierGroups?.length > 0
|
|
405
|
+
? formatModifiers(modifier.selectedModifierGroups, true)
|
|
406
|
+
: []);
|
|
478
407
|
// For top-level groups, we render without the list
|
|
479
408
|
if (!nested) {
|
|
480
409
|
return (React.createElement(commonUi.Typography, { key: group.id, variant: "body2" },
|
|
481
410
|
group.menuItemModifierGroupName,
|
|
482
411
|
": ",
|
|
483
412
|
modifiers,
|
|
484
|
-
|
|
413
|
+
nestedGroups?.length > 0 && React.createElement("ul", { className: classes.ul }, nestedGroups)));
|
|
485
414
|
}
|
|
486
415
|
// For nested groups, we use list items
|
|
487
416
|
return (React.createElement("li", { key: group.id, className: classes.li },
|
|
@@ -508,7 +437,7 @@ var DishCheckoutCard = function (_a) {
|
|
|
508
437
|
React.createElement(commonUi.Icon, { icon: webIcons.Trash, size: "large" })))),
|
|
509
438
|
React.createElement(commonUi.Box, { display: "flex", gridGap: 16, alignItems: "center" },
|
|
510
439
|
React.createElement(core.FormControl, { variant: "outlined", hiddenLabel: true },
|
|
511
|
-
React.createElement(core.Select, { disabled: disabled, value: quantity, onOpen:
|
|
440
|
+
React.createElement(core.Select, { disabled: disabled, value: quantity, onOpen: () => setOpen(true), onClose: () => setOpen(false), SelectDisplayProps: { 'aria-label': `${labelString(name)} quantity select` }, disableUnderline: true, onChange: handleQuantityChange, fullWidth: true, startAdornment: React.createElement(core.InputAdornment, { position: "start" },
|
|
512
441
|
React.createElement(commonUi.Icon, { icon: open ? webIcons.ChevronUp : webIcons.ChevronDown, size: "large" })), inputProps: { shrink: false }, MenuProps: {
|
|
513
442
|
disablePortal: true,
|
|
514
443
|
anchorOrigin: {
|
|
@@ -521,7 +450,7 @@ var DishCheckoutCard = function (_a) {
|
|
|
521
450
|
},
|
|
522
451
|
getContentAnchorEl: null,
|
|
523
452
|
classes: { paper: classes.selectPaper },
|
|
524
|
-
}, className: classes.select }, Array.from({ length: maxQuantity - minQuantity + 1 },
|
|
453
|
+
}, className: classes.select }, Array.from({ length: maxQuantity - minQuantity + 1 }, (_, index) => (React.createElement(core.MenuItem, { key: index + minQuantity, value: index + minQuantity, "aria-label": `${index + minQuantity}` }, index + minQuantity))))),
|
|
525
454
|
React.createElement(commonUi.Typography, { className: classes.price }, formattedPrice)),
|
|
526
455
|
warningMessage && (React.createElement(commonUi.Box, { className: classes.warning },
|
|
527
456
|
React.createElement(commonUi.Box, { paddingTop: 0.25 },
|
|
@@ -529,8 +458,8 @@ var DishCheckoutCard = function (_a) {
|
|
|
529
458
|
React.createElement(commonUi.Typography, { variant: "body2" }, warningMessage)))));
|
|
530
459
|
};
|
|
531
460
|
|
|
532
|
-
|
|
533
|
-
|
|
461
|
+
const DishDetailsReview = React.forwardRef((props) => {
|
|
462
|
+
const { userName, userAvatarUrl, content, createdAgo, alt } = props;
|
|
534
463
|
return (React.createElement(commonUi.Box, { display: "flex" },
|
|
535
464
|
React.createElement(commonUi.Box, { mr: 1 },
|
|
536
465
|
React.createElement(commonUi.Avatar, { size: "small", src: userAvatarUrl, alt: alt })),
|
|
@@ -542,14 +471,14 @@ var DishDetailsReview = React.forwardRef(function (props) {
|
|
|
542
471
|
});
|
|
543
472
|
DishDetailsReview.displayName = 'DishDetailsReview';
|
|
544
473
|
|
|
545
|
-
|
|
474
|
+
const useDishModifierCardStyles = core.makeStyles((theme) => ({
|
|
546
475
|
root: {
|
|
547
476
|
borderRadius: '8px',
|
|
548
477
|
border: '1px solid var(--surfaces-card-stroke, #E0E0E0)',
|
|
549
478
|
display: 'flex',
|
|
550
479
|
flexDirection: 'column',
|
|
551
480
|
padding: theme.spacing(2.5),
|
|
552
|
-
color: theme.palette.grey[900]
|
|
481
|
+
color: `${theme.palette.grey[900]} !important`,
|
|
553
482
|
},
|
|
554
483
|
error: {
|
|
555
484
|
color: theme.palette.error.main,
|
|
@@ -561,8 +490,8 @@ var useDishModifierCardStyles = core.makeStyles(function (theme) { return ({
|
|
|
561
490
|
fontSize: theme.spacing(2.25),
|
|
562
491
|
marginBottom: theme.spacing(2),
|
|
563
492
|
},
|
|
564
|
-
})
|
|
565
|
-
|
|
493
|
+
}));
|
|
494
|
+
const useRadioModifierFormStyles = core.makeStyles((theme) => ({
|
|
566
495
|
label: {
|
|
567
496
|
alignItems: 'center',
|
|
568
497
|
display: 'flex',
|
|
@@ -587,8 +516,8 @@ var useRadioModifierFormStyles = core.makeStyles(function (theme) { return ({
|
|
|
587
516
|
flex: 1,
|
|
588
517
|
},
|
|
589
518
|
},
|
|
590
|
-
})
|
|
591
|
-
|
|
519
|
+
}));
|
|
520
|
+
const useCheckboxModifierFormStyles = core.makeStyles((theme) => ({
|
|
592
521
|
label: {
|
|
593
522
|
alignItems: 'center',
|
|
594
523
|
display: 'flex',
|
|
@@ -613,8 +542,8 @@ var useCheckboxModifierFormStyles = core.makeStyles(function (theme) { return ({
|
|
|
613
542
|
flex: 1,
|
|
614
543
|
},
|
|
615
544
|
},
|
|
616
|
-
})
|
|
617
|
-
|
|
545
|
+
}));
|
|
546
|
+
const useLabelStyles = core.makeStyles((theme) => ({
|
|
618
547
|
label: {
|
|
619
548
|
margin: theme.spacing(0.5, 0),
|
|
620
549
|
},
|
|
@@ -624,27 +553,27 @@ var useLabelStyles = core.makeStyles(function (theme) { return ({
|
|
|
624
553
|
price: {
|
|
625
554
|
color: theme.palette.grey[700],
|
|
626
555
|
},
|
|
627
|
-
})
|
|
628
|
-
|
|
556
|
+
}));
|
|
557
|
+
const useOptionsStyles = core.makeStyles((theme) => ({
|
|
629
558
|
options: {
|
|
630
559
|
color: theme.palette.info.main,
|
|
631
560
|
marginBottom: theme.spacing(1.5),
|
|
632
561
|
padding: 0,
|
|
633
562
|
},
|
|
634
|
-
})
|
|
563
|
+
}));
|
|
635
564
|
|
|
636
|
-
|
|
565
|
+
const useQuantityPickerStyles = core.makeStyles((theme) => ({
|
|
637
566
|
root: {
|
|
638
567
|
height: theme.spacing(7),
|
|
639
568
|
backgroundColor: 'none',
|
|
640
569
|
},
|
|
641
|
-
})
|
|
642
|
-
|
|
570
|
+
}));
|
|
571
|
+
const useQuantityInputStyles = core.makeStyles((theme) => ({
|
|
643
572
|
root: {
|
|
644
573
|
height: '100%',
|
|
645
574
|
width: 'min-content',
|
|
646
575
|
borderRadius: theme.spacing(12.5),
|
|
647
|
-
background:
|
|
576
|
+
background: (props) => (props.variation === 'modifierCount' ? 'unset' : theme.palette.grey[100]),
|
|
648
577
|
},
|
|
649
578
|
input: {
|
|
650
579
|
'&::-webkit-clear-button, &::-webkit-outer-spin-button, &::-webkit-inner-spin-button': {
|
|
@@ -654,47 +583,46 @@ var useQuantityInputStyles = core.makeStyles(function (theme) { return ({
|
|
|
654
583
|
fontWeight: 600,
|
|
655
584
|
padding: 0,
|
|
656
585
|
textAlign: 'center',
|
|
657
|
-
zIndex:
|
|
658
|
-
backgroundColor:
|
|
659
|
-
alignSelf:
|
|
660
|
-
height:
|
|
661
|
-
minWidth:
|
|
662
|
-
borderRadius:
|
|
663
|
-
margin:
|
|
664
|
-
},
|
|
665
|
-
})
|
|
666
|
-
|
|
586
|
+
zIndex: (props) => (props.value === 0 && props.variation === 'modifierCount' ? -1 : 1),
|
|
587
|
+
backgroundColor: (props) => (props.variation === 'modifierCount' ? theme.palette.grey[100] : 'unset'),
|
|
588
|
+
alignSelf: (props) => (props.variation === 'modifierCount' ? 'stretch' : 'unset'),
|
|
589
|
+
height: (props) => (props.variation === 'modifierCount' ? 'auto' : 'unset'),
|
|
590
|
+
minWidth: (props) => (props.variation === 'modifierCount' ? theme.spacing(5) : theme.spacing(2.75)),
|
|
591
|
+
borderRadius: (props) => (props.variation === 'modifierCount' ? theme.spacing(1) : 'unset'),
|
|
592
|
+
margin: (props) => (props.variation === 'modifierCount' ? theme.spacing(0.5, 0) : 0),
|
|
593
|
+
},
|
|
594
|
+
}));
|
|
595
|
+
const useStartAdornmentStyles = core.makeStyles((theme) => ({
|
|
667
596
|
root: {
|
|
668
597
|
color: theme.palette.text.primary,
|
|
669
|
-
zIndex:
|
|
598
|
+
zIndex: (props) => (props.value === 0 && props.variation === 'modifierCount' ? -1 : 1),
|
|
670
599
|
},
|
|
671
|
-
})
|
|
672
|
-
|
|
600
|
+
}));
|
|
601
|
+
const useEndAdornmentStyles = core.makeStyles((theme) => ({
|
|
673
602
|
root: {
|
|
674
603
|
color: theme.palette.text.primary,
|
|
675
604
|
},
|
|
676
|
-
})
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
var onIncrement = function (event) {
|
|
605
|
+
}));
|
|
606
|
+
|
|
607
|
+
const QuantityPicker = ({ value, onChange, disabled, preventManualChange, disableIncrement, variation, name, min = 1, max = 99, }) => {
|
|
608
|
+
const fieldClasses = useQuantityPickerStyles();
|
|
609
|
+
const inputClasses = useQuantityInputStyles({ variation, value });
|
|
610
|
+
const startAdornmentClasses = useStartAdornmentStyles({ variation, value });
|
|
611
|
+
const endAdornmentClasses = useEndAdornmentStyles({ variation, value });
|
|
612
|
+
const inputRef = React.useRef(null);
|
|
613
|
+
const [shouldSelect, setShouldSelect] = React.useState(false);
|
|
614
|
+
const onIncrement = (event) => {
|
|
687
615
|
onChange(event, { quantity: value + 1, reason: 'increment' });
|
|
688
616
|
};
|
|
689
|
-
|
|
617
|
+
const onDecrement = (event) => {
|
|
690
618
|
onChange(event, { quantity: value - 1, reason: 'decrement' });
|
|
691
619
|
};
|
|
692
|
-
|
|
620
|
+
const handleChange = (event) => {
|
|
693
621
|
if (preventManualChange) {
|
|
694
622
|
event.preventDefault();
|
|
695
623
|
return;
|
|
696
624
|
}
|
|
697
|
-
|
|
625
|
+
let newValue = parseInt(event.target.value, 10);
|
|
698
626
|
if (isNaN(newValue)) {
|
|
699
627
|
newValue = min;
|
|
700
628
|
setShouldSelect(true);
|
|
@@ -709,7 +637,7 @@ var QuantityPicker = function (_a) {
|
|
|
709
637
|
newValue = max;
|
|
710
638
|
onChange(event, { quantity: newValue, reason: 'change' });
|
|
711
639
|
};
|
|
712
|
-
React.useEffect(
|
|
640
|
+
React.useEffect(() => {
|
|
713
641
|
if (shouldSelect && inputRef.current) {
|
|
714
642
|
inputRef.current.focus();
|
|
715
643
|
inputRef.current.select();
|
|
@@ -719,40 +647,39 @@ var QuantityPicker = function (_a) {
|
|
|
719
647
|
return (React.createElement(core.TextField, { classes: fieldClasses, type: "number", variant: variation === 'itemCount' ? 'filled' : 'standard', value: value, disabled: disabled, onChange: handleChange, inputRef: inputRef, InputProps: {
|
|
720
648
|
classes: inputClasses,
|
|
721
649
|
disableUnderline: true,
|
|
722
|
-
endAdornment: (React.createElement(commonUi.IconButton, { "aria-label":
|
|
650
|
+
endAdornment: (React.createElement(commonUi.IconButton, { "aria-label": `increase quantity ${name}`, className: endAdornmentClasses.root, color: "default", onClick: onIncrement, disabled: disabled || value >= max || disableIncrement },
|
|
723
651
|
React.createElement(commonUi.Icon, { icon: webIcons.PlusCircle }))),
|
|
724
|
-
startAdornment: (React.createElement(commonUi.IconButton, { "aria-label":
|
|
652
|
+
startAdornment: (React.createElement(commonUi.IconButton, { "aria-label": `decrease quantity ${name}`, className: startAdornmentClasses.root, color: "default", onClick: onDecrement, disabled: disabled || value <= min },
|
|
725
653
|
React.createElement(commonUi.Icon, { icon: webIcons.MinusCircle }))),
|
|
726
654
|
}, inputProps: {
|
|
727
|
-
min
|
|
728
|
-
max
|
|
655
|
+
min,
|
|
656
|
+
max,
|
|
729
657
|
} }));
|
|
730
658
|
};
|
|
731
659
|
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
var classes = useLabelStyles();
|
|
660
|
+
const Label = (props) => {
|
|
661
|
+
const { name, price, disabled = false } = props;
|
|
662
|
+
const classes = useLabelStyles();
|
|
736
663
|
return (React.createElement(core.Box, { display: "flex", flexDirection: "column", className: classes.label },
|
|
737
664
|
React.createElement(core.Box, { display: "flex", alignItems: "center", gridGap: 8 },
|
|
738
|
-
React.createElement(core.Typography, { className: classNames(
|
|
739
|
-
price && (React.createElement(core.Typography, { className: classNames(
|
|
665
|
+
React.createElement(core.Typography, { className: classNames({ [classes.disabled]: disabled }) }, name)),
|
|
666
|
+
price && (React.createElement(core.Typography, { className: classNames({ [classes.price]: !disabled }, { [classes.disabled]: disabled }) },
|
|
740
667
|
"+ ",
|
|
741
668
|
price))));
|
|
742
669
|
};
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
670
|
+
const Options = (props) => {
|
|
671
|
+
const { handleOptionsClick } = props;
|
|
672
|
+
const classes = useOptionsStyles();
|
|
746
673
|
return (React.createElement(core.Box, null,
|
|
747
674
|
React.createElement(Button, { variation: "none", className: classes.options, onClick: handleOptionsClick },
|
|
748
675
|
React.createElement(core.Typography, { variant: "caption" }, "OPTIONS"),
|
|
749
676
|
React.createElement(commonUi.Icon, { icon: webIcons.ChevronRight }))));
|
|
750
677
|
};
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
678
|
+
const SingleSelectModifierControl = (props) => {
|
|
679
|
+
const { modifiers, name, isOutOfStock, onChange, value, handleOptionsClick, aggregatePrice, isRequired } = props;
|
|
680
|
+
const radioClasses = useRadioModifierFormStyles();
|
|
681
|
+
const makeHandleChange = (modifier) => (e) => {
|
|
682
|
+
const isModifierInValue = Boolean(value.find((v) => v.modifierId === modifier.id));
|
|
756
683
|
if (!isModifierInValue && modifier.hasModifiers) {
|
|
757
684
|
handleOptionsClick(modifier.id);
|
|
758
685
|
}
|
|
@@ -764,27 +691,23 @@ var SingleSelectModifierControl = function (props) {
|
|
|
764
691
|
price: modifier.price || 0,
|
|
765
692
|
quantity: 1,
|
|
766
693
|
});
|
|
767
|
-
};
|
|
694
|
+
};
|
|
768
695
|
return (React.createElement(core.FormControl, { fullWidth: true },
|
|
769
|
-
React.createElement(core.RadioGroup, { "aria-label": name }, modifiers.map(
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
modifier.outOfStock && (React.createElement(core.Box, { minWidth: "90px", marginLeft: 2 },
|
|
779
|
-
React.createElement(StatusTag, { color: "warning", label: "Out of stock", variant: "outlined", size: "md" })))), labelPlacement: "start" }),
|
|
780
|
-
modifier.hasModifiers && !modifier.outOfStock && (React.createElement(Options, { handleOptionsClick: function () { return handleOptionsClick(modifier.id); } }))));
|
|
781
|
-
}))));
|
|
696
|
+
React.createElement(core.RadioGroup, { "aria-label": name }, modifiers.map((modifier) => (React.createElement(core.Box, { key: modifier.id },
|
|
697
|
+
React.createElement(core.FormControlLabel, { key: modifier.id, value: modifier.id, className: radioClasses.root, control: React.createElement(core.Radio, { checked: value[0]?.modifierId === modifier.id, className: classNames({
|
|
698
|
+
[radioClasses.hideRadio]: modifier.outOfStock,
|
|
699
|
+
[radioClasses.radio]: !modifier.outOfStock,
|
|
700
|
+
}), disabled: isOutOfStock || modifier.outOfStock, onChange: makeHandleChange(modifier), required: isRequired }), label: React.createElement(core.Box, { className: radioClasses.label },
|
|
701
|
+
React.createElement(Label, { name: modifier.name, price: aggregatePrice[modifier.id] || modifier.formattedPrice, disabled: isOutOfStock || modifier.outOfStock }),
|
|
702
|
+
modifier.outOfStock && (React.createElement(core.Box, { minWidth: "90px", marginLeft: 2 },
|
|
703
|
+
React.createElement(StatusTag, { color: "warning", label: "Out of stock", variant: "outlined", size: "md" })))), labelPlacement: "start" }),
|
|
704
|
+
modifier.hasModifiers && !modifier.outOfStock && (React.createElement(Options, { handleOptionsClick: () => handleOptionsClick(modifier.id) }))))))));
|
|
782
705
|
};
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
706
|
+
const MultipleSelectControl = (props) => {
|
|
707
|
+
const { modifiers, value, isOutOfStock, onChange, disableNewSelections, handleOptionsClick, aggregatePrice } = props;
|
|
708
|
+
const classes = useCheckboxModifierFormStyles();
|
|
709
|
+
const makeHandleChange = (modifier) => () => {
|
|
710
|
+
const isModifierInValue = Boolean(value.find((v) => v.modifierId === modifier.id));
|
|
788
711
|
if (!isModifierInValue && modifier.hasModifiers) {
|
|
789
712
|
handleOptionsClick(modifier.id);
|
|
790
713
|
}
|
|
@@ -796,21 +719,20 @@ var MultipleSelectControl = function (props) {
|
|
|
796
719
|
price: modifier.price || 0,
|
|
797
720
|
quantity: isModifierInValue ? 0 : 1,
|
|
798
721
|
});
|
|
799
|
-
};
|
|
722
|
+
};
|
|
800
723
|
return (React.createElement(core.FormControl, { fullWidth: true },
|
|
801
|
-
React.createElement(core.FormGroup, null, modifiers.map(
|
|
802
|
-
var _a, _b;
|
|
724
|
+
React.createElement(core.FormGroup, null, modifiers.map((modifier) => {
|
|
803
725
|
return (React.createElement(core.Box, { key: modifier.id },
|
|
804
|
-
React.createElement(core.FormControlLabel, { key: modifier.id, value: modifier.id, className: classes.root, checked: value.some(
|
|
726
|
+
React.createElement(core.FormControlLabel, { key: modifier.id, value: modifier.id, className: classes.root, checked: value.some((v) => v.modifierId === modifier.id), onChange: makeHandleChange(modifier), control: React.createElement(core.Checkbox, { className: classNames({ [classes.hideCheckbox]: modifier.outOfStock }, { [classes.checkbox]: !modifier.outOfStock }), disabled: isOutOfStock || modifier.outOfStock || (!modifier.quantity && disableNewSelections) }), label: React.createElement(core.Box, { className: classes.label },
|
|
805
727
|
React.createElement(Label, { name: modifier.name, price: aggregatePrice[modifier.id] || modifier.formattedPrice, disabled: isOutOfStock || modifier.outOfStock }),
|
|
806
728
|
modifier.outOfStock && (React.createElement(core.Box, { minWidth: "90px", marginLeft: 2 },
|
|
807
729
|
React.createElement(StatusTag, { color: "warning", label: "Out of stock", variant: "outlined", size: "md" })))), labelPlacement: "start" }),
|
|
808
|
-
modifier.hasModifiers && !modifier.outOfStock && (React.createElement(Options, { handleOptionsClick:
|
|
730
|
+
modifier.hasModifiers && !modifier.outOfStock && (React.createElement(Options, { handleOptionsClick: () => handleOptionsClick(modifier.id) }))));
|
|
809
731
|
}))));
|
|
810
732
|
};
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
733
|
+
const MultipleQuantitySelectControl = (props) => {
|
|
734
|
+
const { modifiers, isOutOfStock, onChange, disableNewSelections, handleOptionsClick, selectionQuantity } = props;
|
|
735
|
+
const makeHandleChange = (modifier) => (_e, customEvent) => {
|
|
814
736
|
onChange({
|
|
815
737
|
isRadio: false,
|
|
816
738
|
modifierId: modifier.id,
|
|
@@ -819,16 +741,16 @@ var MultipleQuantitySelectControl = function (props) {
|
|
|
819
741
|
price: modifier.price || 0,
|
|
820
742
|
quantity: customEvent.quantity,
|
|
821
743
|
});
|
|
822
|
-
};
|
|
744
|
+
};
|
|
823
745
|
return (React.createElement(core.FormControl, { fullWidth: true },
|
|
824
|
-
React.createElement(core.FormGroup, null, modifiers.map(
|
|
746
|
+
React.createElement(core.FormGroup, null, modifiers.map((modifier) => (React.createElement(core.Box, { key: modifier.id, style: { justifyContent: 'space-between', flexDirection: 'column' }, display: "flex" },
|
|
825
747
|
React.createElement(core.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" },
|
|
826
748
|
React.createElement(Label, { name: modifier.name, price: modifier.formattedPrice, disabled: isOutOfStock || modifier.outOfStock }),
|
|
827
749
|
modifier.outOfStock && (React.createElement(core.Box, { minWidth: "90px", marginLeft: 2 },
|
|
828
750
|
React.createElement(StatusTag, { color: "warning", label: "Out of stock", variant: "outlined", size: "md" }))),
|
|
829
751
|
!modifier.outOfStock && (React.createElement(QuantityPicker, { variation: "modifierCount", value: modifier.quantity, disableIncrement: disableNewSelections, preventManualChange: true, onChange: makeHandleChange(modifier), disabled: isOutOfStock || modifier.outOfStock, name: modifier.name }))),
|
|
830
752
|
React.createElement(core.Box, { display: "flex", alignItems: "flex-start", gridGap: 4 },
|
|
831
|
-
modifier.hasModifiers && !modifier.outOfStock && (React.createElement(Options, { handleOptionsClick:
|
|
753
|
+
modifier.hasModifiers && !modifier.outOfStock && (React.createElement(Options, { handleOptionsClick: () => handleOptionsClick(modifier.id) })),
|
|
832
754
|
selectionQuantity[modifier.id] &&
|
|
833
755
|
selectionQuantity[modifier.id].requiredSelectionCount > 0 &&
|
|
834
756
|
selectionQuantity[modifier.id].requiredSelectionCount !==
|
|
@@ -836,25 +758,25 @@ var MultipleQuantitySelectControl = function (props) {
|
|
|
836
758
|
selectionQuantity[modifier.id].currentSelectionCount,
|
|
837
759
|
"/",
|
|
838
760
|
selectionQuantity[modifier.id].requiredSelectionCount,
|
|
839
|
-
" selected")))))
|
|
761
|
+
" selected")))))))));
|
|
840
762
|
};
|
|
841
|
-
|
|
763
|
+
const ModifierControls = (props) => {
|
|
842
764
|
switch (props.type) {
|
|
843
765
|
case 'singleSelect':
|
|
844
|
-
return React.createElement(SingleSelectModifierControl,
|
|
766
|
+
return React.createElement(SingleSelectModifierControl, { ...props });
|
|
845
767
|
case 'multipleSelect':
|
|
846
|
-
return React.createElement(MultipleSelectControl,
|
|
768
|
+
return React.createElement(MultipleSelectControl, { ...props });
|
|
847
769
|
case 'multipleQuantitySelect':
|
|
848
|
-
return React.createElement(MultipleQuantitySelectControl,
|
|
770
|
+
return React.createElement(MultipleQuantitySelectControl, { ...props });
|
|
849
771
|
default:
|
|
850
772
|
return null;
|
|
851
773
|
}
|
|
852
774
|
};
|
|
853
775
|
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
776
|
+
const getStatusTagProps = (props) => {
|
|
777
|
+
const { messages, error, isRequired, isOutOfStock } = props;
|
|
778
|
+
const { optionalText, outOfStockText, requiredText } = messages;
|
|
779
|
+
let color = 'default';
|
|
858
780
|
switch (true) {
|
|
859
781
|
case error:
|
|
860
782
|
color = 'error';
|
|
@@ -863,7 +785,7 @@ var getStatusTagProps = function (props) {
|
|
|
863
785
|
color = 'warning';
|
|
864
786
|
break;
|
|
865
787
|
}
|
|
866
|
-
|
|
788
|
+
let label = optionalText;
|
|
867
789
|
switch (true) {
|
|
868
790
|
case isOutOfStock:
|
|
869
791
|
label = outOfStockText;
|
|
@@ -872,40 +794,33 @@ var getStatusTagProps = function (props) {
|
|
|
872
794
|
label = requiredText;
|
|
873
795
|
break;
|
|
874
796
|
}
|
|
875
|
-
|
|
876
|
-
return { color
|
|
797
|
+
const variant = isRequired || isOutOfStock ? 'outlined' : 'filled';
|
|
798
|
+
return { color, label, variant };
|
|
877
799
|
};
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
var classes = useDishModifierCardStyles();
|
|
800
|
+
const DishModifierCard = (props) => {
|
|
801
|
+
const { aggregatePrice, name, disableNewSelections, modifiers, value, messages, onChange, type, error, isOutOfStock, isRequired, handleOptionsClick, selectionQuantity, } = props;
|
|
802
|
+
const classes = useDishModifierCardStyles();
|
|
882
803
|
return (React.createElement(commonUi.Box, { className: classes.root },
|
|
883
804
|
React.createElement(commonUi.Box, { display: "flex", justifyContent: "space-between", width: "100%", alignItems: "center", height: "fit-content", marginBottom: 2 },
|
|
884
|
-
React.createElement(StatusTag,
|
|
885
|
-
!isOutOfStock && (React.createElement(commonUi.Typography, { variant: "subtitle1", className: classNames(
|
|
805
|
+
React.createElement(StatusTag, { ...getStatusTagProps(props) }),
|
|
806
|
+
!isOutOfStock && (React.createElement(commonUi.Typography, { variant: "subtitle1", className: classNames({ [classes.error]: error, [classes.helperText]: !error }) }, messages.helperText))),
|
|
886
807
|
React.createElement(commonUi.Typography, { className: classes.name }, name),
|
|
887
808
|
React.createElement(commonUi.Box, null,
|
|
888
809
|
React.createElement(ModifierControls, { name: name, value: value, modifiers: modifiers, isOutOfStock: isOutOfStock, isRequired: isRequired, onChange: onChange, disableNewSelections: disableNewSelections, type: type, messages: messages, handleOptionsClick: handleOptionsClick, aggregatePrice: aggregatePrice, selectionQuantity: selectionQuantity }))));
|
|
889
810
|
};
|
|
890
811
|
DishModifierCard.displayName = 'DishModifierCard';
|
|
891
812
|
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
813
|
+
const useLocationCardStyles = core.makeStyles((theme) => {
|
|
814
|
+
const { palette: { info, grey, secondary, background }, spacing, } = theme;
|
|
815
|
+
const selectedBackgroundColor = core.lighten(info.light, 0.9);
|
|
816
|
+
const backgroundColor = background.default;
|
|
896
817
|
return {
|
|
897
818
|
root: {
|
|
898
|
-
border:
|
|
899
|
-
var selected = _a.selected;
|
|
900
|
-
return selected ? "1px solid " + info.light : '1px solid var(--surfaces-card-stroke, #E0E0E0)';
|
|
901
|
-
},
|
|
819
|
+
border: ({ selected }) => selected ? `1px solid ${info.light}` : '1px solid var(--surfaces-card-stroke, #E0E0E0)',
|
|
902
820
|
display: 'flex',
|
|
903
821
|
borderRadius: '10px',
|
|
904
822
|
color: grey[900],
|
|
905
|
-
backgroundColor:
|
|
906
|
-
var selected = _a.selected, outOfRange = _a.outOfRange;
|
|
907
|
-
return selected ? selectedBackgroundColor : outOfRange ? grey[200] : backgroundColor;
|
|
908
|
-
},
|
|
823
|
+
backgroundColor: ({ selected, outOfRange }) => selected ? selectedBackgroundColor : outOfRange ? grey[200] : backgroundColor,
|
|
909
824
|
},
|
|
910
825
|
actionAreaFocusHighlight: {
|
|
911
826
|
'&:disabled': {
|
|
@@ -949,15 +864,15 @@ var useLocationCardStyles = core.makeStyles(function (theme) {
|
|
|
949
864
|
};
|
|
950
865
|
});
|
|
951
866
|
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
867
|
+
const LocationCard = (props) => {
|
|
868
|
+
const { name, address, distance, generalAvailability, pickupAvailability, deliveryAvailability, onClick, selected, value, outOfRange, outOfRangeMessage, CardActionAreaProps, ...muiProps } = props;
|
|
869
|
+
const classes = useLocationCardStyles(props);
|
|
870
|
+
const anyAvailability = generalAvailability || pickupAvailability || deliveryAvailability;
|
|
871
|
+
const handleClick = () => {
|
|
957
872
|
onClick(value);
|
|
958
873
|
};
|
|
959
|
-
return (React.createElement(core.Card,
|
|
960
|
-
React.createElement(core.CardActionArea,
|
|
874
|
+
return (React.createElement(core.Card, { className: classes.root, ...muiProps },
|
|
875
|
+
React.createElement(core.CardActionArea, { onClick: handleClick, role: "radio", "aria-checked": selected, disabled: outOfRange || Boolean(anyAvailability), classes: { focusHighlight: classes.actionAreaFocusHighlight }, ...CardActionAreaProps },
|
|
961
876
|
React.createElement(core.CardContent, { className: classes.content },
|
|
962
877
|
React.createElement(core.Box, { className: classes.locationInfo },
|
|
963
878
|
React.createElement(core.Box, { display: "flex", justifyContent: "space-between" },
|
|
@@ -975,55 +890,48 @@ var LocationCard = function (props) {
|
|
|
975
890
|
React.createElement(core.Typography, { variant: "body2", className: classes.greyText }, outOfRangeMessage)))))));
|
|
976
891
|
};
|
|
977
892
|
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
_a[theme.breakpoints.up('lg')] = {
|
|
983
|
-
alignSelf: 'start',
|
|
984
|
-
},
|
|
985
|
-
_a),
|
|
986
|
-
menuItem: {
|
|
987
|
-
alignItems: 'center',
|
|
988
|
-
display: 'flex',
|
|
989
|
-
gridGap: theme.spacing(1),
|
|
893
|
+
const useMenuDropdownStyles = core.makeStyles((theme) => ({
|
|
894
|
+
formControl: {
|
|
895
|
+
[theme.breakpoints.up('lg')]: {
|
|
896
|
+
alignSelf: 'start',
|
|
990
897
|
},
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
898
|
+
},
|
|
899
|
+
menuItem: {
|
|
900
|
+
alignItems: 'center',
|
|
901
|
+
display: 'flex',
|
|
902
|
+
gridGap: theme.spacing(1),
|
|
903
|
+
},
|
|
904
|
+
select: {
|
|
905
|
+
'& .MuiSelect-root': {
|
|
906
|
+
'&:focus': {
|
|
907
|
+
outline: '2px solid #0076CB',
|
|
908
|
+
borderRadius: 8,
|
|
909
|
+
},
|
|
910
|
+
color: '#212121',
|
|
911
|
+
padding: theme.spacing(1, 0.5, 1, 0.5),
|
|
912
|
+
zIndex: 10,
|
|
913
|
+
[theme.breakpoints.down('md')]: {
|
|
914
|
+
width: 0,
|
|
915
|
+
minWidth: 0,
|
|
916
|
+
padding: 0,
|
|
917
|
+
},
|
|
1010
918
|
},
|
|
1011
|
-
}
|
|
1012
|
-
|
|
919
|
+
},
|
|
920
|
+
unavailable: {
|
|
921
|
+
color: theme.palette.grey[700],
|
|
922
|
+
},
|
|
923
|
+
}));
|
|
1013
924
|
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
var breakpoints = _a.breakpoints;
|
|
1020
|
-
return breakpoints.down('md');
|
|
1021
|
-
});
|
|
925
|
+
const MenuDropdown = (props) => {
|
|
926
|
+
const { menuOptions, onSelect, selectedOptionId } = props;
|
|
927
|
+
const classes = useMenuDropdownStyles(props);
|
|
928
|
+
const [open, setOpen] = React.useState(false);
|
|
929
|
+
const isMobile = core.useMediaQuery((theme) => theme.breakpoints.down('md'));
|
|
1022
930
|
return (React.createElement(core.FormControl, { hiddenLabel: true, classes: { root: classes.formControl } },
|
|
1023
931
|
React.createElement("label", { id: "menu-dropdown-label", className: "sr-only" }, props.label),
|
|
1024
|
-
React.createElement(core.Select, { SelectDisplayProps: { 'aria-labelledby': 'menu-dropdown-label' }, value: selectedOptionId, onOpen:
|
|
1025
|
-
React.createElement(commonUi.Icon, { icon: webIcons.RestaurantMenu, size: isMobile ? 'extra-large' : 'large' })), IconComponent:
|
|
1026
|
-
React.createElement(commonUi.Icon, { color: "#0076CB", icon: open ? webIcons.ChevronUp : webIcons.ChevronDown, size: "large" })))
|
|
932
|
+
React.createElement(core.Select, { SelectDisplayProps: { 'aria-labelledby': 'menu-dropdown-label' }, value: selectedOptionId, onOpen: () => setOpen(true), onClose: () => setOpen(false), disableUnderline: true, onChange: (event) => onSelect(event.target.value), fullWidth: true, open: open, startAdornment: React.createElement(core.InputAdornment, { position: "start", onClick: () => setOpen(true) },
|
|
933
|
+
React.createElement(commonUi.Icon, { icon: webIcons.RestaurantMenu, size: isMobile ? 'extra-large' : 'large' })), IconComponent: () => (React.createElement(core.InputAdornment, { position: "end", onClick: () => setOpen(true) },
|
|
934
|
+
React.createElement(commonUi.Icon, { color: "#0076CB", icon: open ? webIcons.ChevronUp : webIcons.ChevronDown, size: "large" }))), MenuProps: {
|
|
1027
935
|
disablePortal: true,
|
|
1028
936
|
anchorOrigin: {
|
|
1029
937
|
vertical: 'bottom',
|
|
@@ -1034,9 +942,9 @@ var MenuDropdown = function (props) {
|
|
|
1034
942
|
horizontal: 'left',
|
|
1035
943
|
},
|
|
1036
944
|
getContentAnchorEl: null,
|
|
1037
|
-
}, className: classes.select, renderValue:
|
|
945
|
+
}, className: classes.select, renderValue: (selected) => menuOptions.find((menuOption) => menuOption.id === selected)?.name }, menuOptions.map((option, index) => (React.createElement(core.MenuItem, { key: index, value: option.id, className: classNames(classes.menuItem, option.isUnavailable ? classes.unavailable : '') },
|
|
1038
946
|
option.name,
|
|
1039
|
-
option.isUnavailable && React.createElement(commonUi.Icon, { icon: webIcons.Clock, size: "large" })))
|
|
947
|
+
option.isUnavailable && React.createElement(commonUi.Icon, { icon: webIcons.Clock, size: "large" })))))));
|
|
1040
948
|
};
|
|
1041
949
|
|
|
1042
950
|
var _path;
|
|
@@ -1056,36 +964,36 @@ function SvgLeafIcon(props) {
|
|
|
1056
964
|
})));
|
|
1057
965
|
}
|
|
1058
966
|
|
|
1059
|
-
|
|
967
|
+
const useMenuFilterStyles = core.makeStyles((theme) => ({
|
|
1060
968
|
triggerLabel: {
|
|
1061
969
|
color: theme.palette.info.main,
|
|
1062
970
|
whiteSpace: 'nowrap',
|
|
1063
971
|
},
|
|
1064
|
-
})
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
972
|
+
}));
|
|
973
|
+
|
|
974
|
+
const MenuFilter = (props) => {
|
|
975
|
+
const { options, onChange, onClear, value, triggerLabel = 'Add Filter', noOptionsLabel = 'Reset Filters' } = props;
|
|
976
|
+
const triggerId = 'menu-filter-trigger';
|
|
977
|
+
const popoverId = 'menu-filter-popover';
|
|
978
|
+
const classes = useMenuFilterStyles();
|
|
979
|
+
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
980
|
+
const open = Boolean(anchorEl);
|
|
981
|
+
const optionIds = options.map((opt) => opt.id);
|
|
982
|
+
const valueIds = value.map((val) => val.id);
|
|
983
|
+
const availableIds = optionIds.filter((optionId) => !valueIds.includes(optionId));
|
|
984
|
+
const availableFilters = options.filter((opt) => availableIds.includes(opt.id));
|
|
985
|
+
const allFiltersSelected = availableFilters.length === 0;
|
|
986
|
+
const handleChange = (value, event) => {
|
|
1079
987
|
onChange(value, event);
|
|
1080
988
|
setAnchorEl(null);
|
|
1081
989
|
};
|
|
1082
|
-
|
|
990
|
+
const handleTriggerClick = (event) => {
|
|
1083
991
|
setAnchorEl(event.currentTarget);
|
|
1084
992
|
};
|
|
1085
|
-
|
|
993
|
+
const handleClose = () => {
|
|
1086
994
|
setAnchorEl(null);
|
|
1087
995
|
};
|
|
1088
|
-
|
|
996
|
+
const handleClear = () => {
|
|
1089
997
|
onClear();
|
|
1090
998
|
setAnchorEl(null);
|
|
1091
999
|
};
|
|
@@ -1094,46 +1002,14 @@ var MenuFilter = function (props) {
|
|
|
1094
1002
|
}
|
|
1095
1003
|
return (React.createElement(React.Fragment, null,
|
|
1096
1004
|
React.createElement(core.Button, { id: triggerId, "aria-controls": popoverId, "aria-haspopup": "true", "aria-expanded": open, onClick: handleTriggerClick, size: "small", startIcon: React.createElement(commonUi.Icon, { icon: SvgLeafIcon }), classes: { label: classes.triggerLabel } }, triggerLabel),
|
|
1097
|
-
React.createElement(core.Menu, { id: popoverId, anchorEl: anchorEl, open: open, onClose: handleClose }, availableFilters.map(
|
|
1098
|
-
return (React.createElement(core.MenuItem, { key: index, value: option.id, onClick:
|
|
1005
|
+
React.createElement(core.Menu, { id: popoverId, anchorEl: anchorEl, open: open, onClose: handleClose }, availableFilters.map((option, index) => {
|
|
1006
|
+
return (React.createElement(core.MenuItem, { key: index, value: option.id, onClick: (event) => handleChange(option, event) },
|
|
1099
1007
|
React.createElement(ItemTag, { alt: option.abbr, color: option.color }, option.abbr),
|
|
1100
1008
|
React.createElement(core.Box, { ml: 1 }, option.name)));
|
|
1101
1009
|
}))));
|
|
1102
1010
|
};
|
|
1103
1011
|
|
|
1104
|
-
|
|
1105
|
-
var palette = _a.palette, spacing = _a.spacing;
|
|
1106
|
-
return ({
|
|
1107
|
-
root: {
|
|
1108
|
-
'& > .MuiTab-wrapper': {
|
|
1109
|
-
flexDirection: 'row-reverse',
|
|
1110
|
-
gridGap: spacing(1),
|
|
1111
|
-
textAlign: 'center',
|
|
1112
|
-
'& > svg': {
|
|
1113
|
-
marginBottom: '0 !important',
|
|
1114
|
-
},
|
|
1115
|
-
},
|
|
1116
|
-
},
|
|
1117
|
-
isUnavailable: {
|
|
1118
|
-
color: palette.grey[700],
|
|
1119
|
-
},
|
|
1120
|
-
});
|
|
1121
|
-
});
|
|
1122
|
-
|
|
1123
|
-
var MenuTab = function (props) {
|
|
1124
|
-
var isUnavailable = props.isUnavailable, value = props.value;
|
|
1125
|
-
var classes = useMenuTabStyles(props);
|
|
1126
|
-
return (React.createElement(core.Tab, tslib.__assign({ "data-tab-for-section-id": value, classes: {
|
|
1127
|
-
root: classes.root,
|
|
1128
|
-
}, disabled: isUnavailable, icon: isUnavailable ? React.createElement(commonUi.Icon, { icon: webIcons.Clock, size: "large" }) : undefined }, props)));
|
|
1129
|
-
};
|
|
1130
|
-
|
|
1131
|
-
var MenuTabGroup = function (props) {
|
|
1132
|
-
var children = props.children, muiProps = tslib.__rest(props, ["children"]);
|
|
1133
|
-
return (React.createElement(core.Tabs, tslib.__assign({ scrollButtons: "on", variant: "scrollable" }, muiProps), children));
|
|
1134
|
-
};
|
|
1135
|
-
|
|
1136
|
-
var useSelectableChipStyles = core.makeStyles(function (theme) { return ({
|
|
1012
|
+
const useSelectableChipStyles = core.makeStyles((theme) => ({
|
|
1137
1013
|
root: {
|
|
1138
1014
|
border: '2px solid',
|
|
1139
1015
|
borderColor: theme.palette.grey[100],
|
|
@@ -1161,124 +1037,113 @@ var useSelectableChipStyles = core.makeStyles(function (theme) { return ({
|
|
|
1161
1037
|
},
|
|
1162
1038
|
},
|
|
1163
1039
|
},
|
|
1164
|
-
})
|
|
1040
|
+
}));
|
|
1165
1041
|
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
return (React.createElement(core.Tab,
|
|
1042
|
+
const SelectableChip = (props) => {
|
|
1043
|
+
const classes = useSelectableChipStyles(props);
|
|
1044
|
+
return (React.createElement(core.Tab, { "data-tab-for-section-id": props.value, classes: {
|
|
1169
1045
|
root: classes.root,
|
|
1170
1046
|
selected: classes.selected,
|
|
1171
|
-
}
|
|
1047
|
+
}, ...props }));
|
|
1172
1048
|
};
|
|
1173
1049
|
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
_b.gridGap = spacing(1.5),
|
|
1187
|
-
_b),
|
|
1188
|
-
});
|
|
1189
|
-
});
|
|
1050
|
+
const useSelectableChipGroupStyles = core.makeStyles(({ breakpoints, spacing }) => ({
|
|
1051
|
+
flexContainer: {
|
|
1052
|
+
[breakpoints.down('md')]: {
|
|
1053
|
+
padding: spacing(0, 2),
|
|
1054
|
+
},
|
|
1055
|
+
[breakpoints.up('lg')]: {
|
|
1056
|
+
alignItems: 'flex-start',
|
|
1057
|
+
flexDirection: 'column',
|
|
1058
|
+
},
|
|
1059
|
+
gridGap: spacing(1.5),
|
|
1060
|
+
},
|
|
1061
|
+
}));
|
|
1190
1062
|
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
return (React.createElement(core.Tabs,
|
|
1063
|
+
const SelectableChipGroup = (props) => {
|
|
1064
|
+
const { children, ...muiProps } = props;
|
|
1065
|
+
const classes = useSelectableChipGroupStyles(props);
|
|
1066
|
+
return (React.createElement(core.Tabs, { TabIndicatorProps: {
|
|
1195
1067
|
hidden: true,
|
|
1196
|
-
}, variant: "scrollable", scrollButtons: "off", classes: classes
|
|
1068
|
+
}, variant: "scrollable", scrollButtons: "off", classes: classes, ...muiProps }, children));
|
|
1197
1069
|
};
|
|
1198
1070
|
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
var filters = props.filters, onChipClick = props.onChipClick;
|
|
1217
|
-
var classes = useStyles$4();
|
|
1218
|
-
return (React.createElement(React.Fragment, null, filters.map(function (filter, index) { return (React.createElement(core.Chip, { key: filter.name + "-" + index, classes: classes, onClick: function (event) { return onChipClick(filter, event); }, label: React.createElement(React.Fragment, null,
|
|
1071
|
+
const useStyles$4 = core.makeStyles(({ spacing }) => ({
|
|
1072
|
+
root: {
|
|
1073
|
+
padding: spacing(0.5, 0),
|
|
1074
|
+
height: 'unset',
|
|
1075
|
+
borderRadius: 4,
|
|
1076
|
+
},
|
|
1077
|
+
label: {
|
|
1078
|
+
paddingLeft: 8,
|
|
1079
|
+
display: 'flex',
|
|
1080
|
+
gridGap: 8,
|
|
1081
|
+
alignItems: 'center',
|
|
1082
|
+
},
|
|
1083
|
+
}));
|
|
1084
|
+
const SelectedMenuFiltersList = (props) => {
|
|
1085
|
+
const { filters, onChipClick } = props;
|
|
1086
|
+
const classes = useStyles$4();
|
|
1087
|
+
return (React.createElement(React.Fragment, null, filters.map((filter, index) => (React.createElement(core.Chip, { key: `${filter.name}-${index}`, classes: classes, onClick: (event) => onChipClick(filter, event), label: React.createElement(React.Fragment, null,
|
|
1219
1088
|
React.createElement(ItemTag, { alt: filter.abbr, color: filter.color }, filter.abbr),
|
|
1220
1089
|
React.createElement(core.Typography, { variant: "caption" }, filter.name),
|
|
1221
|
-
React.createElement(commonUi.Icon, { icon: webIcons.XCircle, size: "large" })) }))
|
|
1090
|
+
React.createElement(commonUi.Icon, { icon: webIcons.XCircle, size: "large" })) })))));
|
|
1222
1091
|
};
|
|
1223
1092
|
|
|
1224
|
-
|
|
1225
|
-
var children = props.children, restProps = tslib.__rest(props, ["children"]);
|
|
1226
|
-
return (React.createElement(core.Box, tslib.__assign({ display: "flex", flexDirection: "column", gridGap: 40, marginBottom: 4 }, restProps, { ref: ref }, { "data-component-type": "menu-section-group" }), children));
|
|
1227
|
-
});
|
|
1228
|
-
MenuSectionGroup.displayName = 'MenuSectionGroup';
|
|
1229
|
-
|
|
1230
|
-
var useStyles$3 = core.makeStyles(function () { return ({
|
|
1093
|
+
const useStyles$3 = core.makeStyles(() => ({
|
|
1231
1094
|
title: {
|
|
1232
1095
|
fontWeight: 400,
|
|
1233
1096
|
fontSize: 20,
|
|
1234
1097
|
lineHeight: '30px',
|
|
1235
1098
|
},
|
|
1236
|
-
})
|
|
1099
|
+
}));
|
|
1237
1100
|
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
return (React.createElement(core.Box,
|
|
1101
|
+
const MenuSection = React.forwardRef((props, ref) => {
|
|
1102
|
+
const { name, children, loading, ...restProps } = props;
|
|
1103
|
+
const classes = useStyles$3();
|
|
1104
|
+
return (React.createElement(core.Box, { ...restProps, ref, component: 'section', "data-component-type": "menu-section", style: { scrollMarginTop: '70px' } },
|
|
1242
1105
|
React.createElement(core.Box, { marginTop: 1, marginBottom: 4 },
|
|
1243
1106
|
React.createElement(core.Typography, { component: "h1", className: classes.title }, loading ? React.createElement(lab.Skeleton, null) : name)),
|
|
1244
1107
|
children));
|
|
1245
1108
|
});
|
|
1246
1109
|
MenuSection.displayName = 'MenuSection';
|
|
1247
1110
|
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
return ({
|
|
1252
|
-
main: (_b = {},
|
|
1253
|
-
_b[breakpoints.down('md')] = {
|
|
1254
|
-
gridTemplateColumns: '1fr',
|
|
1255
|
-
},
|
|
1256
|
-
_b[breakpoints.up('lg')] = {
|
|
1257
|
-
gridTemplateColumns: 'repeat(2, minmax(280px, 1fr))',
|
|
1258
|
-
},
|
|
1259
|
-
_b.display = 'grid',
|
|
1260
|
-
_b.gridGap = 32,
|
|
1261
|
-
_b),
|
|
1262
|
-
});
|
|
1111
|
+
const MenuSectionGroup = React.forwardRef((props, ref) => {
|
|
1112
|
+
const { children, ...restProps } = props;
|
|
1113
|
+
return (React.createElement(core.Box, { display: "flex", flexDirection: "column", gridGap: 40, marginBottom: 4, ...restProps, ref, "data-component-type": "menu-section-group" }, children));
|
|
1263
1114
|
});
|
|
1115
|
+
MenuSectionGroup.displayName = 'MenuSectionGroup';
|
|
1264
1116
|
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1117
|
+
const useStyles$2 = core.makeStyles(({ breakpoints }) => ({
|
|
1118
|
+
main: {
|
|
1119
|
+
[breakpoints.down('md')]: {
|
|
1120
|
+
gridTemplateColumns: '1fr',
|
|
1121
|
+
},
|
|
1122
|
+
[breakpoints.up('lg')]: {
|
|
1123
|
+
gridTemplateColumns: 'repeat(2, minmax(280px, 1fr))',
|
|
1124
|
+
},
|
|
1125
|
+
display: 'grid',
|
|
1126
|
+
gridGap: 32,
|
|
1127
|
+
},
|
|
1128
|
+
}));
|
|
1129
|
+
|
|
1130
|
+
const MenuItemGroup = React.forwardRef((props, ref) => {
|
|
1131
|
+
const classes = useStyles$2();
|
|
1132
|
+
const { children, className, ...restProps } = props;
|
|
1133
|
+
return (React.createElement(core.Box, { className: classNames(classes.main, className), ref, "data-component-type": "menu-item-group", ...restProps }, props.children));
|
|
1269
1134
|
});
|
|
1270
1135
|
MenuItemGroup.displayName = 'MenuItemGroup';
|
|
1271
1136
|
|
|
1272
|
-
|
|
1137
|
+
const PageSection = (props) => (React.createElement(core.Box, { p: 4, borderBottom: "1px solid #E0E0E0" }, props.children));
|
|
1273
1138
|
|
|
1274
|
-
|
|
1139
|
+
const useStyles$1 = core.makeStyles(() => ({
|
|
1275
1140
|
closeButton: {
|
|
1276
1141
|
padding: 0,
|
|
1277
1142
|
},
|
|
1278
|
-
})
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1143
|
+
}));
|
|
1144
|
+
const DialogTitle = (props) => {
|
|
1145
|
+
const { Icon, title, titleId, onClose } = props;
|
|
1146
|
+
const classes = useStyles$1();
|
|
1282
1147
|
return (React.createElement(core.DialogTitle, null,
|
|
1283
1148
|
React.createElement(core.Box, { display: "flex", alignItems: "center", gridGap: 16 },
|
|
1284
1149
|
Icon && Icon,
|
|
@@ -1287,56 +1152,47 @@ var DialogTitle = function (props) {
|
|
|
1287
1152
|
React.createElement(commonUi.Icon, { icon: webIcons.X })))));
|
|
1288
1153
|
};
|
|
1289
1154
|
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
return (React.createElement(core.Box,
|
|
1155
|
+
const DialogSection = (props) => {
|
|
1156
|
+
const { edgeToEdge, borderBottom, children, ...restProps } = props;
|
|
1157
|
+
return (React.createElement(core.Box, { paddingTop: 4, paddingBottom: borderBottom ? 4 : 0, paddingX: edgeToEdge ? 0 : 2, borderBottom: borderBottom ? '1px solid #E0E0E0' : undefined, ...restProps }, children));
|
|
1293
1158
|
};
|
|
1294
1159
|
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
'& $thumb': {
|
|
1300
|
-
backgroundColor: palette.success.main,
|
|
1301
|
-
},
|
|
1302
|
-
'&& + $track': {
|
|
1303
|
-
backgroundColor: palette.success.main,
|
|
1304
|
-
opacity: 0.5,
|
|
1305
|
-
},
|
|
1160
|
+
const Switch = core.withStyles(({ palette }) => ({
|
|
1161
|
+
checked: {
|
|
1162
|
+
'& $thumb': {
|
|
1163
|
+
backgroundColor: palette.success.main,
|
|
1306
1164
|
},
|
|
1307
|
-
|
|
1308
|
-
|
|
1165
|
+
'&& + $track': {
|
|
1166
|
+
backgroundColor: palette.success.main,
|
|
1167
|
+
opacity: 0.5,
|
|
1309
1168
|
},
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
}
|
|
1169
|
+
},
|
|
1170
|
+
switchBase: {
|
|
1171
|
+
color: palette.grey[300],
|
|
1172
|
+
},
|
|
1173
|
+
thumb: {},
|
|
1174
|
+
track: {},
|
|
1175
|
+
}))(core.Switch);
|
|
1314
1176
|
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
checked: {
|
|
1319
|
-
|
|
1320
|
-
'&$checked': {
|
|
1321
|
-
color: palette.info.main,
|
|
1322
|
-
},
|
|
1177
|
+
const Checkbox = core.withStyles(({ palette }) => ({
|
|
1178
|
+
checked: {},
|
|
1179
|
+
root: {
|
|
1180
|
+
'&$checked': {
|
|
1181
|
+
color: palette.info.main,
|
|
1323
1182
|
},
|
|
1324
|
-
}
|
|
1325
|
-
})(core.Checkbox);
|
|
1183
|
+
},
|
|
1184
|
+
}))(core.Checkbox);
|
|
1326
1185
|
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
checked: {
|
|
1331
|
-
|
|
1332
|
-
'&$checked': {
|
|
1333
|
-
color: palette.info.main,
|
|
1334
|
-
},
|
|
1186
|
+
const Radio = core.withStyles(({ palette }) => ({
|
|
1187
|
+
checked: {},
|
|
1188
|
+
root: {
|
|
1189
|
+
'&$checked': {
|
|
1190
|
+
color: palette.info.main,
|
|
1335
1191
|
},
|
|
1336
|
-
}
|
|
1337
|
-
})(core.Radio);
|
|
1192
|
+
},
|
|
1193
|
+
}))(core.Radio);
|
|
1338
1194
|
|
|
1339
|
-
|
|
1195
|
+
const useStyles = core.makeStyles((theme) => ({
|
|
1340
1196
|
root: {
|
|
1341
1197
|
'& > div': {
|
|
1342
1198
|
padding: 0,
|
|
@@ -1358,63 +1214,59 @@ var useStyles = core.makeStyles(function (theme) { return ({
|
|
|
1358
1214
|
color: theme.palette.grey[700],
|
|
1359
1215
|
},
|
|
1360
1216
|
header: {
|
|
1361
|
-
color:
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
}[props.type]);
|
|
1367
|
-
},
|
|
1217
|
+
color: (props) => ({
|
|
1218
|
+
alert: theme.palette.error.main,
|
|
1219
|
+
info: theme.palette.info.main,
|
|
1220
|
+
offer: theme.palette.success.main,
|
|
1221
|
+
}[props.type]),
|
|
1368
1222
|
},
|
|
1369
1223
|
headerTitle: {
|
|
1370
|
-
color:
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
}[props.type]);
|
|
1376
|
-
},
|
|
1224
|
+
color: (props) => ({
|
|
1225
|
+
alert: theme.palette.error.main,
|
|
1226
|
+
info: theme.palette.info.main,
|
|
1227
|
+
offer: theme.palette.success.main,
|
|
1228
|
+
}[props.type]),
|
|
1377
1229
|
fontWeight: 600,
|
|
1378
1230
|
},
|
|
1379
1231
|
content: {
|
|
1380
1232
|
marginLeft: theme.spacing(5),
|
|
1381
1233
|
},
|
|
1382
|
-
})
|
|
1234
|
+
}));
|
|
1383
1235
|
|
|
1384
|
-
|
|
1385
|
-
|
|
1236
|
+
const bannerIconStyles = { color: 'inherit', width: 24, height: 24 };
|
|
1237
|
+
const BannerTypeIcons = {
|
|
1386
1238
|
alert: React.createElement(webIcons.Warning, { style: bannerIconStyles }),
|
|
1387
1239
|
info: React.createElement(webIcons.Info, { style: bannerIconStyles }),
|
|
1388
1240
|
offer: React.createElement(webIcons.DollarSign, { style: bannerIconStyles }),
|
|
1389
1241
|
};
|
|
1390
1242
|
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1243
|
+
const MenuBanner = (props) => {
|
|
1244
|
+
const { show } = props;
|
|
1245
|
+
const classes = useStyles(props);
|
|
1394
1246
|
if (!show)
|
|
1395
1247
|
return null;
|
|
1396
1248
|
return (React.createElement(core.Card, { classes: { root: classes.root }, variant: "outlined" },
|
|
1397
1249
|
React.createElement(core.CardHeader, { avatar: BannerTypeIcons[props.type], title: props.title, titleTypographyProps: { variant: 'body1' }, classes: { root: classes.header, title: classes.headerTitle } }),
|
|
1398
|
-
React.createElement(MenuBannerDescription,
|
|
1399
|
-
React.createElement(MenuBannerButton,
|
|
1250
|
+
React.createElement(MenuBannerDescription, { ...props }),
|
|
1251
|
+
React.createElement(MenuBannerButton, { ...props })));
|
|
1400
1252
|
};
|
|
1401
1253
|
function MenuBannerDescription(props) {
|
|
1402
|
-
|
|
1403
|
-
|
|
1254
|
+
const classes = useStyles(props);
|
|
1255
|
+
const { description } = props;
|
|
1404
1256
|
if (!description)
|
|
1405
1257
|
return null;
|
|
1406
1258
|
return (React.createElement(core.CardContent, { classes: { root: classes.content } },
|
|
1407
1259
|
React.createElement(core.Typography, { className: classes.description, variant: "body2" }, props.description)));
|
|
1408
1260
|
}
|
|
1409
1261
|
function MenuBannerButton(props) {
|
|
1410
|
-
|
|
1262
|
+
const classes = useStyles(props);
|
|
1411
1263
|
if (!props.buttonLabel)
|
|
1412
1264
|
return null;
|
|
1413
1265
|
return (React.createElement(core.CardContent, { classes: { root: classes.content } },
|
|
1414
|
-
React.createElement(core.Link,
|
|
1266
|
+
React.createElement(core.Link, { component: 'button', variant: 'body2', className: classes.button, ...props.ButtonProps }, props.buttonLabel)));
|
|
1415
1267
|
}
|
|
1416
1268
|
|
|
1417
|
-
|
|
1269
|
+
const palette = {
|
|
1418
1270
|
primary: {
|
|
1419
1271
|
main: '#0A202F',
|
|
1420
1272
|
},
|
|
@@ -1441,7 +1293,7 @@ var palette = {
|
|
|
1441
1293
|
},
|
|
1442
1294
|
};
|
|
1443
1295
|
|
|
1444
|
-
|
|
1296
|
+
const overrides = {
|
|
1445
1297
|
MuiButton: {
|
|
1446
1298
|
root: {
|
|
1447
1299
|
borderRadius: 32,
|
|
@@ -1514,7 +1366,7 @@ var overrides = {
|
|
|
1514
1366
|
},
|
|
1515
1367
|
};
|
|
1516
1368
|
|
|
1517
|
-
|
|
1369
|
+
const props = {
|
|
1518
1370
|
MuiButton: {
|
|
1519
1371
|
disableElevation: true,
|
|
1520
1372
|
},
|
|
@@ -1523,8 +1375,8 @@ var props = {
|
|
|
1523
1375
|
},
|
|
1524
1376
|
};
|
|
1525
1377
|
|
|
1526
|
-
|
|
1527
|
-
|
|
1378
|
+
const fonts = ['"Poppins"', '"sans-serif"'];
|
|
1379
|
+
const typography = {
|
|
1528
1380
|
htmlFontSize: 16,
|
|
1529
1381
|
fontFamily: fonts.join(', '),
|
|
1530
1382
|
h1: {
|
|
@@ -1581,11 +1433,11 @@ var typography = {
|
|
|
1581
1433
|
},
|
|
1582
1434
|
};
|
|
1583
1435
|
|
|
1584
|
-
|
|
1585
|
-
typography
|
|
1586
|
-
palette
|
|
1587
|
-
overrides
|
|
1588
|
-
props
|
|
1436
|
+
const orderingTheme = {
|
|
1437
|
+
typography,
|
|
1438
|
+
palette,
|
|
1439
|
+
overrides,
|
|
1440
|
+
props,
|
|
1589
1441
|
};
|
|
1590
1442
|
|
|
1591
1443
|
exports.Button = Button;
|