@citygross/components 0.7.18 → 0.7.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/components/AddressBlock/AddressBlock.d.ts +0 -1
- package/build/@types/components/Button/IconButton.d.ts +0 -1
- package/build/@types/components/CartItemSummary/CartItemSummary.d.ts +0 -1
- package/build/@types/components/CartSummary/CartSummary.d.ts +5 -2
- package/build/@types/components/Chips/Chip.d.ts +0 -1
- package/build/@types/components/DeliverySlotItem/DeliverySlotItem.d.ts +0 -1
- package/build/@types/components/DotIndicator/DotIndicator.d.ts +0 -1
- package/build/@types/components/FormElements/Input/Input.d.ts +0 -1
- package/build/@types/components/FormElements/TextArea/TextArea.d.ts +0 -1
- package/build/@types/components/Header/Header.stories.d.ts +0 -1
- package/build/@types/components/HeaderLink/HeaderLink.d.ts +0 -1
- package/build/@types/components/HeaderLink/HeaderLink.stories.d.ts +0 -1
- package/build/@types/components/Logo/Logo.d.ts +0 -1
- package/build/@types/components/Logo/Logo.stories.d.ts +0 -1
- package/build/@types/components/Pagination/Pagination.d.ts +0 -1
- package/build/@types/components/QuantitySelector/QuantitySelector.d.ts +0 -1
- package/build/@types/components/RadioGroup/RadioGroup.d.ts +0 -1
- package/build/@types/components/RadioGroup/RadioListItem.d.ts +0 -1
- package/build/@types/components/RadioGroup/RadioListItem.styles.d.ts +0 -1
- package/build/@types/components/Slider/Slider.stories.d.ts +0 -1
- package/build/@types/components/Spinner/Spinner.d.ts +0 -1
- package/build/@types/components/Spinner/Spinner.stories.d.ts +0 -1
- package/build/@types/components/StepperMobile/StepperMobile.d.ts +0 -1
- package/build/@types/components/Timeline/Timeline.d.ts +0 -1
- package/build/@types/components/Timeline/Timeline.styles.d.ts +0 -1
- package/build/@types/components/Typography/h1.stories.d.ts +0 -1
- package/build/@types/components/Typography/h2.stories.d.ts +0 -1
- package/build/@types/components/Typography/h3.stories.d.ts +0 -1
- package/build/@types/containers/TwoColumnsContainer/TwoColumnsPageContainer.stories.d.ts +0 -1
- package/build/@types/containers/WizardContainer/Steps/Step.d.ts +6 -0
- package/build/@types/containers/WizardContainer/WizardContainer.d.ts +2 -0
- package/build/@types/containers/WizardContainer/WizardContainer.stories.d.ts +24 -0
- package/build/cjs/components/src/components/CartSummary/CartSummary.js +16 -14
- package/build/cjs/components/src/components/CartSummary/CartSummary.js.map +1 -1
- package/build/cjs/components/src/components/ListItem/ListItem.styles.js +1 -1
- package/build/cjs/components/src/components/RadioGroup/RadioListItem.js +3 -3
- package/build/cjs/components/src/components/RadioGroup/RadioListItem.styles.js +1 -1
- package/build/es/components/src/components/CartSummary/CartSummary.js +16 -14
- package/build/es/components/src/components/CartSummary/CartSummary.js.map +1 -1
- package/build/es/components/src/components/ListItem/ListItem.styles.js +1 -1
- package/build/es/components/src/components/RadioGroup/RadioListItem.js +3 -3
- package/build/es/components/src/components/RadioGroup/RadioListItem.styles.js +1 -1
- package/package.json +3 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare type TCartSummary = {
|
|
3
2
|
title?: string;
|
|
4
3
|
subTitle?: string;
|
|
@@ -14,6 +13,10 @@ export declare type TCartSummary = {
|
|
|
14
13
|
totalAmount: number;
|
|
15
14
|
totalDiscount: number;
|
|
16
15
|
totalTaxAmount: number;
|
|
16
|
+
totalLabel?: string;
|
|
17
|
+
taxLabel?: string;
|
|
18
|
+
shippingLabel?: string;
|
|
19
|
+
saveLabel?: string;
|
|
17
20
|
};
|
|
18
21
|
export declare type TSummaryItem = {
|
|
19
22
|
amount: number;
|
|
@@ -22,4 +25,4 @@ export declare type TSummaryItem = {
|
|
|
22
25
|
cancelledQuantity: number;
|
|
23
26
|
name?: string;
|
|
24
27
|
};
|
|
25
|
-
export declare function CartSummary(cartSummary: TCartSummary): JSX.Element;
|
|
28
|
+
export declare function CartSummary({ saveLabel, shippingLabel, totalLabel, taxLabel, ...cartSummary }: TCartSummary): JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const BaseTimelineItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
2
|
export declare const BaseTimeline: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
4
3
|
export declare const TimeLineH3: import("styled-components").StyledComponent<({ children, lineThrough, color, fontWeight, ...props }: import("@citygross/typography/build/headers/h3/h3").IH3) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Story } from '@storybook/react';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
component: React.FC<{}>;
|
|
5
|
+
title: string;
|
|
6
|
+
argTypes: {
|
|
7
|
+
containerBackground: {
|
|
8
|
+
options: string[];
|
|
9
|
+
mapping: import("@citygross/design-tokens").Palette | never[];
|
|
10
|
+
control: {
|
|
11
|
+
type: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
background: {
|
|
15
|
+
options: string[];
|
|
16
|
+
mapping: import("@citygross/design-tokens").Palette | never[];
|
|
17
|
+
control: {
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
24
|
+
export declare const Default: Story;
|
|
@@ -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 utils = require('@citygross/utils');
|
|
6
7
|
var React = require('react');
|
|
7
8
|
var Divider = require('../Divider/Divider.js');
|
|
@@ -30,11 +31,12 @@ var calculateSummaryLine = function (items) {
|
|
|
30
31
|
});
|
|
31
32
|
return sumOfItems;
|
|
32
33
|
};
|
|
33
|
-
function CartSummary(
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
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 ? 'sparat via erbjudanden' : _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"]);
|
|
37
|
+
var charges = (_b = cartSummary.charges) !== null && _b !== void 0 ? _b : [];
|
|
38
|
+
var bags = (_c = cartSummary.bags) !== null && _c !== void 0 ? _c : [];
|
|
39
|
+
var groceries = (_d = cartSummary.groceries) !== null && _d !== void 0 ? _d : [];
|
|
38
40
|
var sumOfBags = calculateSummaryLine(bags);
|
|
39
41
|
var sumOfGroceries = calculateSummaryLine(groceries);
|
|
40
42
|
return (React__default['default'].createElement(CartSummary_styles.CartSummaryContainer, null,
|
|
@@ -49,7 +51,7 @@ function CartSummary(cartSummary) {
|
|
|
49
51
|
sumOfBags.quantity,
|
|
50
52
|
" st"),
|
|
51
53
|
React__default['default'].createElement(CartSummary_styles.AmountWrapper, null,
|
|
52
|
-
sumOfBags.cancelledAmount > 0 && (React__default['default'].createElement(typography.BodyText, { lineThrough: true, color: (
|
|
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))),
|
|
53
55
|
React__default['default'].createElement(typography.H3, { fontWeight: 'semiBold' }, utils.formatPrice(sumOfBags.amount))))),
|
|
54
56
|
groceries.length > 0 && (React__default['default'].createElement(CartSummary_styles.CartLine, null,
|
|
55
57
|
React__default['default'].createElement(typography.BodyText, null,
|
|
@@ -57,9 +59,9 @@ function CartSummary(cartSummary) {
|
|
|
57
59
|
sumOfGroceries.quantity,
|
|
58
60
|
" st"),
|
|
59
61
|
React__default['default'].createElement(CartSummary_styles.AmountWrapper, null,
|
|
60
|
-
sumOfGroceries.cancelledAmount > 0 && (React__default['default'].createElement(typography.BodyText, { lineThrough: true, color: (
|
|
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))),
|
|
61
63
|
React__default['default'].createElement(typography.H3, { fontWeight: 'semiBold' }, utils.formatPrice(sumOfGroceries.amount))))),
|
|
62
|
-
(charges === null || charges === void 0 ? void 0 : charges.length) > 0 && (React__default['default'].createElement(Divider.Divider, { xsSpacing: (
|
|
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 :
|
|
63
65
|
charges.map(function (charge) {
|
|
64
66
|
var _a, _b;
|
|
65
67
|
return (React__default['default'].createElement(CartSummary_styles.CartLine, { key: charge.name },
|
|
@@ -69,18 +71,18 @@ function CartSummary(cartSummary) {
|
|
|
69
71
|
React__default['default'].createElement(typography.BodyText, null, utils.formatPrice(charge.amount)))));
|
|
70
72
|
}),
|
|
71
73
|
cartSummary.totalDiscount > 0 && (React__default['default'].createElement(CartSummary_styles.CartLine, null,
|
|
72
|
-
React__default['default'].createElement(typography.BodyText, { color: (
|
|
73
|
-
React__default['default'].createElement(typography.BodyText, { color: (
|
|
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))))),
|
|
74
76
|
React__default['default'].createElement(CartSummary_styles.CartSummaryFooter, null,
|
|
75
|
-
((
|
|
77
|
+
((_l = cartSummary.deliveryFee) === null || _l === void 0 ? void 0 : _l.amount) &&
|
|
76
78
|
cartSummary.deliveryFee.amount > 0 && (React__default['default'].createElement(CartSummary_styles.CartLine, null,
|
|
77
|
-
React__default['default'].createElement(typography.BodyText, null,
|
|
79
|
+
React__default['default'].createElement(typography.BodyText, null, shippingLabel),
|
|
78
80
|
React__default['default'].createElement(typography.BodyText, null, utils.formatPrice(cartSummary.deliveryFee.amount)))),
|
|
79
81
|
React__default['default'].createElement(CartSummary_styles.CartLine, null,
|
|
80
|
-
React__default['default'].createElement(typography.H3, { fontWeight: 'semiBold' },
|
|
82
|
+
React__default['default'].createElement(typography.H3, { fontWeight: 'semiBold' }, totalLabel),
|
|
81
83
|
React__default['default'].createElement(typography.H3, { fontWeight: 'semiBold' }, utils.formatPrice(cartSummary.totalAmount))),
|
|
82
84
|
React__default['default'].createElement(CartSummary_styles.CartLine, null,
|
|
83
|
-
React__default['default'].createElement(typography.BodyText, null,
|
|
85
|
+
React__default['default'].createElement(typography.BodyText, null, taxLabel),
|
|
84
86
|
React__default['default'].createElement(typography.BodyText, null, utils.formatPrice(cartSummary.totalTaxAmount)))))));
|
|
85
87
|
}
|
|
86
88
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -13,7 +13,7 @@ var ItemInformationContainer = styled__default['default'].div(templateObject_1 |
|
|
|
13
13
|
var ListItemContainer = styled__default['default'].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n\n p {\n padding: 1px 0px;\n }\n"], ["\n display: flex;\n justify-content: space-between;\n\n p {\n padding: 1px 0px;\n }\n"])));
|
|
14
14
|
var ListLeft = styled__default['default'].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", "px;\n @media (min-width: ", "px) {\n gap: 20px;\n }\n"], ["\n display: flex;\n align-items: center;\n gap: ", "px;\n @media (min-width: ", "px) {\n gap: 20px;\n }\n"])), 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.breakpoints) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
15
15
|
var ListRight = styled__default['default'].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n justify-content: space-between;\n text-align: right;\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n justify-content: space-between;\n text-align: right;\n"])));
|
|
16
|
-
var ListImageContainer = styled__default['default'].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n flex-direction: row;\n width: ", "px;\n height: ", "px;\n"], ["\n display: flex;\n align-items: center;\n flex-direction: row;\n width: ", "px;\n height: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.ListImageMaxWidth; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.ListImageMaxWidth; });
|
|
16
|
+
var ListImageContainer = styled__default['default'].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: row;\n width: ", "px;\n height: ", "px;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: row;\n width: ", "px;\n height: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.ListImageMaxWidth; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.ListImageMaxWidth; });
|
|
17
17
|
var ListImage = styled__default['default'].img(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n max-width: 100%;\n max-height: 50px;\n"], ["\n max-width: 100%;\n max-height: 50px;\n"])));
|
|
18
18
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
19
19
|
|
|
@@ -14,8 +14,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
14
14
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
15
|
|
|
16
16
|
function RadioListItem(_a) {
|
|
17
|
-
var _b, _c, _d;
|
|
18
|
-
var item = _a.item, onClick = _a.onClick, selected = _a.selected, name = _a.name,
|
|
17
|
+
var _b, _c, _d, _e;
|
|
18
|
+
var item = _a.item, onClick = _a.onClick, selected = _a.selected, name = _a.name, _f = _a.radioColor, radioColor = _f === void 0 ? 'alertBlue' : _f, defaultDisabledString = _a.defaultDisabledString, _g = _a.flexGrow, flexGrow = _g === void 0 ? 1 : _g, isDisabled = _a.isDisabled, dotIndicator = _a.dotIndicator, transparent = _a.transparent, noPadding = _a.noPadding;
|
|
19
19
|
var checked = item.value === selected;
|
|
20
20
|
return (React__default['default'].createElement(RadioListItem_styles.BaseRadioListItemContainer, { background: transparent
|
|
21
21
|
? (_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.transparent
|
|
@@ -34,7 +34,7 @@ function RadioListItem(_a) {
|
|
|
34
34
|
: defaultDisabledString
|
|
35
35
|
: item.secondaryLabel),
|
|
36
36
|
item.textOnSelected && checked && (React__default['default'].createElement(RadioListItem_styles.ExtraTextContainer, null,
|
|
37
|
-
React__default['default'].createElement(typography.BodyText, { size: typography.TextTypes.TextSize.SMALL, color:
|
|
37
|
+
React__default['default'].createElement(typography.BodyText, { size: typography.TextTypes.TextSize.SMALL, color: (_e = designTokens.theme.palette) === null || _e === void 0 ? void 0 : _e.dark }, item.textOnSelected)))));
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
exports.RadioListItem = RadioListItem;
|
|
@@ -12,7 +12,7 @@ var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
|
12
12
|
|
|
13
13
|
var BaseRadioListItemContainer = styled__default['default'].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n padding: ", "px;\n align-items: center;\n cursor: pointer;\n flex-wrap: wrap;\n border-radius: ", "px;\n background: ", ";\n > p:first-of-type {\n margin-left: ", "px;\n }\n"], ["\n display: flex;\n padding: ", "px;\n align-items: center;\n cursor: pointer;\n flex-wrap: wrap;\n border-radius: ", "px;\n background: ", ";\n > p:first-of-type {\n margin-left: ", "px;\n }\n"])), function (props) { var _a; return (props.noPadding ? 0 : (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs); }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.small; }, function (props) { return props.background; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
14
14
|
var BaseRadioItemLeftWrapper = styled__default['default'].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n ", ";\n > * {\n &:first-child {\n margin-right: ", "px;\n }\n }\n ", ";\n"], ["\n display: flex;\n align-items: center;\n ", ";\n > * {\n &:first-child {\n margin-right: ", "px;\n }\n }\n ", ";\n"])), function (props) { return props.flexGrow && "flex-grow: " + props.flexGrow; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { return props.isDisabled && 'opacity: 0.4'; });
|
|
15
|
-
var ExtraTextContainer = styled__default['default'].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n flex-basis: 100%;\n margin-left: ", "px;\n text-align: start;\n"], ["\n flex-basis: 100%;\n margin-left: ", "px;\n text-align: start;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xl; });
|
|
15
|
+
var ExtraTextContainer = styled__default['default'].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n flex-basis: 100%;\n margin-left: ", "px;\n text-align: start;\n margin-top: ", "px;\n"], ["\n flex-basis: 100%;\n margin-left: ", "px;\n text-align: start;\n margin-top: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xl; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
16
16
|
var StyledH3 = styled__default['default'](typography.H3).attrs({ as: 'label' })(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n cursor: pointer;\n"], ["\n cursor: pointer;\n"])));
|
|
17
17
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
18
18
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __rest } from '../../../../_virtual/_tslib.js';
|
|
1
2
|
import { formatPrice } from '@citygross/utils';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { Divider } from '../Divider/Divider.js';
|
|
@@ -22,11 +23,12 @@ var calculateSummaryLine = function (items) {
|
|
|
22
23
|
});
|
|
23
24
|
return sumOfItems;
|
|
24
25
|
};
|
|
25
|
-
function CartSummary(
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var
|
|
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 ? 'sparat via erbjudanden' : _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"]);
|
|
29
|
+
var charges = (_b = cartSummary.charges) !== null && _b !== void 0 ? _b : [];
|
|
30
|
+
var bags = (_c = cartSummary.bags) !== null && _c !== void 0 ? _c : [];
|
|
31
|
+
var groceries = (_d = cartSummary.groceries) !== null && _d !== void 0 ? _d : [];
|
|
30
32
|
var sumOfBags = calculateSummaryLine(bags);
|
|
31
33
|
var sumOfGroceries = calculateSummaryLine(groceries);
|
|
32
34
|
return (React.createElement(CartSummaryContainer, null,
|
|
@@ -41,7 +43,7 @@ function CartSummary(cartSummary) {
|
|
|
41
43
|
sumOfBags.quantity,
|
|
42
44
|
" st"),
|
|
43
45
|
React.createElement(AmountWrapper, null,
|
|
44
|
-
sumOfBags.cancelledAmount > 0 && (React.createElement(BodyText, { lineThrough: true, color: (
|
|
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))),
|
|
45
47
|
React.createElement(H3, { fontWeight: 'semiBold' }, formatPrice(sumOfBags.amount))))),
|
|
46
48
|
groceries.length > 0 && (React.createElement(CartLine, null,
|
|
47
49
|
React.createElement(BodyText, null,
|
|
@@ -49,9 +51,9 @@ function CartSummary(cartSummary) {
|
|
|
49
51
|
sumOfGroceries.quantity,
|
|
50
52
|
" st"),
|
|
51
53
|
React.createElement(AmountWrapper, null,
|
|
52
|
-
sumOfGroceries.cancelledAmount > 0 && (React.createElement(BodyText, { lineThrough: true, color: (
|
|
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))),
|
|
53
55
|
React.createElement(H3, { fontWeight: 'semiBold' }, formatPrice(sumOfGroceries.amount))))),
|
|
54
|
-
(charges === null || charges === void 0 ? void 0 : charges.length) > 0 && (React.createElement(Divider, { xsSpacing: (
|
|
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 :
|
|
55
57
|
charges.map(function (charge) {
|
|
56
58
|
var _a, _b;
|
|
57
59
|
return (React.createElement(CartLine, { key: charge.name },
|
|
@@ -61,18 +63,18 @@ function CartSummary(cartSummary) {
|
|
|
61
63
|
React.createElement(BodyText, null, formatPrice(charge.amount)))));
|
|
62
64
|
}),
|
|
63
65
|
cartSummary.totalDiscount > 0 && (React.createElement(CartLine, null,
|
|
64
|
-
React.createElement(BodyText, { color: (
|
|
65
|
-
React.createElement(BodyText, { color: (
|
|
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))))),
|
|
66
68
|
React.createElement(CartSummaryFooter, null,
|
|
67
|
-
((
|
|
69
|
+
((_l = cartSummary.deliveryFee) === null || _l === void 0 ? void 0 : _l.amount) &&
|
|
68
70
|
cartSummary.deliveryFee.amount > 0 && (React.createElement(CartLine, null,
|
|
69
|
-
React.createElement(BodyText, null,
|
|
71
|
+
React.createElement(BodyText, null, shippingLabel),
|
|
70
72
|
React.createElement(BodyText, null, formatPrice(cartSummary.deliveryFee.amount)))),
|
|
71
73
|
React.createElement(CartLine, null,
|
|
72
|
-
React.createElement(H3, { fontWeight: 'semiBold' },
|
|
74
|
+
React.createElement(H3, { fontWeight: 'semiBold' }, totalLabel),
|
|
73
75
|
React.createElement(H3, { fontWeight: 'semiBold' }, formatPrice(cartSummary.totalAmount))),
|
|
74
76
|
React.createElement(CartLine, null,
|
|
75
|
-
React.createElement(BodyText, null,
|
|
77
|
+
React.createElement(BodyText, null, taxLabel),
|
|
76
78
|
React.createElement(BodyText, null, formatPrice(cartSummary.totalTaxAmount)))))));
|
|
77
79
|
}
|
|
78
80
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,7 +5,7 @@ var ItemInformationContainer = styled.div(templateObject_1 || (templateObject_1
|
|
|
5
5
|
var ListItemContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n\n p {\n padding: 1px 0px;\n }\n"], ["\n display: flex;\n justify-content: space-between;\n\n p {\n padding: 1px 0px;\n }\n"])));
|
|
6
6
|
var ListLeft = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", "px;\n @media (min-width: ", "px) {\n gap: 20px;\n }\n"], ["\n display: flex;\n align-items: center;\n gap: ", "px;\n @media (min-width: ", "px) {\n gap: 20px;\n }\n"])), 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.breakpoints) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
7
7
|
var ListRight = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n justify-content: space-between;\n text-align: right;\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n justify-content: space-between;\n text-align: right;\n"])));
|
|
8
|
-
var ListImageContainer = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n flex-direction: row;\n width: ", "px;\n height: ", "px;\n"], ["\n display: flex;\n align-items: center;\n flex-direction: row;\n width: ", "px;\n height: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.ListImageMaxWidth; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.ListImageMaxWidth; });
|
|
8
|
+
var ListImageContainer = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: row;\n width: ", "px;\n height: ", "px;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: row;\n width: ", "px;\n height: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.ListImageMaxWidth; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.ListImageMaxWidth; });
|
|
9
9
|
var ListImage = styled.img(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n max-width: 100%;\n max-height: 50px;\n"], ["\n max-width: 100%;\n max-height: 50px;\n"])));
|
|
10
10
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
11
11
|
|
|
@@ -6,8 +6,8 @@ import { theme } from '@citygross/design-tokens';
|
|
|
6
6
|
import { BaseRadioListItemContainer, BaseRadioItemLeftWrapper, StyledH3, ExtraTextContainer } from './RadioListItem.styles.js';
|
|
7
7
|
|
|
8
8
|
function RadioListItem(_a) {
|
|
9
|
-
var _b, _c, _d;
|
|
10
|
-
var item = _a.item, onClick = _a.onClick, selected = _a.selected, name = _a.name,
|
|
9
|
+
var _b, _c, _d, _e;
|
|
10
|
+
var item = _a.item, onClick = _a.onClick, selected = _a.selected, name = _a.name, _f = _a.radioColor, radioColor = _f === void 0 ? 'alertBlue' : _f, defaultDisabledString = _a.defaultDisabledString, _g = _a.flexGrow, flexGrow = _g === void 0 ? 1 : _g, isDisabled = _a.isDisabled, dotIndicator = _a.dotIndicator, transparent = _a.transparent, noPadding = _a.noPadding;
|
|
11
11
|
var checked = item.value === selected;
|
|
12
12
|
return (React.createElement(BaseRadioListItemContainer, { background: transparent
|
|
13
13
|
? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.transparent
|
|
@@ -26,7 +26,7 @@ function RadioListItem(_a) {
|
|
|
26
26
|
: defaultDisabledString
|
|
27
27
|
: item.secondaryLabel),
|
|
28
28
|
item.textOnSelected && checked && (React.createElement(ExtraTextContainer, null,
|
|
29
|
-
React.createElement(BodyText, { size: TextTypes.TextSize.SMALL, color:
|
|
29
|
+
React.createElement(BodyText, { size: TextTypes.TextSize.SMALL, color: (_e = theme.palette) === null || _e === void 0 ? void 0 : _e.dark }, item.textOnSelected)))));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export { RadioListItem };
|
|
@@ -4,7 +4,7 @@ import styled from 'styled-components';
|
|
|
4
4
|
|
|
5
5
|
var BaseRadioListItemContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n padding: ", "px;\n align-items: center;\n cursor: pointer;\n flex-wrap: wrap;\n border-radius: ", "px;\n background: ", ";\n > p:first-of-type {\n margin-left: ", "px;\n }\n"], ["\n display: flex;\n padding: ", "px;\n align-items: center;\n cursor: pointer;\n flex-wrap: wrap;\n border-radius: ", "px;\n background: ", ";\n > p:first-of-type {\n margin-left: ", "px;\n }\n"])), function (props) { var _a; return (props.noPadding ? 0 : (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs); }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.small; }, function (props) { return props.background; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
6
6
|
var BaseRadioItemLeftWrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n ", ";\n > * {\n &:first-child {\n margin-right: ", "px;\n }\n }\n ", ";\n"], ["\n display: flex;\n align-items: center;\n ", ";\n > * {\n &:first-child {\n margin-right: ", "px;\n }\n }\n ", ";\n"])), function (props) { return props.flexGrow && "flex-grow: " + props.flexGrow; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { return props.isDisabled && 'opacity: 0.4'; });
|
|
7
|
-
var ExtraTextContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-basis: 100%;\n margin-left: ", "px;\n text-align: start;\n"], ["\n flex-basis: 100%;\n margin-left: ", "px;\n text-align: start;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xl; });
|
|
7
|
+
var ExtraTextContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-basis: 100%;\n margin-left: ", "px;\n text-align: start;\n margin-top: ", "px;\n"], ["\n flex-basis: 100%;\n margin-left: ", "px;\n text-align: start;\n margin-top: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xl; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
8
8
|
var StyledH3 = styled(H3).attrs({ as: 'label' })(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n cursor: pointer;\n"], ["\n cursor: pointer;\n"])));
|
|
9
9
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
10
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citygross/components",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.22",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./build/cjs/components/src/index.js",
|
|
@@ -64,11 +64,12 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@citygross/design-tokens": "^0.2.12",
|
|
66
66
|
"@citygross/icons": "^0.1.1",
|
|
67
|
+
"@citygross/react-use-bg-wizard": "^0.0.6",
|
|
67
68
|
"@citygross/typography": "^0.0.39",
|
|
68
69
|
"@citygross/utils": "^0.0.17",
|
|
69
70
|
"framer-motion": "^4.1.17",
|
|
70
71
|
"moment": "^2.29.1",
|
|
71
72
|
"react-loading-skeleton": "^2.2.0"
|
|
72
73
|
},
|
|
73
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "040f14246768a14b8cbc834d2386b262abf4879d"
|
|
74
75
|
}
|