@popmenu/ordering-ui 0.98.0 → 0.99.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.
@@ -1,4 +1,3 @@
1
- import { ReactNode } from 'react';
2
1
  import { CardActionAreaProps } from '@material-ui/core';
3
2
  import { CardProps as MuiCardProps } from '@material-ui/core/Card';
4
3
  export interface LocationCardProps extends Omit<MuiCardProps, 'onClick'> {
@@ -6,18 +5,20 @@ export interface LocationCardProps extends Omit<MuiCardProps, 'onClick'> {
6
5
  name: string;
7
6
  /** Renders the address of the restaurant location */
8
7
  address?: string;
9
- /** Renders the appropriate availability of the restaurant location */
10
- availability?: string | ReactNode;
8
+ /** Renders the general availability hours of the restaurant location. */
9
+ generalAvailability?: string;
10
+ /** Renders the pickup availability hours of the restaurant location */
11
+ pickupAvailability?: string;
12
+ /** Renders the delivery availability hours of the restaurant location */
13
+ deliveryAvailability?: string;
11
14
  /** Renders the distance of the restaurant location (if applicable) */
12
15
  distance?: string;
13
16
  /** Callback for when the LocationCard is clicked */
14
- onClick: (value: string) => void;
17
+ onClick: (value: number) => void;
15
18
  /** Sets card selection state */
16
19
  selected?: boolean;
17
20
  /** The value of a card in respects to selection state. */
18
- value: string;
21
+ value: number;
19
22
  /** Props passed to the CardActionArea rendered by SelectableCard. */
20
23
  CardActionAreaProps?: CardActionAreaProps;
21
- /** Unique label for the location card */
22
- labelId: string;
23
24
  }
package/build/index.es.js CHANGED
@@ -1878,8 +1878,12 @@ var useLocationCardStyles = makeStyles(function (theme) {
1878
1878
  },
1879
1879
  availability: {
1880
1880
  color: secondary.light,
1881
- display: 'flex',
1881
+ display: 'grid',
1882
1882
  gridGap: spacing(0.5),
1883
+ gridTemplateColumns: 'auto 1fr',
1884
+ },
1885
+ availabilityMessage: {
1886
+ gridColumn: '2 / 3',
1883
1887
  },
1884
1888
  checkIcon: {
1885
1889
  color: info.main,
@@ -1910,13 +1914,14 @@ var useLocationCardStyles = makeStyles(function (theme) {
1910
1914
  });
1911
1915
 
1912
1916
  var LocationCard = function (props) {
1913
- var name = props.name, address = props.address, distance = props.distance, availability = props.availability, onClick = props.onClick, selected = props.selected, value = props.value, labelId = props.labelId, CardActionAreaProps = props.CardActionAreaProps, muiProps = __rest$1(props, ["name", "address", "distance", "availability", "onClick", "selected", "value", "labelId", "CardActionAreaProps"]);
1917
+ var name = props.name, address = props.address, distance = props.distance, generalAvailability = props.generalAvailability, pickupAvailability = props.pickupAvailability, deliveryAvailability = props.deliveryAvailability, onClick = props.onClick, selected = props.selected, value = props.value, CardActionAreaProps = props.CardActionAreaProps, muiProps = __rest$1(props, ["name", "address", "distance", "generalAvailability", "pickupAvailability", "deliveryAvailability", "onClick", "selected", "value", "CardActionAreaProps"]);
1914
1918
  var classes = useLocationCardStyles(props);
1919
+ var anyAvailability = generalAvailability || pickupAvailability || deliveryAvailability;
1915
1920
  var handleClick = function () {
1916
1921
  onClick(value);
1917
1922
  };
1918
1923
  return (React__default.createElement(Card$1, __assign$1({ className: classes.root }, muiProps),
1919
- React__default.createElement(CardActionArea$1, __assign$1({ onClick: handleClick, classes: { focusHighlight: classes.focusHighlight }, role: "checkbox", "aria-checked": selected, "aria-labelledby": labelId }, CardActionAreaProps),
1924
+ React__default.createElement(CardActionArea$1, __assign$1({ onClick: handleClick, classes: { focusHighlight: classes.focusHighlight }, role: "checkbox", "aria-checked": selected }, CardActionAreaProps),
1920
1925
  React__default.createElement(CardContent, { className: classes.content },
1921
1926
  React__default.createElement(Box, { className: classes.locationInfo },
1922
1927
  React__default.createElement(Box, { display: "flex", justifyContent: "space-between" },
@@ -1924,9 +1929,11 @@ var LocationCard = function (props) {
1924
1929
  selected && React__default.createElement(Icon, { icon: SvgCheck, size: "extra-large", className: classes.checkIcon })),
1925
1930
  address && (React__default.createElement(Typography, { className: classes.address, variant: "body2" }, address)),
1926
1931
  React__default.createElement(Typography, { className: classes.distance }, distance)),
1927
- availability && (React__default.createElement(Box, { className: classes.availability },
1932
+ anyAvailability && (React__default.createElement(Box, { className: classes.availability },
1928
1933
  React__default.createElement(Icon, { icon: SvgClock, size: "large" }),
1929
- React__default.createElement(Typography, { variant: "body2" }, availability)))))));
1934
+ generalAvailability && (React__default.createElement(Typography, { className: classes.availabilityMessage, variant: "body2" }, generalAvailability)),
1935
+ pickupAvailability && (React__default.createElement(Typography, { className: classes.availabilityMessage, variant: "body2" }, pickupAvailability)),
1936
+ deliveryAvailability && (React__default.createElement(Typography, { className: classes.availabilityMessage, variant: "body2" }, deliveryAvailability))))))));
1930
1937
  };
1931
1938
 
1932
1939
  var useMenuDropdownStyles = makeStyles(function (theme) {