@popmenu/ordering-ui 0.86.1 → 0.88.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.
|
@@ -22,6 +22,8 @@ export interface MenuItemProps {
|
|
|
22
22
|
}>;
|
|
23
23
|
/** Number of likes */
|
|
24
24
|
likeCount?: Maybe<number>;
|
|
25
|
+
/** when true, shows a skeleton in place of content */
|
|
26
|
+
loading?: boolean;
|
|
25
27
|
/** Number of reviews */
|
|
26
28
|
reviewCount?: Maybe<number>;
|
|
27
29
|
/** Callback for when the DishCard is clicked */
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface MenuSectionProps {
|
|
3
|
+
/** when true, will render a skeleton in place of the section title */
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
/** the name of a section, will render as the section's title */
|
|
3
6
|
name: string;
|
|
4
7
|
children: React.ReactNode;
|
|
5
8
|
}
|
package/build/index.es.js
CHANGED
|
@@ -47,6 +47,7 @@ import '@material-ui/core/Tabs';
|
|
|
47
47
|
import MuiToggleButton from '@material-ui/lab/ToggleButton';
|
|
48
48
|
import MuiToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';
|
|
49
49
|
import MuiTooltip from '@material-ui/core/Tooltip';
|
|
50
|
+
import { Skeleton } from '@material-ui/lab';
|
|
50
51
|
import MuiRadioGroup from '@material-ui/core/RadioGroup';
|
|
51
52
|
|
|
52
53
|
/*! *****************************************************************************
|
|
@@ -135,6 +136,7 @@ var useDishCardStyles = makeStyles(function (theme) {
|
|
|
135
136
|
_b.overflow = 'visible',
|
|
136
137
|
_b),
|
|
137
138
|
cardTitle: {
|
|
139
|
+
flexGrow: 1,
|
|
138
140
|
fontWeight: 500,
|
|
139
141
|
fontSize: 18,
|
|
140
142
|
lineHeight: '27px',
|
|
@@ -623,6 +625,10 @@ var classNames$1 = classnames$1.exports;
|
|
|
623
625
|
var iconStaticClassName = 'pop-icon';
|
|
624
626
|
var Icon = function (props) {
|
|
625
627
|
var icon = props.icon, className = props.className, restProps = __rest(props, ["icon", "className"]);
|
|
628
|
+
var hasAccessibleAttr = Boolean(restProps['aria-describedby'] || restProps['aria-label']);
|
|
629
|
+
if (!hasAccessibleAttr && restProps['aria-hidden'] === undefined) {
|
|
630
|
+
restProps['aria-hidden'] = true;
|
|
631
|
+
}
|
|
626
632
|
var classes = useIconStyles(props);
|
|
627
633
|
var isValid = true;
|
|
628
634
|
if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {
|
|
@@ -1370,23 +1376,24 @@ StatusTag.defaultProps = {
|
|
|
1370
1376
|
StatusTag.displayName = 'StatusTag';
|
|
1371
1377
|
|
|
1372
1378
|
var MenuItem = forwardRef(function (props, ref) {
|
|
1373
|
-
var onClick = props.onClick, id = props.id,
|
|
1379
|
+
var onClick = props.onClick, id = props.id, description = props.description, isOutOfStock = props.isOutOfStock, title = props.title, loading = props.loading;
|
|
1374
1380
|
var classes = useDishCardStyles(props);
|
|
1375
1381
|
var handleClick = function (event) {
|
|
1376
1382
|
onClick(id, event);
|
|
1377
1383
|
};
|
|
1378
1384
|
return (React__default.createElement(Card, { className: classes.card, ref: ref, elevation: 0, "data-component-type": "menu-item" },
|
|
1379
|
-
React__default.createElement(CardActionArea, { className: classes.cardActionArea, onClick: handleClick },
|
|
1385
|
+
React__default.createElement(CardActionArea, { className: classes.cardActionArea, onClick: handleClick, disabled: loading },
|
|
1380
1386
|
React__default.createElement(MenuItemInfo, null,
|
|
1381
1387
|
React__default.createElement(Box, { display: "flex", gridGap: 8, alignItems: "center" },
|
|
1382
|
-
React__default.createElement(Typography$1, { className: classes.cardTitle }, title),
|
|
1388
|
+
React__default.createElement(Typography$1, { className: classes.cardTitle }, loading ? React__default.createElement(Skeleton, null) : title),
|
|
1383
1389
|
isOutOfStock && React__default.createElement(StatusTag, { color: "warning", label: "Out of stock", variant: "outlined", size: "sm" })),
|
|
1384
|
-
React__default.createElement(Typography$1, { className: classes.cardDescription, paragraph: true }, description),
|
|
1385
|
-
React__default.createElement(
|
|
1386
|
-
|
|
1390
|
+
React__default.createElement(Typography$1, { className: classes.cardDescription, paragraph: true }, loading ? React__default.createElement(Skeleton, null) : description),
|
|
1391
|
+
loading ? (React__default.createElement(Skeleton, null,
|
|
1392
|
+
React__default.createElement(MenuItemReactions, { likeCount: props.likeCount, reviewCount: props.reviewCount }))) : (React__default.createElement(MenuItemReactions, { likeCount: props.likeCount, reviewCount: props.reviewCount })),
|
|
1393
|
+
loading ? (React__default.createElement(Skeleton, { style: { flexGrow: 1 }, width: 100, height: 48 })) : (React__default.createElement(Box, { display: "flex", justifyContent: "space-between", alignItems: "end", flexGrow: 1 },
|
|
1387
1394
|
React__default.createElement(MenuItemPrice, { price: props.price, available: props.available }),
|
|
1388
|
-
React__default.createElement(MenuItemTags, { itemTags: props.itemTags }))),
|
|
1389
|
-
React__default.createElement(MenuItemImg, { image: props.image }))));
|
|
1395
|
+
React__default.createElement(MenuItemTags, { itemTags: props.itemTags })))),
|
|
1396
|
+
loading ? React__default.createElement(Skeleton, { height: 100, width: 100 }) : React__default.createElement(MenuItemImg, { image: props.image }))));
|
|
1390
1397
|
});
|
|
1391
1398
|
MenuItem.displayName = 'MenuItem';
|
|
1392
1399
|
|
|
@@ -1952,6 +1959,7 @@ var useSelectableChipStyles = makeStyles(function (theme) { return ({
|
|
|
1952
1959
|
minHeight: 'unset',
|
|
1953
1960
|
opacity: 'unset',
|
|
1954
1961
|
textTransform: 'none',
|
|
1962
|
+
textAlign: 'left',
|
|
1955
1963
|
'&::-webkit-scrollbar': {
|
|
1956
1964
|
display: 'none',
|
|
1957
1965
|
},
|
|
@@ -2038,11 +2046,11 @@ var useStyles$2 = makeStyles$1(function () { return ({
|
|
|
2038
2046
|
}); });
|
|
2039
2047
|
|
|
2040
2048
|
var MenuSection = forwardRef(function (props, ref) {
|
|
2041
|
-
var name = props.name, children = props.children, restProps = __rest$1(props, ["name", "children"]);
|
|
2049
|
+
var name = props.name, children = props.children, loading = props.loading, restProps = __rest$1(props, ["name", "children", "loading"]);
|
|
2042
2050
|
var classes = useStyles$2();
|
|
2043
2051
|
return (React__default.createElement(Box, __assign$1({}, restProps, { ref: ref, component: 'section' }, { "data-component-type": "menu-section" }),
|
|
2044
2052
|
React__default.createElement(Box, { marginTop: 1, marginBottom: 4 },
|
|
2045
|
-
React__default.createElement(Typography$1, { component: "h2", className: classes.title }, name)),
|
|
2053
|
+
React__default.createElement(Typography$1, { component: "h2", className: classes.title }, loading ? React__default.createElement(Skeleton, null) : name)),
|
|
2046
2054
|
children));
|
|
2047
2055
|
});
|
|
2048
2056
|
MenuSection.displayName = 'MenuSection';
|