@popmenu/ordering-ui 0.95.0 → 0.97.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 +1 @@
1
- export declare const useDishCardStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"cardActionArea" | "card" | "cardTitle" | "cardDescription">;
1
+ export declare const useMenuItemStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"cardActionArea" | "card" | "cardTitle" | "cardDescription">;
@@ -26,7 +26,7 @@ export interface MenuItemProps {
26
26
  loading?: boolean;
27
27
  /** Number of reviews */
28
28
  reviewCount?: Maybe<number>;
29
- /** Callback for when the DishCard is clicked */
29
+ /** Callback for when MenuItem is clicked */
30
30
  onClick: (id: string, event: React.MouseEvent<HTMLButtonElement>) => void;
31
31
  /** Whether or not the menu item is available for ordering */
32
32
  available: boolean;
package/build/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Button as Button$1, makeStyles as makeStyles$1, Box, Typography as Typography$1, Link as Link$1, Paper as Paper$1, Avatar as Avatar$1, Card, CardActionArea, FormControl, Select, InputAdornment, MenuItem as MenuItem$1, TextField, RadioGroup, FormControlLabel as FormControlLabel$1, Radio as Radio$2, FormGroup, Checkbox as Checkbox$2, Menu, Tabs, Chip, DialogTitle as DialogTitle$1, IconButton as IconButton$1, withStyles, Switch as Switch$2 } from '@material-ui/core';
1
+ import { Button as Button$1, makeStyles as makeStyles$1, Box, Typography as Typography$1, Link as Link$1, Paper as Paper$1, Avatar as Avatar$1, Card, CardActionArea, FormControl, Select, InputAdornment, MenuItem as MenuItem$1, TextField, RadioGroup, FormControlLabel as FormControlLabel$1, Radio as Radio$2, FormGroup, Checkbox as Checkbox$2, useMediaQuery, Menu, Tabs, Chip, DialogTitle as DialogTitle$1, IconButton as IconButton$1, withStyles, Switch as Switch$2 } from '@material-ui/core';
2
2
  export * from '@material-ui/core';
3
3
  import * as React from 'react';
4
4
  import React__default, { forwardRef, createContext, createElement, useContext, useState } from 'react';
@@ -114,7 +114,7 @@ var Button = forwardRef(function (props, ref) {
114
114
  });
115
115
  Button.displayName = 'Button';
116
116
 
117
- var useDishCardStyles = makeStyles(function (theme) {
117
+ var useMenuItemStyles = makeStyles(function (theme) {
118
118
  var _a, _b;
119
119
  return ({
120
120
  cardActionArea: (_a = {
@@ -160,6 +160,7 @@ var useDishCardStyles = makeStyles(function (theme) {
160
160
  fontWeight: 400,
161
161
  fontSize: 14,
162
162
  lineHeight: '20px',
163
+ marginBottom: theme.spacing(1),
163
164
  color: theme.palette.grey[700],
164
165
  '-webkit-line-clamp': 2,
165
166
  display: '-webkit-box',
@@ -476,6 +477,25 @@ function SvgTrash(props) {
476
477
  })));
477
478
  }
478
479
 
480
+ var _g$11;
481
+
482
+ function _extends$1G() { _extends$1G = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1G.apply(this, arguments); }
483
+
484
+ function SvgRestaurantMenu(props) {
485
+ return /*#__PURE__*/React.createElement("svg", _extends$1G({
486
+ viewBox: "0 0 16 16",
487
+ fill: "none",
488
+ strokeLinecap: "round",
489
+ strokeLinejoin: "round",
490
+ width: "1em",
491
+ height: "1em"
492
+ }, props), _g$11 || (_g$11 = /*#__PURE__*/React.createElement("g", {
493
+ stroke: "currentColor"
494
+ }, /*#__PURE__*/React.createElement("path", {
495
+ d: "M11.334.667l-8 2.666h8V.667zM3.333 3.333h9.333v11.333H3.333zM5.333 8h5.334m-5.334 2.333h1m2 0h2.334"
496
+ }))));
497
+ }
498
+
479
499
  var _path$h, _path2$3;
480
500
 
481
501
  function _extends$C() { _extends$C = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$C.apply(this, arguments); }
@@ -1430,7 +1450,7 @@ StatusTag.displayName = 'StatusTag';
1430
1450
 
1431
1451
  var MenuItem = forwardRef(function (props, ref) {
1432
1452
  var onClick = props.onClick, id = props.id, description = props.description, isOutOfStock = props.isOutOfStock, title = props.title, loading = props.loading;
1433
- var classes = useDishCardStyles(props);
1453
+ var classes = useMenuItemStyles(props);
1434
1454
  var handleClick = function (event) {
1435
1455
  onClick(id, event);
1436
1456
  };
@@ -1909,40 +1929,8 @@ var LocationCard = function (props) {
1909
1929
  React__default.createElement(Typography, { variant: "body2" }, availability)))))));
1910
1930
  };
1911
1931
 
1912
- var _g, _defs;
1913
-
1914
- function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
1915
-
1916
- function SvgRestaurantMenuIcon(props) {
1917
- return /*#__PURE__*/React.createElement("svg", _extends$1({
1918
- width: 20,
1919
- height: 21,
1920
- fill: "none",
1921
- xmlns: "http://www.w3.org/2000/svg"
1922
- }, props), _g || (_g = /*#__PURE__*/React.createElement("g", {
1923
- clipPath: "url(#restaurant-menu-icon_svg__clip0_3133_12817)",
1924
- stroke: "#2E3042",
1925
- strokeWidth: 1.667,
1926
- strokeLinejoin: "round"
1927
- }, /*#__PURE__*/React.createElement("path", {
1928
- d: "M14.167 1.623l-10 3.333h10V1.623z",
1929
- strokeLinecap: "round"
1930
- }), /*#__PURE__*/React.createElement("path", {
1931
- d: "M4.167 4.957h11.667v14.167H4.167z"
1932
- }), /*#__PURE__*/React.createElement("path", {
1933
- d: "M6.667 10.79h6.667m-6.667 2.916h1.25m2.5 0h2.917",
1934
- strokeLinecap: "round"
1935
- }))), _defs || (_defs = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
1936
- id: "restaurant-menu-icon_svg__clip0_3133_12817"
1937
- }, /*#__PURE__*/React.createElement("path", {
1938
- fill: "#fff",
1939
- transform: "translate(0 .79)",
1940
- d: "M0 0h20v20H0z"
1941
- })))));
1942
- }
1943
-
1944
1932
  var useMenuDropdownStyles = makeStyles(function (theme) {
1945
- var _a;
1933
+ var _a, _b;
1946
1934
  return ({
1947
1935
  formControl: (_a = {},
1948
1936
  _a[theme.breakpoints.up('lg')] = {
@@ -1955,11 +1943,17 @@ var useMenuDropdownStyles = makeStyles(function (theme) {
1955
1943
  gridGap: theme.spacing(1),
1956
1944
  },
1957
1945
  select: {
1958
- '& .MuiSelect-root': {
1959
- color: '#212121',
1960
- padding: theme.spacing(1, 0.5, 1, 0.5),
1961
- zIndex: 10,
1962
- },
1946
+ '& .MuiSelect-root': (_b = {
1947
+ color: '#212121',
1948
+ padding: theme.spacing(1, 0.5, 1, 0.5),
1949
+ zIndex: 10
1950
+ },
1951
+ _b[theme.breakpoints.down('md')] = {
1952
+ width: 0,
1953
+ minWidth: 0,
1954
+ padding: 0,
1955
+ },
1956
+ _b),
1963
1957
  },
1964
1958
  unavailable: {
1965
1959
  color: theme.palette.grey[700],
@@ -1971,9 +1965,13 @@ var MenuDropdown = function (props) {
1971
1965
  var menuOptions = props.menuOptions, onSelect = props.onSelect, selectedOptionId = props.selectedOptionId;
1972
1966
  var classes = useMenuDropdownStyles(props);
1973
1967
  var _a = useState(false), open = _a[0], setOpen = _a[1];
1968
+ var isMobile = useMediaQuery(function (_a) {
1969
+ var breakpoints = _a.breakpoints;
1970
+ return breakpoints.down('md');
1971
+ });
1974
1972
  return (React__default.createElement(FormControl, { hiddenLabel: true, classes: { root: classes.formControl } },
1975
1973
  React__default.createElement(Select, { open: open, value: selectedOptionId, labelId: "menu-dropdown-select", onClick: function () { return setOpen(!open); }, disableUnderline: true, onChange: function (event) { return onSelect(event.target.value); }, fullWidth: true, startAdornment: React__default.createElement(InputAdornment, { position: "start" },
1976
- React__default.createElement(Icon, { icon: SvgRestaurantMenuIcon, size: "large" })), IconComponent: function () { return (React__default.createElement(InputAdornment, { position: "end" },
1974
+ React__default.createElement(Icon, { icon: SvgRestaurantMenu, size: isMobile ? 'extra-large' : 'large' })), IconComponent: function () { return (React__default.createElement(InputAdornment, { position: "end" },
1977
1975
  React__default.createElement(Icon, { color: "#0076CB", icon: open ? SvgChevronUp : SvgChevronDown, size: "large" }))); }, MenuProps: {
1978
1976
  disablePortal: true,
1979
1977
  anchorOrigin: {