@citygross/components 0.7.246 → 0.8.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.
Files changed (61) hide show
  1. package/build/@types/components/CartCard/CartCard.styles.d.ts +1 -0
  2. package/build/@types/components/CgButton/CgButton.d.ts +2 -1
  3. package/build/@types/components/CgButton/CgButton.styles.d.ts +3 -0
  4. package/build/@types/components/CouponCode/CouponCode.d.ts +19 -0
  5. package/build/@types/components/CouponCode/CouponCode.styles.d.ts +14 -0
  6. package/build/@types/components/QuantitySelector/QuantitySelector.d.ts +2 -1
  7. package/build/@types/components/QuantitySelector/QuantitySelector.styles.d.ts +4 -1
  8. package/build/@types/index.d.ts +2 -0
  9. package/build/cjs/_virtual/_tslib.js +40 -0
  10. package/build/cjs/_virtual/_tslib.js.map +1 -1
  11. package/build/cjs/components/src/components/AddressBlock/AddressBlock.js +1 -0
  12. package/build/cjs/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
  13. package/build/cjs/components/src/components/CartCard/CartCard.js +1 -2
  14. package/build/cjs/components/src/components/CartCard/CartCard.js.map +1 -1
  15. package/build/cjs/components/src/components/CartCard/CartCard.styles.js +4 -2
  16. package/build/cjs/components/src/components/CartCard/CartCard.styles.js.map +1 -1
  17. package/build/cjs/components/src/components/CgButton/CgButton.js +8 -4
  18. package/build/cjs/components/src/components/CgButton/CgButton.js.map +1 -1
  19. package/build/cjs/components/src/components/CgButton/CgButton.styles.js +7 -3
  20. package/build/cjs/components/src/components/CgButton/CgButton.styles.js.map +1 -1
  21. package/build/cjs/components/src/components/CouponCode/CouponCode.js +81 -0
  22. package/build/cjs/components/src/components/CouponCode/CouponCode.js.map +1 -0
  23. package/build/cjs/components/src/components/CouponCode/CouponCode.styles.js +31 -0
  24. package/build/cjs/components/src/components/CouponCode/CouponCode.styles.js.map +1 -0
  25. package/build/cjs/components/src/components/QuantitySelector/QuantitySelector.js +14 -4
  26. package/build/cjs/components/src/components/QuantitySelector/QuantitySelector.js.map +1 -1
  27. package/build/cjs/components/src/components/QuantitySelector/QuantitySelector.styles.js +6 -4
  28. package/build/cjs/components/src/components/QuantitySelector/QuantitySelector.styles.js.map +1 -1
  29. package/build/cjs/components/src/components/WarningLabel/WarningLabel.js +1 -0
  30. package/build/cjs/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
  31. package/build/cjs/components/src/index.js +6 -0
  32. package/build/cjs/components/src/index.js.map +1 -1
  33. package/build/cjs/design-tokens/build/index.js +4 -1
  34. package/build/cjs/design-tokens/build/index.js.map +1 -1
  35. package/build/es/_virtual/_tslib.js +39 -1
  36. package/build/es/_virtual/_tslib.js.map +1 -1
  37. package/build/es/components/src/components/AddressBlock/AddressBlock.js +1 -0
  38. package/build/es/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
  39. package/build/es/components/src/components/CartCard/CartCard.js +2 -3
  40. package/build/es/components/src/components/CartCard/CartCard.js.map +1 -1
  41. package/build/es/components/src/components/CartCard/CartCard.styles.js +4 -3
  42. package/build/es/components/src/components/CartCard/CartCard.styles.js.map +1 -1
  43. package/build/es/components/src/components/CgButton/CgButton.js +9 -5
  44. package/build/es/components/src/components/CgButton/CgButton.js.map +1 -1
  45. package/build/es/components/src/components/CgButton/CgButton.styles.js +6 -4
  46. package/build/es/components/src/components/CgButton/CgButton.styles.js.map +1 -1
  47. package/build/es/components/src/components/CouponCode/CouponCode.js +73 -0
  48. package/build/es/components/src/components/CouponCode/CouponCode.js.map +1 -0
  49. package/build/es/components/src/components/CouponCode/CouponCode.styles.js +19 -0
  50. package/build/es/components/src/components/CouponCode/CouponCode.styles.js.map +1 -0
  51. package/build/es/components/src/components/QuantitySelector/QuantitySelector.js +15 -5
  52. package/build/es/components/src/components/QuantitySelector/QuantitySelector.js.map +1 -1
  53. package/build/es/components/src/components/QuantitySelector/QuantitySelector.styles.js +6 -4
  54. package/build/es/components/src/components/QuantitySelector/QuantitySelector.styles.js.map +1 -1
  55. package/build/es/components/src/components/WarningLabel/WarningLabel.js +1 -0
  56. package/build/es/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
  57. package/build/es/components/src/index.js +1 -0
  58. package/build/es/components/src/index.js.map +1 -1
  59. package/build/es/design-tokens/build/index.js +4 -1
  60. package/build/es/design-tokens/build/index.js.map +1 -1
  61. package/package.json +3 -3
@@ -8,3 +8,4 @@ export declare const CartCardDelete: import("styled-components").StyledComponent
8
8
  export declare const PriceContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
9
9
  export declare const MaxWarning: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
10
10
  export declare const MarkingsContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
11
+ export declare const CartCardTitle: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, {}, never>;
@@ -20,5 +20,6 @@ export declare type TCgButton = {
20
20
  children?: React.ReactNode;
21
21
  disabled?: boolean;
22
22
  onClick?: () => void;
23
+ fullWidth?: boolean;
23
24
  };
24
- export declare const CgButton: ({ size, variant, icon, flexReverse, disabled, onClick, children }: TCgButton) => JSX.Element;
25
+ export declare const CgButton: ({ size, variant, icon, flexReverse, disabled, onClick, children, loading, fullWidth }: TCgButton) => JSX.Element;
@@ -7,5 +7,8 @@ export declare type TCgButtonStyleProps = {
7
7
  flexReverse?: boolean;
8
8
  loading?: boolean;
9
9
  isIconOnly?: boolean;
10
+ fullWidth?: boolean;
10
11
  };
11
12
  export declare const CgButtonContainer: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, TCgButtonStyleProps, never>;
13
+ export declare const CgButtonContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Pick<TCgButtonStyleProps, "flexReverse" | "size" | "loading">, never>;
14
+ export declare const CgButtonLoader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ export declare enum ECouponCodeStatus {
3
+ Success = "Success",
4
+ Invalid = "Invalid",
5
+ Error = "Error",
6
+ Empty = "Empty"
7
+ }
8
+ declare type TSubmitResult = {
9
+ status: ECouponCodeStatus;
10
+ message: string;
11
+ };
12
+ export declare type TCouponCode = {
13
+ label: string;
14
+ resetLabel: string;
15
+ placeholder: string;
16
+ onSubmit: (value: string) => Promise<TSubmitResult>;
17
+ };
18
+ export declare function CouponCode({ label, resetLabel, placeholder, onSubmit }: TCouponCode): JSX.Element;
19
+ export {};
@@ -0,0 +1,14 @@
1
+ import { ECouponCodeStatus } from './CouponCode';
2
+ declare type TCouponInput = {
3
+ customFocus: boolean;
4
+ ab?: boolean;
5
+ };
6
+ declare type TCouponResultContainer = {
7
+ status?: ECouponCodeStatus;
8
+ };
9
+ export declare const CouponContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
10
+ export declare const CouponInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, TCouponInput, never>;
11
+ export declare const CouponResultContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TCouponResultContainer, never>;
12
+ export declare const CouponResultMessage: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
13
+ export declare const CouponButtonContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
14
+ export {};
@@ -6,5 +6,6 @@ export declare type TQuantitySelector = {
6
6
  maxValue: number;
7
7
  value: number;
8
8
  inCart?: boolean;
9
+ onBlur: () => void;
9
10
  };
10
- export declare function QuantitySelector({ onAdd, onSubtract, onChange, maxValue, value, }: TQuantitySelector): JSX.Element;
11
+ export declare function QuantitySelector({ onAdd, onSubtract, onChange, maxValue, value, onBlur }: TQuantitySelector): JSX.Element;
@@ -1,7 +1,10 @@
1
1
  declare type TQuantityButton = {
2
2
  direction: 'left' | 'right';
3
3
  };
4
+ declare type TQuanityInput = {
5
+ customFocus: boolean;
6
+ };
4
7
  export declare const QuantitySelectorContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
5
8
  export declare const QuantityButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, TQuantityButton, never>;
6
- export declare const QuantityInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {}, never>;
9
+ export declare const QuantityInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, TQuanityInput, never>;
7
10
  export {};
@@ -76,5 +76,7 @@ export * from './components/MaxHeightText/MaxHeightText';
76
76
  export * from './components/ToolTipDialog/ToolTipDialog';
77
77
  export * from './components/CartSubTotal/CartSubTotal';
78
78
  export * from './components/CgButton/CgButton';
79
+ export * from './components/CouponCode/CouponCode';
80
+ export * from './components/CgButton/CgButton';
79
81
  export * from './components/CartCardLabel/CartCardLabel';
80
82
  export * from './components/CartCard/CartCard';
@@ -40,6 +40,44 @@ function __rest(s, e) {
40
40
  return t;
41
41
  }
42
42
 
43
+ function __awaiter(thisArg, _arguments, P, generator) {
44
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
45
+ return new (P || (P = Promise))(function (resolve, reject) {
46
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
47
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
48
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
49
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
50
+ });
51
+ }
52
+
53
+ function __generator(thisArg, body) {
54
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
55
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
56
+ function verb(n) { return function (v) { return step([n, v]); }; }
57
+ function step(op) {
58
+ if (f) throw new TypeError("Generator is already executing.");
59
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
60
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
61
+ if (y = 0, t) op = [op[0] & 2, t.value];
62
+ switch (op[0]) {
63
+ case 0: case 1: t = op; break;
64
+ case 4: _.label++; return { value: op[1], done: false };
65
+ case 5: _.label++; y = op[1]; op = [0]; continue;
66
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
67
+ default:
68
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
69
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
70
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
71
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
72
+ if (t[2]) _.ops.pop();
73
+ _.trys.pop(); continue;
74
+ }
75
+ op = body.call(thisArg, _);
76
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
77
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
78
+ }
79
+ }
80
+
43
81
  function __makeTemplateObject(cooked, raw) {
44
82
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
45
83
  return cooked;
@@ -49,6 +87,8 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
49
87
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
50
88
  };
51
89
 
90
+ exports.__awaiter = __awaiter;
91
+ exports.__generator = __generator;
52
92
  exports.__makeTemplateObject = __makeTemplateObject;
53
93
  exports.__rest = __rest;
54
94
  //# sourceMappingURL=_tslib.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_tslib.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"_tslib.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -92,6 +92,7 @@ require('../MaxHeightText/styles.js');
92
92
  require('../ToolTipDialog/ToolTipDialog.styles.js');
93
93
  require('../CartSubTotal/CartSubTotal.js');
94
94
  require('../CgButton/CgButton.js');
95
+ require('../CouponCode/CouponCode.js');
95
96
  require('../CartCardLabel/CartCardLabel.styles.js');
96
97
  require('../CartCard/CartCard.styles.js');
97
98
 
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var React = require('react');
6
6
  var fallback_grocery = require('./assets/fallback_grocery.svg.js');
7
7
  var CartCard_styles = require('./CartCard.styles.js');
8
- var typography = require('@citygross/typography');
9
8
  var icons = require('@citygross/icons');
10
9
  var CgButton = require('../CgButton/CgButton.js');
11
10
 
@@ -21,7 +20,7 @@ var CartCard = function (_a) {
21
20
  React__default["default"].createElement(CartCard_styles.CartCardInnerTop, null,
22
21
  React__default["default"].createElement(CartCard_styles.CartCardInfo, null,
23
22
  markings && (React__default["default"].createElement(CartCard_styles.MarkingsContainer, null, markings)),
24
- title && React__default["default"].createElement(typography.H3, null, title),
23
+ title && React__default["default"].createElement(CartCard_styles.CartCardTitle, null, title),
25
24
  description && description),
26
25
  showDelete && (React__default["default"].createElement("div", null,
27
26
  React__default["default"].createElement(CgButton.CgButton, { onClick: onDelete, variant: CgButton.EButtonVariant.secondary, icon: React__default["default"].createElement(icons.Icons.Trash, { width: 16, height: 16 }) })))),
@@ -1 +1 @@
1
- {"version":3,"file":"CartCard.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CartCard.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -10,7 +10,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
10
10
 
11
11
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
12
12
 
13
- var CartCardImage = styled__default["default"].img(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n width: 48px;\n height: 48px;\n"], ["\n width: 48px;\n height: 48px;\n"])));
13
+ var CartCardImage = styled__default["default"].img(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n width: 48px;\n height: 48px;\n object-fit: contain;\n"], ["\n width: 48px;\n height: 48px;\n object-fit: contain;\n"])));
14
14
  var CartCardContainer = styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: flex;\n gap: ", "px;\n align-items: center;\n width: 100%;\n"], ["\n display: flex;\n gap: ", "px;\n align-items: center;\n width: 100%;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
15
15
  var CartCardInfo = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n flex: 1;\n"], ["\n flex: 1;\n"])));
16
16
  var CartCardInnerTop = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n"], ["\n display: flex;\n justify-content: space-between;\n"])));
@@ -21,7 +21,8 @@ var MaxWarningAnimate = styled.keyframes(templateObject_8 || (templateObject_8 =
21
21
  var PriceContainer = styled__default["default"].div(templateObject_9 || (templateObject_9 = _tslib.__makeTemplateObject(["\n position: relative;\n flex: 1;\n"], ["\n position: relative;\n flex: 1;\n"])));
22
22
  var MaxWarning = styled__default["default"].div(templateObject_10 || (templateObject_10 = _tslib.__makeTemplateObject(["\n color: ", ";\n animation: ", " 2s forwards;\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: ", ";\n font-size: ", "px;\n"], ["\n color: ", ";\n animation: ", " 2s forwards;\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: ", ";\n font-size: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.alertRed; }, MaxWarningAnimate, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; });
23
23
  var MarkingsContainer = styled__default["default"].div(templateObject_11 || (templateObject_11 = _tslib.__makeTemplateObject(["\n margin-bottom: ", "px;\n"], ["\n margin-bottom: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; });
24
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
24
+ var CartCardTitle = styled__default["default"].p(templateObject_12 || (templateObject_12 = _tslib.__makeTemplateObject(["\n font-weight: ", ";\n font-size: ", "px;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n text-overflow: ellipsis;\n overflow: hidden;\n"], ["\n font-weight: ", ";\n font-size: ", "px;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n text-overflow: ellipsis;\n overflow: hidden;\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.weight.medium; }, function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s3; });
25
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12;
25
26
 
26
27
  exports.CartCardContainer = CartCardContainer;
27
28
  exports.CartCardImage = CartCardImage;
@@ -29,6 +30,7 @@ exports.CartCardInfo = CartCardInfo;
29
30
  exports.CartCardInner = CartCardInner;
30
31
  exports.CartCardInnerTop = CartCardInnerTop;
31
32
  exports.CartCardPriceContainer = CartCardPriceContainer;
33
+ exports.CartCardTitle = CartCardTitle;
32
34
  exports.MarkingsContainer = MarkingsContainer;
33
35
  exports.MaxWarning = MaxWarning;
34
36
  exports.PriceContainer = PriceContainer;
@@ -1 +1 @@
1
- {"version":3,"file":"CartCard.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CartCard.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var CgButton_styles = require('./CgButton.styles.js');
7
+ var Spinner = require('../Spinner/Spinner.js');
7
8
 
8
9
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
10
 
@@ -24,8 +25,8 @@ exports.EButtonVariant = void 0;
24
25
  EButtonVariant[EButtonVariant["ghost"] = 4] = "ghost";
25
26
  })(exports.EButtonVariant || (exports.EButtonVariant = {}));
26
27
  var CgButton = function (_a) {
27
- var size = _a.size, variant = _a.variant, icon = _a.icon, flexReverse = _a.flexReverse, disabled = _a.disabled, onClick = _a.onClick, children = _a.children;
28
- return (React__default["default"].createElement(CgButton_styles.CgButtonContainer, { size: size, variant: variant, isIconOnly: !children, flexReverse: flexReverse, disabled: disabled, onKeyDown: function (event) {
28
+ var size = _a.size, variant = _a.variant, icon = _a.icon, flexReverse = _a.flexReverse, disabled = _a.disabled, onClick = _a.onClick, children = _a.children, loading = _a.loading, fullWidth = _a.fullWidth;
29
+ return (React__default["default"].createElement(CgButton_styles.CgButtonContainer, { size: size, variant: variant, isIconOnly: !children, flexReverse: flexReverse, disabled: disabled || loading, fullWidth: fullWidth, onKeyDown: function (event) {
29
30
  if (event.key === 'Enter') {
30
31
  onClick && onClick();
31
32
  }
@@ -33,8 +34,11 @@ var CgButton = function (_a) {
33
34
  e.preventDefault();
34
35
  onClick && onClick();
35
36
  } },
36
- icon,
37
- children));
37
+ React__default["default"].createElement(CgButton_styles.CgButtonContent, { size: size, flexReverse: flexReverse, loading: loading },
38
+ icon,
39
+ children),
40
+ loading && (React__default["default"].createElement(CgButton_styles.CgButtonLoader, null,
41
+ React__default["default"].createElement(Spinner.Spinner, { animationSpeedMs: 1000, size: 16 })))));
38
42
  };
39
43
 
40
44
  exports.CgButton = CgButton;
@@ -1 +1 @@
1
- {"version":3,"file":"CgButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CgButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -46,12 +46,12 @@ var buttonShadow = function (size, variant) {
46
46
  return 'inset 0px -2px 0px rgba(0, 0, 0, 0.15)';
47
47
  }
48
48
  };
49
- var CgButtonContainer = styled__default["default"].button(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n border-radius: ", "px;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: ", "px;\n flex-direction: ", ";\n font-size ", ";\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\n &:disabled{\n cursor: default;\n }\n &:after{\n content: '';\n display: block;\n width: 100%;\n height: 100%;\n position: absolute;\n box-shadow: ", ";\n border-radius: ", "px;\n top: 0;\n left: 0;\n }\n\n ", "\n"], ["\n border-radius: ", "px;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: ", "px;\n flex-direction: ", ";\n font-size ", ";\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\n &:disabled{\n cursor: default;\n }\n &:after{\n content: '';\n display: block;\n width: 100%;\n height: 100%;\n position: absolute;\n box-shadow: ", ";\n border-radius: ", "px;\n top: 0;\n left: 0;\n }\n\n ", "\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { return (props.flexReverse ? 'row-reverse' : 'row'); }, function (props) { return buttonFontSize(props.size, props.theme.typography); }, function (props) {
49
+ var CgButtonContainer = styled__default["default"].button(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n border-radius: ", "px;\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\n ", "\n &:disabled {\n cursor: default;\n }\n &:after {\n content: '';\n display: block;\n width: 100%;\n height: 100%;\n position: absolute;\n box-shadow: ", ";\n border-radius: ", "px;\n top: 0;\n left: 0;\n }\n\n ", "\n"], ["\n border-radius: ", "px;\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\n ", "\n &:disabled {\n cursor: default;\n }\n &:after {\n content: '';\n display: block;\n width: 100%;\n height: 100%;\n position: absolute;\n box-shadow: ", ";\n border-radius: ", "px;\n top: 0;\n left: 0;\n }\n\n ", "\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) {
50
50
  var _a;
51
51
  return props.isIconOnly
52
52
  ? "".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs, "px")
53
53
  : buttonPadding(props.size, props.theme.spacings);
54
- }, global_styles.focusVisible, function (props) { return buttonShadow(props.size, props.variant); }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) {
54
+ }, function (props) { return (props === null || props === void 0 ? void 0 : props.fullWidth) && "width: 100%;"; }, global_styles.focusVisible, function (props) { return buttonShadow(props.size, props.variant); }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) {
55
55
  switch (props.variant) {
56
56
  case CgButton.EButtonVariant.primary:
57
57
  return CgPrimary;
@@ -67,7 +67,11 @@ var CgButtonContainer = styled__default["default"].button(templateObject_7 || (t
67
67
  return CgPrimary;
68
68
  }
69
69
  });
70
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
70
+ var CgButtonContent = styled__default["default"].div(templateObject_8 || (templateObject_8 = _tslib.__makeTemplateObject(["\ndisplay: flex;\njustify-content: center;\nalign-items: center;\ngap: ", "px;\nflex-direction: ", ";\nfont-size ", ";\n", ";\n"], ["\ndisplay: flex;\njustify-content: center;\nalign-items: center;\ngap: ", "px;\nflex-direction: ", ";\nfont-size ", ";\n", ";\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { return (props.flexReverse ? 'row-reverse' : 'row'); }, function (props) { return buttonFontSize(props.size, props.theme.typography); }, function (props) { return (props === null || props === void 0 ? void 0 : props.loading) && "opacity: 0"; });
71
+ var CgButtonLoader = styled__default["default"].div(templateObject_9 || (templateObject_9 = _tslib.__makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: grid;\n place-content: center;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: grid;\n place-content: center;\n"])));
72
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
71
73
 
72
74
  exports.CgButtonContainer = CgButtonContainer;
75
+ exports.CgButtonContent = CgButtonContent;
76
+ exports.CgButtonLoader = CgButtonLoader;
73
77
  //# sourceMappingURL=CgButton.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CgButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CgButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,81 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _tslib = require('../../../../_virtual/_tslib.js');
6
+ var React = require('react');
7
+ var CouponCode_styles = require('./CouponCode.styles.js');
8
+ var CgButton = require('../CgButton/CgButton.js');
9
+ var icons = require('@citygross/icons');
10
+ var designTokens = require('@citygross/design-tokens');
11
+ var Link = require('../Links/Link.js');
12
+ var typography = require('@citygross/typography');
13
+
14
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
+
16
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
17
+
18
+ exports.ECouponCodeStatus = void 0;
19
+ (function (ECouponCodeStatus) {
20
+ ECouponCodeStatus["Success"] = "Success";
21
+ ECouponCodeStatus["Invalid"] = "Invalid";
22
+ ECouponCodeStatus["Error"] = "Error";
23
+ ECouponCodeStatus["Empty"] = "Empty";
24
+ })(exports.ECouponCodeStatus || (exports.ECouponCodeStatus = {}));
25
+ var CouponResultIcon = function (_a) {
26
+ var _b, _c, _d;
27
+ var status = _a.status;
28
+ switch (status) {
29
+ case exports.ECouponCodeStatus.Success:
30
+ return (React__default["default"].createElement(icons.Icons.CheckMark, { color: (_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.alertGreen, width: 20, height: 20 }));
31
+ case exports.ECouponCodeStatus.Invalid:
32
+ return (React__default["default"].createElement(icons.Icons.Cross, { color: (_c = designTokens.theme.palette) === null || _c === void 0 ? void 0 : _c.alertRed, width: 20, height: 20 }));
33
+ default:
34
+ return (React__default["default"].createElement(icons.Icons.Alert, { color: (_d = designTokens.theme.palette) === null || _d === void 0 ? void 0 : _d.alertRed, width: 20, height: 20 }));
35
+ }
36
+ };
37
+ var initialResult = {
38
+ status: exports.ECouponCodeStatus.Empty,
39
+ message: ''
40
+ };
41
+ function CouponCode(_a) {
42
+ var _this = this;
43
+ var label = _a.label, resetLabel = _a.resetLabel, placeholder = _a.placeholder, onSubmit = _a.onSubmit;
44
+ var _b = React.useState(''), value = _b[0], setValue = _b[1];
45
+ var _c = React.useState(false), loading = _c[0], setLoading = _c[1];
46
+ var _d = React.useState(false), customFocus = _d[0], setCustomFocus = _d[1];
47
+ var _e = React.useState(initialResult), result = _e[0], setResult = _e[1];
48
+ var handleSubmit = function () { return _tslib.__awaiter(_this, void 0, void 0, function () {
49
+ var result;
50
+ return _tslib.__generator(this, function (_a) {
51
+ switch (_a.label) {
52
+ case 0:
53
+ setLoading(true);
54
+ return [4 /*yield*/, onSubmit(value)];
55
+ case 1:
56
+ result = _a.sent();
57
+ setResult(result);
58
+ setLoading(false);
59
+ return [2 /*return*/];
60
+ }
61
+ });
62
+ }); };
63
+ return (React__default["default"].createElement(React__default["default"].Fragment, null, (result === null || result === void 0 ? void 0 : result.status) === exports.ECouponCodeStatus.Empty ? (React__default["default"].createElement(CouponCode_styles.CouponContainer, null,
64
+ React__default["default"].createElement(CouponCode_styles.CouponInput, { type: "text", placeholder: placeholder, value: value, onChange: function (e) { return setValue(e.currentTarget.value); }, onMouseDown: function () {
65
+ setCustomFocus(true);
66
+ }, onBlur: function () { return setCustomFocus(false); }, customFocus: customFocus }),
67
+ React__default["default"].createElement(CouponCode_styles.CouponButtonContainer, null,
68
+ React__default["default"].createElement(CgButton.CgButton, { variant: CgButton.EButtonVariant.secondary, disabled: loading || !value, onClick: function () { return handleSubmit(); }, size: CgButton.ECgButtonSize.medium, fullWidth: true }, label)))) : (React__default["default"].createElement(CouponCode_styles.CouponResultContainer, { status: result === null || result === void 0 ? void 0 : result.status }, (result === null || result === void 0 ? void 0 : result.status) === exports.ECouponCodeStatus.Success ? (React__default["default"].createElement(CouponCode_styles.CouponResultMessage, null,
69
+ React__default["default"].createElement(CouponResultIcon, { status: result === null || result === void 0 ? void 0 : result.status }),
70
+ React__default["default"].createElement("p", null, result === null || result === void 0 ? void 0 :
71
+ result.message,
72
+ " ",
73
+ value))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
74
+ React__default["default"].createElement(CouponCode_styles.CouponResultMessage, null,
75
+ React__default["default"].createElement(CouponResultIcon, { status: result.status }),
76
+ React__default["default"].createElement("p", null, result === null || result === void 0 ? void 0 : result.message)),
77
+ React__default["default"].createElement(Link.Link, { color: "black", size: typography.TextTypes.TextSize.SMALL, textDecoration: "underline", onClick: function () { return setResult(initialResult); } }, resetLabel)))))));
78
+ }
79
+
80
+ exports.CouponCode = CouponCode;
81
+ //# sourceMappingURL=CouponCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CouponCode.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _tslib = require('../../../../_virtual/_tslib.js');
6
+ var styled = require('styled-components');
7
+ var global_styles = require('../../shared/global.styles.js');
8
+ var CouponCode = require('./CouponCode.js');
9
+
10
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
+
12
+ var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
13
+
14
+ var CouponContainer = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n gap: ", "px;\n width: 100%;\n"], ["\n display: flex;\n gap: ", "px;\n width: 100%;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs2; });
15
+ var CouponInput = styled__default["default"].input(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n grid-area: 1/1/1/1;\n border-radius: ", "px;\n border: 1px solid ", ";\n background: ", ";\n padding: ", ";\n outline: none;\n background: white;\n font-size: ", "px;\n flex: 1;\n ", "\n &:focus-visible {\n border: 1px solid ", ";\n }\n"], ["\n grid-area: 1/1/1/1;\n border-radius: ", "px;\n border: 1px solid ", ";\n background: ", ";\n padding: ", ";\n outline: none;\n background: white;\n font-size: ", "px;\n flex: 1;\n ", "\n &:focus-visible {\n border: 1px solid ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.medium; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, function (props) { var _a, _b; return "".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs, "px ").concat((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs2, "px"); }, function (props) { var _a, _b; return (_b = (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size) === null || _b === void 0 ? void 0 : _b.s3; }, function (props) { return !props.customFocus && global_styles.focusVisible; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlue; });
16
+ var CouponResultContainer = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n font-size: ", "px;\n padding: ", ";\n background: ", ";\n display: flex;\n height: ", "px;\n border-radius: ", "px;\n justify-content: space-between;\n"], ["\n font-size: ", "px;\n padding: ", ";\n background: ", ";\n display: flex;\n height: ", "px;\n border-radius: ", "px;\n justify-content: space-between;\n"])), function (props) { var _a, _b; return (_b = (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size) === null || _b === void 0 ? void 0 : _b.s2; }, function (props) { var _a, _b; return "".concat((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.couponContainerPadding, "px ").concat((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs, "px"); }, function (props) {
17
+ var _a, _b;
18
+ return props.status === CouponCode.ECouponCodeStatus.Success
19
+ ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.greenLight
20
+ : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.redLight;
21
+ }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.couponContainerHeight; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; });
22
+ var CouponResultMessage = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: flex;\n gap: ", "px;\n"], ["\n display: flex;\n gap: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs2; });
23
+ var CouponButtonContainer = styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n width: ", "px;\n"], ["\n width: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.couponButtonContainer; });
24
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
25
+
26
+ exports.CouponButtonContainer = CouponButtonContainer;
27
+ exports.CouponContainer = CouponContainer;
28
+ exports.CouponInput = CouponInput;
29
+ exports.CouponResultContainer = CouponResultContainer;
30
+ exports.CouponResultMessage = CouponResultMessage;
31
+ //# sourceMappingURL=CouponCode.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CouponCode.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -11,12 +11,22 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
11
11
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
12
 
13
13
  function QuantitySelector(_a) {
14
- var onAdd = _a.onAdd, onSubtract = _a.onSubtract, onChange = _a.onChange, maxValue = _a.maxValue, value = _a.value;
14
+ var onAdd = _a.onAdd, onSubtract = _a.onSubtract, onChange = _a.onChange, maxValue = _a.maxValue, value = _a.value, onBlur = _a.onBlur;
15
+ var _b = React.useState(false), customFocus = _b[0], setCustomFocus = _b[1];
15
16
  return (React__default["default"].createElement(QuantitySelector_styles.QuantitySelectorContainer, null,
16
- React__default["default"].createElement(QuantitySelector_styles.QuantityButton, { direction: 'left', disabled: value <= 0, onClick: onSubtract, tabIndex: -1 },
17
+ React__default["default"].createElement(QuantitySelector_styles.QuantityButton, { direction: "left", disabled: value <= 0, onClick: onSubtract, tabIndex: -1 },
17
18
  React__default["default"].createElement(icons.Icons.Minus, { width: 16, height: 16 })),
18
- React__default["default"].createElement(QuantitySelector_styles.QuantityInput, { max: maxValue, value: value, type: "number", onChange: function (e) { return onChange(e); } }),
19
- React__default["default"].createElement(QuantitySelector_styles.QuantityButton, { direction: 'right', disabled: value >= maxValue, onClick: onAdd, tabIndex: -1 },
19
+ React__default["default"].createElement(QuantitySelector_styles.QuantityInput, { customFocus: customFocus, max: maxValue, value: value, type: "number", onMouseDown: function () {
20
+ setCustomFocus(true);
21
+ }, onKeyDown: function (event) {
22
+ if (event.key === 'Enter' || event.key === 'Escape') {
23
+ event.currentTarget.blur();
24
+ }
25
+ }, onBlur: function () {
26
+ onBlur && onBlur();
27
+ setCustomFocus(false);
28
+ }, onChange: function (e) { return onChange(e); } }),
29
+ React__default["default"].createElement(QuantitySelector_styles.QuantityButton, { direction: "right", disabled: value >= maxValue, onClick: onAdd, tabIndex: -1 },
20
30
  React__default["default"].createElement(icons.Icons.Plus, { width: 16, height: 16 }))));
21
31
  }
22
32
 
@@ -1 +1 @@
1
- {"version":3,"file":"QuantitySelector.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"QuantitySelector.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -10,13 +10,15 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
10
10
 
11
11
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
12
12
 
13
- var quantityButton = styled.css(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n &:disabled {\n background-color: ", ";\n opacity: 0.5;\n }\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n"], ["\n &:disabled {\n background-color: ", ";\n opacity: 0.5;\n }\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lightest; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter; });
14
- var border = styled.css(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n border: 1px solid ", ";"], ["\n border: 1px solid ", ";"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.disabledGray; });
13
+ var quantityButton = styled.css(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n cursor: pointer;\n &:disabled {\n background-color: ", ";\n opacity: 0.5;\n cursor: default;\n }\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n"], ["\n cursor: pointer;\n &:disabled {\n background-color: ", ";\n opacity: 0.5;\n cursor: default;\n }\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lightest; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter; });
14
+ var border = styled.css(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n border: 1px solid ", ";\n"], ["\n border: 1px solid ", ";\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.disabledGray; });
15
15
  var borderRadiusLeft = styled.css(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n"], ["\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.small; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.small; });
16
16
  var borderRadiusRight = styled.css(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n"], ["\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.small; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.small; });
17
17
  var QuantitySelectorContainer = styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n display: grid;\n grid-template-columns: 40px 48px 40px;\n height: 40px;\n background: ", ";\n width: 128px;\n\n @media (min-width: ", "px) {\n grid-template-columns: 32px 40px 32px;\n width: 104px;\n height: 32px;\n }\n"], ["\n display: grid;\n grid-template-columns: 40px 48px 40px;\n height: 40px;\n background: ", ";\n width: 128px;\n\n @media (min-width: ", "px) {\n grid-template-columns: 32px 40px 32px;\n width: 104px;\n height: 32px;\n }\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.transparent; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.sm; });
18
- var QuantityButton = styled__default["default"].button(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ", ";\n ", "\n ", "\n ", "\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ", ";\n ", "\n ", "\n ", "\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, quantityButton, border, function (props) { return (props.direction === 'left' ? borderRadiusLeft : borderRadiusRight); });
19
- var QuantityInput = styled__default["default"].input(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n ", "\n z-index: 1;\n border-left: none;\n border-right: none;\n text-align: center;\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n border-left: 1px solid ", ";\n border-right: 1px solid ", ";\n }\n ", "\n"], ["\n ", "\n z-index: 1;\n border-left: none;\n border-right: none;\n text-align: center;\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n border-left: 1px solid ", ";\n border-right: 1px solid ", ";\n }\n ", "\n"])), border, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.disabledGray; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.disabledGray; }, global_styles.focusVisible);
18
+ var QuantityButton = styled__default["default"].button(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ", ";\n ", "\n ", "\n ", "\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ", ";\n ", "\n ", "\n ", "\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, quantityButton, border, function (props) {
19
+ return props.direction === 'left' ? borderRadiusLeft : borderRadiusRight;
20
+ });
21
+ var QuantityInput = styled__default["default"].input(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n ", "\n z-index: 1;\n border-left: none;\n border-right: none;\n text-align: center;\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n border: 1px solid ", ";\n }\n outline: none;\n ", "\n"], ["\n ", "\n z-index: 1;\n border-left: none;\n border-right: none;\n text-align: center;\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n border: 1px solid ", ";\n }\n outline: none;\n ", "\n"])), border, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.alertBlue; }, function (props) { return !props.customFocus && global_styles.focusVisible; });
20
22
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
21
23
 
22
24
  exports.QuantityButton = QuantityButton;
@@ -1 +1 @@
1
- {"version":3,"file":"QuantitySelector.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"QuantitySelector.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -92,6 +92,7 @@ require('../MaxHeightText/styles.js');
92
92
  require('../ToolTipDialog/ToolTipDialog.styles.js');
93
93
  require('../CartSubTotal/CartSubTotal.js');
94
94
  require('../CgButton/CgButton.js');
95
+ require('../CouponCode/CouponCode.js');
95
96
  require('../CartCardLabel/CartCardLabel.styles.js');
96
97
  require('../CartCard/CartCard.styles.js');
97
98
 
@@ -1 +1 @@
1
- {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -83,6 +83,7 @@ var MaxHeightText = require('./components/MaxHeightText/MaxHeightText.js');
83
83
  var ToolTipDialog = require('./components/ToolTipDialog/ToolTipDialog.js');
84
84
  var CartSubTotal = require('./components/CartSubTotal/CartSubTotal.js');
85
85
  var CgButton = require('./components/CgButton/CgButton.js');
86
+ var CouponCode = require('./components/CouponCode/CouponCode.js');
86
87
  var CartCardLabel = require('./components/CartCardLabel/CartCardLabel.js');
87
88
  var CartCard = require('./components/CartCard/CartCard.js');
88
89
 
@@ -212,6 +213,11 @@ Object.defineProperty(exports, 'ECgButtonSize', {
212
213
  enumerable: true,
213
214
  get: function () { return CgButton.ECgButtonSize; }
214
215
  });
216
+ exports.CouponCode = CouponCode.CouponCode;
217
+ Object.defineProperty(exports, 'ECouponCodeStatus', {
218
+ enumerable: true,
219
+ get: function () { return CouponCode.ECouponCodeStatus; }
220
+ });
215
221
  exports.CartCardLabel = CartCardLabel.CartCardLabel;
216
222
  exports.CartCard = CartCard.CartCard;
217
223
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -119,7 +119,10 @@ var constants = {
119
119
  maxHeightFaderHeight: 50,
120
120
  paginationButtonWidth: 44,
121
121
  cartCardImageSize: 48,
122
- toolTipCloseSize: 20
122
+ toolTipCloseSize: 20,
123
+ couponContainerHeight: 43,
124
+ couponButtonContainer: 102,
125
+ couponContainerPadding: 10
123
126
  };
124
127
 
125
128
  var palette = {