@citygross/components 0.7.53 → 0.7.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/build/@types/components/CartItemSummary/CartItemSummary.d.ts +3 -1
  2. package/build/@types/components/Header/Header.d.ts +1 -1
  3. package/build/@types/components/Logo/Logo.d.ts +1 -1
  4. package/build/@types/components/WarningLabel/WarningLabel.d.ts +2 -1
  5. package/build/@types/components/WarningLabel/WarningLabel.styles.d.ts +4 -2
  6. package/build/cjs/components/src/components/CartItemSummary/CartItemSummary.js +4 -4
  7. package/build/cjs/components/src/components/Header/Header.js +3 -3
  8. package/build/cjs/components/src/components/Logo/Logo.styles.js +1 -1
  9. package/build/cjs/components/src/components/WarningLabel/WarningLabel.js +69 -2
  10. package/build/cjs/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
  11. package/build/cjs/components/src/components/WarningLabel/WarningLabel.styles.js +5 -2
  12. package/build/cjs/components/src/components/WarningLabel/WarningLabel.styles.js.map +1 -1
  13. package/build/cjs/utils/build/index.js +5 -3
  14. package/build/cjs/utils/build/index.js.map +1 -1
  15. package/build/es/components/src/components/CartItemSummary/CartItemSummary.js +4 -4
  16. package/build/es/components/src/components/Header/Header.js +3 -3
  17. package/build/es/components/src/components/Logo/Logo.styles.js +1 -1
  18. package/build/es/components/src/components/WarningLabel/WarningLabel.js +70 -3
  19. package/build/es/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
  20. package/build/es/components/src/components/WarningLabel/WarningLabel.styles.js +5 -2
  21. package/build/es/components/src/components/WarningLabel/WarningLabel.styles.js.map +1 -1
  22. package/build/es/utils/build/index.js +5 -3
  23. package/build/es/utils/build/index.js.map +1 -1
  24. package/package.json +3 -3
@@ -1,5 +1,7 @@
1
1
  import { TSummaryItem } from '../CartSummary/CartSummary';
2
2
  export declare type TCartItemSummary = {
3
3
  product: TSummaryItem;
4
+ withParenthesis?: boolean;
5
+ unit?: string;
4
6
  };
5
- export declare function CartItemSummary({ product }: TCartItemSummary): JSX.Element;
7
+ export declare function CartItemSummary({ product, withParenthesis, unit }: TCartItemSummary): JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  export declare type THeader = {
3
- logoImage: JSX.Element;
3
+ logoImage?: JSX.Element;
4
4
  logOut?: () => void;
5
5
  logOutLabel?: string;
6
6
  children?: ReactNode;
@@ -1,4 +1,4 @@
1
1
  export declare type TLogo = {
2
- logoImage: JSX.Element;
2
+ logoImage?: JSX.Element;
3
3
  };
4
4
  export declare function Logo({ logoImage }: TLogo): JSX.Element;
@@ -2,5 +2,6 @@ import React from 'react';
2
2
  export declare type TWarningLabel = {
3
3
  children: React.ReactNode;
4
4
  background: string;
5
+ toolTip?: React.ReactNode;
5
6
  };
6
- export declare function WarningLabel({ children, background }: TWarningLabel): JSX.Element;
7
+ export declare function WarningLabel({ children, background, toolTip }: TWarningLabel): JSX.Element;
@@ -1,4 +1,6 @@
1
- export declare type TSlotReservationIndicator = {
1
+ /// <reference types="react" />
2
+ export declare type TWarningIndicator = {
2
3
  background?: string;
4
+ toolTip?: React.ReactNode;
3
5
  };
4
- export declare const SlotReservationIndicator: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TSlotReservationIndicator, never>;
6
+ export declare const WarningIndicator: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TWarningIndicator, never>;
@@ -14,17 +14,17 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
14
  var Skeleton__default = /*#__PURE__*/_interopDefaultLegacy(Skeleton);
15
15
 
16
16
  function CartItemSummary(_a) {
17
- var product = _a.product;
17
+ var product = _a.product, withParenthesis = _a.withParenthesis, _b = _a.unit, unit = _b === void 0 ? "st" : _b;
18
18
  return (React__default['default'].createElement(CartItemSummary_styles.CartItemSummaryWrapper, null,
19
19
  product &&
20
20
  (product.amount === 0 || product.amount) &&
21
21
  (product === null || product === void 0 ? void 0 : product.cancelledQuantity) !== 0 &&
22
22
  (product === null || product === void 0 ? void 0 : product.cancelledQuantity) && (React__default['default'].createElement(CartItemSummary_styles.CancelledWrapper, null,
23
23
  React__default['default'].createElement(typography.BodyText, { size: typography.TextTypes.TextSize.SMALL, lineThrough: true }, (product === null || product === void 0 ? void 0 : product.cancelledQuantity) ? (product.cancelledQuantity + " st") : (React__default['default'].createElement(Skeleton__default['default'], { width: 100 }))),
24
- React__default['default'].createElement(CartItemSummary_styles.AmountText, { lineThrough: true }, product ? (utils.formatPrice(product.cancelledAmount)) : (React__default['default'].createElement(Skeleton__default['default'], { width: 100 }))))),
24
+ React__default['default'].createElement(CartItemSummary_styles.AmountText, { lineThrough: true, fontWeight: withParenthesis ? 'regular' : 'semiBold' }, product ? (utils.formatPrice(product.cancelledAmount, withParenthesis)) : (React__default['default'].createElement(Skeleton__default['default'], { width: 100 }))))),
25
25
  React__default['default'].createElement(CartItemSummary_styles.ItemInformationContainer, null,
26
- React__default['default'].createElement(typography.BodyText, { size: typography.TextTypes.TextSize.SMALL }, (product === null || product === void 0 ? void 0 : product.quantity) || (product === null || product === void 0 ? void 0 : product.quantity) === 0 ? (product.quantity + " st") : (React__default['default'].createElement(Skeleton__default['default'], { width: 100 }))),
27
- React__default['default'].createElement(CartItemSummary_styles.AmountText, null, product ? utils.formatPrice(product.amount) : React__default['default'].createElement(Skeleton__default['default'], { width: 100 })))));
26
+ React__default['default'].createElement(typography.BodyText, { size: typography.TextTypes.TextSize.SMALL }, (product === null || product === void 0 ? void 0 : product.quantity) || (product === null || product === void 0 ? void 0 : product.quantity) === 0 ? (product.quantity + " " + unit) : (React__default['default'].createElement(Skeleton__default['default'], { width: 100 }))),
27
+ React__default['default'].createElement(CartItemSummary_styles.AmountText, { fontWeight: withParenthesis ? 'regular' : 'semiBold' }, product ? (utils.formatPrice(product.amount, withParenthesis)) : (React__default['default'].createElement(Skeleton__default['default'], { width: 100 }))))));
28
28
  }
29
29
 
30
30
  exports.CartItemSummary = CartItemSummary;
@@ -21,10 +21,10 @@ function Header(_a) {
21
21
  var device = utils.useDetectDevice();
22
22
  return (React__default['default'].createElement(Header_styles.Wrapper, null,
23
23
  topLinkLabel && topLinkHref && (React__default['default'].createElement(HeaderLink.HeaderLink, { linkHref: topLinkHref, icon: React__default['default'].createElement(Icon.Icons.ChevronLeft, { width: 20, height: 20, color: (_c = designTokens.theme.palette) === null || _c === void 0 ? void 0 : _c.white }), linkLabel: topLinkLabel })),
24
- React__default['default'].createElement(Header_styles.HeaderWrapper, null,
24
+ (logoImage || logOutLabel) && (React__default['default'].createElement(Header_styles.HeaderWrapper, null,
25
25
  React__default['default'].createElement(Header_styles.HeaderContainer, { maxWidth: lowerContainerMaxWidth },
26
- React__default['default'].createElement(Logo.Logo, { logoImage: logoImage }),
27
- logOut && (React__default['default'].createElement(Button.Button, { onClick: function () { return logOut && logOut(); }, color: 'white', size: device.isMobile ? 'medium' : 'large' }, logOutLabel)))),
26
+ logoImage && React__default['default'].createElement(Logo.Logo, { logoImage: logoImage }),
27
+ logOut && (React__default['default'].createElement(Button.Button, { onClick: function () { return logOut && logOut(); }, color: 'white', size: device.isMobile ? 'medium' : 'large' }, logOutLabel))))),
28
28
  children && React__default['default'].createElement(Header_styles.MenuContainer, null, children)));
29
29
  }
30
30
 
@@ -9,7 +9,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
11
11
 
12
- var Logo = styled__default['default'].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n position: relative;\n\n width: 163px;\n height: 62px;\n"], ["\n display: flex;\n align-items: center;\n position: relative;\n\n width: 163px;\n height: 62px;\n"])));
12
+ var Logo = styled__default['default'].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n position: relative;\n"], ["\n display: flex;\n align-items: center;\n position: relative;\n"])));
13
13
  var templateObject_1;
14
14
 
15
15
  exports.Logo = Logo;
@@ -3,6 +3,71 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
+ require('@citygross/typography');
7
+ require('../AddressBlock/AddressBlock.styles.js');
8
+ require('../../../../design-tokens/build/index.js');
9
+ require('../AlertBox/AlertBox.styles.js');
10
+ require('../Button/Button.js');
11
+ require('@citygross/utils');
12
+ require('@citygross/design-tokens');
13
+ require('@citygross/icons');
14
+ require('../Logo/Logo.styles.js');
15
+ require('../Header/Header.styles.js');
16
+ require('../HeaderLink/HeaderLink.styles.js');
17
+ require('../BackgroundImage/BackgroundImage.styles.js');
18
+ require('../Badge/Badge.styles.js');
19
+ require('../Box/Box.styles.js');
20
+ require('../Button/Button.styles.js');
21
+ require('../BackButton/BackButton.styles.js');
22
+ require('react-loading-skeleton');
23
+ require('../CartItemSummary/CartItemSummary.styles.js');
24
+ require('../Divider/Divider.styles.js');
25
+ require('../CartSummary/CartSummary.styles.js');
26
+ require('../CustomerInfoBlock/CustomerInfoBlock.styles.js');
27
+ require('../Collapsable/Collapsable.styles.js');
28
+ require('../DeliverySlotItem/DeliverySlotItem.styles.js');
29
+ require('../Slider/Slider.styles.js');
30
+ require('../DeliveryTimeBlock/DeliveryTimeBlock.styles.js');
31
+ require('../Menu/Menu.styles.js');
32
+ require('../DateBox/DateBox.styles.js');
33
+ require('../DotIndicator/DotIndicator.styles.js');
34
+ require('../Form/Form.styles.js');
35
+ require('../FormControl/FormControl.js');
36
+ require('../FormElements/Checkbox/Checkbox.styles.js');
37
+ require('../FormElements/Input/Input.styles.js');
38
+ require('../FormElements/Radio/Radio.styles.js');
39
+ require('../FormElements/Switch/Switch.styles.js');
40
+ require('../FormGroup/FormGroup.styles.js');
41
+ require('../GridContainer/GridContainer.styles.js');
42
+ require('../HighlightBox/HighlightBox.styles.js');
43
+ require('../IconToolTip/IconToolTip.styles.js');
44
+ require('../Spacer/Spacer.styles.js');
45
+ require('../InfoTextBlock/InfoTextBlock.styles.js');
46
+ require('../LayoutBox/LayoutBox.styles.js');
47
+ require('../ListItem/ListItem.styles.js');
48
+ require('../ListItemWithRadio/ListItemWithRadio.styles.js');
49
+ require('../Links/Link.js');
50
+ require('react-dom');
51
+ require('../Modal/Modal.styles.js');
52
+ require('../RadioBox/RadioBoxItem.styles.js');
53
+ require('../RadioBox/RadioBoxList.styles.js');
54
+ require('../RadioGroup/RadioGroup.styles.js');
55
+ require('../RadioListItem/RadioListItem.styles.js');
56
+ require('../RippleContainer/RippleContainer.styles.js');
57
+ require('../Select/Select.styles.js');
58
+ require('../Spinner/Spinner.styles.js');
59
+ require('../Stepper/Stepper.styles.js');
60
+ var ToolTip = require('../ToolTip/ToolTip.js');
61
+ require('../StepperMobile/StepperMobile.styles.js');
62
+ require('../FormElements/TextArea/TextArea.styles.js');
63
+ require('../Table/Table.styles.js');
64
+ require('../Timeline/Timeline.styles.js');
65
+ require('../QuantitySelector/QuantitySelector.styles.js');
66
+ require('../Pagination/Pagination.styles.js');
67
+ require('../../containers/PageContainer/PageContainer.styles.js');
68
+ require('../../../../utils/build/index.js');
69
+ require('../../containers/TwoColumnsContainer/TwoColumnsPageContainer.styles.js');
70
+ require('../UnorderedList/UnorderedList.styles.js');
6
71
  var WarningLabel_styles = require('./WarningLabel.styles.js');
7
72
 
8
73
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -10,8 +75,10 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
10
75
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
76
 
12
77
  function WarningLabel(_a) {
13
- var children = _a.children, background = _a.background;
14
- return (React__default['default'].createElement(WarningLabel_styles.SlotReservationIndicator, { background: background }, children));
78
+ var children = _a.children, background = _a.background, toolTip = _a.toolTip;
79
+ return (React__default['default'].createElement(WarningLabel_styles.WarningIndicator, { background: background, toolTip: toolTip },
80
+ toolTip && React__default['default'].createElement(ToolTip.ToolTip, null, toolTip),
81
+ children));
15
82
  }
16
83
 
17
84
  exports.WarningLabel = WarningLabel;
@@ -1 +1 @@
1
- {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -9,8 +9,11 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
11
11
 
12
- var SlotReservationIndicator = styled__default['default'].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n padding: ", "px\n ", "px;\n background-color: ", ";\n border-radius: ", "px;\n display: inline-block;\n"], ["\n padding: ", "px\n ", "px;\n background-color: ", ";\n border-radius: ", "px;\n display: inline-block;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { return props.background; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.big; });
12
+ var WarningIndicator = styled__default['default'].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n padding: ", "px\n ", "px;\n background-color: ", ";\n border-radius: ", "px;\n display: inline-block;\n position: relative;\n ", ";\n"], ["\n padding: ", "px\n ", "px;\n background-color: ", ";\n border-radius: ", "px;\n display: inline-block;\n position: relative;\n ", ";\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { return props.background; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.big; }, function (props) {
13
+ return props.toolTip &&
14
+ "\n > {\n &:first-child {\n display: none;\n }\n }\n\n &:hover {\n > {\n &:first-child {\n display: block;\n }\n }\n }\n ";
15
+ });
13
16
  var templateObject_1;
14
17
 
15
- exports.SlotReservationIndicator = SlotReservationIndicator;
18
+ exports.WarningIndicator = WarningIndicator;
16
19
  //# sourceMappingURL=WarningLabel.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WarningLabel.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"WarningLabel.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
@@ -18,12 +18,14 @@ function _interopDefaultLegacy$1 (e) { return e && typeof e === 'object' && 'def
18
18
 
19
19
  var React__default = /*#__PURE__*/_interopDefaultLegacy$1(React);
20
20
 
21
- var formatPrice = function (price) {
21
+ var formatPrice = function (price, withParenthesis) {
22
22
  if (price === null || price === undefined) {
23
23
  return;
24
24
  }
25
- var formattedPrice = (Math.round(price * 100) / 100).toFixed(2);
26
- return formattedPrice.replace('.', ',') + " kr";
25
+ var formattedPrice = (Math.round(price * 100) / 100)
26
+ .toFixed(2)
27
+ .replace('.', ',');
28
+ return (withParenthesis ? "(" + formattedPrice + ")" : formattedPrice) + " kr";
27
29
  };
28
30
 
29
31
  var capitalizeFirstLetter = function (string) {