@citygross/components 0.8.168 → 0.8.170
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/CartSubTotal/CartSubTotal.d.ts +2 -2
- package/build/cjs/components/src/components/CartSubTotal/CartSubTotal.js +2 -2
- package/build/cjs/components/src/components/CartSubTotal/CartSubTotal.styles.js +10 -2
- package/build/cjs/components/src/components/CartSubTotal/CartSubTotal.styles.js.map +1 -1
- package/build/cjs/components/src/components/ToolTipDialog/ToolTipDialog.styles.js +1 -1
- package/build/es/components/src/components/CartSubTotal/CartSubTotal.js +2 -2
- package/build/es/components/src/components/CartSubTotal/CartSubTotal.styles.js +10 -2
- package/build/es/components/src/components/CartSubTotal/CartSubTotal.styles.js.map +1 -1
- package/build/es/components/src/components/ToolTipDialog/ToolTipDialog.styles.js +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare type TCartSubTotal = {
|
|
3
3
|
children?: React.ReactNode;
|
|
4
|
-
|
|
4
|
+
fromPrice?: boolean;
|
|
5
5
|
info?: React.ReactNode;
|
|
6
6
|
infoOnBottom?: boolean;
|
|
7
7
|
label: string;
|
|
@@ -14,4 +14,4 @@ export declare enum ECartSubTotalTypes {
|
|
|
14
14
|
items = "items",
|
|
15
15
|
charges = "charges"
|
|
16
16
|
}
|
|
17
|
-
export declare const CartSubTotal: ({ children,
|
|
17
|
+
export declare const CartSubTotal: ({ children, fromPrice, info, infoOnBottom, label, priceColor, tooltipAriaLabel, type, value }: TCartSubTotal) => JSX.Element;
|
|
@@ -20,7 +20,7 @@ exports.ECartSubTotalTypes = void 0;
|
|
|
20
20
|
})(exports.ECartSubTotalTypes || (exports.ECartSubTotalTypes = {}));
|
|
21
21
|
var CartSubTotal = function (_a) {
|
|
22
22
|
var _b;
|
|
23
|
-
var children = _a.children,
|
|
23
|
+
var children = _a.children, fromPrice = _a.fromPrice, info = _a.info, infoOnBottom = _a.infoOnBottom, label = _a.label, _c = _a.priceColor, priceColor = _c === void 0 ? (_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.darkest : _c, tooltipAriaLabel = _a.tooltipAriaLabel, type = _a.type, value = _a.value;
|
|
24
24
|
var formattedPrice = utils.formatPriceWithNoZero(value);
|
|
25
25
|
var _d = React.useState(false), infoOpen = _d[0], setInfoOpen = _d[1];
|
|
26
26
|
var tooltipId = "tooltip-".concat(label.toLowerCase().replace(/ /g, '-'));
|
|
@@ -35,7 +35,7 @@ var CartSubTotal = function (_a) {
|
|
|
35
35
|
React__default["default"].createElement(icons.Icons.Info, { "aria-hidden": "true", height: 16, width: 16 }))),
|
|
36
36
|
React__default["default"].createElement(CartSubTotal_styles.Price, { priceColor: priceColor }, (value !== 0 && !value) || isNaN(value)
|
|
37
37
|
? '-'
|
|
38
|
-
: "".concat(
|
|
38
|
+
: "".concat(fromPrice ? 'Från ' : '').concat(formattedPrice, " kr")),
|
|
39
39
|
infoOpen && (React__default["default"].createElement(ToolTipDialog.ToolTipDialog, { id: tooltipId, info: info, onBottom: infoOnBottom, toggle: toggleInfoOpen })))) : (React__default["default"].createElement(CartSubTotal_styles.CartSubTotalContainer, { type: type },
|
|
40
40
|
React__default["default"].createElement(CartSubTotal_styles.SubTotalLabel, null,
|
|
41
41
|
label,
|
|
@@ -21,8 +21,16 @@ var CartSubTotalContainer = styled__default["default"].div(templateObject_1 || (
|
|
|
21
21
|
? "\n font-size: ".concat((_c = (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.size) === null || _c === void 0 ? void 0 : _c.s3, "px;\n font-weight: ").concat((_e = (_d = theme.typography) === null || _d === void 0 ? void 0 : _d.weight) === null || _e === void 0 ? void 0 : _e.medium, ";\n ")
|
|
22
22
|
: "\n font-size: ".concat((_g = (_f = theme.typography) === null || _f === void 0 ? void 0 : _f.size) === null || _g === void 0 ? void 0 : _g.s2, "px;\n font-weight: ").concat((_j = (_h = theme.typography) === null || _h === void 0 ? void 0 : _h.weight) === null || _j === void 0 ? void 0 : _j.regular, ";\n ");
|
|
23
23
|
});
|
|
24
|
-
var SubTotalLabel = styled__default["default"].div(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 (
|
|
25
|
-
var
|
|
24
|
+
var SubTotalLabel = styled__default["default"].div(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 (_a) {
|
|
25
|
+
var _b;
|
|
26
|
+
var theme = _a.theme;
|
|
27
|
+
return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
|
|
28
|
+
});
|
|
29
|
+
var ToolTipButton = styled__default["default"].button(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n background: transparent;\n border: none;\n cursor: pointer;\n padding: ", "px;\n\n svg {\n display: block;\n }\n"], ["\n background: transparent;\n border: none;\n cursor: pointer;\n padding: ", "px;\n\n svg {\n display: block;\n }\n"])), function (_a) {
|
|
30
|
+
var _b;
|
|
31
|
+
var theme = _a.theme;
|
|
32
|
+
return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxxs;
|
|
33
|
+
});
|
|
26
34
|
var Price = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (_a) {
|
|
27
35
|
var priceColor = _a.priceColor;
|
|
28
36
|
return priceColor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartSubTotal.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CartSubTotal.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -40,7 +40,7 @@ var DialogContainer = styled__default["default"].div(templateObject_1 || (templa
|
|
|
40
40
|
? "\n margin-top: ".concat((_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs2, "px;\n top: 100%;\n ")
|
|
41
41
|
: "\n margin-bottom: ".concat((_c = theme.spacings) === null || _c === void 0 ? void 0 : _c.xxs2, "px;\n bottom: 100%;\n ");
|
|
42
42
|
});
|
|
43
|
-
var DialogClose = styled__default["default"].button(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n background: transparent;\n border: none;\n cursor: pointer;\n\n svg {\n display: block;\n }\n"], ["\n background: transparent;\n border: none;\n cursor: pointer;\n\n svg {\n display: block;\n }\n"])));
|
|
43
|
+
var DialogClose = styled__default["default"].button(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 0;\n\n svg {\n display: block;\n }\n"], ["\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 0;\n\n svg {\n display: block;\n }\n"])));
|
|
44
44
|
var templateObject_1, templateObject_2;
|
|
45
45
|
|
|
46
46
|
exports.DialogClose = DialogClose;
|
|
@@ -12,7 +12,7 @@ var ECartSubTotalTypes;
|
|
|
12
12
|
})(ECartSubTotalTypes || (ECartSubTotalTypes = {}));
|
|
13
13
|
var CartSubTotal = function (_a) {
|
|
14
14
|
var _b;
|
|
15
|
-
var children = _a.children,
|
|
15
|
+
var children = _a.children, fromPrice = _a.fromPrice, info = _a.info, infoOnBottom = _a.infoOnBottom, label = _a.label, _c = _a.priceColor, priceColor = _c === void 0 ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.darkest : _c, tooltipAriaLabel = _a.tooltipAriaLabel, type = _a.type, value = _a.value;
|
|
16
16
|
var formattedPrice = formatPriceWithNoZero(value);
|
|
17
17
|
var _d = useState(false), infoOpen = _d[0], setInfoOpen = _d[1];
|
|
18
18
|
var tooltipId = "tooltip-".concat(label.toLowerCase().replace(/ /g, '-'));
|
|
@@ -27,7 +27,7 @@ var CartSubTotal = function (_a) {
|
|
|
27
27
|
React.createElement(Icons.Info, { "aria-hidden": "true", height: 16, width: 16 }))),
|
|
28
28
|
React.createElement(Price, { priceColor: priceColor }, (value !== 0 && !value) || isNaN(value)
|
|
29
29
|
? '-'
|
|
30
|
-
: "".concat(
|
|
30
|
+
: "".concat(fromPrice ? 'Från ' : '').concat(formattedPrice, " kr")),
|
|
31
31
|
infoOpen && (React.createElement(ToolTipDialog, { id: tooltipId, info: info, onBottom: infoOnBottom, toggle: toggleInfoOpen })))) : (React.createElement(CartSubTotalContainer, { type: type },
|
|
32
32
|
React.createElement(SubTotalLabel, null,
|
|
33
33
|
label,
|
|
@@ -13,8 +13,16 @@ var CartSubTotalContainer = styled.div(templateObject_1 || (templateObject_1 = _
|
|
|
13
13
|
? "\n font-size: ".concat((_c = (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.size) === null || _c === void 0 ? void 0 : _c.s3, "px;\n font-weight: ").concat((_e = (_d = theme.typography) === null || _d === void 0 ? void 0 : _d.weight) === null || _e === void 0 ? void 0 : _e.medium, ";\n ")
|
|
14
14
|
: "\n font-size: ".concat((_g = (_f = theme.typography) === null || _f === void 0 ? void 0 : _f.size) === null || _g === void 0 ? void 0 : _g.s2, "px;\n font-weight: ").concat((_j = (_h = theme.typography) === null || _h === void 0 ? void 0 : _h.weight) === null || _j === void 0 ? void 0 : _j.regular, ";\n ");
|
|
15
15
|
});
|
|
16
|
-
var SubTotalLabel = styled.div(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 (
|
|
17
|
-
var
|
|
16
|
+
var SubTotalLabel = styled.div(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 (_a) {
|
|
17
|
+
var _b;
|
|
18
|
+
var theme = _a.theme;
|
|
19
|
+
return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
|
|
20
|
+
});
|
|
21
|
+
var ToolTipButton = styled.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background: transparent;\n border: none;\n cursor: pointer;\n padding: ", "px;\n\n svg {\n display: block;\n }\n"], ["\n background: transparent;\n border: none;\n cursor: pointer;\n padding: ", "px;\n\n svg {\n display: block;\n }\n"])), function (_a) {
|
|
22
|
+
var _b;
|
|
23
|
+
var theme = _a.theme;
|
|
24
|
+
return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxxs;
|
|
25
|
+
});
|
|
18
26
|
var Price = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (_a) {
|
|
19
27
|
var priceColor = _a.priceColor;
|
|
20
28
|
return priceColor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartSubTotal.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CartSubTotal.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -32,7 +32,7 @@ var DialogContainer = styled.div(templateObject_1 || (templateObject_1 = __makeT
|
|
|
32
32
|
? "\n margin-top: ".concat((_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs2, "px;\n top: 100%;\n ")
|
|
33
33
|
: "\n margin-bottom: ".concat((_c = theme.spacings) === null || _c === void 0 ? void 0 : _c.xxs2, "px;\n bottom: 100%;\n ");
|
|
34
34
|
});
|
|
35
|
-
var DialogClose = styled.button(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: transparent;\n border: none;\n cursor: pointer;\n\n svg {\n display: block;\n }\n"], ["\n background: transparent;\n border: none;\n cursor: pointer;\n\n svg {\n display: block;\n }\n"])));
|
|
35
|
+
var DialogClose = styled.button(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 0;\n\n svg {\n display: block;\n }\n"], ["\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 0;\n\n svg {\n display: block;\n }\n"])));
|
|
36
36
|
var templateObject_1, templateObject_2;
|
|
37
37
|
|
|
38
38
|
export { DialogClose, DialogContainer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citygross/components",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.170",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./build/cjs/components/src/index.js",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"react-slick": "^0.30.1",
|
|
75
75
|
"slick-carousel": "^1.8.1"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "f8479fa27291861f50fd17855e0dc26adda4fd55"
|
|
78
78
|
}
|