@citygross/components 0.19.7 → 0.21.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 (26) hide show
  1. package/build/@types/components/CartSummary/CartSummary.d.ts +5 -1
  2. package/build/@types/components/CartSummary/CartSummary.styles.d.ts +6 -3
  3. package/build/@types/components/Pill/Pill.d.ts +7 -3
  4. package/build/@types/components/Pill/Pill.styles.d.ts +2 -4
  5. package/build/cjs/components/src/components/AddressBlock/AddressBlock.js +1 -1
  6. package/build/cjs/components/src/components/CartSummary/CartSummary.js +41 -29
  7. package/build/cjs/components/src/components/CartSummary/CartSummary.js.map +1 -1
  8. package/build/cjs/components/src/components/CartSummary/CartSummary.styles.js +29 -10
  9. package/build/cjs/components/src/components/CartSummary/CartSummary.styles.js.map +1 -1
  10. package/build/cjs/components/src/components/Pill/Pill.js +9 -11
  11. package/build/cjs/components/src/components/Pill/Pill.js.map +1 -1
  12. package/build/cjs/components/src/components/Pill/Pill.styles.js +100 -21
  13. package/build/cjs/components/src/components/Pill/Pill.styles.js.map +1 -1
  14. package/build/cjs/components/src/index.js +4 -0
  15. package/build/cjs/components/src/index.js.map +1 -1
  16. package/build/es/components/src/components/AddressBlock/AddressBlock.js +1 -1
  17. package/build/es/components/src/components/CartSummary/CartSummary.js +42 -30
  18. package/build/es/components/src/components/CartSummary/CartSummary.js.map +1 -1
  19. package/build/es/components/src/components/CartSummary/CartSummary.styles.js +29 -11
  20. package/build/es/components/src/components/CartSummary/CartSummary.styles.js.map +1 -1
  21. package/build/es/components/src/components/Pill/Pill.js +11 -13
  22. package/build/es/components/src/components/Pill/Pill.js.map +1 -1
  23. package/build/es/components/src/components/Pill/Pill.styles.js +102 -21
  24. package/build/es/components/src/components/Pill/Pill.styles.js.map +1 -1
  25. package/build/es/components/src/index.js +1 -1
  26. package/package.json +2 -2
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ export declare type TCartSummaryVariant = 'default' | 'yellow';
2
3
  export declare type TCartSummary = {
3
4
  bags?: TSummaryItem[];
4
5
  cateredMeals?: TSummaryItem[];
@@ -10,6 +11,7 @@ export declare type TCartSummary = {
10
11
  totalDiscountAmount: number;
11
12
  };
12
13
  groceries?: TSummaryItem[];
14
+ ariaLabel?: string;
13
15
  itemsLabel?: string;
14
16
  saveLabel?: string;
15
17
  shippingLabel?: string;
@@ -18,8 +20,10 @@ export declare type TCartSummary = {
18
20
  title?: string;
19
21
  totalAmount: number;
20
22
  totalDiscount: number;
23
+ totalTaxAmount?: number;
21
24
  totalLabel?: string;
22
25
  pickingFeeFromLabel?: string;
26
+ variant?: TCartSummaryVariant;
23
27
  };
24
28
  export declare type TSummaryItem = {
25
29
  amount: number;
@@ -31,4 +35,4 @@ export declare type TSummaryItem = {
31
35
  quantity: number;
32
36
  tooltipAriaLabel?: string;
33
37
  };
34
- export declare function CartSummary({ saveLabel, totalLabel, itemsLabel, ...cartSummary }: TCartSummary): React.JSX.Element;
38
+ export declare function CartSummary({ saveLabel, totalLabel, itemsLabel, ariaLabel, taxLabel, variant, ...cartSummary }: TCartSummary): React.JSX.Element;
@@ -1,12 +1,15 @@
1
+ import type { TCartSummaryVariant } from './CartSummary';
1
2
  declare type TCartLine = {
2
3
  cancelled?: boolean;
3
4
  };
4
- declare type TSummaryHeader = {
5
+ declare type TCartSummaryVariantProps = {
5
6
  title?: string;
7
+ variant?: TCartSummaryVariant;
6
8
  };
7
9
  export declare const CartSummaryContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
8
- export declare const CartPaymentContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
9
- export declare const CartSummaryContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TSummaryHeader, never>;
10
+ export declare const CartPaymentContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TCartSummaryVariantProps, never>;
11
+ export declare const CartSummaryContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TCartSummaryVariantProps, never>;
12
+ export declare const CartSummaryFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
10
13
  export declare const ChargesContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
11
14
  export declare const CartLine: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TCartLine, never>;
12
15
  export declare const AmountWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -1,8 +1,12 @@
1
1
  import React from 'react';
2
+ export declare enum EPillVariant {
3
+ rounded = "rounded",
4
+ square = "square"
5
+ }
2
6
  export declare type TPill = {
3
7
  active?: boolean;
4
- amount?: number;
8
+ children: React.ReactNode;
5
9
  onClick: () => void;
6
- text: string;
7
- };
10
+ variant?: EPillVariant;
11
+ } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'>;
8
12
  export declare const Pill: React.FunctionComponent<TPill>;
@@ -1,7 +1,5 @@
1
1
  import { TPill } from './Pill';
2
- declare type TActive = Pick<TPill, 'active'>;
3
- export declare const PillComponent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TActive, never>;
2
+ declare type TPillStyles = Pick<TPill, 'active' | 'variant'>;
4
3
  export declare const PillContent: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
5
- export declare const Text: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
6
- export declare const Amount: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
4
+ export declare const PillComponent: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, TPillStyles, never>;
7
5
  export {};
@@ -81,7 +81,7 @@ require('../Modal/Modal.js');
81
81
  require('../NavMainLink/NavMainLink.styled.js');
82
82
  require('../Pagination/Pagination.styles.js');
83
83
  require('../PartnerOffer/PartnerOffer.js');
84
- require('../Pill/Pill.styles.js');
84
+ require('../Pill/Pill.js');
85
85
  require('styled-components');
86
86
  require('../PersonalCouponCard/PersonalCouponCard.styles.js');
87
87
  require('../PriceTag/PriceTag.types.js');
@@ -34,7 +34,7 @@ var calculateSummaryLine = function (items) {
34
34
  };
35
35
  function CartSummary(_a) {
36
36
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
37
- var _q = _a.saveLabel, saveLabel = _q === void 0 ? 'Varav rabatt' : _q, _r = _a.totalLabel, totalLabel = _r === void 0 ? 'Totalt' : _r, _s = _a.itemsLabel, itemsLabel = _s === void 0 ? 'Varor' : _s, cartSummary = _tslib.__rest(_a, ["saveLabel", "totalLabel", "itemsLabel"]);
37
+ var _q = _a.saveLabel, saveLabel = _q === void 0 ? 'Varav rabatt' : _q, _r = _a.totalLabel, totalLabel = _r === void 0 ? 'Totalt' : _r, _s = _a.itemsLabel, itemsLabel = _s === void 0 ? 'Varor' : _s, _t = _a.ariaLabel, ariaLabel = _t === void 0 ? 'Ordersammanfattning' : _t, _u = _a.taxLabel, taxLabel = _u === void 0 ? 'Varav moms' : _u, _v = _a.variant, variant = _v === void 0 ? 'default' : _v, cartSummary = _tslib.__rest(_a, ["saveLabel", "totalLabel", "itemsLabel", "ariaLabel", "taxLabel", "variant"]);
38
38
  var charges = (_b = cartSummary.charges) !== null && _b !== void 0 ? _b : [];
39
39
  var pickingFeeFromLabel = cartSummary.pickingFeeFromLabel;
40
40
  var bags = (_c = cartSummary.bags) !== null && _c !== void 0 ? _c : [];
@@ -85,38 +85,50 @@ function CartSummary(_a) {
85
85
  React__default["default"].createElement(CartSummary_styles.ChargeTooltipInfo, null,
86
86
  React__default["default"].createElement(typography.BodyText, { color: (_e = index.theme.palette) === null || _e === void 0 ? void 0 : _e.white, size: typography.TextTypes.TextSize.SMALL }, charge.info))))));
87
87
  };
88
+ var isYellowVariant = variant === 'yellow';
89
+ var discountLine = cartSummary.totalDiscount > 0 ? (React__default["default"].createElement(CartSummary_styles.CartLine, null,
90
+ React__default["default"].createElement(typography.BodyText, { size: isYellowVariant ? undefined : typography.TextTypes.TextSize.SMALL }, saveLabel),
91
+ React__default["default"].createElement(typography.BodyText, { color: (_h = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _h === void 0 ? void 0 : _h.alertRed, size: isYellowVariant ? undefined : typography.TextTypes.TextSize.SMALL }, utils.formatPrice(cartSummary.totalDiscount)))) : null;
92
+ var totalLine = (React__default["default"].createElement(CartSummary_styles.CartLine, null,
93
+ React__default["default"].createElement(typography.BodyText, { fontWeight: "semiBold" }, totalLabel),
94
+ React__default["default"].createElement(typography.BodyText, { fontWeight: "semiBold" }, utils.formatPrice(cartSummary.totalAmount))));
95
+ var taxLine = cartSummary.totalTaxAmount !== undefined ? (React__default["default"].createElement(CartSummary_styles.CartLine, null,
96
+ React__default["default"].createElement(typography.BodyText, null, taxLabel),
97
+ React__default["default"].createElement(typography.BodyText, null, utils.formatPrice(cartSummary.totalTaxAmount)))) : null;
88
98
  return (React__default["default"].createElement(CartSummary_styles.CartSummaryContainer, { role: "region" },
89
- React__default["default"].createElement(CartSummary_styles.CartPaymentContainer, null,
99
+ React__default["default"].createElement(CartSummary_styles.CartPaymentContainer, { variant: variant },
90
100
  cartSummary.title && (React__default["default"].createElement(CartSummary_styles.CartSummaryTitle, null,
91
101
  React__default["default"].createElement(typography.BodyText, { fontWeight: "semiBold" }, cartSummary.title),
92
102
  React__default["default"].createElement(typography.BodyText, null, cartSummary.subtitle))),
93
- React__default["default"].createElement(CartSummary_styles.CartSummaryContent, { title: cartSummary.title, role: "group", "aria-label": "Ordersammanfattning" },
94
- ((groceries === null || groceries === void 0 ? void 0 : groceries.length) > 0 || (cateredMeals === null || cateredMeals === void 0 ? void 0 : cateredMeals.length) > 0) && (React__default["default"].createElement(CartSummary_styles.CartLine, null,
95
- React__default["default"].createElement(typography.BodyText, { fontWeight: "medium" },
96
- itemsLabel,
97
- React__default["default"].createElement(CartSummary_styles.QuantitySpan, null, " (".concat(((_h = sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.quantity) !== null && _h !== void 0 ? _h : 0) + ((_j = sumOfCateredMeals === null || sumOfCateredMeals === void 0 ? void 0 : sumOfCateredMeals.quantity) !== null && _j !== void 0 ? _j : 0), ")"))),
98
- React__default["default"].createElement(CartSummary_styles.AmountWrapper, null,
99
- (sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.cancelledAmount) > 0 && (React__default["default"].createElement(typography.BodyText, { lineThrough: true, color: (_k = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _k === void 0 ? void 0 : _k.dark }, utils.formatPrice(((_l = sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.cancelledAmount) !== null && _l !== void 0 ? _l : 0) +
100
- ((_m = sumOfCateredMeals === null || sumOfCateredMeals === void 0 ? void 0 : sumOfCateredMeals.cancelledAmount) !== null && _m !== void 0 ? _m : 0)))),
101
- React__default["default"].createElement(typography.BodyText, null, utils.formatPrice(sumOfGroceries.amount + sumOfCateredMeals.amount))))),
102
- bags.length > 0 && (React__default["default"].createElement(CartSummary_styles.CartLine, null,
103
- React__default["default"].createElement(typography.BodyText, null,
104
- "Matkassar",
105
- React__default["default"].createElement(CartSummary_styles.QuantitySpan, null,
106
- "(",
107
- sumOfBags.quantity,
108
- ")")),
109
- React__default["default"].createElement(CartSummary_styles.AmountWrapper, null,
110
- sumOfBags.cancelledAmount > 0 && (React__default["default"].createElement(typography.BodyText, { lineThrough: true, color: (_o = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _o === void 0 ? void 0 : _o.dark }, utils.formatPrice(sumOfBags.cancelledAmount))),
111
- React__default["default"].createElement(typography.BodyText, { fontWeight: "semiBold" }, utils.formatPrice(sumOfBags.amount))))),
112
- (charges === null || charges === void 0 ? void 0 : charges.length) > 0 && (React__default["default"].createElement(CartSummary_styles.ChargesContainer, null, charges === null || charges === void 0 ? void 0 : charges.map(function (charge) { return (React__default["default"].createElement(ChargeLine, { key: charge.name, charge: charge })); }))),
113
- React__default["default"].createElement(CartSummary_styles.ChargesContainer, null,
114
- React__default["default"].createElement(CartSummary_styles.CartLine, null,
115
- React__default["default"].createElement(typography.BodyText, { fontWeight: "semiBold" }, totalLabel),
116
- React__default["default"].createElement(typography.BodyText, { fontWeight: "semiBold" }, utils.formatPrice(cartSummary.totalAmount))),
117
- cartSummary.totalDiscount > 0 && (React__default["default"].createElement(CartSummary_styles.CartLine, null,
118
- React__default["default"].createElement(typography.BodyText, { size: typography.TextTypes.TextSize.SMALL }, saveLabel),
119
- React__default["default"].createElement(typography.BodyText, { color: (_p = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _p === void 0 ? void 0 : _p.alertRed, size: typography.TextTypes.TextSize.SMALL }, utils.formatPrice(cartSummary.totalDiscount)))))))));
103
+ React__default["default"].createElement("div", { role: "group", "aria-label": ariaLabel },
104
+ React__default["default"].createElement(CartSummary_styles.CartSummaryContent, { title: cartSummary.title, variant: variant },
105
+ ((groceries === null || groceries === void 0 ? void 0 : groceries.length) > 0 || (cateredMeals === null || cateredMeals === void 0 ? void 0 : cateredMeals.length) > 0) && (React__default["default"].createElement(CartSummary_styles.CartLine, null,
106
+ React__default["default"].createElement(typography.BodyText, { fontWeight: "medium" },
107
+ itemsLabel,
108
+ React__default["default"].createElement(CartSummary_styles.QuantitySpan, null, " (".concat(((_j = sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.quantity) !== null && _j !== void 0 ? _j : 0) + ((_k = sumOfCateredMeals === null || sumOfCateredMeals === void 0 ? void 0 : sumOfCateredMeals.quantity) !== null && _k !== void 0 ? _k : 0), ")"))),
109
+ React__default["default"].createElement(CartSummary_styles.AmountWrapper, null,
110
+ (sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.cancelledAmount) > 0 && (React__default["default"].createElement(typography.BodyText, { lineThrough: true, color: (_l = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _l === void 0 ? void 0 : _l.dark }, utils.formatPrice(((_m = sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.cancelledAmount) !== null && _m !== void 0 ? _m : 0) +
111
+ ((_o = sumOfCateredMeals === null || sumOfCateredMeals === void 0 ? void 0 : sumOfCateredMeals.cancelledAmount) !== null && _o !== void 0 ? _o : 0)))),
112
+ React__default["default"].createElement(typography.BodyText, null, utils.formatPrice(sumOfGroceries.amount + sumOfCateredMeals.amount))))),
113
+ bags.length > 0 && (React__default["default"].createElement(CartSummary_styles.CartLine, null,
114
+ React__default["default"].createElement(typography.BodyText, null,
115
+ "Matkassar",
116
+ React__default["default"].createElement(CartSummary_styles.QuantitySpan, null,
117
+ "(",
118
+ sumOfBags.quantity,
119
+ ")")),
120
+ React__default["default"].createElement(CartSummary_styles.AmountWrapper, null,
121
+ sumOfBags.cancelledAmount > 0 && (React__default["default"].createElement(typography.BodyText, { lineThrough: true, color: (_p = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _p === void 0 ? void 0 : _p.dark }, utils.formatPrice(sumOfBags.cancelledAmount))),
122
+ React__default["default"].createElement(typography.BodyText, { fontWeight: "semiBold" }, utils.formatPrice(sumOfBags.amount))))),
123
+ (charges === null || charges === void 0 ? void 0 : charges.length) > 0 && (React__default["default"].createElement(CartSummary_styles.ChargesContainer, null, charges === null || charges === void 0 ? void 0 : charges.map(function (charge) { return (React__default["default"].createElement(ChargeLine, { key: charge.name, charge: charge })); }))),
124
+ isYellowVariant && discountLine,
125
+ !isYellowVariant && (React__default["default"].createElement(CartSummary_styles.ChargesContainer, null,
126
+ totalLine,
127
+ discountLine,
128
+ taxLine))),
129
+ isYellowVariant && (React__default["default"].createElement(CartSummary_styles.CartSummaryFooter, null,
130
+ totalLine,
131
+ taxLine))))));
120
132
  }
121
133
 
122
134
  exports.CartSummary = CartSummary;
@@ -1 +1 @@
1
- {"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -10,22 +10,41 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
10
10
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
11
11
 
12
12
  var CartSummaryContainer = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n &:focus {\n outline-offset: ", "px;\n }\n &:focus:not(:focus-visible) {\n outline: none;\n }\n"], ["\n &:focus {\n outline-offset: ", "px;\n }\n &:focus:not(:focus-visible) {\n outline: none;\n }\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxxs; });
13
- var CartPaymentContainer = styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n background: ", ";\n overflow-wrap: break-word;\n word-break: break-word;\n"], ["\n background: ", ";\n overflow-wrap: break-word;\n word-break: break-word;\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; });
14
- var CartSummaryContent = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n ", ";\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"], ["\n ", ";\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"])), function (props) { var _a; return props.title && "padding-top: ".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm, "px"); }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
15
- var ChargesContainer = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
16
- var CartLine = styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n position: relative;\n text-decoration: ", ";\n"], ["\n display: flex;\n justify-content: space-between;\n position: relative;\n text-decoration: ", ";\n"])), function (props) { return props.cancelled && 'line-through'; });
17
- var AmountWrapper = styled__default["default"].div(templateObject_6 || (templateObject_6 = _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.xs; });
18
- var LabelWrapper = styled__default["default"].div(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n gap: ", "px;\n"], ["\n display: flex;\n align-items: flex-start;\n gap: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
19
- var ChargeTooltipInfo = styled__default["default"].div(templateObject_8 || (templateObject_8 = _tslib.__makeTemplateObject(["\n flex: 1;\n line-height: normal;\n min-width: 0;\n overflow-wrap: break-word;\n white-space: pre-line;\n width: 100%;\n word-break: break-word;\n"], ["\n flex: 1;\n line-height: normal;\n min-width: 0;\n overflow-wrap: break-word;\n white-space: pre-line;\n width: 100%;\n word-break: break-word;\n"])));
20
- var CartSummaryTitle = styled__default["default"].div(templateObject_9 || (templateObject_9 = _tslib.__makeTemplateObject(["\n padding: ", "px 0\n ", "px;\n margin: 0 ", "px;\n display: flex;\n gap: ", "px;\n border-bottom: 1px solid ", ";\n"], ["\n padding: ", "px 0\n ", "px;\n margin: 0 ", "px;\n display: flex;\n gap: ", "px;\n border-bottom: 1px solid ", ";\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.light; });
21
- var QuantitySpan = styled__default["default"].span(templateObject_10 || (templateObject_10 = _tslib.__makeTemplateObject(["\n color: ", ";\n font-size: ", "px;\n display: inline-block;\n margin-left: ", "px;\n font-weight: ", ";\n"], ["\n color: ", ";\n font-size: ", "px;\n display: inline-block;\n margin-left: ", "px;\n font-weight: ", ";\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.disabledDarkGray; }, 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.s1; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) { var _a, _b; return (_b = (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.weight) === null || _b === void 0 ? void 0 : _b.regular; });
22
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
13
+ var CartPaymentContainer = styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n background: ", ";\n overflow-wrap: break-word;\n word-break: break-word;\n"], ["\n background: ", ";\n overflow-wrap: break-word;\n word-break: break-word;\n"])), function (props) {
14
+ var _a, _b;
15
+ return props.variant === 'yellow'
16
+ ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.yellowLighter
17
+ : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.white;
18
+ });
19
+ var CartSummaryContent = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n ", ";\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"], ["\n ", ";\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"])), function (props) {
20
+ var _a, _b, _c, _d;
21
+ return props.variant === 'yellow'
22
+ ? "padding: ".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.md, "px;\n padding-top: ").concat(props.title
23
+ ? (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.sm
24
+ : (_c = props.theme.spacings) === null || _c === void 0 ? void 0 : _c.md, "px")
25
+ : props.title && "padding-top: ".concat((_d = props.theme.spacings) === null || _d === void 0 ? void 0 : _d.sm, "px");
26
+ }, function (props) {
27
+ var _a, _b;
28
+ return props.variant === 'yellow'
29
+ ? (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs
30
+ : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.sm;
31
+ });
32
+ var CartSummaryFooter = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n padding: ", "px;\n background: ", ";\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"], ["\n padding: ", "px;\n background: ", ";\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.yellowLight; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
33
+ var ChargesContainer = styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
34
+ var CartLine = styled__default["default"].div(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n position: relative;\n text-decoration: ", ";\n"], ["\n display: flex;\n justify-content: space-between;\n position: relative;\n text-decoration: ", ";\n"])), function (props) { return props.cancelled && 'line-through'; });
35
+ var AmountWrapper = styled__default["default"].div(templateObject_7 || (templateObject_7 = _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.xs; });
36
+ var LabelWrapper = styled__default["default"].div(templateObject_8 || (templateObject_8 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n gap: ", "px;\n"], ["\n display: flex;\n align-items: flex-start;\n gap: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
37
+ var ChargeTooltipInfo = styled__default["default"].div(templateObject_9 || (templateObject_9 = _tslib.__makeTemplateObject(["\n flex: 1;\n line-height: normal;\n min-width: 0;\n overflow-wrap: break-word;\n white-space: pre-line;\n width: 100%;\n word-break: break-word;\n"], ["\n flex: 1;\n line-height: normal;\n min-width: 0;\n overflow-wrap: break-word;\n white-space: pre-line;\n width: 100%;\n word-break: break-word;\n"])));
38
+ var CartSummaryTitle = styled__default["default"].div(templateObject_10 || (templateObject_10 = _tslib.__makeTemplateObject(["\n padding: ", "px 0\n ", "px;\n margin: 0 ", "px;\n display: flex;\n gap: ", "px;\n border-bottom: 1px solid ", ";\n"], ["\n padding: ", "px 0\n ", "px;\n margin: 0 ", "px;\n display: flex;\n gap: ", "px;\n border-bottom: 1px solid ", ";\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.light; });
39
+ var QuantitySpan = styled__default["default"].span(templateObject_11 || (templateObject_11 = _tslib.__makeTemplateObject(["\n color: ", ";\n font-size: ", "px;\n display: inline-block;\n margin-left: ", "px;\n font-weight: ", ";\n"], ["\n color: ", ";\n font-size: ", "px;\n display: inline-block;\n margin-left: ", "px;\n font-weight: ", ";\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.disabledDarkGray; }, 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.s1; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) { var _a, _b; return (_b = (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.weight) === null || _b === void 0 ? void 0 : _b.regular; });
40
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
23
41
 
24
42
  exports.AmountWrapper = AmountWrapper;
25
43
  exports.CartLine = CartLine;
26
44
  exports.CartPaymentContainer = CartPaymentContainer;
27
45
  exports.CartSummaryContainer = CartSummaryContainer;
28
46
  exports.CartSummaryContent = CartSummaryContent;
47
+ exports.CartSummaryFooter = CartSummaryFooter;
29
48
  exports.CartSummaryTitle = CartSummaryTitle;
30
49
  exports.ChargeTooltipInfo = ChargeTooltipInfo;
31
50
  exports.ChargesContainer = ChargesContainer;
@@ -1 +1 @@
1
- {"version":3,"file":"CartSummary.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CartSummary.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,6 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var _tslib = require('../../../../_virtual/_tslib.js');
5
6
  var React = require('react');
6
7
  var Pill_styles = require('./Pill.styles.js');
7
8
 
@@ -9,18 +10,15 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
9
10
 
10
11
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
12
 
13
+ exports.EPillVariant = void 0;
14
+ (function (EPillVariant) {
15
+ EPillVariant["rounded"] = "rounded";
16
+ EPillVariant["square"] = "square";
17
+ })(exports.EPillVariant || (exports.EPillVariant = {}));
12
18
  var Pill = function (_a) {
13
- var _b = _a.active, active = _b === void 0 ? false : _b, amount = _a.amount, onClick = _a.onClick, text = _a.text;
14
- return (React__default["default"].createElement(Pill_styles.PillComponent, { active: active, onClick: onClick, onKeyDown: function (e) {
15
- if (e.key === 'Enter')
16
- onClick();
17
- }, tabIndex: 0 },
18
- React__default["default"].createElement(Pill_styles.PillContent, null,
19
- React__default["default"].createElement(Pill_styles.Text, null, text),
20
- amount !== undefined && React__default["default"].createElement(Pill_styles.Amount, null,
21
- "(",
22
- amount,
23
- ")"))));
19
+ var _b = _a.active, active = _b === void 0 ? false : _b, children = _a.children, onClick = _a.onClick, _c = _a.type, type = _c === void 0 ? 'button' : _c, _d = _a.variant, variant = _d === void 0 ? exports.EPillVariant.rounded : _d, props = _tslib.__rest(_a, ["active", "children", "onClick", "type", "variant"]);
20
+ return (React__default["default"].createElement(Pill_styles.PillComponent, _tslib.__assign({}, props, { active: active, "aria-pressed": active, onClick: onClick, type: type, variant: variant }),
21
+ React__default["default"].createElement(Pill_styles.PillContent, null, children)));
24
22
  };
25
23
 
26
24
  exports.Pill = Pill;
@@ -1 +1 @@
1
- {"version":3,"file":"Pill.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Pill.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -5,34 +5,113 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var _tslib = require('../../../../_virtual/_tslib.js');
6
6
  var styled = require('styled-components');
7
7
  var global_styles = require('../../shared/global.styles.js');
8
+ var Pill = require('./Pill.js');
8
9
 
9
10
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
11
 
11
12
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
12
13
 
13
- var PillComponent = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n cursor: pointer;\n font-size: ", "px;\n font-weight: ", ";\n line-height: ", "px;\n padding: ", "px\n ", "px;\n width: fit-content;\n\n ", "\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n border-color: ", ";\n }\n"], ["\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n cursor: pointer;\n font-size: ", "px;\n font-weight: ", ";\n line-height: ", "px;\n padding: ", "px\n ", "px;\n width: fit-content;\n\n ", "\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n border-color: ", ";\n }\n"])), function (props) { var _a, _b; return props.active ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.blueLight : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.white; }, function (props) {
14
- var _a, _b;
15
- return props.active
16
- ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlue
17
- : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.medium;
18
- }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.big; }, function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; }, 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.lineHeight.s2; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs2; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs2; }, global_styles.focusVisible, function (props) {
19
- var _a, _b;
20
- return props.active
21
- ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.blueLight
22
- : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.lightest;
23
- }, function (props) { var _a; return props.active && ((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlueHover); }, function (props) {
24
- var _a, _b;
25
- return props.active
26
- ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.blueLighter
27
- : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.lighter;
28
- }, function (props) { var _a; return props.active && ((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlueHover); });
29
- var PillContent = styled__default["default"].span(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", "px;\n"], ["\n display: flex;\n align-items: center;\n gap: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; });
30
- var Text = styled__default["default"].span(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.darkest; });
31
- var Amount = styled__default["default"].span(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.placeholder; });
14
+ var PillContent = styled__default["default"].span(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n align-items: center;\n display: flex;\n gap: ", "px;\n"], ["\n align-items: center;\n display: flex;\n gap: ", "px;\n"])), function (_a) {
15
+ var _b;
16
+ var theme = _a.theme;
17
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
18
+ });
19
+ var roundedStyles = styled.css(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n line-height: ", "px;\n padding: ", "px\n ", "px;\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n border-color: ", ";\n }\n"], ["\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n line-height: ", "px;\n padding: ", "px\n ", "px;\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n border-color: ", ";\n }\n"])), function (_a) {
20
+ var _b, _c;
21
+ var active = _a.active, theme = _a.theme;
22
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.blueLight : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.white;
23
+ }, function (_a) {
24
+ var _b, _c;
25
+ var active = _a.active, theme = _a.theme;
26
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.brandBlue : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.medium;
27
+ }, function (_a) {
28
+ var _b;
29
+ var theme = _a.theme;
30
+ return (_b = theme.attributes) === null || _b === void 0 ? void 0 : _b.borderRadius.big;
31
+ }, function (_a) {
32
+ var _b;
33
+ var theme = _a.theme;
34
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.lineHeight.s2;
35
+ }, function (_a) {
36
+ var _b;
37
+ var theme = _a.theme;
38
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs2;
39
+ }, function (_a) {
40
+ var _b;
41
+ var theme = _a.theme;
42
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xs2;
43
+ }, function (_a) {
44
+ var _b, _c;
45
+ var active = _a.active, theme = _a.theme;
46
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.blueLight : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.lightest;
47
+ }, function (_a) {
48
+ var _b;
49
+ var active = _a.active, theme = _a.theme;
50
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.brandBlueHover : undefined;
51
+ }, function (_a) {
52
+ var _b, _c;
53
+ var active = _a.active, theme = _a.theme;
54
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.blueLighter : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.lighter;
55
+ }, function (_a) {
56
+ var _b;
57
+ var active = _a.active, theme = _a.theme;
58
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.brandBlueHover : undefined;
59
+ });
60
+ var squareStyles = styled.css(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n color: ", ";\n height: ", "px;\n justify-content: center;\n padding: ", "px\n ", "px;\n\n &:hover {\n border-color: ", ";\n }\n\n @media screen and (max-width: ", "px) {\n width: 100%;\n }\n"], ["\n align-items: center;\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n color: ", ";\n height: ", "px;\n justify-content: center;\n padding: ", "px\n ", "px;\n\n &:hover {\n border-color: ", ";\n }\n\n @media screen and (max-width: ", "px) {\n width: 100%;\n }\n"])), function (_a) {
61
+ var _b, _c;
62
+ var active = _a.active, theme = _a.theme;
63
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.darkest : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.white;
64
+ }, function (_a) {
65
+ var _b, _c;
66
+ var active = _a.active, theme = _a.theme;
67
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.darkest : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.medium;
68
+ }, function (_a) {
69
+ var _b;
70
+ var theme = _a.theme;
71
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
72
+ }, function (_a) {
73
+ var _b;
74
+ var active = _a.active, theme = _a.theme;
75
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.white : 'inherit';
76
+ }, function (_a) {
77
+ var _b;
78
+ var theme = _a.theme;
79
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xl;
80
+ }, function (_a) {
81
+ var _b;
82
+ var theme = _a.theme;
83
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
84
+ }, function (_a) {
85
+ var _b;
86
+ var theme = _a.theme;
87
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.sm;
88
+ }, function (_a) {
89
+ var _b;
90
+ var theme = _a.theme;
91
+ return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.placeholder;
92
+ }, function (_a) {
93
+ var _b;
94
+ var theme = _a.theme;
95
+ return (_b = theme.breakpoints) === null || _b === void 0 ? void 0 : _b.md;
96
+ });
97
+ var PillComponent = styled__default["default"].button(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n border: none;\n cursor: pointer;\n display: flex;\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n width: fit-content;\n\n ", "\n\n ", "\n"], ["\n border: none;\n cursor: pointer;\n display: flex;\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n width: fit-content;\n\n ", "\n\n ", "\n"])), function (_a) {
98
+ var _b;
99
+ var theme = _a.theme;
100
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.type.primary;
101
+ }, function (_a) {
102
+ var _b;
103
+ var theme = _a.theme;
104
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.size.s2;
105
+ }, function (_a) {
106
+ var _b;
107
+ var theme = _a.theme;
108
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.weight.medium;
109
+ }, global_styles.focusVisible, function (_a) {
110
+ var variant = _a.variant;
111
+ return variant === Pill.EPillVariant.square ? squareStyles : roundedStyles;
112
+ });
32
113
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
33
114
 
34
- exports.Amount = Amount;
35
115
  exports.PillComponent = PillComponent;
36
116
  exports.PillContent = PillContent;
37
- exports.Text = Text;
38
117
  //# sourceMappingURL=Pill.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pill.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Pill.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -238,6 +238,10 @@ exports.Modal = Modal.Modal;
238
238
  exports.NavMainLink = NavMainLink.NavMainLink;
239
239
  exports.Pagination = Pagination.Pagination;
240
240
  exports.PartnerOffer = PartnerOffer.PartnerOffer;
241
+ Object.defineProperty(exports, 'EPillVariant', {
242
+ enumerable: true,
243
+ get: function () { return Pill.EPillVariant; }
244
+ });
241
245
  exports.Pill = Pill.Pill;
242
246
  exports.PersonalCouponCard = PersonalCouponCard.PersonalCouponCard;
243
247
  exports.PriceStripe = PriceStripe.PriceStripe;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -77,7 +77,7 @@ import '../Modal/Modal.js';
77
77
  import '../NavMainLink/NavMainLink.styled.js';
78
78
  import '../Pagination/Pagination.styles.js';
79
79
  import '../PartnerOffer/PartnerOffer.js';
80
- import '../Pill/Pill.styles.js';
80
+ import '../Pill/Pill.js';
81
81
  import 'styled-components';
82
82
  import '../PersonalCouponCard/PersonalCouponCard.styles.js';
83
83
  import '../PriceTag/PriceTag.types.js';
@@ -5,7 +5,7 @@ import { formatPrice } from '@citygross/utils';
5
5
  import { theme as theme_1 } from '../../../../design-tokens/build/index.js';
6
6
  import { ToolTipButton } from '../CgButton/ToolTipButton/ToolTipButton.js';
7
7
  import { ToolTipDialog } from '../ToolTipDialog/ToolTipDialog.js';
8
- import { CartSummaryContainer, CartPaymentContainer, CartSummaryTitle, CartSummaryContent, CartLine, QuantitySpan, AmountWrapper, ChargesContainer, LabelWrapper, ChargeTooltipInfo } from './CartSummary.styles.js';
8
+ import { CartLine, CartSummaryContainer, CartPaymentContainer, CartSummaryTitle, CartSummaryContent, QuantitySpan, AmountWrapper, ChargesContainer, CartSummaryFooter, LabelWrapper, ChargeTooltipInfo } from './CartSummary.styles.js';
9
9
 
10
10
  var calculateSummaryLine = function (items) {
11
11
  var sumOfItems = items === null || items === void 0 ? void 0 : items.reduce(function (prev, curr) {
@@ -26,7 +26,7 @@ var calculateSummaryLine = function (items) {
26
26
  };
27
27
  function CartSummary(_a) {
28
28
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
29
- var _q = _a.saveLabel, saveLabel = _q === void 0 ? 'Varav rabatt' : _q, _r = _a.totalLabel, totalLabel = _r === void 0 ? 'Totalt' : _r, _s = _a.itemsLabel, itemsLabel = _s === void 0 ? 'Varor' : _s, cartSummary = __rest(_a, ["saveLabel", "totalLabel", "itemsLabel"]);
29
+ var _q = _a.saveLabel, saveLabel = _q === void 0 ? 'Varav rabatt' : _q, _r = _a.totalLabel, totalLabel = _r === void 0 ? 'Totalt' : _r, _s = _a.itemsLabel, itemsLabel = _s === void 0 ? 'Varor' : _s, _t = _a.ariaLabel, ariaLabel = _t === void 0 ? 'Ordersammanfattning' : _t, _u = _a.taxLabel, taxLabel = _u === void 0 ? 'Varav moms' : _u, _v = _a.variant, variant = _v === void 0 ? 'default' : _v, cartSummary = __rest(_a, ["saveLabel", "totalLabel", "itemsLabel", "ariaLabel", "taxLabel", "variant"]);
30
30
  var charges = (_b = cartSummary.charges) !== null && _b !== void 0 ? _b : [];
31
31
  var pickingFeeFromLabel = cartSummary.pickingFeeFromLabel;
32
32
  var bags = (_c = cartSummary.bags) !== null && _c !== void 0 ? _c : [];
@@ -77,38 +77,50 @@ function CartSummary(_a) {
77
77
  React.createElement(ChargeTooltipInfo, null,
78
78
  React.createElement(BodyText, { color: (_e = theme_1.palette) === null || _e === void 0 ? void 0 : _e.white, size: TextTypes.TextSize.SMALL }, charge.info))))));
79
79
  };
80
+ var isYellowVariant = variant === 'yellow';
81
+ var discountLine = cartSummary.totalDiscount > 0 ? (React.createElement(CartLine, null,
82
+ React.createElement(BodyText, { size: isYellowVariant ? undefined : TextTypes.TextSize.SMALL }, saveLabel),
83
+ React.createElement(BodyText, { color: (_h = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _h === void 0 ? void 0 : _h.alertRed, size: isYellowVariant ? undefined : TextTypes.TextSize.SMALL }, formatPrice(cartSummary.totalDiscount)))) : null;
84
+ var totalLine = (React.createElement(CartLine, null,
85
+ React.createElement(BodyText, { fontWeight: "semiBold" }, totalLabel),
86
+ React.createElement(BodyText, { fontWeight: "semiBold" }, formatPrice(cartSummary.totalAmount))));
87
+ var taxLine = cartSummary.totalTaxAmount !== undefined ? (React.createElement(CartLine, null,
88
+ React.createElement(BodyText, null, taxLabel),
89
+ React.createElement(BodyText, null, formatPrice(cartSummary.totalTaxAmount)))) : null;
80
90
  return (React.createElement(CartSummaryContainer, { role: "region" },
81
- React.createElement(CartPaymentContainer, null,
91
+ React.createElement(CartPaymentContainer, { variant: variant },
82
92
  cartSummary.title && (React.createElement(CartSummaryTitle, null,
83
93
  React.createElement(BodyText, { fontWeight: "semiBold" }, cartSummary.title),
84
94
  React.createElement(BodyText, null, cartSummary.subtitle))),
85
- React.createElement(CartSummaryContent, { title: cartSummary.title, role: "group", "aria-label": "Ordersammanfattning" },
86
- ((groceries === null || groceries === void 0 ? void 0 : groceries.length) > 0 || (cateredMeals === null || cateredMeals === void 0 ? void 0 : cateredMeals.length) > 0) && (React.createElement(CartLine, null,
87
- React.createElement(BodyText, { fontWeight: "medium" },
88
- itemsLabel,
89
- React.createElement(QuantitySpan, null, " (".concat(((_h = sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.quantity) !== null && _h !== void 0 ? _h : 0) + ((_j = sumOfCateredMeals === null || sumOfCateredMeals === void 0 ? void 0 : sumOfCateredMeals.quantity) !== null && _j !== void 0 ? _j : 0), ")"))),
90
- React.createElement(AmountWrapper, null,
91
- (sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.cancelledAmount) > 0 && (React.createElement(BodyText, { lineThrough: true, color: (_k = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _k === void 0 ? void 0 : _k.dark }, formatPrice(((_l = sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.cancelledAmount) !== null && _l !== void 0 ? _l : 0) +
92
- ((_m = sumOfCateredMeals === null || sumOfCateredMeals === void 0 ? void 0 : sumOfCateredMeals.cancelledAmount) !== null && _m !== void 0 ? _m : 0)))),
93
- React.createElement(BodyText, null, formatPrice(sumOfGroceries.amount + sumOfCateredMeals.amount))))),
94
- bags.length > 0 && (React.createElement(CartLine, null,
95
- React.createElement(BodyText, null,
96
- "Matkassar",
97
- React.createElement(QuantitySpan, null,
98
- "(",
99
- sumOfBags.quantity,
100
- ")")),
101
- React.createElement(AmountWrapper, null,
102
- sumOfBags.cancelledAmount > 0 && (React.createElement(BodyText, { lineThrough: true, color: (_o = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _o === void 0 ? void 0 : _o.dark }, formatPrice(sumOfBags.cancelledAmount))),
103
- React.createElement(BodyText, { fontWeight: "semiBold" }, formatPrice(sumOfBags.amount))))),
104
- (charges === null || charges === void 0 ? void 0 : charges.length) > 0 && (React.createElement(ChargesContainer, null, charges === null || charges === void 0 ? void 0 : charges.map(function (charge) { return (React.createElement(ChargeLine, { key: charge.name, charge: charge })); }))),
105
- React.createElement(ChargesContainer, null,
106
- React.createElement(CartLine, null,
107
- React.createElement(BodyText, { fontWeight: "semiBold" }, totalLabel),
108
- React.createElement(BodyText, { fontWeight: "semiBold" }, formatPrice(cartSummary.totalAmount))),
109
- cartSummary.totalDiscount > 0 && (React.createElement(CartLine, null,
110
- React.createElement(BodyText, { size: TextTypes.TextSize.SMALL }, saveLabel),
111
- React.createElement(BodyText, { color: (_p = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _p === void 0 ? void 0 : _p.alertRed, size: TextTypes.TextSize.SMALL }, formatPrice(cartSummary.totalDiscount)))))))));
95
+ React.createElement("div", { role: "group", "aria-label": ariaLabel },
96
+ React.createElement(CartSummaryContent, { title: cartSummary.title, variant: variant },
97
+ ((groceries === null || groceries === void 0 ? void 0 : groceries.length) > 0 || (cateredMeals === null || cateredMeals === void 0 ? void 0 : cateredMeals.length) > 0) && (React.createElement(CartLine, null,
98
+ React.createElement(BodyText, { fontWeight: "medium" },
99
+ itemsLabel,
100
+ React.createElement(QuantitySpan, null, " (".concat(((_j = sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.quantity) !== null && _j !== void 0 ? _j : 0) + ((_k = sumOfCateredMeals === null || sumOfCateredMeals === void 0 ? void 0 : sumOfCateredMeals.quantity) !== null && _k !== void 0 ? _k : 0), ")"))),
101
+ React.createElement(AmountWrapper, null,
102
+ (sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.cancelledAmount) > 0 && (React.createElement(BodyText, { lineThrough: true, color: (_l = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _l === void 0 ? void 0 : _l.dark }, formatPrice(((_m = sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.cancelledAmount) !== null && _m !== void 0 ? _m : 0) +
103
+ ((_o = sumOfCateredMeals === null || sumOfCateredMeals === void 0 ? void 0 : sumOfCateredMeals.cancelledAmount) !== null && _o !== void 0 ? _o : 0)))),
104
+ React.createElement(BodyText, null, formatPrice(sumOfGroceries.amount + sumOfCateredMeals.amount))))),
105
+ bags.length > 0 && (React.createElement(CartLine, null,
106
+ React.createElement(BodyText, null,
107
+ "Matkassar",
108
+ React.createElement(QuantitySpan, null,
109
+ "(",
110
+ sumOfBags.quantity,
111
+ ")")),
112
+ React.createElement(AmountWrapper, null,
113
+ sumOfBags.cancelledAmount > 0 && (React.createElement(BodyText, { lineThrough: true, color: (_p = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _p === void 0 ? void 0 : _p.dark }, formatPrice(sumOfBags.cancelledAmount))),
114
+ React.createElement(BodyText, { fontWeight: "semiBold" }, formatPrice(sumOfBags.amount))))),
115
+ (charges === null || charges === void 0 ? void 0 : charges.length) > 0 && (React.createElement(ChargesContainer, null, charges === null || charges === void 0 ? void 0 : charges.map(function (charge) { return (React.createElement(ChargeLine, { key: charge.name, charge: charge })); }))),
116
+ isYellowVariant && discountLine,
117
+ !isYellowVariant && (React.createElement(ChargesContainer, null,
118
+ totalLine,
119
+ discountLine,
120
+ taxLine))),
121
+ isYellowVariant && (React.createElement(CartSummaryFooter, null,
122
+ totalLine,
123
+ taxLine))))));
112
124
  }
113
125
 
114
126
  export { CartSummary };
@@ -1 +1 @@
1
- {"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,16 +2,34 @@ import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  var CartSummaryContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:focus {\n outline-offset: ", "px;\n }\n &:focus:not(:focus-visible) {\n outline: none;\n }\n"], ["\n &:focus {\n outline-offset: ", "px;\n }\n &:focus:not(:focus-visible) {\n outline: none;\n }\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxxs; });
5
- var CartPaymentContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: ", ";\n overflow-wrap: break-word;\n word-break: break-word;\n"], ["\n background: ", ";\n overflow-wrap: break-word;\n word-break: break-word;\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; });
6
- var CartSummaryContent = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", ";\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"], ["\n ", ";\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"])), function (props) { var _a; return props.title && "padding-top: ".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm, "px"); }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
7
- var ChargesContainer = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
8
- var CartLine = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n position: relative;\n text-decoration: ", ";\n"], ["\n display: flex;\n justify-content: space-between;\n position: relative;\n text-decoration: ", ";\n"])), function (props) { return props.cancelled && 'line-through'; });
9
- var AmountWrapper = styled.div(templateObject_6 || (templateObject_6 = __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.xs; });
10
- var LabelWrapper = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n gap: ", "px;\n"], ["\n display: flex;\n align-items: flex-start;\n gap: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
11
- var ChargeTooltipInfo = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n flex: 1;\n line-height: normal;\n min-width: 0;\n overflow-wrap: break-word;\n white-space: pre-line;\n width: 100%;\n word-break: break-word;\n"], ["\n flex: 1;\n line-height: normal;\n min-width: 0;\n overflow-wrap: break-word;\n white-space: pre-line;\n width: 100%;\n word-break: break-word;\n"])));
12
- var CartSummaryTitle = styled.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n padding: ", "px 0\n ", "px;\n margin: 0 ", "px;\n display: flex;\n gap: ", "px;\n border-bottom: 1px solid ", ";\n"], ["\n padding: ", "px 0\n ", "px;\n margin: 0 ", "px;\n display: flex;\n gap: ", "px;\n border-bottom: 1px solid ", ";\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.light; });
13
- var QuantitySpan = styled.span(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n color: ", ";\n font-size: ", "px;\n display: inline-block;\n margin-left: ", "px;\n font-weight: ", ";\n"], ["\n color: ", ";\n font-size: ", "px;\n display: inline-block;\n margin-left: ", "px;\n font-weight: ", ";\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.disabledDarkGray; }, 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.s1; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) { var _a, _b; return (_b = (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.weight) === null || _b === void 0 ? void 0 : _b.regular; });
14
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
5
+ var CartPaymentContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: ", ";\n overflow-wrap: break-word;\n word-break: break-word;\n"], ["\n background: ", ";\n overflow-wrap: break-word;\n word-break: break-word;\n"])), function (props) {
6
+ var _a, _b;
7
+ return props.variant === 'yellow'
8
+ ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.yellowLighter
9
+ : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.white;
10
+ });
11
+ var CartSummaryContent = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", ";\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"], ["\n ", ";\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"])), function (props) {
12
+ var _a, _b, _c, _d;
13
+ return props.variant === 'yellow'
14
+ ? "padding: ".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.md, "px;\n padding-top: ").concat(props.title
15
+ ? (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.sm
16
+ : (_c = props.theme.spacings) === null || _c === void 0 ? void 0 : _c.md, "px")
17
+ : props.title && "padding-top: ".concat((_d = props.theme.spacings) === null || _d === void 0 ? void 0 : _d.sm, "px");
18
+ }, function (props) {
19
+ var _a, _b;
20
+ return props.variant === 'yellow'
21
+ ? (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs
22
+ : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.sm;
23
+ });
24
+ var CartSummaryFooter = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding: ", "px;\n background: ", ";\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"], ["\n padding: ", "px;\n background: ", ";\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.yellowLight; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
25
+ var ChargesContainer = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
26
+ var CartLine = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n position: relative;\n text-decoration: ", ";\n"], ["\n display: flex;\n justify-content: space-between;\n position: relative;\n text-decoration: ", ";\n"])), function (props) { return props.cancelled && 'line-through'; });
27
+ var AmountWrapper = styled.div(templateObject_7 || (templateObject_7 = __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.xs; });
28
+ var LabelWrapper = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n gap: ", "px;\n"], ["\n display: flex;\n align-items: flex-start;\n gap: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
29
+ var ChargeTooltipInfo = styled.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n flex: 1;\n line-height: normal;\n min-width: 0;\n overflow-wrap: break-word;\n white-space: pre-line;\n width: 100%;\n word-break: break-word;\n"], ["\n flex: 1;\n line-height: normal;\n min-width: 0;\n overflow-wrap: break-word;\n white-space: pre-line;\n width: 100%;\n word-break: break-word;\n"])));
30
+ var CartSummaryTitle = styled.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n padding: ", "px 0\n ", "px;\n margin: 0 ", "px;\n display: flex;\n gap: ", "px;\n border-bottom: 1px solid ", ";\n"], ["\n padding: ", "px 0\n ", "px;\n margin: 0 ", "px;\n display: flex;\n gap: ", "px;\n border-bottom: 1px solid ", ";\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.light; });
31
+ var QuantitySpan = styled.span(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n color: ", ";\n font-size: ", "px;\n display: inline-block;\n margin-left: ", "px;\n font-weight: ", ";\n"], ["\n color: ", ";\n font-size: ", "px;\n display: inline-block;\n margin-left: ", "px;\n font-weight: ", ";\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.disabledDarkGray; }, 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.s1; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) { var _a, _b; return (_b = (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.weight) === null || _b === void 0 ? void 0 : _b.regular; });
32
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
15
33
 
16
- export { AmountWrapper, CartLine, CartPaymentContainer, CartSummaryContainer, CartSummaryContent, CartSummaryTitle, ChargeTooltipInfo, ChargesContainer, LabelWrapper, QuantitySpan };
34
+ export { AmountWrapper, CartLine, CartPaymentContainer, CartSummaryContainer, CartSummaryContent, CartSummaryFooter, CartSummaryTitle, ChargeTooltipInfo, ChargesContainer, LabelWrapper, QuantitySpan };
17
35
  //# sourceMappingURL=CartSummary.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CartSummary.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CartSummary.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,19 +1,17 @@
1
+ import { __rest, __assign } from '../../../../_virtual/_tslib.js';
1
2
  import React from 'react';
2
- import { PillComponent, PillContent, Text, Amount } from './Pill.styles.js';
3
+ import { PillComponent, PillContent } from './Pill.styles.js';
3
4
 
5
+ var EPillVariant;
6
+ (function (EPillVariant) {
7
+ EPillVariant["rounded"] = "rounded";
8
+ EPillVariant["square"] = "square";
9
+ })(EPillVariant || (EPillVariant = {}));
4
10
  var Pill = function (_a) {
5
- var _b = _a.active, active = _b === void 0 ? false : _b, amount = _a.amount, onClick = _a.onClick, text = _a.text;
6
- return (React.createElement(PillComponent, { active: active, onClick: onClick, onKeyDown: function (e) {
7
- if (e.key === 'Enter')
8
- onClick();
9
- }, tabIndex: 0 },
10
- React.createElement(PillContent, null,
11
- React.createElement(Text, null, text),
12
- amount !== undefined && React.createElement(Amount, null,
13
- "(",
14
- amount,
15
- ")"))));
11
+ var _b = _a.active, active = _b === void 0 ? false : _b, children = _a.children, onClick = _a.onClick, _c = _a.type, type = _c === void 0 ? 'button' : _c, _d = _a.variant, variant = _d === void 0 ? EPillVariant.rounded : _d, props = __rest(_a, ["active", "children", "onClick", "type", "variant"]);
12
+ return (React.createElement(PillComponent, __assign({}, props, { active: active, "aria-pressed": active, onClick: onClick, type: type, variant: variant }),
13
+ React.createElement(PillContent, null, children)));
16
14
  };
17
15
 
18
- export { Pill };
16
+ export { EPillVariant, Pill };
19
17
  //# sourceMappingURL=Pill.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pill.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Pill.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
@@ -1,27 +1,108 @@
1
1
  import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
2
- import styled from 'styled-components';
2
+ import styled, { css } from 'styled-components';
3
3
  import { focusVisible } from '../../shared/global.styles.js';
4
+ import { EPillVariant } from './Pill.js';
4
5
 
5
- var PillComponent = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n cursor: pointer;\n font-size: ", "px;\n font-weight: ", ";\n line-height: ", "px;\n padding: ", "px\n ", "px;\n width: fit-content;\n\n ", "\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n border-color: ", ";\n }\n"], ["\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n cursor: pointer;\n font-size: ", "px;\n font-weight: ", ";\n line-height: ", "px;\n padding: ", "px\n ", "px;\n width: fit-content;\n\n ", "\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n border-color: ", ";\n }\n"])), function (props) { var _a, _b; return props.active ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.blueLight : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.white; }, function (props) {
6
- var _a, _b;
7
- return props.active
8
- ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlue
9
- : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.medium;
10
- }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.big; }, function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; }, 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.lineHeight.s2; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs2; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs2; }, focusVisible, function (props) {
11
- var _a, _b;
12
- return props.active
13
- ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.blueLight
14
- : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.lightest;
15
- }, function (props) { var _a; return props.active && ((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlueHover); }, function (props) {
16
- var _a, _b;
17
- return props.active
18
- ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.blueLighter
19
- : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.lighter;
20
- }, function (props) { var _a; return props.active && ((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlueHover); });
21
- var PillContent = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", "px;\n"], ["\n display: flex;\n align-items: center;\n gap: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; });
22
- var Text = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.darkest; });
23
- var Amount = styled.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.placeholder; });
6
+ var PillContent = styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n gap: ", "px;\n"], ["\n align-items: center;\n display: flex;\n gap: ", "px;\n"])), function (_a) {
7
+ var _b;
8
+ var theme = _a.theme;
9
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
10
+ });
11
+ var roundedStyles = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n line-height: ", "px;\n padding: ", "px\n ", "px;\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n border-color: ", ";\n }\n"], ["\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n line-height: ", "px;\n padding: ", "px\n ", "px;\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n border-color: ", ";\n }\n"])), function (_a) {
12
+ var _b, _c;
13
+ var active = _a.active, theme = _a.theme;
14
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.blueLight : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.white;
15
+ }, function (_a) {
16
+ var _b, _c;
17
+ var active = _a.active, theme = _a.theme;
18
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.brandBlue : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.medium;
19
+ }, function (_a) {
20
+ var _b;
21
+ var theme = _a.theme;
22
+ return (_b = theme.attributes) === null || _b === void 0 ? void 0 : _b.borderRadius.big;
23
+ }, function (_a) {
24
+ var _b;
25
+ var theme = _a.theme;
26
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.lineHeight.s2;
27
+ }, function (_a) {
28
+ var _b;
29
+ var theme = _a.theme;
30
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs2;
31
+ }, function (_a) {
32
+ var _b;
33
+ var theme = _a.theme;
34
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xs2;
35
+ }, function (_a) {
36
+ var _b, _c;
37
+ var active = _a.active, theme = _a.theme;
38
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.blueLight : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.lightest;
39
+ }, function (_a) {
40
+ var _b;
41
+ var active = _a.active, theme = _a.theme;
42
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.brandBlueHover : undefined;
43
+ }, function (_a) {
44
+ var _b, _c;
45
+ var active = _a.active, theme = _a.theme;
46
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.blueLighter : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.lighter;
47
+ }, function (_a) {
48
+ var _b;
49
+ var active = _a.active, theme = _a.theme;
50
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.brandBlueHover : undefined;
51
+ });
52
+ var squareStyles = css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n color: ", ";\n height: ", "px;\n justify-content: center;\n padding: ", "px\n ", "px;\n\n &:hover {\n border-color: ", ";\n }\n\n @media screen and (max-width: ", "px) {\n width: 100%;\n }\n"], ["\n align-items: center;\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n color: ", ";\n height: ", "px;\n justify-content: center;\n padding: ", "px\n ", "px;\n\n &:hover {\n border-color: ", ";\n }\n\n @media screen and (max-width: ", "px) {\n width: 100%;\n }\n"])), function (_a) {
53
+ var _b, _c;
54
+ var active = _a.active, theme = _a.theme;
55
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.darkest : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.white;
56
+ }, function (_a) {
57
+ var _b, _c;
58
+ var active = _a.active, theme = _a.theme;
59
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.darkest : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.medium;
60
+ }, function (_a) {
61
+ var _b;
62
+ var theme = _a.theme;
63
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
64
+ }, function (_a) {
65
+ var _b;
66
+ var active = _a.active, theme = _a.theme;
67
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.white : 'inherit';
68
+ }, function (_a) {
69
+ var _b;
70
+ var theme = _a.theme;
71
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xl;
72
+ }, function (_a) {
73
+ var _b;
74
+ var theme = _a.theme;
75
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
76
+ }, function (_a) {
77
+ var _b;
78
+ var theme = _a.theme;
79
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.sm;
80
+ }, function (_a) {
81
+ var _b;
82
+ var theme = _a.theme;
83
+ return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.placeholder;
84
+ }, function (_a) {
85
+ var _b;
86
+ var theme = _a.theme;
87
+ return (_b = theme.breakpoints) === null || _b === void 0 ? void 0 : _b.md;
88
+ });
89
+ var PillComponent = styled.button(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border: none;\n cursor: pointer;\n display: flex;\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n width: fit-content;\n\n ", "\n\n ", "\n"], ["\n border: none;\n cursor: pointer;\n display: flex;\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n width: fit-content;\n\n ", "\n\n ", "\n"])), function (_a) {
90
+ var _b;
91
+ var theme = _a.theme;
92
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.type.primary;
93
+ }, function (_a) {
94
+ var _b;
95
+ var theme = _a.theme;
96
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.size.s2;
97
+ }, function (_a) {
98
+ var _b;
99
+ var theme = _a.theme;
100
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.weight.medium;
101
+ }, focusVisible, function (_a) {
102
+ var variant = _a.variant;
103
+ return variant === EPillVariant.square ? squareStyles : roundedStyles;
104
+ });
24
105
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
25
106
 
26
- export { Amount, PillComponent, PillContent, Text };
107
+ export { PillComponent, PillContent };
27
108
  //# sourceMappingURL=Pill.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pill.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Pill.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -65,7 +65,7 @@ export { EModalSize, EModalVariant, Modal } from './components/Modal/Modal.js';
65
65
  export { NavMainLink } from './components/NavMainLink/NavMainLink.js';
66
66
  export { Pagination } from './components/Pagination/Pagination.js';
67
67
  export { PartnerOffer } from './components/PartnerOffer/PartnerOffer.js';
68
- export { Pill } from './components/Pill/Pill.js';
68
+ export { EPillVariant, Pill } from './components/Pill/Pill.js';
69
69
  export { PersonalCouponCard } from './components/PersonalCouponCard/PersonalCouponCard.js';
70
70
  export { PriceStripe } from './components/PriceStripe/PriceStripe.js';
71
71
  export { PriceTag } from './components/PriceTag/PriceTag.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.19.7",
3
+ "version": "0.21.0",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -76,5 +76,5 @@
76
76
  "react-slick": "^0.30.1",
77
77
  "slick-carousel": "^1.8.1"
78
78
  },
79
- "gitHead": "271816201612dcad31d394bb60132d361fcb83dd"
79
+ "gitHead": "f4cda44b6d5a413b6ea5e6f8fa5cdd34a7bd5273"
80
80
  }