@popmenu/ordering-ui 0.75.0 → 0.76.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.
package/build/index.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var core = require('@material-ui/core');
5
6
  var React = require('react');
6
7
  require('@material-ui/lab/Alert');
7
- var core = require('@material-ui/core');
8
8
  require('@material-ui/core/AppBar');
9
9
  var MuiAvatar = require('@material-ui/core/Avatar');
10
10
  var styles = require('@material-ui/core/styles');
@@ -132,6 +132,23 @@ function __rest$1(s, e) {
132
132
  return t;
133
133
  }
134
134
 
135
+ var Button$1 = React.forwardRef(function (props, ref) {
136
+ var _a = props.variation, variation = _a === void 0 ? 'primary' : _a, muiProps = __rest$1(props, ["variation"]);
137
+ var variationProps = {};
138
+ switch (variation) {
139
+ case 'primary':
140
+ variationProps.variant = 'contained';
141
+ variationProps.color = 'primary';
142
+ break;
143
+ case 'secondary':
144
+ variationProps.variant = 'outlined';
145
+ variationProps.color = 'primary';
146
+ break;
147
+ }
148
+ return React__default['default'].createElement(core.Button, __assign$1({}, variationProps, muiProps, { ref: ref }));
149
+ });
150
+ Button$1.displayName = 'Button';
151
+
135
152
  /*! *****************************************************************************
136
153
  Copyright (c) Microsoft Corporation.
137
154
 
@@ -518,7 +535,7 @@ styles.makeStyles(function (theme) { return ({
518
535
  },
519
536
  }); });
520
537
 
521
- var useButtonStyles$1 = styles.makeStyles(function () { return ({
538
+ var useButtonStyles = styles.makeStyles(function () { return ({
522
539
  root: {
523
540
  minWidth: 'unset',
524
541
  },
@@ -530,10 +547,10 @@ var useButtonStyles$1 = styles.makeStyles(function () { return ({
530
547
  },
531
548
  }); });
532
549
 
533
- var Button$1 = React.forwardRef(function (props, ref) {
550
+ var Button = React.forwardRef(function (props, ref) {
534
551
  props.textTransform; var loading = props.loading, classesOverride = props.classes, className = props.className, muiProps = __rest(props, ["textTransform", "loading", "classes", "className"]);
535
552
  props.classes; var styleProps = __rest(props, ["classes"]);
536
- var classes = useButtonStyles$1(styleProps);
553
+ var classes = useButtonStyles(styleProps);
537
554
  var typography = styles.useTheme().typography;
538
555
  var loadingIndicator = {
539
556
  startIcon: React__default['default'].createElement(CircularProgress__default['default'], { color: "inherit", size: typography.button.fontSize }),
@@ -541,7 +558,7 @@ var Button$1 = React.forwardRef(function (props, ref) {
541
558
  };
542
559
  return (React__default['default'].createElement(MuiButton__default['default'], __assign({ ref: ref, classes: __assign(__assign({}, classes), classesOverride), className: classNames$1([className, 'pm-button']) }, muiProps, (loading && loadingIndicator))));
543
560
  });
544
- Button$1.displayName = 'Button';
561
+ Button.displayName = 'Button';
545
562
 
546
563
  var Checkbox = React.forwardRef(function (props, ref) {
547
564
  var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
@@ -550,7 +567,7 @@ var Checkbox = React.forwardRef(function (props, ref) {
550
567
  });
551
568
  Checkbox.displayName = 'Checkbox';
552
569
 
553
- var getBackground$1 = function (theme) { return function (props) {
570
+ var getBackground = function (theme) { return function (props) {
554
571
  var variant = props.variant, severity = props.severity;
555
572
  var background = theme.palette.grey[100];
556
573
  var backgrounds = {
@@ -569,7 +586,7 @@ var getBackground$1 = function (theme) { return function (props) {
569
586
  }
570
587
  return background;
571
588
  }; };
572
- var getColor$1 = function (theme) { return function (props) {
589
+ var getColor = function (theme) { return function (props) {
573
590
  var variant = props.variant, severity = props.severity;
574
591
  var textColor;
575
592
  if (variant === 'outlined' && severity) {
@@ -611,8 +628,8 @@ var getBorder = function (theme) { return function (props) {
611
628
  }; };
612
629
  var useChipStyles = styles.makeStyles(function (theme) { return ({
613
630
  root: {
614
- background: getBackground$1(theme),
615
- color: getColor$1(theme),
631
+ background: getBackground(theme),
632
+ color: getColor(theme),
616
633
  borderColor: getBorder(theme),
617
634
  borderRadius: theme.spacing(0.5),
618
635
  },
@@ -978,103 +995,6 @@ core.makeStyles(function (theme) { return ({
978
995
  },
979
996
  }); });
980
997
 
981
- var getColor = function (theme) { return function (props) {
982
- var variant = props.variant;
983
- if (variant === 'primary') {
984
- return theme.palette.common.white;
985
- }
986
- else if (variant === 'text') {
987
- return theme.palette.info.main;
988
- }
989
- return theme.palette.common.black;
990
- }; };
991
- var getBackground = function (theme) { return function (props) {
992
- var variant = props.variant;
993
- if (variant === 'primary') {
994
- return '#0A202F';
995
- }
996
- else {
997
- return theme.palette.common.white;
998
- }
999
- }; };
1000
- var getFontSize = function () { return function (props) {
1001
- var variant = props.variant;
1002
- if (variant === 'primary') {
1003
- return '1rem';
1004
- }
1005
- else {
1006
- return '0.875rem';
1007
- }
1008
- }; };
1009
- var buttonTypography = {
1010
- fontWeight: 400,
1011
- lineHeight: '1.25rem',
1012
- };
1013
- var useButtonStyles = styles.makeStyles(function (theme) { return ({
1014
- root: {
1015
- borderRadius: theme.spacing(6),
1016
- color: getColor(theme),
1017
- background: getBackground(theme),
1018
- fontSize: getFontSize(),
1019
- textTransform: 'none',
1020
- minWidth: 'unset',
1021
- },
1022
- disabled: {
1023
- '&$root': {
1024
- background: theme.palette.grey[300],
1025
- },
1026
- },
1027
- contained: {
1028
- padding: theme.spacing(2),
1029
- '&:hover': {
1030
- background: getBackground(theme),
1031
- },
1032
- },
1033
- outlined: {
1034
- padding: theme.spacing(2),
1035
- },
1036
- sizeSmall: {
1037
- padding: theme.spacing(1, 2),
1038
- },
1039
- text: {
1040
- padding: theme.spacing(1),
1041
- margin: 'auto',
1042
- },
1043
- label: __assign$1({}, buttonTypography),
1044
- }); });
1045
-
1046
- var deriveButtonProps = function (buttonProps) {
1047
- var variant = buttonProps.variant;
1048
- var derived = {};
1049
- switch (variant) {
1050
- case 'primary':
1051
- derived.variant = 'contained';
1052
- break;
1053
- case 'secondary':
1054
- derived.variant = 'outlined';
1055
- break;
1056
- case 'text':
1057
- derived.variant = 'text';
1058
- break;
1059
- default:
1060
- derived.variant = variant;
1061
- break;
1062
- }
1063
- return derived;
1064
- };
1065
-
1066
- var Button = React.forwardRef(function (props, ref) {
1067
- var children = props.children; props.variant; var classesOverride = props.classes, commonProps = __rest$1(props, ["children", "variant", "classes"]);
1068
- var classes = useButtonStyles(props);
1069
- var derivedProps = deriveButtonProps(props);
1070
- var mergedProps = __assign$1(__assign$1({}, derivedProps), commonProps);
1071
- return (React__default['default'].createElement(Button$1, __assign$1({ ref: ref, classes: __assign$1(__assign$1({}, classes), classesOverride), disableElevation: true }, mergedProps), children));
1072
- });
1073
- Button.defaultProps = {
1074
- variant: 'primary',
1075
- };
1076
- Button.displayName = 'Button';
1077
-
1078
998
  var _path$1f;
1079
999
 
1080
1000
  function _extends$2M() { _extends$2M = 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$2M.apply(this, arguments); }
@@ -1573,7 +1493,7 @@ var DishCheckoutCard = function (props) {
1573
1493
  specialInstructions,
1574
1494
  "\"")),
1575
1495
  React__default['default'].createElement(core.Box, { display: "flex", gridGap: 1, height: "100%" },
1576
- React__default['default'].createElement(Button, { variant: "text", onClick: onEdit }, "Edit"),
1496
+ React__default['default'].createElement(Button$1, { variant: "text", onClick: onEdit }, "Edit"),
1577
1497
  React__default['default'].createElement(IconButton, { onClick: onDelete },
1578
1498
  React__default['default'].createElement(Icon, { icon: SvgTrash, className: classes.deleteIcon })))),
1579
1499
  React__default['default'].createElement(core.Box, { display: "flex", gridGap: 16, alignItems: "center" },
@@ -1785,7 +1705,7 @@ DishModifierCard.displayName = 'DishModifierCard';
1785
1705
  var useLocationCardStyles = styles.makeStyles(function (theme) {
1786
1706
  var _a = theme.palette, info = _a.info, grey = _a.grey, secondary = _a.secondary, spacing = theme.spacing;
1787
1707
  var selectedBackgroundColor = styles.lighten(theme.palette.info.light, 0.9);
1788
- var backgroundColor = theme.palette.surface.light;
1708
+ var backgroundColor = theme.palette.background.default;
1789
1709
  return {
1790
1710
  root: {
1791
1711
  background: '#FFF',
@@ -2120,7 +2040,121 @@ var SelectableChipGroup = function (props) {
2120
2040
  React__default['default'].createElement(core.Box, { minWidth: "1px" })));
2121
2041
  };
2122
2042
 
2123
- exports.Button = Button;
2043
+ var palette = {
2044
+ primary: {
2045
+ light: '#7B7FA3',
2046
+ main: '#2E3042',
2047
+ dark: '#1A1D20',
2048
+ },
2049
+ secondary: {
2050
+ light: '#DA777E',
2051
+ main: '#F04649',
2052
+ dark: '#B3212B',
2053
+ },
2054
+ info: {
2055
+ light: '#52B7FF',
2056
+ main: '#0076CB',
2057
+ dark: '#164B54',
2058
+ },
2059
+ success: {
2060
+ light: '#48D3AB',
2061
+ main: '#00B485',
2062
+ dark: '#00663E',
2063
+ contrastText: '#FFFFFF',
2064
+ },
2065
+ error: {
2066
+ light: '#DA777E',
2067
+ main: '#E52021',
2068
+ dark: '#A80005',
2069
+ },
2070
+ warning: {
2071
+ light: '#F0DFBA',
2072
+ main: '#F5C364',
2073
+ dark: '#E57E45',
2074
+ },
2075
+ };
2076
+
2077
+ var overrides = {
2078
+ MuiButton: {
2079
+ root: {
2080
+ borderRadius: 32,
2081
+ textTransform: 'none',
2082
+ },
2083
+ },
2084
+ };
2085
+
2086
+ var props = {
2087
+ MuiButton: {
2088
+ disableElevation: true,
2089
+ },
2090
+ };
2091
+
2092
+ var fonts = ['"Poppins"', '"sans-serif"'];
2093
+ var typography = {
2094
+ htmlFontSize: 16,
2095
+ fontFamily: fonts.join(', '),
2096
+ h1: {
2097
+ fontWeight: 400,
2098
+ fontSize: '6rem',
2099
+ lineHeight: '9rem',
2100
+ },
2101
+ h2: {
2102
+ fontWeight: 400,
2103
+ fontSize: '3.75rem',
2104
+ lineHeight: '5.625rem',
2105
+ },
2106
+ h3: {
2107
+ fontWeight: 400,
2108
+ fontSize: '3rem',
2109
+ lineHeight: '4.5rem',
2110
+ },
2111
+ h4: {
2112
+ fontWeight: 400,
2113
+ fontSize: '2.125rem',
2114
+ lineHeight: '3.25rem',
2115
+ },
2116
+ h5: {
2117
+ fontWeight: 500,
2118
+ fontSize: '1.5rem',
2119
+ lineHeight: '2.25rem',
2120
+ },
2121
+ h6: {
2122
+ fontWeight: 500,
2123
+ fontSize: '1.25rem',
2124
+ lineHeight: '1.875rem',
2125
+ },
2126
+ body1: {
2127
+ fontWeight: 400,
2128
+ fontSize: '1rem',
2129
+ lineHeight: '1.5rem',
2130
+ },
2131
+ body2: {
2132
+ fontWeight: 400,
2133
+ fontSize: '0.875rem',
2134
+ lineHeight: '1.25rem',
2135
+ },
2136
+ subtitle1: {
2137
+ fontWeight: 400,
2138
+ fontSize: '0.75rem',
2139
+ lineHeight: '1.125rem',
2140
+ color: '#9E9E9E',
2141
+ },
2142
+ button: {
2143
+ fontWeight: 500,
2144
+ fontSize: '0.875rem',
2145
+ lineHeight: '1.25rem',
2146
+ textTransform: 'capitalize',
2147
+ },
2148
+ };
2149
+
2150
+ var orderingTheme = {
2151
+ typography: typography,
2152
+ palette: palette,
2153
+ overrides: overrides,
2154
+ props: props,
2155
+ };
2156
+
2157
+ exports.Button = Button$1;
2124
2158
  exports.DishCard = DishCard;
2125
2159
  exports.DishCheckoutCard = DishCheckoutCard;
2126
2160
  exports.DishDetailsReview = DishDetailsReview;
@@ -2136,4 +2170,13 @@ exports.ReactionCounterGroup = ReactionCounterGroup;
2136
2170
  exports.SelectableChip = SelectableChip;
2137
2171
  exports.SelectableChipGroup = SelectableChipGroup;
2138
2172
  exports.StatusTag = StatusTag;
2173
+ exports.orderingTheme = orderingTheme;
2174
+ Object.keys(core).forEach(function (k) {
2175
+ if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
2176
+ enumerable: true,
2177
+ get: function () {
2178
+ return core[k];
2179
+ }
2180
+ });
2181
+ });
2139
2182
  //# sourceMappingURL=index.js.map