@citygross/components 0.7.178 → 0.7.179

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.
@@ -5,6 +5,7 @@ export declare type TCartSummary = {
5
5
  bags?: TSummaryItem[];
6
6
  groceries?: TSummaryItem[];
7
7
  charges?: TSummaryItem[];
8
+ cateredMeals?: TSummaryItem[];
8
9
  deliveryFee?: {
9
10
  amount: number;
10
11
  taxAmount: number;
@@ -32,26 +32,36 @@ var calculateSummaryLine = function (items) {
32
32
  return sumOfItems;
33
33
  };
34
34
  function CartSummary(_a) {
35
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
36
- var _m = _a.saveLabel, saveLabel = _m === void 0 ? 'Rabatter' : _m, _o = _a.shippingLabel, shippingLabel = _o === void 0 ? 'frakt' : _o, _p = _a.totalLabel, totalLabel = _p === void 0 ? 'totalt' : _p, _q = _a.taxLabel, taxLabel = _q === void 0 ? 'varav moms' : _q, cartSummary = _tslib.__rest(_a, ["saveLabel", "shippingLabel", "totalLabel", "taxLabel"]);
35
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
36
+ var _p = _a.saveLabel, saveLabel = _p === void 0 ? 'Rabatter' : _p, _q = _a.shippingLabel, shippingLabel = _q === void 0 ? 'frakt' : _q, _r = _a.totalLabel, totalLabel = _r === void 0 ? 'totalt' : _r, _s = _a.taxLabel, taxLabel = _s === void 0 ? 'varav moms' : _s, cartSummary = _tslib.__rest(_a, ["saveLabel", "shippingLabel", "totalLabel", "taxLabel"]);
37
37
  var charges = (_b = cartSummary.charges) !== null && _b !== void 0 ? _b : [];
38
38
  var bags = (_c = cartSummary.bags) !== null && _c !== void 0 ? _c : [];
39
39
  var groceries = (_d = cartSummary.groceries) !== null && _d !== void 0 ? _d : [];
40
+ var cateredMeals = (_e = cartSummary === null || cartSummary === void 0 ? void 0 : cartSummary.cateredMeals) !== null && _e !== void 0 ? _e : [];
40
41
  var sumOfBags = calculateSummaryLine(bags);
41
42
  var sumOfGroceries = calculateSummaryLine(groceries);
43
+ var sumOfCateredMeals = calculateSummaryLine(cateredMeals);
42
44
  return (React__default["default"].createElement(CartSummary_styles.CartSummaryContainer, null,
43
45
  React__default["default"].createElement(CartSummary_styles.CartPaymentContainer, null,
44
46
  cartSummary.title && (React__default["default"].createElement(CartSummary_styles.CartSummaryTitle, null,
45
47
  React__default["default"].createElement(typography.H3, null, cartSummary.title),
46
48
  React__default["default"].createElement(typography.BodyText, null, cartSummary.subTitle))),
47
49
  React__default["default"].createElement(CartSummary_styles.CartSummaryHeader, { title: cartSummary.title },
50
+ (cateredMeals === null || cateredMeals === void 0 ? void 0 : cateredMeals.length) > 0 && (React__default["default"].createElement(CartSummary_styles.CartLine, null,
51
+ React__default["default"].createElement(typography.BodyText, null,
52
+ "catering ",
53
+ sumOfCateredMeals.quantity,
54
+ " st"),
55
+ React__default["default"].createElement(CartSummary_styles.AmountWrapper, null,
56
+ sumOfCateredMeals.cancelledAmount > 0 && (React__default["default"].createElement(typography.BodyText, { lineThrough: true, color: (_f = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _f === void 0 ? void 0 : _f.dark }, utils.formatPrice(sumOfCateredMeals.cancelledAmount))),
57
+ React__default["default"].createElement(typography.H3, { fontWeight: 'semiBold' }, utils.formatPrice(sumOfCateredMeals.amount))))),
48
58
  bags.length > 0 && (React__default["default"].createElement(CartSummary_styles.CartLine, null,
49
59
  React__default["default"].createElement(typography.BodyText, null,
50
60
  "matkassar ",
51
61
  sumOfBags.quantity,
52
62
  " st"),
53
63
  React__default["default"].createElement(CartSummary_styles.AmountWrapper, null,
54
- sumOfBags.cancelledAmount > 0 && (React__default["default"].createElement(typography.BodyText, { lineThrough: true, color: (_e = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _e === void 0 ? void 0 : _e.dark }, utils.formatPrice(sumOfBags.cancelledAmount))),
64
+ sumOfBags.cancelledAmount > 0 && (React__default["default"].createElement(typography.BodyText, { lineThrough: true, color: (_g = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _g === void 0 ? void 0 : _g.dark }, utils.formatPrice(sumOfBags.cancelledAmount))),
55
65
  React__default["default"].createElement(typography.H3, { fontWeight: 'semiBold' }, utils.formatPrice(sumOfBags.amount))))),
56
66
  groceries.length > 0 && (React__default["default"].createElement(CartSummary_styles.CartLine, null,
57
67
  React__default["default"].createElement(typography.BodyText, null,
@@ -59,9 +69,9 @@ function CartSummary(_a) {
59
69
  sumOfGroceries.quantity,
60
70
  " st"),
61
71
  React__default["default"].createElement(CartSummary_styles.AmountWrapper, null,
62
- sumOfGroceries.cancelledAmount > 0 && (React__default["default"].createElement(typography.BodyText, { lineThrough: true, color: (_f = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _f === void 0 ? void 0 : _f.dark }, utils.formatPrice(sumOfGroceries.cancelledAmount))),
72
+ sumOfGroceries.cancelledAmount > 0 && (React__default["default"].createElement(typography.BodyText, { lineThrough: true, color: (_h = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _h === void 0 ? void 0 : _h.dark }, utils.formatPrice(sumOfGroceries.cancelledAmount))),
63
73
  React__default["default"].createElement(typography.H3, { fontWeight: 'semiBold' }, utils.formatPrice(sumOfGroceries.amount))))),
64
- (charges === null || charges === void 0 ? void 0 : charges.length) > 0 && (React__default["default"].createElement(Divider.Divider, { xsSpacing: (_g = index.theme.spacings) === null || _g === void 0 ? void 0 : _g.xs, lgSpacing: (_h = index.theme.spacings) === null || _h === void 0 ? void 0 : _h.xs })), charges === null || charges === void 0 ? void 0 :
74
+ (charges === null || charges === void 0 ? void 0 : charges.length) > 0 && (React__default["default"].createElement(Divider.Divider, { xsSpacing: (_j = index.theme.spacings) === null || _j === void 0 ? void 0 : _j.xs, lgSpacing: (_k = index.theme.spacings) === null || _k === void 0 ? void 0 : _k.xs })), charges === null || charges === void 0 ? void 0 :
65
75
  charges.map(function (charge) {
66
76
  var _a, _b;
67
77
  return (React__default["default"].createElement(CartSummary_styles.CartLine, { key: charge.name },
@@ -71,10 +81,10 @@ function CartSummary(_a) {
71
81
  React__default["default"].createElement(typography.BodyText, null, utils.formatPrice(charge.amount)))));
72
82
  }),
73
83
  cartSummary.totalDiscount > 0 && (React__default["default"].createElement(CartSummary_styles.CartLine, null,
74
- React__default["default"].createElement(typography.BodyText, { color: (_j = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _j === void 0 ? void 0 : _j.alertRed }, saveLabel),
75
- React__default["default"].createElement(typography.BodyText, { color: (_k = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _k === void 0 ? void 0 : _k.alertRed }, utils.formatPrice(cartSummary.totalDiscount))))),
84
+ React__default["default"].createElement(typography.BodyText, { color: (_l = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _l === void 0 ? void 0 : _l.alertRed }, saveLabel),
85
+ React__default["default"].createElement(typography.BodyText, { color: (_m = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _m === void 0 ? void 0 : _m.alertRed }, utils.formatPrice(cartSummary.totalDiscount))))),
76
86
  React__default["default"].createElement(CartSummary_styles.CartSummaryFooter, null,
77
- ((_l = cartSummary.deliveryFee) === null || _l === void 0 ? void 0 : _l.amount) &&
87
+ ((_o = cartSummary.deliveryFee) === null || _o === void 0 ? void 0 : _o.amount) &&
78
88
  cartSummary.deliveryFee.amount > 0 && (React__default["default"].createElement(CartSummary_styles.CartLine, null,
79
89
  React__default["default"].createElement(typography.BodyText, null, shippingLabel),
80
90
  React__default["default"].createElement(typography.BodyText, null, utils.formatPrice(cartSummary.deliveryFee.amount)))),
@@ -1 +1 @@
1
- {"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -24,26 +24,36 @@ var calculateSummaryLine = function (items) {
24
24
  return sumOfItems;
25
25
  };
26
26
  function CartSummary(_a) {
27
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
28
- var _m = _a.saveLabel, saveLabel = _m === void 0 ? 'Rabatter' : _m, _o = _a.shippingLabel, shippingLabel = _o === void 0 ? 'frakt' : _o, _p = _a.totalLabel, totalLabel = _p === void 0 ? 'totalt' : _p, _q = _a.taxLabel, taxLabel = _q === void 0 ? 'varav moms' : _q, cartSummary = __rest(_a, ["saveLabel", "shippingLabel", "totalLabel", "taxLabel"]);
27
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
28
+ var _p = _a.saveLabel, saveLabel = _p === void 0 ? 'Rabatter' : _p, _q = _a.shippingLabel, shippingLabel = _q === void 0 ? 'frakt' : _q, _r = _a.totalLabel, totalLabel = _r === void 0 ? 'totalt' : _r, _s = _a.taxLabel, taxLabel = _s === void 0 ? 'varav moms' : _s, cartSummary = __rest(_a, ["saveLabel", "shippingLabel", "totalLabel", "taxLabel"]);
29
29
  var charges = (_b = cartSummary.charges) !== null && _b !== void 0 ? _b : [];
30
30
  var bags = (_c = cartSummary.bags) !== null && _c !== void 0 ? _c : [];
31
31
  var groceries = (_d = cartSummary.groceries) !== null && _d !== void 0 ? _d : [];
32
+ var cateredMeals = (_e = cartSummary === null || cartSummary === void 0 ? void 0 : cartSummary.cateredMeals) !== null && _e !== void 0 ? _e : [];
32
33
  var sumOfBags = calculateSummaryLine(bags);
33
34
  var sumOfGroceries = calculateSummaryLine(groceries);
35
+ var sumOfCateredMeals = calculateSummaryLine(cateredMeals);
34
36
  return (React.createElement(CartSummaryContainer, null,
35
37
  React.createElement(CartPaymentContainer, null,
36
38
  cartSummary.title && (React.createElement(CartSummaryTitle, null,
37
39
  React.createElement(H3, null, cartSummary.title),
38
40
  React.createElement(BodyText, null, cartSummary.subTitle))),
39
41
  React.createElement(CartSummaryHeader, { title: cartSummary.title },
42
+ (cateredMeals === null || cateredMeals === void 0 ? void 0 : cateredMeals.length) > 0 && (React.createElement(CartLine, null,
43
+ React.createElement(BodyText, null,
44
+ "catering ",
45
+ sumOfCateredMeals.quantity,
46
+ " st"),
47
+ React.createElement(AmountWrapper, null,
48
+ sumOfCateredMeals.cancelledAmount > 0 && (React.createElement(BodyText, { lineThrough: true, color: (_f = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _f === void 0 ? void 0 : _f.dark }, formatPrice(sumOfCateredMeals.cancelledAmount))),
49
+ React.createElement(H3, { fontWeight: 'semiBold' }, formatPrice(sumOfCateredMeals.amount))))),
40
50
  bags.length > 0 && (React.createElement(CartLine, null,
41
51
  React.createElement(BodyText, null,
42
52
  "matkassar ",
43
53
  sumOfBags.quantity,
44
54
  " st"),
45
55
  React.createElement(AmountWrapper, null,
46
- sumOfBags.cancelledAmount > 0 && (React.createElement(BodyText, { lineThrough: true, color: (_e = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _e === void 0 ? void 0 : _e.dark }, formatPrice(sumOfBags.cancelledAmount))),
56
+ sumOfBags.cancelledAmount > 0 && (React.createElement(BodyText, { lineThrough: true, color: (_g = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _g === void 0 ? void 0 : _g.dark }, formatPrice(sumOfBags.cancelledAmount))),
47
57
  React.createElement(H3, { fontWeight: 'semiBold' }, formatPrice(sumOfBags.amount))))),
48
58
  groceries.length > 0 && (React.createElement(CartLine, null,
49
59
  React.createElement(BodyText, null,
@@ -51,9 +61,9 @@ function CartSummary(_a) {
51
61
  sumOfGroceries.quantity,
52
62
  " st"),
53
63
  React.createElement(AmountWrapper, null,
54
- sumOfGroceries.cancelledAmount > 0 && (React.createElement(BodyText, { lineThrough: true, color: (_f = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _f === void 0 ? void 0 : _f.dark }, formatPrice(sumOfGroceries.cancelledAmount))),
64
+ sumOfGroceries.cancelledAmount > 0 && (React.createElement(BodyText, { lineThrough: true, color: (_h = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _h === void 0 ? void 0 : _h.dark }, formatPrice(sumOfGroceries.cancelledAmount))),
55
65
  React.createElement(H3, { fontWeight: 'semiBold' }, formatPrice(sumOfGroceries.amount))))),
56
- (charges === null || charges === void 0 ? void 0 : charges.length) > 0 && (React.createElement(Divider, { xsSpacing: (_g = theme_1.spacings) === null || _g === void 0 ? void 0 : _g.xs, lgSpacing: (_h = theme_1.spacings) === null || _h === void 0 ? void 0 : _h.xs })), charges === null || charges === void 0 ? void 0 :
66
+ (charges === null || charges === void 0 ? void 0 : charges.length) > 0 && (React.createElement(Divider, { xsSpacing: (_j = theme_1.spacings) === null || _j === void 0 ? void 0 : _j.xs, lgSpacing: (_k = theme_1.spacings) === null || _k === void 0 ? void 0 : _k.xs })), charges === null || charges === void 0 ? void 0 :
57
67
  charges.map(function (charge) {
58
68
  var _a, _b;
59
69
  return (React.createElement(CartLine, { key: charge.name },
@@ -63,10 +73,10 @@ function CartSummary(_a) {
63
73
  React.createElement(BodyText, null, formatPrice(charge.amount)))));
64
74
  }),
65
75
  cartSummary.totalDiscount > 0 && (React.createElement(CartLine, null,
66
- React.createElement(BodyText, { color: (_j = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _j === void 0 ? void 0 : _j.alertRed }, saveLabel),
67
- React.createElement(BodyText, { color: (_k = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _k === void 0 ? void 0 : _k.alertRed }, formatPrice(cartSummary.totalDiscount))))),
76
+ React.createElement(BodyText, { color: (_l = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _l === void 0 ? void 0 : _l.alertRed }, saveLabel),
77
+ React.createElement(BodyText, { color: (_m = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _m === void 0 ? void 0 : _m.alertRed }, formatPrice(cartSummary.totalDiscount))))),
68
78
  React.createElement(CartSummaryFooter, null,
69
- ((_l = cartSummary.deliveryFee) === null || _l === void 0 ? void 0 : _l.amount) &&
79
+ ((_o = cartSummary.deliveryFee) === null || _o === void 0 ? void 0 : _o.amount) &&
70
80
  cartSummary.deliveryFee.amount > 0 && (React.createElement(CartLine, null,
71
81
  React.createElement(BodyText, null, shippingLabel),
72
82
  React.createElement(BodyText, null, formatPrice(cartSummary.deliveryFee.amount)))),
@@ -1 +1 @@
1
- {"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.7.178",
3
+ "version": "0.7.179",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -71,5 +71,5 @@
71
71
  "moment": "^2.29.1",
72
72
  "react-loading-skeleton": "^2.2.0"
73
73
  },
74
- "gitHead": "ce1e09811af13c1c0aa4332feb3c0c6dbb8c83e7"
74
+ "gitHead": "4f6ff81bd82505e05064c50f1f302a387d2dfbb8"
75
75
  }