@citygross/components 0.14.3 → 0.14.5
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.styles.d.ts +1 -2
- package/build/@types/components/CartSummary/CartSummary.styles.d.ts +0 -1
- package/build/@types/components/CgButton/ToolTipButton/ToolTipButton.d.ts +2 -0
- package/build/@types/components/CgButton/ToolTipButton/ToolTipButton.styles.d.ts +1 -0
- package/build/@types/components/FormElements/Checkbox/Checkbox.styles.d.ts +1 -1
- package/build/@types/components/ToolTipDialog/ToolTipDialog.d.ts +2 -4
- package/build/@types/components/ToolTipDialog/ToolTipDialog.styles.d.ts +2 -3
- package/build/@types/index.d.ts +1 -0
- package/build/cjs/components/src/components/Accordion/Accordion.js +1 -2
- package/build/cjs/components/src/components/Accordion/Accordion.js.map +1 -1
- package/build/cjs/components/src/components/Accordion/Accordion.styles.js +10 -2
- package/build/cjs/components/src/components/Accordion/Accordion.styles.js.map +1 -1
- package/build/cjs/components/src/components/AddressBlock/AddressBlock.js +4 -3
- package/build/cjs/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
- package/build/cjs/components/src/components/CartSubTotal/CartSubTotal.js +4 -5
- package/build/cjs/components/src/components/CartSubTotal/CartSubTotal.js.map +1 -1
- package/build/cjs/components/src/components/CartSubTotal/CartSubTotal.styles.js +2 -8
- package/build/cjs/components/src/components/CartSubTotal/CartSubTotal.styles.js.map +1 -1
- package/build/cjs/components/src/components/CartSummary/CartSummary.js +6 -13
- package/build/cjs/components/src/components/CartSummary/CartSummary.js.map +1 -1
- package/build/cjs/components/src/components/CartSummary/CartSummary.styles.js +4 -6
- package/build/cjs/components/src/components/CartSummary/CartSummary.styles.js.map +1 -1
- package/build/cjs/components/src/components/CgButton/ToolTipButton/ToolTipButton.js +23 -0
- package/build/cjs/components/src/components/CgButton/ToolTipButton/ToolTipButton.js.map +1 -0
- package/build/cjs/components/src/components/CgButton/ToolTipButton/ToolTipButton.styles.js +20 -0
- package/build/cjs/components/src/components/CgButton/ToolTipButton/ToolTipButton.styles.js.map +1 -0
- package/build/cjs/components/src/components/FormElements/Checkbox/Checkbox.js +3 -3
- package/build/cjs/components/src/components/FormElements/FormElement.styles.js +1 -1
- package/build/cjs/components/src/components/FormElements/Radio/Radio.js +3 -3
- package/build/cjs/components/src/components/ToolTipDialog/ToolTipDialog.js +12 -10
- package/build/cjs/components/src/components/ToolTipDialog/ToolTipDialog.js.map +1 -1
- package/build/cjs/components/src/index.js +2 -0
- package/build/cjs/components/src/index.js.map +1 -1
- package/build/es/components/src/components/Accordion/Accordion.js +1 -2
- package/build/es/components/src/components/Accordion/Accordion.js.map +1 -1
- package/build/es/components/src/components/Accordion/Accordion.styles.js +10 -2
- package/build/es/components/src/components/Accordion/Accordion.styles.js.map +1 -1
- package/build/es/components/src/components/AddressBlock/AddressBlock.js +4 -3
- package/build/es/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
- package/build/es/components/src/components/CartSubTotal/CartSubTotal.js +5 -6
- package/build/es/components/src/components/CartSubTotal/CartSubTotal.js.map +1 -1
- package/build/es/components/src/components/CartSubTotal/CartSubTotal.styles.js +3 -8
- package/build/es/components/src/components/CartSubTotal/CartSubTotal.styles.js.map +1 -1
- package/build/es/components/src/components/CartSummary/CartSummary.js +6 -13
- package/build/es/components/src/components/CartSummary/CartSummary.js.map +1 -1
- package/build/es/components/src/components/CartSummary/CartSummary.styles.js +5 -6
- package/build/es/components/src/components/CartSummary/CartSummary.styles.js.map +1 -1
- package/build/es/components/src/components/CgButton/ToolTipButton/ToolTipButton.js +15 -0
- package/build/es/components/src/components/CgButton/ToolTipButton/ToolTipButton.js.map +1 -0
- package/build/es/components/src/components/CgButton/ToolTipButton/ToolTipButton.styles.js +12 -0
- package/build/es/components/src/components/CgButton/ToolTipButton/ToolTipButton.styles.js.map +1 -0
- package/build/es/components/src/components/FormElements/Checkbox/Checkbox.js +4 -4
- package/build/es/components/src/components/FormElements/FormElement.styles.js +1 -1
- package/build/es/components/src/components/FormElements/Radio/Radio.js +4 -4
- package/build/es/components/src/components/ToolTipDialog/ToolTipDialog.js +12 -10
- package/build/es/components/src/components/ToolTipDialog/ToolTipDialog.js.map +1 -1
- package/build/es/components/src/index.js +1 -0
- package/build/es/components/src/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { TCartSubTotal } from './CartSubTotal';
|
|
1
|
+
import { type TCartSubTotal } from './CartSubTotal';
|
|
2
2
|
declare type TCartSubTotalContainer = Pick<TCartSubTotal, 'type'>;
|
|
3
3
|
export declare const CartSubTotalContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TCartSubTotalContainer, never>;
|
|
4
4
|
export declare const SubTotalLabel: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
-
export declare const ToolTipButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
6
5
|
declare type TCartSubTotalPrice = Pick<TCartSubTotal, 'priceColor'>;
|
|
7
6
|
export declare const Price: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TCartSubTotalPrice, never>;
|
|
8
7
|
export {};
|
|
@@ -10,7 +10,6 @@ export declare const CartSummaryContent: import("styled-components").StyledCompo
|
|
|
10
10
|
export declare const CartLine: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TCartLine, never>;
|
|
11
11
|
export declare const AmountWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
12
12
|
export declare const LabelWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
13
|
-
export declare const ToolTipButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
14
13
|
export declare const CartSummaryTitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
15
14
|
export declare const QuantitySpan: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
16
15
|
export declare const TotalLine: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TCartLine, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ToolTipButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TOptionInputContainer } from '../FormElement.types';
|
|
1
|
+
import type { TOptionInputContainer } from '../FormElement.types';
|
|
2
2
|
export declare const CheckboxContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TOptionInputContainer, never>;
|
|
3
3
|
export declare const IconContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare type TToolTipDialog = {
|
|
3
|
-
id?: string;
|
|
4
|
-
info: React.ReactNode;
|
|
5
3
|
onBottom?: boolean;
|
|
6
4
|
toggle: () => void;
|
|
7
|
-
}
|
|
8
|
-
export declare const ToolTipDialog: ({
|
|
5
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
6
|
+
export declare const ToolTipDialog: ({ children, id, onBottom, toggle }: TToolTipDialog) => JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
};
|
|
1
|
+
import type { TToolTipDialog } from './ToolTipDialog';
|
|
2
|
+
export declare type TDialogContainer = Pick<TToolTipDialog, 'onBottom'>;
|
|
4
3
|
export declare const DialogContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TDialogContainer, never>;
|
|
5
4
|
export declare const DialogClose: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
package/build/@types/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export * from './components/CgButton/CgButton';
|
|
|
16
16
|
export * from './components/CgButton/CgButton.types';
|
|
17
17
|
export * from './components/CgButton/ButtonAsLink/ButtonAsLink';
|
|
18
18
|
export * from './components/CgButton/DivAsButton/DivAsButton';
|
|
19
|
+
export * from './components/CgButton/ToolTipButton/ToolTipButton';
|
|
19
20
|
export * from './components/Chips/Chip';
|
|
20
21
|
export * from './components/Collapsable/Collapsable';
|
|
21
22
|
export * from './components/CouponCode/CouponCode';
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var designTokens = require('@citygross/design-tokens');
|
|
7
7
|
var icons = require('@citygross/icons');
|
|
8
|
-
var typography = require('@citygross/typography');
|
|
9
8
|
var Accordion_styles = require('./Accordion.styles.js');
|
|
10
9
|
|
|
11
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -62,7 +61,7 @@ var Accordion = function (_a) {
|
|
|
62
61
|
setIsOpen(true);
|
|
63
62
|
onToggle === null || onToggle === void 0 ? void 0 : onToggle(true);
|
|
64
63
|
}, type: "button" },
|
|
65
|
-
|
|
64
|
+
title,
|
|
66
65
|
React__default["default"].createElement(Accordion_styles.Chevron, { "data-state": isOpen ? 'open' : 'collapsed' },
|
|
67
66
|
React__default["default"].createElement(icons.Icons.ChevronDown, { "aria-hidden": "true", height: (_b = designTokens.theme.spacings) === null || _b === void 0 ? void 0 : _b.sm, width: (_c = designTokens.theme.spacings) === null || _c === void 0 ? void 0 : _c.sm }))),
|
|
68
67
|
React__default["default"].createElement(Accordion_styles.Content, { "aria-labelledby": headerId, "data-state": isOpen ? 'open' : 'collapsed', hidden: isCollapsed, id: contentId, maxHeight: isOpen ? contentHeight : 0, onTransitionEnd: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Accordion.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -14,13 +14,21 @@ var Container = styled__default["default"].div(templateObject_1 || (templateObje
|
|
|
14
14
|
var theme = _a.theme;
|
|
15
15
|
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.light;
|
|
16
16
|
});
|
|
17
|
-
var Header = styled__default["default"].button(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n background: none;\n border: 0;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ", ";\n text-align: left;\n width: 100%;\n"], ["\n background: none;\n border: 0;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ", ";\n text-align: left;\n width: 100%;\n"])), function (_a) {
|
|
17
|
+
var Header = styled__default["default"].button(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n background: none;\n border: 0;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: ", "px;\n font-weight: ", ";\n padding: ", ";\n text-align: left;\n width: 100%;\n"], ["\n background: none;\n border: 0;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: ", "px;\n font-weight: ", ";\n padding: ", ";\n text-align: left;\n width: 100%;\n"])), function (_a) {
|
|
18
|
+
var _b, _c;
|
|
19
|
+
var theme = _a.theme;
|
|
20
|
+
return (_c = (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.size) === null || _c === void 0 ? void 0 : _c.s3;
|
|
21
|
+
}, function (_a) {
|
|
22
|
+
var _b, _c;
|
|
23
|
+
var theme = _a.theme;
|
|
24
|
+
return (_c = (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.weight) === null || _c === void 0 ? void 0 : _c.medium;
|
|
25
|
+
}, function (_a) {
|
|
18
26
|
var _b, _c;
|
|
19
27
|
var theme = _a.theme;
|
|
20
28
|
return "".concat((_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.sm, "px ").concat((_c = theme.spacings) === null || _c === void 0 ? void 0 : _c.md, "px");
|
|
21
29
|
});
|
|
22
30
|
var Chevron = styled__default["default"].span(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n display: inline-flex;\n transition: transform 200ms ease;\n\n &[data-state='open'] {\n transform: rotate(180deg);\n }\n"], ["\n display: inline-flex;\n transition: transform 200ms ease;\n\n &[data-state='open'] {\n transform: rotate(180deg);\n }\n"])));
|
|
23
|
-
var Content = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n max-height: ", "px;\n opacity: 0;\n overflow: hidden;\n padding: 0 ", "px;\n transition
|
|
31
|
+
var Content = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n max-height: ", "px;\n opacity: 0;\n overflow: hidden;\n padding: 0 ", "px;\n transition:\n max-height 220ms ease,\n opacity 200ms ease;\n\n &[data-state='open'] {\n opacity: 1;\n padding: ", ";\n }\n"], ["\n max-height: ", "px;\n opacity: 0;\n overflow: hidden;\n padding: 0 ", "px;\n transition:\n max-height 220ms ease,\n opacity 200ms ease;\n\n &[data-state='open'] {\n opacity: 1;\n padding: ", ";\n }\n"])), function (_a) {
|
|
24
32
|
var maxHeight = _a.maxHeight;
|
|
25
33
|
return maxHeight;
|
|
26
34
|
}, function (_a) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Accordion.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -26,9 +26,10 @@ require('@citygross/utils');
|
|
|
26
26
|
require('react-loading-skeleton');
|
|
27
27
|
require('../CartItemSummary/CartItemSummary.styles.js');
|
|
28
28
|
require('../CartSubTotal/CartSubTotal.js');
|
|
29
|
+
require('../../../../design-tokens/build/index.js');
|
|
30
|
+
require('../CgButton/ToolTipButton/ToolTipButton.styles.js');
|
|
29
31
|
require('../ToolTipDialog/ToolTipDialog.styles.js');
|
|
30
32
|
require('../CartSummary/CartSummary.styles.js');
|
|
31
|
-
require('../../../../design-tokens/build/index.js');
|
|
32
33
|
require('../CgButton/ButtonAsLink/ButtonAsLink.styles.js');
|
|
33
34
|
require('../CgButton/CgButton.styles.js');
|
|
34
35
|
require('../Chips/Chip.styles.js');
|
|
@@ -45,10 +46,10 @@ require('../Fieldset/Fieldset.styles.js');
|
|
|
45
46
|
require('../Flex/Flex.styles.js');
|
|
46
47
|
require('../Form/Form.styles.js');
|
|
47
48
|
require('../FormControl/FormControl.js');
|
|
48
|
-
require('../ScreenReader/ScreenReader.styles.js');
|
|
49
49
|
require('../FormElements/FormElement.types.js');
|
|
50
|
-
require('../
|
|
50
|
+
require('../ScreenReader/ScreenReader.styles.js');
|
|
51
51
|
require('../FormElements/FormElement.styles.js');
|
|
52
|
+
require('../FormElements/Checkbox/Checkbox.styles.js');
|
|
52
53
|
require('../FormElements/Input/Input.js');
|
|
53
54
|
require('../FormElements/InputOld/InputOld.styles.js');
|
|
54
55
|
require('../FormElements/Radio/Radio.styles.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var
|
|
6
|
+
var designTokens = require('@citygross/design-tokens');
|
|
7
7
|
var utils = require('@citygross/utils');
|
|
8
|
+
var ToolTipButton = require('../CgButton/ToolTipButton/ToolTipButton.js');
|
|
8
9
|
var ToolTipDialog = require('../ToolTipDialog/ToolTipDialog.js');
|
|
9
10
|
var CartSubTotal_styles = require('./CartSubTotal.styles.js');
|
|
10
|
-
var designTokens = require('@citygross/design-tokens');
|
|
11
11
|
|
|
12
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
13
|
|
|
@@ -35,12 +35,11 @@ var CartSubTotal = function (_a) {
|
|
|
35
35
|
React__default["default"].createElement(CartSubTotal_styles.SubTotalLabel, null,
|
|
36
36
|
label,
|
|
37
37
|
children,
|
|
38
|
-
React__default["default"].createElement(
|
|
39
|
-
React__default["default"].createElement(icons.Icons.Info, { "aria-hidden": "true", height: 16, width: 16 }))),
|
|
38
|
+
React__default["default"].createElement(ToolTipButton.ToolTipButton, { "aria-expanded": infoOpen, "aria-label": tooltipAriaLabel, "aria-describedby": infoOpen ? tooltipId : undefined, onClick: handleTooltipClick })),
|
|
40
39
|
React__default["default"].createElement(CartSubTotal_styles.Price, { priceColor: priceColor }, (value !== 0 && !value) || isNaN(value)
|
|
41
40
|
? '-'
|
|
42
41
|
: "".concat(fromPrice ? 'Från ' : '').concat(formattedPrice, " kr")),
|
|
43
|
-
infoOpen && (React__default["default"].createElement(ToolTipDialog.ToolTipDialog, { id: tooltipId,
|
|
42
|
+
infoOpen && (React__default["default"].createElement(ToolTipDialog.ToolTipDialog, { id: tooltipId, onBottom: infoOnBottom, toggle: toggleInfoOpen }, info)))) : (React__default["default"].createElement(CartSubTotal_styles.CartSubTotalContainer, { type: type },
|
|
44
43
|
React__default["default"].createElement(CartSubTotal_styles.SubTotalLabel, null,
|
|
45
44
|
label,
|
|
46
45
|
children),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartSubTotal.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CartSubTotal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -26,19 +26,13 @@ var SubTotalLabel = styled__default["default"].div(templateObject_2 || (template
|
|
|
26
26
|
var theme = _a.theme;
|
|
27
27
|
return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
|
|
28
28
|
});
|
|
29
|
-
var
|
|
30
|
-
var _b;
|
|
31
|
-
var theme = _a.theme;
|
|
32
|
-
return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxxs;
|
|
33
|
-
});
|
|
34
|
-
var Price = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (_a) {
|
|
29
|
+
var Price = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (_a) {
|
|
35
30
|
var priceColor = _a.priceColor;
|
|
36
31
|
return priceColor;
|
|
37
32
|
});
|
|
38
|
-
var templateObject_1, templateObject_2, templateObject_3
|
|
33
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
39
34
|
|
|
40
35
|
exports.CartSubTotalContainer = CartSubTotalContainer;
|
|
41
36
|
exports.Price = Price;
|
|
42
37
|
exports.SubTotalLabel = SubTotalLabel;
|
|
43
|
-
exports.ToolTipButton = ToolTipButton;
|
|
44
38
|
//# sourceMappingURL=CartSubTotal.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartSubTotal.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CartSubTotal.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _tslib = require('../../../../_virtual/_tslib.js');
|
|
6
|
-
var utils = require('@citygross/utils');
|
|
7
6
|
var React = require('react');
|
|
8
|
-
var icons = require('@citygross/icons');
|
|
9
|
-
var ToolTipDialog = require('../ToolTipDialog/ToolTipDialog.js');
|
|
10
|
-
var CartSummary_styles = require('./CartSummary.styles.js');
|
|
11
7
|
var typography = require('@citygross/typography');
|
|
8
|
+
var utils = require('@citygross/utils');
|
|
12
9
|
var index = require('../../../../design-tokens/build/index.js');
|
|
10
|
+
var ToolTipButton = require('../CgButton/ToolTipButton/ToolTipButton.js');
|
|
11
|
+
var ToolTipDialog = require('../ToolTipDialog/ToolTipDialog.js');
|
|
12
|
+
var CartSummary_styles = require('./CartSummary.styles.js');
|
|
13
13
|
|
|
14
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
15
|
|
|
@@ -53,12 +53,6 @@ function CartSummary(_a) {
|
|
|
53
53
|
if (charges.length > 0) {
|
|
54
54
|
summaryParts.push("".concat(charges.length, " avgifter"));
|
|
55
55
|
}
|
|
56
|
-
var summaryText = summaryParts.length > 0
|
|
57
|
-
? "".concat(summaryParts.join(', '), ". ").concat(totalLabel, " ").concat(utils.formatPrice(cartSummary.totalAmount))
|
|
58
|
-
: "".concat(totalLabel, " ").concat(utils.formatPrice(cartSummary.totalAmount));
|
|
59
|
-
cartSummary.totalDiscount > 0
|
|
60
|
-
? "".concat(summaryText, ". ").concat(saveLabel, " ").concat(utils.formatPrice(cartSummary.totalDiscount))
|
|
61
|
-
: summaryText;
|
|
62
56
|
var ChargeLine = function (_a) {
|
|
63
57
|
var _b, _c;
|
|
64
58
|
var charge = _a.charge;
|
|
@@ -74,9 +68,8 @@ function CartSummary(_a) {
|
|
|
74
68
|
React__default["default"].createElement(CartSummary_styles.LabelWrapper, null,
|
|
75
69
|
React__default["default"].createElement(typography.BodyText, null, chargeName),
|
|
76
70
|
charge.info && (React__default["default"].createElement(React.Fragment, null,
|
|
77
|
-
React__default["default"].createElement(
|
|
78
|
-
|
|
79
|
-
infoOpen && (React__default["default"].createElement(ToolTipDialog.ToolTipDialog, { id: tooltipId, info: charge.info, toggle: toggleInfoOpen }))))),
|
|
71
|
+
React__default["default"].createElement(ToolTipButton.ToolTipButton, { "aria-expanded": infoOpen, "aria-label": charge.tooltipAriaLabel || "Mer information om ".concat(chargeName), "aria-describedby": infoOpen ? tooltipId : undefined, onClick: toggleInfoOpen }),
|
|
72
|
+
infoOpen && (React__default["default"].createElement(ToolTipDialog.ToolTipDialog, { id: tooltipId, toggle: toggleInfoOpen }, charge.info))))),
|
|
80
73
|
React__default["default"].createElement(CartSummary_styles.AmountWrapper, null,
|
|
81
74
|
charge.cancelledAmount > 0 && (React__default["default"].createElement(typography.BodyText, { lineThrough: true, color: (_c = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _c === void 0 ? void 0 : _c.dark, "aria-label": "Original price ".concat(utils.formatPrice(charge.cancelledAmount)) }, utils.formatPrice(charge.cancelledAmount))),
|
|
82
75
|
React__default["default"].createElement(typography.BodyText, { "aria-label": "".concat(chargeName, " ").concat(utils.formatPrice(charge.amount)) }, utils.formatPrice(charge.amount)))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -15,11 +15,10 @@ var CartSummaryContent = styled__default["default"].div(templateObject_3 || (tem
|
|
|
15
15
|
var CartLine = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n text-decoration: ", ";\n"], ["\n display: flex;\n justify-content: space-between;\n text-decoration: ", ";\n"])), function (props) { return props.cancelled && 'line-through'; });
|
|
16
16
|
var AmountWrapper = styled__default["default"].div(templateObject_5 || (templateObject_5 = _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; });
|
|
17
17
|
var LabelWrapper = styled__default["default"].div(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", "px;\n position: relative;\n"], ["\n display: flex;\n align-items: center;\n gap: ", "px;\n position: relative;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
|
|
18
|
+
var CartSummaryTitle = styled__default["default"].div(templateObject_7 || (templateObject_7 = _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; });
|
|
19
|
+
var QuantitySpan = styled__default["default"].span(templateObject_8 || (templateObject_8 = _tslib.__makeTemplateObject(["\n color: ", ";\n font-size: ", "px;\n"], ["\n color: ", ";\n font-size: ", "px;\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; });
|
|
20
|
+
var TotalLine = styled__default["default"](CartLine)(templateObject_9 || (templateObject_9 = _tslib.__makeTemplateObject(["\n margin-top: ", "px;\n"], ["\n margin-top: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.md; });
|
|
21
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
23
22
|
|
|
24
23
|
exports.AmountWrapper = AmountWrapper;
|
|
25
24
|
exports.CartLine = CartLine;
|
|
@@ -29,6 +28,5 @@ exports.CartSummaryContent = CartSummaryContent;
|
|
|
29
28
|
exports.CartSummaryTitle = CartSummaryTitle;
|
|
30
29
|
exports.LabelWrapper = LabelWrapper;
|
|
31
30
|
exports.QuantitySpan = QuantitySpan;
|
|
32
|
-
exports.ToolTipButton = ToolTipButton;
|
|
33
31
|
exports.TotalLine = TotalLine;
|
|
34
32
|
//# 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _tslib = require('../../../../../_virtual/_tslib.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var designTokens = require('@citygross/design-tokens');
|
|
8
|
+
var icons = require('@citygross/icons');
|
|
9
|
+
var ToolTipButton_styles = require('./ToolTipButton.styles.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
+
|
|
15
|
+
var ToolTipButton = function (_a) {
|
|
16
|
+
var _b, _c;
|
|
17
|
+
var props = _tslib.__rest(_a, []);
|
|
18
|
+
return (React__default["default"].createElement(ToolTipButton_styles.ToolTipButton, _tslib.__assign({}, props),
|
|
19
|
+
React__default["default"].createElement(icons.Icons.Info, { "aria-hidden": "true", height: (_b = designTokens.theme.spacings) === null || _b === void 0 ? void 0 : _b.sm, width: (_c = designTokens.theme.spacings) === null || _c === void 0 ? void 0 : _c.sm })));
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.ToolTipButton = ToolTipButton;
|
|
23
|
+
//# sourceMappingURL=ToolTipButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolTipButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _tslib = require('../../../../../_virtual/_tslib.js');
|
|
6
|
+
var styled = require('styled-components');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
11
|
+
|
|
12
|
+
var ToolTipButton = styled__default["default"].button(templateObject_1 || (templateObject_1 = _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) {
|
|
13
|
+
var _b;
|
|
14
|
+
var theme = _a.theme;
|
|
15
|
+
return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxxs;
|
|
16
|
+
});
|
|
17
|
+
var templateObject_1;
|
|
18
|
+
|
|
19
|
+
exports.ToolTipButton = ToolTipButton;
|
|
20
|
+
//# sourceMappingURL=ToolTipButton.styles.js.map
|
package/build/cjs/components/src/components/CgButton/ToolTipButton/ToolTipButton.styles.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolTipButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _tslib = require('../../../../../_virtual/_tslib.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var icons = require('@citygross/icons');
|
|
8
|
-
var ScreenReader = require('../../ScreenReader/ScreenReader.js');
|
|
9
8
|
var typography = require('@citygross/typography');
|
|
10
9
|
var formElement = require('../../../helpers/form-element.js');
|
|
11
|
-
var
|
|
10
|
+
var ScreenReader = require('../../ScreenReader/ScreenReader.js');
|
|
12
11
|
var FormElement_styles = require('../FormElement.styles.js');
|
|
12
|
+
var Checkbox_styles = require('./Checkbox.styles.js');
|
|
13
13
|
|
|
14
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
15
|
|
|
@@ -23,7 +23,7 @@ var Checkbox = function (_a) {
|
|
|
23
23
|
React__default["default"].createElement(Checkbox_styles.CheckboxContainer, { attributes: attributes },
|
|
24
24
|
React__default["default"].createElement(Checkbox_styles.IconContainer, null,
|
|
25
25
|
React__default["default"].createElement(icons.Icons.CheckMark, { color: iconColor }))),
|
|
26
|
-
hideLabel ? (React__default["default"].createElement(ScreenReader.ScreenReader, { string: label })) : (React__default["default"].createElement(typography.BodyText, { color: labelColor
|
|
26
|
+
hideLabel ? (React__default["default"].createElement(ScreenReader.ScreenReader, { string: label })) : (React__default["default"].createElement(typography.BodyText, { color: labelColor }, label))));
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
exports.Checkbox = Checkbox;
|
|
@@ -82,7 +82,7 @@ var ErrorLabel = styled__default["default"].label(templateObject_4 || (templateO
|
|
|
82
82
|
var theme = _a.theme;
|
|
83
83
|
return (_c = (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.size) === null || _c === void 0 ? void 0 : _c.s2;
|
|
84
84
|
});
|
|
85
|
-
var OptionInputWrapper = styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n cursor: ", ";\n display: inline-flex;\n align-items:
|
|
85
|
+
var OptionInputWrapper = styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n cursor: ", ";\n display: inline-flex;\n align-items: flex-start;\n gap: ", "px;\n padding: ", "px;\n position: relative;\n\n &:has(input:focus-visible) {\n border-radius: ", "px;\n box-shadow: ", ";\n }\n"], ["\n cursor: ", ";\n display: inline-flex;\n align-items: flex-start;\n gap: ", "px;\n padding: ", "px;\n position: relative;\n\n &:has(input:focus-visible) {\n border-radius: ", "px;\n box-shadow: ", ";\n }\n"])), function (_a) {
|
|
86
86
|
var disabled = _a.disabled;
|
|
87
87
|
return (disabled ? 'not-allowed' : 'pointer');
|
|
88
88
|
}, function (_a) {
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _tslib = require('../../../../../_virtual/_tslib.js');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var ScreenReader = require('../../ScreenReader/ScreenReader.js');
|
|
8
7
|
var typography = require('@citygross/typography');
|
|
9
8
|
var formElement = require('../../../helpers/form-element.js');
|
|
10
|
-
var
|
|
9
|
+
var ScreenReader = require('../../ScreenReader/ScreenReader.js');
|
|
11
10
|
var FormElement_styles = require('../FormElement.styles.js');
|
|
11
|
+
var Radio_styles = require('./Radio.styles.js');
|
|
12
12
|
|
|
13
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
14
|
|
|
@@ -21,7 +21,7 @@ var Radio = function (_a) {
|
|
|
21
21
|
return (React__default["default"].createElement(FormElement_styles.OptionInputWrapper, { as: "label", disabled: disabled },
|
|
22
22
|
React__default["default"].createElement(FormElement_styles.HiddenInput, _tslib.__assign({ type: "radio", checked: checked, disabled: disabled }, props)),
|
|
23
23
|
React__default["default"].createElement(Radio_styles.RadioContainer, { attributes: attributes, borderSize: borderSize, checked: checked, disabled: disabled }),
|
|
24
|
-
showLabel ? (React__default["default"].createElement(typography.BodyText, { color: labelColor
|
|
24
|
+
showLabel ? (React__default["default"].createElement(typography.BodyText, { color: labelColor }, label)) : (React__default["default"].createElement(ScreenReader.ScreenReader, { string: label }))));
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
exports.Radio = Radio;
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var
|
|
6
|
+
var designTokens = require('@citygross/design-tokens');
|
|
7
7
|
var icons = require('@citygross/icons');
|
|
8
|
+
var utils = require('@citygross/utils');
|
|
8
9
|
var ToolTipDialog_styles = require('./ToolTipDialog.styles.js');
|
|
9
10
|
|
|
10
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -12,8 +13,9 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
12
13
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
14
|
|
|
14
15
|
var ToolTipDialog = function (_a) {
|
|
15
|
-
var
|
|
16
|
-
var
|
|
16
|
+
var _b, _c, _d;
|
|
17
|
+
var children = _a.children, id = _a.id, onBottom = _a.onBottom, toggle = _a.toggle;
|
|
18
|
+
var toolTipRef = React.useRef(null);
|
|
17
19
|
var isOpenRef = React.useRef(true);
|
|
18
20
|
var triggerElementRef = React.useRef(null);
|
|
19
21
|
React.useEffect(function () {
|
|
@@ -25,17 +27,17 @@ var ToolTipDialog = function (_a) {
|
|
|
25
27
|
}
|
|
26
28
|
toggle();
|
|
27
29
|
}, [toggle]);
|
|
28
|
-
utils.useOutsideClick(
|
|
30
|
+
utils.useOutsideClick(toolTipRef, handleClose);
|
|
29
31
|
React.useEffect(function () {
|
|
30
32
|
var focusTrapCleanup;
|
|
31
|
-
if (
|
|
33
|
+
if (toolTipRef.current) {
|
|
32
34
|
focusTrapCleanup = utils.focusTrap({
|
|
33
35
|
exitFunction: handleClose,
|
|
34
|
-
ref:
|
|
36
|
+
ref: toolTipRef
|
|
35
37
|
});
|
|
36
38
|
}
|
|
37
39
|
var handleKeyDown = function (event) {
|
|
38
|
-
if (event.key === 'Escape' && isOpenRef.current &&
|
|
40
|
+
if (event.key === 'Escape' && isOpenRef.current && toolTipRef.current) {
|
|
39
41
|
event.stopPropagation();
|
|
40
42
|
isOpenRef.current = false;
|
|
41
43
|
handleClose();
|
|
@@ -51,10 +53,10 @@ var ToolTipDialog = function (_a) {
|
|
|
51
53
|
}
|
|
52
54
|
};
|
|
53
55
|
}, [handleClose]);
|
|
54
|
-
return (React__default["default"].createElement(ToolTipDialog_styles.DialogContainer, { "aria-live": "polite", id: id, onBottom: onBottom, ref:
|
|
55
|
-
|
|
56
|
+
return (React__default["default"].createElement(ToolTipDialog_styles.DialogContainer, { "aria-live": "polite", id: id, onBottom: onBottom, ref: toolTipRef, role: "tooltip" },
|
|
57
|
+
children,
|
|
56
58
|
React__default["default"].createElement(ToolTipDialog_styles.DialogClose, { "aria-label": "St\u00E4ng", onClick: handleClose },
|
|
57
|
-
React__default["default"].createElement(icons.Icons.Cross, { "aria-hidden": "true", color:
|
|
59
|
+
React__default["default"].createElement(icons.Icons.Cross, { "aria-hidden": "true", color: (_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.white, height: (_c = designTokens.theme.spacings) === null || _c === void 0 ? void 0 : _c.sm2, width: (_d = designTokens.theme.spacings) === null || _d === void 0 ? void 0 : _d.sm2 }))));
|
|
58
60
|
};
|
|
59
61
|
|
|
60
62
|
exports.ToolTipDialog = ToolTipDialog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolTipDialog.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToolTipDialog.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -23,6 +23,7 @@ var CgButton = require('./components/CgButton/CgButton.js');
|
|
|
23
23
|
var CgButton_types = require('./components/CgButton/CgButton.types.js');
|
|
24
24
|
var ButtonAsLink = require('./components/CgButton/ButtonAsLink/ButtonAsLink.js');
|
|
25
25
|
var DivAsButton = require('./components/CgButton/DivAsButton/DivAsButton.js');
|
|
26
|
+
var ToolTipButton = require('./components/CgButton/ToolTipButton/ToolTipButton.js');
|
|
26
27
|
var Chip = require('./components/Chips/Chip.js');
|
|
27
28
|
var Collapsable = require('./components/Collapsable/Collapsable.js');
|
|
28
29
|
var CouponCode = require('./components/CouponCode/CouponCode.js');
|
|
@@ -149,6 +150,7 @@ Object.defineProperty(exports, 'EButtonVariant', {
|
|
|
149
150
|
});
|
|
150
151
|
exports.ButtonAsLink = ButtonAsLink.ButtonAsLink;
|
|
151
152
|
exports.DivAsButton = DivAsButton.DivAsButton;
|
|
153
|
+
exports.ToolTipButton = ToolTipButton.ToolTipButton;
|
|
152
154
|
exports.Chip = Chip.Chip;
|
|
153
155
|
exports.Collapsable = Collapsable.Collapsable;
|
|
154
156
|
exports.CouponCode = CouponCode.CouponCode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useState, useRef, useLayoutEffect, useEffect } from 'react';
|
|
2
2
|
import { theme } from '@citygross/design-tokens';
|
|
3
3
|
import { Icons } from '@citygross/icons';
|
|
4
|
-
import { BodyText } from '@citygross/typography';
|
|
5
4
|
import { Container, Header, Chevron, Content } from './Accordion.styles.js';
|
|
6
5
|
|
|
7
6
|
var Accordion = function (_a) {
|
|
@@ -54,7 +53,7 @@ var Accordion = function (_a) {
|
|
|
54
53
|
setIsOpen(true);
|
|
55
54
|
onToggle === null || onToggle === void 0 ? void 0 : onToggle(true);
|
|
56
55
|
}, type: "button" },
|
|
57
|
-
|
|
56
|
+
title,
|
|
58
57
|
React.createElement(Chevron, { "data-state": isOpen ? 'open' : 'collapsed' },
|
|
59
58
|
React.createElement(Icons.ChevronDown, { "aria-hidden": "true", height: (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.sm, width: (_c = theme.spacings) === null || _c === void 0 ? void 0 : _c.sm }))),
|
|
60
59
|
React.createElement(Content, { "aria-labelledby": headerId, "data-state": isOpen ? 'open' : 'collapsed', hidden: isCollapsed, id: contentId, maxHeight: isOpen ? contentHeight : 0, onTransitionEnd: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Accordion.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -6,13 +6,21 @@ var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplat
|
|
|
6
6
|
var theme = _a.theme;
|
|
7
7
|
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.light;
|
|
8
8
|
});
|
|
9
|
-
var Header = styled.button(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: none;\n border: 0;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ", ";\n text-align: left;\n width: 100%;\n"], ["\n background: none;\n border: 0;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ", ";\n text-align: left;\n width: 100%;\n"])), function (_a) {
|
|
9
|
+
var Header = styled.button(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: none;\n border: 0;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: ", "px;\n font-weight: ", ";\n padding: ", ";\n text-align: left;\n width: 100%;\n"], ["\n background: none;\n border: 0;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: ", "px;\n font-weight: ", ";\n padding: ", ";\n text-align: left;\n width: 100%;\n"])), function (_a) {
|
|
10
|
+
var _b, _c;
|
|
11
|
+
var theme = _a.theme;
|
|
12
|
+
return (_c = (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.size) === null || _c === void 0 ? void 0 : _c.s3;
|
|
13
|
+
}, function (_a) {
|
|
14
|
+
var _b, _c;
|
|
15
|
+
var theme = _a.theme;
|
|
16
|
+
return (_c = (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.weight) === null || _c === void 0 ? void 0 : _c.medium;
|
|
17
|
+
}, function (_a) {
|
|
10
18
|
var _b, _c;
|
|
11
19
|
var theme = _a.theme;
|
|
12
20
|
return "".concat((_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.sm, "px ").concat((_c = theme.spacings) === null || _c === void 0 ? void 0 : _c.md, "px");
|
|
13
21
|
});
|
|
14
22
|
var Chevron = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: inline-flex;\n transition: transform 200ms ease;\n\n &[data-state='open'] {\n transform: rotate(180deg);\n }\n"], ["\n display: inline-flex;\n transition: transform 200ms ease;\n\n &[data-state='open'] {\n transform: rotate(180deg);\n }\n"])));
|
|
15
|
-
var Content = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n max-height: ", "px;\n opacity: 0;\n overflow: hidden;\n padding: 0 ", "px;\n transition
|
|
23
|
+
var Content = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n max-height: ", "px;\n opacity: 0;\n overflow: hidden;\n padding: 0 ", "px;\n transition:\n max-height 220ms ease,\n opacity 200ms ease;\n\n &[data-state='open'] {\n opacity: 1;\n padding: ", ";\n }\n"], ["\n max-height: ", "px;\n opacity: 0;\n overflow: hidden;\n padding: 0 ", "px;\n transition:\n max-height 220ms ease,\n opacity 200ms ease;\n\n &[data-state='open'] {\n opacity: 1;\n padding: ", ";\n }\n"])), function (_a) {
|
|
16
24
|
var maxHeight = _a.maxHeight;
|
|
17
25
|
return maxHeight;
|
|
18
26
|
}, function (_a) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Accordion.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -22,9 +22,10 @@ import '@citygross/utils';
|
|
|
22
22
|
import 'react-loading-skeleton';
|
|
23
23
|
import '../CartItemSummary/CartItemSummary.styles.js';
|
|
24
24
|
import '../CartSubTotal/CartSubTotal.js';
|
|
25
|
+
import '../../../../design-tokens/build/index.js';
|
|
26
|
+
import '../CgButton/ToolTipButton/ToolTipButton.styles.js';
|
|
25
27
|
import '../ToolTipDialog/ToolTipDialog.styles.js';
|
|
26
28
|
import '../CartSummary/CartSummary.styles.js';
|
|
27
|
-
import '../../../../design-tokens/build/index.js';
|
|
28
29
|
import '../CgButton/ButtonAsLink/ButtonAsLink.styles.js';
|
|
29
30
|
import '../CgButton/CgButton.styles.js';
|
|
30
31
|
import '../Chips/Chip.styles.js';
|
|
@@ -41,10 +42,10 @@ import '../Fieldset/Fieldset.styles.js';
|
|
|
41
42
|
import '../Flex/Flex.styles.js';
|
|
42
43
|
import '../Form/Form.styles.js';
|
|
43
44
|
import '../FormControl/FormControl.js';
|
|
44
|
-
import '../ScreenReader/ScreenReader.styles.js';
|
|
45
45
|
import '../FormElements/FormElement.types.js';
|
|
46
|
-
import '../
|
|
46
|
+
import '../ScreenReader/ScreenReader.styles.js';
|
|
47
47
|
import '../FormElements/FormElement.styles.js';
|
|
48
|
+
import '../FormElements/Checkbox/Checkbox.styles.js';
|
|
48
49
|
import '../FormElements/Input/Input.js';
|
|
49
50
|
import '../FormElements/InputOld/InputOld.styles.js';
|
|
50
51
|
import '../FormElements/Radio/Radio.styles.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { theme } from '@citygross/design-tokens';
|
|
3
3
|
import { formatPriceWithNoZero } from '@citygross/utils';
|
|
4
|
+
import { ToolTipButton } from '../CgButton/ToolTipButton/ToolTipButton.js';
|
|
4
5
|
import { ToolTipDialog } from '../ToolTipDialog/ToolTipDialog.js';
|
|
5
|
-
import { CartSubTotalContainer, SubTotalLabel,
|
|
6
|
-
import { theme } from '@citygross/design-tokens';
|
|
6
|
+
import { CartSubTotalContainer, SubTotalLabel, Price } from './CartSubTotal.styles.js';
|
|
7
7
|
|
|
8
8
|
var ECartSubTotalTypes;
|
|
9
9
|
(function (ECartSubTotalTypes) {
|
|
@@ -27,12 +27,11 @@ var CartSubTotal = function (_a) {
|
|
|
27
27
|
React.createElement(SubTotalLabel, null,
|
|
28
28
|
label,
|
|
29
29
|
children,
|
|
30
|
-
React.createElement(ToolTipButton, { "aria-expanded": infoOpen, "aria-label": tooltipAriaLabel, "aria-describedby": infoOpen ? tooltipId : undefined, onClick: handleTooltipClick },
|
|
31
|
-
React.createElement(Icons.Info, { "aria-hidden": "true", height: 16, width: 16 }))),
|
|
30
|
+
React.createElement(ToolTipButton, { "aria-expanded": infoOpen, "aria-label": tooltipAriaLabel, "aria-describedby": infoOpen ? tooltipId : undefined, onClick: handleTooltipClick })),
|
|
32
31
|
React.createElement(Price, { priceColor: priceColor }, (value !== 0 && !value) || isNaN(value)
|
|
33
32
|
? '-'
|
|
34
33
|
: "".concat(fromPrice ? 'Från ' : '').concat(formattedPrice, " kr")),
|
|
35
|
-
infoOpen && (React.createElement(ToolTipDialog, { id: tooltipId,
|
|
34
|
+
infoOpen && (React.createElement(ToolTipDialog, { id: tooltipId, onBottom: infoOnBottom, toggle: toggleInfoOpen }, info)))) : (React.createElement(CartSubTotalContainer, { type: type },
|
|
36
35
|
React.createElement(SubTotalLabel, null,
|
|
37
36
|
label,
|
|
38
37
|
children),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartSubTotal.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CartSubTotal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -18,16 +18,11 @@ var SubTotalLabel = styled.div(templateObject_2 || (templateObject_2 = __makeTem
|
|
|
18
18
|
var theme = _a.theme;
|
|
19
19
|
return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
|
|
20
20
|
});
|
|
21
|
-
var
|
|
22
|
-
var _b;
|
|
23
|
-
var theme = _a.theme;
|
|
24
|
-
return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxxs;
|
|
25
|
-
});
|
|
26
|
-
var Price = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (_a) {
|
|
21
|
+
var Price = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (_a) {
|
|
27
22
|
var priceColor = _a.priceColor;
|
|
28
23
|
return priceColor;
|
|
29
24
|
});
|
|
30
|
-
var templateObject_1, templateObject_2, templateObject_3
|
|
25
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
31
26
|
|
|
32
|
-
export { CartSubTotalContainer, Price, SubTotalLabel
|
|
27
|
+
export { CartSubTotalContainer, Price, SubTotalLabel };
|
|
33
28
|
//# sourceMappingURL=CartSubTotal.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartSubTotal.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CartSubTotal.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __rest } from '../../../../_virtual/_tslib.js';
|
|
2
|
-
import { formatPrice } from '@citygross/utils';
|
|
3
2
|
import React, { useState, Fragment } from 'react';
|
|
4
|
-
import { Icons } from '@citygross/icons';
|
|
5
|
-
import { ToolTipDialog } from '../ToolTipDialog/ToolTipDialog.js';
|
|
6
|
-
import { CartSummaryContainer, CartPaymentContainer, CartSummaryTitle, CartSummaryContent, CartLine, QuantitySpan, AmountWrapper, TotalLine, LabelWrapper, ToolTipButton } from './CartSummary.styles.js';
|
|
7
3
|
import { H3, BodyText, TextTypes } from '@citygross/typography';
|
|
4
|
+
import { formatPrice } from '@citygross/utils';
|
|
8
5
|
import { theme as theme_1 } from '../../../../design-tokens/build/index.js';
|
|
6
|
+
import { ToolTipButton } from '../CgButton/ToolTipButton/ToolTipButton.js';
|
|
7
|
+
import { ToolTipDialog } from '../ToolTipDialog/ToolTipDialog.js';
|
|
8
|
+
import { CartSummaryContainer, CartPaymentContainer, CartSummaryTitle, CartSummaryContent, CartLine, QuantitySpan, AmountWrapper, TotalLine, LabelWrapper } 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) {
|
|
@@ -45,12 +45,6 @@ function CartSummary(_a) {
|
|
|
45
45
|
if (charges.length > 0) {
|
|
46
46
|
summaryParts.push("".concat(charges.length, " avgifter"));
|
|
47
47
|
}
|
|
48
|
-
var summaryText = summaryParts.length > 0
|
|
49
|
-
? "".concat(summaryParts.join(', '), ". ").concat(totalLabel, " ").concat(formatPrice(cartSummary.totalAmount))
|
|
50
|
-
: "".concat(totalLabel, " ").concat(formatPrice(cartSummary.totalAmount));
|
|
51
|
-
cartSummary.totalDiscount > 0
|
|
52
|
-
? "".concat(summaryText, ". ").concat(saveLabel, " ").concat(formatPrice(cartSummary.totalDiscount))
|
|
53
|
-
: summaryText;
|
|
54
48
|
var ChargeLine = function (_a) {
|
|
55
49
|
var _b, _c;
|
|
56
50
|
var charge = _a.charge;
|
|
@@ -66,9 +60,8 @@ function CartSummary(_a) {
|
|
|
66
60
|
React.createElement(LabelWrapper, null,
|
|
67
61
|
React.createElement(BodyText, null, chargeName),
|
|
68
62
|
charge.info && (React.createElement(Fragment, null,
|
|
69
|
-
React.createElement(ToolTipButton, { "aria-expanded": infoOpen, "aria-label": charge.tooltipAriaLabel || "Mer information om ".concat(chargeName), "aria-describedby": infoOpen ? tooltipId : undefined, onClick: toggleInfoOpen },
|
|
70
|
-
|
|
71
|
-
infoOpen && (React.createElement(ToolTipDialog, { id: tooltipId, info: charge.info, toggle: toggleInfoOpen }))))),
|
|
63
|
+
React.createElement(ToolTipButton, { "aria-expanded": infoOpen, "aria-label": charge.tooltipAriaLabel || "Mer information om ".concat(chargeName), "aria-describedby": infoOpen ? tooltipId : undefined, onClick: toggleInfoOpen }),
|
|
64
|
+
infoOpen && (React.createElement(ToolTipDialog, { id: tooltipId, toggle: toggleInfoOpen }, charge.info))))),
|
|
72
65
|
React.createElement(AmountWrapper, null,
|
|
73
66
|
charge.cancelledAmount > 0 && (React.createElement(BodyText, { lineThrough: true, color: (_c = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _c === void 0 ? void 0 : _c.dark, "aria-label": "Original price ".concat(formatPrice(charge.cancelledAmount)) }, formatPrice(charge.cancelledAmount))),
|
|
74
67
|
React.createElement(BodyText, { "aria-label": "".concat(chargeName, " ").concat(formatPrice(charge.amount)) }, formatPrice(charge.amount)))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -7,11 +7,10 @@ var CartSummaryContent = styled.div(templateObject_3 || (templateObject_3 = __ma
|
|
|
7
7
|
var CartLine = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n text-decoration: ", ";\n"], ["\n display: flex;\n justify-content: space-between;\n text-decoration: ", ";\n"])), function (props) { return props.cancelled && 'line-through'; });
|
|
8
8
|
var AmountWrapper = styled.div(templateObject_5 || (templateObject_5 = __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; });
|
|
9
9
|
var LabelWrapper = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", "px;\n position: relative;\n"], ["\n display: flex;\n align-items: center;\n gap: ", "px;\n position: relative;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
|
|
10
|
+
var CartSummaryTitle = styled.div(templateObject_7 || (templateObject_7 = __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; });
|
|
11
|
+
var QuantitySpan = styled.span(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n color: ", ";\n font-size: ", "px;\n"], ["\n color: ", ";\n font-size: ", "px;\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; });
|
|
12
|
+
var TotalLine = styled(CartLine)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n margin-top: ", "px;\n"], ["\n margin-top: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.md; });
|
|
13
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
15
14
|
|
|
16
|
-
export { AmountWrapper, CartLine, CartPaymentContainer, CartSummaryContainer, CartSummaryContent, CartSummaryTitle, LabelWrapper, QuantitySpan,
|
|
15
|
+
export { AmountWrapper, CartLine, CartPaymentContainer, CartSummaryContainer, CartSummaryContent, CartSummaryTitle, LabelWrapper, QuantitySpan, TotalLine };
|
|
17
16
|
//# 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":";;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { __rest, __assign } from '../../../../../_virtual/_tslib.js';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { theme } from '@citygross/design-tokens';
|
|
4
|
+
import { Icons } from '@citygross/icons';
|
|
5
|
+
import { ToolTipButton as ToolTipButton$1 } from './ToolTipButton.styles.js';
|
|
6
|
+
|
|
7
|
+
var ToolTipButton = function (_a) {
|
|
8
|
+
var _b, _c;
|
|
9
|
+
var props = __rest(_a, []);
|
|
10
|
+
return (React.createElement(ToolTipButton$1, __assign({}, props),
|
|
11
|
+
React.createElement(Icons.Info, { "aria-hidden": "true", height: (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.sm, width: (_c = theme.spacings) === null || _c === void 0 ? void 0 : _c.sm })));
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { ToolTipButton };
|
|
15
|
+
//# sourceMappingURL=ToolTipButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolTipButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __makeTemplateObject } from '../../../../../_virtual/_tslib.js';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
var ToolTipButton = styled.button(templateObject_1 || (templateObject_1 = __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) {
|
|
5
|
+
var _b;
|
|
6
|
+
var theme = _a.theme;
|
|
7
|
+
return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxxs;
|
|
8
|
+
});
|
|
9
|
+
var templateObject_1;
|
|
10
|
+
|
|
11
|
+
export { ToolTipButton };
|
|
12
|
+
//# sourceMappingURL=ToolTipButton.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolTipButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __rest, __assign } from '../../../../../_virtual/_tslib.js';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Icons } from '@citygross/icons';
|
|
4
|
-
import {
|
|
5
|
-
import { BodyText, TextTypes } from '@citygross/typography';
|
|
4
|
+
import { BodyText } from '@citygross/typography';
|
|
6
5
|
import { getColorAttributes } from '../../../helpers/form-element.js';
|
|
7
|
-
import {
|
|
6
|
+
import { ScreenReader } from '../../ScreenReader/ScreenReader.js';
|
|
8
7
|
import { OptionInputWrapper, HiddenInput } from '../FormElement.styles.js';
|
|
8
|
+
import { CheckboxContainer, IconContainer } from './Checkbox.styles.js';
|
|
9
9
|
|
|
10
10
|
var Checkbox = function (_a) {
|
|
11
11
|
var checked = _a.checked, disabled = _a.disabled, hideLabel = _a.hideLabel, label = _a.label, props = __rest(_a, ["checked", "disabled", "hideLabel", "label"]);
|
|
@@ -15,7 +15,7 @@ var Checkbox = function (_a) {
|
|
|
15
15
|
React.createElement(CheckboxContainer, { attributes: attributes },
|
|
16
16
|
React.createElement(IconContainer, null,
|
|
17
17
|
React.createElement(Icons.CheckMark, { color: iconColor }))),
|
|
18
|
-
hideLabel ? (React.createElement(ScreenReader, { string: label })) : (React.createElement(BodyText, { color: labelColor
|
|
18
|
+
hideLabel ? (React.createElement(ScreenReader, { string: label })) : (React.createElement(BodyText, { color: labelColor }, label))));
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export { Checkbox };
|
|
@@ -74,7 +74,7 @@ var ErrorLabel = styled.label(templateObject_4 || (templateObject_4 = __makeTemp
|
|
|
74
74
|
var theme = _a.theme;
|
|
75
75
|
return (_c = (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.size) === null || _c === void 0 ? void 0 : _c.s2;
|
|
76
76
|
});
|
|
77
|
-
var OptionInputWrapper = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n cursor: ", ";\n display: inline-flex;\n align-items:
|
|
77
|
+
var OptionInputWrapper = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n cursor: ", ";\n display: inline-flex;\n align-items: flex-start;\n gap: ", "px;\n padding: ", "px;\n position: relative;\n\n &:has(input:focus-visible) {\n border-radius: ", "px;\n box-shadow: ", ";\n }\n"], ["\n cursor: ", ";\n display: inline-flex;\n align-items: flex-start;\n gap: ", "px;\n padding: ", "px;\n position: relative;\n\n &:has(input:focus-visible) {\n border-radius: ", "px;\n box-shadow: ", ";\n }\n"])), function (_a) {
|
|
78
78
|
var disabled = _a.disabled;
|
|
79
79
|
return (disabled ? 'not-allowed' : 'pointer');
|
|
80
80
|
}, function (_a) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __rest, __assign } from '../../../../../_virtual/_tslib.js';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { BodyText, TextTypes } from '@citygross/typography';
|
|
3
|
+
import { BodyText } from '@citygross/typography';
|
|
5
4
|
import { getColorAttributes, getBorderSize } from '../../../helpers/form-element.js';
|
|
6
|
-
import {
|
|
5
|
+
import { ScreenReader } from '../../ScreenReader/ScreenReader.js';
|
|
7
6
|
import { OptionInputWrapper, HiddenInput } from '../FormElement.styles.js';
|
|
7
|
+
import { RadioContainer } from './Radio.styles.js';
|
|
8
8
|
|
|
9
9
|
var Radio = function (_a) {
|
|
10
10
|
var checked = _a.checked, disabled = _a.disabled, label = _a.label, showLabel = _a.showLabel, props = __rest(_a, ["checked", "disabled", "label", "showLabel"]);
|
|
@@ -13,7 +13,7 @@ var Radio = function (_a) {
|
|
|
13
13
|
return (React.createElement(OptionInputWrapper, { as: "label", disabled: disabled },
|
|
14
14
|
React.createElement(HiddenInput, __assign({ type: "radio", checked: checked, disabled: disabled }, props)),
|
|
15
15
|
React.createElement(RadioContainer, { attributes: attributes, borderSize: borderSize, checked: checked, disabled: disabled }),
|
|
16
|
-
showLabel ? (React.createElement(BodyText, { color: labelColor
|
|
16
|
+
showLabel ? (React.createElement(BodyText, { color: labelColor }, label)) : (React.createElement(ScreenReader, { string: label }))));
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export { Radio };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useCallback } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { theme } from '@citygross/design-tokens';
|
|
3
3
|
import { Icons } from '@citygross/icons';
|
|
4
|
+
import { useOutsideClick, focusTrap } from '@citygross/utils';
|
|
4
5
|
import { DialogContainer, DialogClose } from './ToolTipDialog.styles.js';
|
|
5
6
|
|
|
6
7
|
var ToolTipDialog = function (_a) {
|
|
7
|
-
var
|
|
8
|
-
var
|
|
8
|
+
var _b, _c, _d;
|
|
9
|
+
var children = _a.children, id = _a.id, onBottom = _a.onBottom, toggle = _a.toggle;
|
|
10
|
+
var toolTipRef = useRef(null);
|
|
9
11
|
var isOpenRef = useRef(true);
|
|
10
12
|
var triggerElementRef = useRef(null);
|
|
11
13
|
useEffect(function () {
|
|
@@ -17,17 +19,17 @@ var ToolTipDialog = function (_a) {
|
|
|
17
19
|
}
|
|
18
20
|
toggle();
|
|
19
21
|
}, [toggle]);
|
|
20
|
-
useOutsideClick(
|
|
22
|
+
useOutsideClick(toolTipRef, handleClose);
|
|
21
23
|
useEffect(function () {
|
|
22
24
|
var focusTrapCleanup;
|
|
23
|
-
if (
|
|
25
|
+
if (toolTipRef.current) {
|
|
24
26
|
focusTrapCleanup = focusTrap({
|
|
25
27
|
exitFunction: handleClose,
|
|
26
|
-
ref:
|
|
28
|
+
ref: toolTipRef
|
|
27
29
|
});
|
|
28
30
|
}
|
|
29
31
|
var handleKeyDown = function (event) {
|
|
30
|
-
if (event.key === 'Escape' && isOpenRef.current &&
|
|
32
|
+
if (event.key === 'Escape' && isOpenRef.current && toolTipRef.current) {
|
|
31
33
|
event.stopPropagation();
|
|
32
34
|
isOpenRef.current = false;
|
|
33
35
|
handleClose();
|
|
@@ -43,10 +45,10 @@ var ToolTipDialog = function (_a) {
|
|
|
43
45
|
}
|
|
44
46
|
};
|
|
45
47
|
}, [handleClose]);
|
|
46
|
-
return (React.createElement(DialogContainer, { "aria-live": "polite", id: id, onBottom: onBottom, ref:
|
|
47
|
-
|
|
48
|
+
return (React.createElement(DialogContainer, { "aria-live": "polite", id: id, onBottom: onBottom, ref: toolTipRef, role: "tooltip" },
|
|
49
|
+
children,
|
|
48
50
|
React.createElement(DialogClose, { "aria-label": "St\u00E4ng", onClick: handleClose },
|
|
49
|
-
React.createElement(Icons.Cross, { "aria-hidden": "true", color:
|
|
51
|
+
React.createElement(Icons.Cross, { "aria-hidden": "true", color: (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.white, height: (_c = theme.spacings) === null || _c === void 0 ? void 0 : _c.sm2, width: (_d = theme.spacings) === null || _d === void 0 ? void 0 : _d.sm2 }))));
|
|
50
52
|
};
|
|
51
53
|
|
|
52
54
|
export { ToolTipDialog };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolTipDialog.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToolTipDialog.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -19,6 +19,7 @@ export { CgButton } from './components/CgButton/CgButton.js';
|
|
|
19
19
|
export { EButtonSize, EButtonVariant } from './components/CgButton/CgButton.types.js';
|
|
20
20
|
export { ButtonAsLink } from './components/CgButton/ButtonAsLink/ButtonAsLink.js';
|
|
21
21
|
export { DivAsButton } from './components/CgButton/DivAsButton/DivAsButton.js';
|
|
22
|
+
export { ToolTipButton } from './components/CgButton/ToolTipButton/ToolTipButton.js';
|
|
22
23
|
export { Chip } from './components/Chips/Chip.js';
|
|
23
24
|
export { Collapsable } from './components/Collapsable/Collapsable.js';
|
|
24
25
|
export { CouponCode, ECouponCodeStatus } from './components/CouponCode/CouponCode.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citygross/components",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.5",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./build/cjs/components/src/index.js",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"react-slick": "^0.30.1",
|
|
76
76
|
"slick-carousel": "^1.8.1"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "78a4d8252a80d5fbe3460b0c67d6c28d7b25b2bc"
|
|
79
79
|
}
|