@popmenu/ordering-ui 0.71.0 → 0.72.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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SyntheticEvent } from 'react';
|
|
1
2
|
export interface DishCardProps {
|
|
2
3
|
/** Renders the title of the dish */
|
|
3
4
|
title: string;
|
|
@@ -5,6 +6,7 @@ export interface DishCardProps {
|
|
|
5
6
|
price: string;
|
|
6
7
|
/** Renders the description of the dish */
|
|
7
8
|
description: string;
|
|
9
|
+
id: string;
|
|
8
10
|
/** The image to be displayed. */
|
|
9
11
|
image: {
|
|
10
12
|
alt: string;
|
|
@@ -21,7 +23,7 @@ export interface DishCardProps {
|
|
|
21
23
|
/** Number of reviews */
|
|
22
24
|
reviewCount: number;
|
|
23
25
|
/** Callback for when the DishCard is clicked */
|
|
24
|
-
onClick: () => void;
|
|
26
|
+
onClick: (event: SyntheticEvent) => void;
|
|
25
27
|
/** Boolean for whether or not the view is in mobile */
|
|
26
28
|
isMobile: boolean;
|
|
27
29
|
}
|
package/build/index.es.js
CHANGED
|
@@ -970,6 +970,7 @@ var useButtonStyles = makeStyles$1(function (theme) { return ({
|
|
|
970
970
|
color: getColor(theme),
|
|
971
971
|
background: getBackground(theme),
|
|
972
972
|
fontSize: getFontSize(),
|
|
973
|
+
textTransform: 'none',
|
|
973
974
|
minWidth: 'unset',
|
|
974
975
|
},
|
|
975
976
|
disabled: {
|
|
@@ -1402,7 +1403,7 @@ var useDishCardStyles = makeStyles$1(function (theme) { return ({
|
|
|
1402
1403
|
|
|
1403
1404
|
var ItemTagGroup = function (props) {
|
|
1404
1405
|
var children = props.children;
|
|
1405
|
-
return (React__default.createElement(Box, { display: "flex", gridGap: 6, ml: 1 }, children));
|
|
1406
|
+
return (React__default.createElement(Box, { display: "flex", gridGap: 6, ml: 1, flexWrap: "wrap" }, children));
|
|
1406
1407
|
};
|
|
1407
1408
|
|
|
1408
1409
|
var useItemtagStyles = makeStyles$1(function (theme) { return ({
|
|
@@ -1421,17 +1422,20 @@ var useItemtagStyles = makeStyles$1(function (theme) { return ({
|
|
|
1421
1422
|
width: '24px',
|
|
1422
1423
|
};
|
|
1423
1424
|
},
|
|
1425
|
+
text: {
|
|
1426
|
+
lineHeight: 1.5,
|
|
1427
|
+
},
|
|
1424
1428
|
}); });
|
|
1425
1429
|
|
|
1426
1430
|
var ItemTag = forwardRef(function (props, ref) {
|
|
1427
1431
|
var _a = props.color, color = _a === void 0 ? 'gray.dark' : _a, alt = props.alt, children = props.children;
|
|
1428
1432
|
var classes = useItemtagStyles({ color: color });
|
|
1429
1433
|
return (React__default.createElement(Avatar$1, { ref: ref, alt: alt, classes: { root: classes.root } },
|
|
1430
|
-
React__default.createElement(Typography, { variant: "caption" }, children)));
|
|
1434
|
+
React__default.createElement(Typography, { variant: "caption", className: classes.text }, children)));
|
|
1431
1435
|
});
|
|
1432
1436
|
|
|
1433
1437
|
var DishCard = function (props) {
|
|
1434
|
-
var title = props.title, description = props.description, image = props.image, likeCount = props.likeCount, reviewCount = props.reviewCount, itemTags = props.itemTags, price = props.price, onClick = props.onClick;
|
|
1438
|
+
var title = props.title, description = props.description, image = props.image, likeCount = props.likeCount, reviewCount = props.reviewCount, itemTags = props.itemTags, price = props.price, onClick = props.onClick, id = props.id;
|
|
1435
1439
|
var classes = useDishCardStyles(props);
|
|
1436
1440
|
var theme = useTheme$1();
|
|
1437
1441
|
var validImage = (image === null || image === void 0 ? void 0 : image.src) && (image === null || image === void 0 ? void 0 : image.alt);
|
|
@@ -1441,7 +1445,7 @@ var DishCard = function (props) {
|
|
|
1441
1445
|
var documentFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
1442
1446
|
return collapsedSizeRem * documentFontSize;
|
|
1443
1447
|
};
|
|
1444
|
-
return (React__default.createElement(Box, { className: classes.root, onClick: onClick },
|
|
1448
|
+
return (React__default.createElement(Box, { className: classes.root, onClick: onClick, id: id },
|
|
1445
1449
|
React__default.createElement(Box, { display: "flex", flexDirection: "column", justifyContent: "space-between", width: "100%", marginRight: 1 },
|
|
1446
1450
|
React__default.createElement(Box, null,
|
|
1447
1451
|
React__default.createElement(Box, { maxHeight: getTruncatedSizePx('h6') + 'px' },
|
|
@@ -1546,10 +1550,10 @@ var DishDetailsReview = forwardRef(function (props) {
|
|
|
1546
1550
|
return (React__default.createElement(Box, { display: "flex" },
|
|
1547
1551
|
React__default.createElement(Box, { mr: 1 },
|
|
1548
1552
|
React__default.createElement(Avatar, { size: "small", src: userAvatarUrl })),
|
|
1549
|
-
React__default.createElement(Box,
|
|
1553
|
+
React__default.createElement(Box, null,
|
|
1550
1554
|
React__default.createElement(Box, { display: "flex", justifyContent: "space-between", mb: 1 },
|
|
1551
1555
|
React__default.createElement(Typography, { color: "grey.600" }, userName),
|
|
1552
|
-
React__default.createElement(Typography, { color: "grey.600", variant: "subtitle1" }, timeSinceCreated)),
|
|
1556
|
+
React__default.createElement(Typography, { color: "grey.600", variant: "subtitle1", style: { display: 'flex', alignItems: 'center' } }, timeSinceCreated)),
|
|
1553
1557
|
React__default.createElement(Typography, { color: "grey.900", weight: "regular" }, content))));
|
|
1554
1558
|
});
|
|
1555
1559
|
DishDetailsReview.displayName = 'DishDetailsReview';
|
|
@@ -1568,6 +1572,14 @@ var useDishModifierCardStyles = makeStyles$1(function (theme) { return ({
|
|
|
1568
1572
|
},
|
|
1569
1573
|
name: {
|
|
1570
1574
|
fontSize: '18px',
|
|
1575
|
+
width: 'max-content',
|
|
1576
|
+
},
|
|
1577
|
+
nameContainer: {
|
|
1578
|
+
display: 'flex',
|
|
1579
|
+
alignItems: 'center',
|
|
1580
|
+
},
|
|
1581
|
+
statusTagContainer: {
|
|
1582
|
+
margin: theme.spacing(0, 2),
|
|
1571
1583
|
},
|
|
1572
1584
|
}); });
|
|
1573
1585
|
var useRadioModifierFormStyles = makeStyles$1(function (theme) { return ({
|
|
@@ -1612,7 +1624,6 @@ var useStatusTagStyles = makeStyles$1(function (theme) { return ({
|
|
|
1612
1624
|
root: {
|
|
1613
1625
|
borderRadius: '5px',
|
|
1614
1626
|
display: 'flex',
|
|
1615
|
-
height: '16px',
|
|
1616
1627
|
padding: theme.spacing(1),
|
|
1617
1628
|
alignItems: 'center',
|
|
1618
1629
|
justifyContent: 'center',
|
|
@@ -1710,9 +1721,10 @@ var DishModifierCard = function (props) {
|
|
|
1710
1721
|
}
|
|
1711
1722
|
return (React__default.createElement(Box, { className: classes.root },
|
|
1712
1723
|
React__default.createElement(Box, { display: "flex", justifyContent: "space-between", width: "100%", alignItems: "center", height: "fit-content" },
|
|
1713
|
-
React__default.createElement(Box, {
|
|
1724
|
+
React__default.createElement(Box, { className: classes.nameContainer },
|
|
1714
1725
|
React__default.createElement(Typography, { className: classes.name }, name),
|
|
1715
|
-
React__default.createElement(
|
|
1726
|
+
React__default.createElement(Box, { className: classes.statusTagContainer },
|
|
1727
|
+
React__default.createElement(StatusTag, { variant: isRequired || isOutOfStock ? 'outlined' : 'filled', label: label, color: color }))),
|
|
1716
1728
|
React__default.createElement(Typography, { variant: "subtitle1", className: error ? classes.error : undefined }, helperText)),
|
|
1717
1729
|
React__default.createElement(Box, null,
|
|
1718
1730
|
React__default.createElement(FormControl, null,
|
|
@@ -2012,6 +2024,7 @@ var useSelectableChipStyles = makeStyles$1(function (theme) { return ({
|
|
|
2012
2024
|
minWidth: 'unset',
|
|
2013
2025
|
minHeight: 'unset',
|
|
2014
2026
|
opacity: 'unset',
|
|
2027
|
+
textTransform: 'none',
|
|
2015
2028
|
'&::-webkit-scrollbar': {
|
|
2016
2029
|
display: 'none',
|
|
2017
2030
|
},
|