@citygross/components 0.8.74 → 0.8.76

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.
@@ -6,6 +6,7 @@ export declare type TPriceStripeSizeAttributes = {
6
6
  export declare type TPriceStripe = {
7
7
  multiPrice?: number;
8
8
  size?: EPriceSize;
9
+ unit?: string;
9
10
  variant?: EPriceVariant;
10
11
  };
11
12
  export declare const PriceStripe: React.FunctionComponent<TPriceStripe>;
@@ -12,11 +12,11 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
12
12
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
13
 
14
14
  var PriceStripe = function (_a) {
15
- var multiPrice = _a.multiPrice, _b = _a.size, size = _b === void 0 ? PriceTag_types.EPriceSize.MEDIUM : _b, variant = _a.variant;
15
+ var multiPrice = _a.multiPrice, _b = _a.size, size = _b === void 0 ? PriceTag_types.EPriceSize.MEDIUM : _b, unit = _a.unit, variant = _a.variant;
16
16
  var _c = price.getPriceStripeAttributes(size, variant), sizeAttributes = _c.sizeAttributes, variantAttributes = _c.variantAttributes;
17
17
  var isMultiPrice = multiPrice && multiPrice > 1;
18
18
  var stripeText = isMultiPrice
19
- ? "".concat(variant === PriceTag_types.EPriceVariant.KLIPP ? variant + ' ' : '').concat(multiPrice, " f\u00F6r")
19
+ ? "".concat(variant === PriceTag_types.EPriceVariant.KLIPP ? variant + ' ' : '').concat(multiPrice, " ").concat(unit === 'kg' ? unit : '', " f\u00F6r")
20
20
  : variant;
21
21
  return (React__default["default"].createElement(PriceStripe_styles.PriceStripe, { backgroundColor: variantAttributes.backgroundColor, fontColor: variantAttributes.fontColor, fontSize: sizeAttributes.fontSize }, stripeText));
22
22
  };
@@ -21,10 +21,12 @@ var PriceTag = function (_a) {
21
21
  var priceBase = Math.floor(price$1);
22
22
  var priceDecimals = (price$1 % 1).toFixed(2).split('.')[1];
23
23
  var showPriceIndicator = priceDecimals === '00';
24
- var showUnit = pant || (unit !== undefined && !(isMultiPrice && unit === 'st'));
24
+ var showUnit = pant ||
25
+ (unit !== undefined &&
26
+ !((isMultiPrice && unit === 'st') || (isMultiPrice && unit === 'kg')));
25
27
  return (React__default["default"].createElement(PriceTag_styles.PriceTagWrapper, { fontColor: variantAttributes.fontColor },
26
28
  variant !== PriceTag_types.EPriceVariant.REGULAR && (React__default["default"].createElement(PriceTag_styles.PriceStripeContainer, null,
27
- React__default["default"].createElement(PriceStripe.PriceStripe, { multiPrice: multiPrice, size: size, variant: variant }))),
29
+ React__default["default"].createElement(PriceStripe.PriceStripe, { multiPrice: multiPrice, size: size, unit: unit, variant: variant }))),
28
30
  React__default["default"].createElement(PriceTag_styles.PriceTagContainer, { backgroundColor: variantAttributes.backgroundColor },
29
31
  React__default["default"].createElement(PriceTag_styles.PriceTag, null,
30
32
  React__default["default"].createElement(PriceTag_styles.PriceBase, { fontSize: sizeAttributes.baseFontSize }, priceBase),
@@ -1 +1 @@
1
- {"version":3,"file":"PriceTag.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"PriceTag.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -40,11 +40,7 @@ var PriceTagWrapper = styled__default["default"].div(templateObject_3 || (templa
40
40
  var theme = _a.theme;
41
41
  return (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint;
42
42
  });
43
- var ButtonWrapper = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n grid-area: ButtonWrapper;\n display: flex;\n align-items: center;\n gap: ", "px;\n justify-self: end;\n min-width: ", "px;\n\n @media (min-width: ", "px) {\n flex-direction: column;\n gap: ", "px;\n margin-top: -", "px;\n }\n"], ["\n grid-area: ButtonWrapper;\n display: flex;\n align-items: center;\n gap: ", "px;\n justify-self: end;\n min-width: ", "px;\n\n @media (min-width: ", "px) {\n flex-direction: column;\n gap: ", "px;\n margin-top: -", "px;\n }\n"])), function (_a) {
44
- var _b;
45
- var theme = _a.theme;
46
- return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.sm;
47
- }, function (_a) {
43
+ var ButtonWrapper = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n grid-area: ButtonWrapper;\n display: flex;\n align-items: center;\n justify-self: end;\n min-width: ", "px;\n\n @media (min-width: ", "px) {\n flex-direction: column;\n gap: ", "px;\n margin-top: -", "px;\n }\n"], ["\n grid-area: ButtonWrapper;\n display: flex;\n align-items: center;\n justify-self: end;\n min-width: ", "px;\n\n @media (min-width: ", "px) {\n flex-direction: column;\n gap: ", "px;\n margin-top: -", "px;\n }\n"])), function (_a) {
48
44
  var _b;
49
45
  var theme = _a.theme;
50
46
  return (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.buttonWrapperMinWidth;
@@ -1 +1 @@
1
- {"version":3,"file":"SearchListItem.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SearchListItem.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,11 +4,11 @@ import { PriceStripe as PriceStripe$1 } from './PriceStripe.styles.js';
4
4
  import { EPriceSize, EPriceVariant } from '../PriceTag/PriceTag.types.js';
5
5
 
6
6
  var PriceStripe = function (_a) {
7
- var multiPrice = _a.multiPrice, _b = _a.size, size = _b === void 0 ? EPriceSize.MEDIUM : _b, variant = _a.variant;
7
+ var multiPrice = _a.multiPrice, _b = _a.size, size = _b === void 0 ? EPriceSize.MEDIUM : _b, unit = _a.unit, variant = _a.variant;
8
8
  var _c = getPriceStripeAttributes(size, variant), sizeAttributes = _c.sizeAttributes, variantAttributes = _c.variantAttributes;
9
9
  var isMultiPrice = multiPrice && multiPrice > 1;
10
10
  var stripeText = isMultiPrice
11
- ? "".concat(variant === EPriceVariant.KLIPP ? variant + ' ' : '').concat(multiPrice, " f\u00F6r")
11
+ ? "".concat(variant === EPriceVariant.KLIPP ? variant + ' ' : '').concat(multiPrice, " ").concat(unit === 'kg' ? unit : '', " f\u00F6r")
12
12
  : variant;
13
13
  return (React.createElement(PriceStripe$1, { backgroundColor: variantAttributes.backgroundColor, fontColor: variantAttributes.fontColor, fontSize: sizeAttributes.fontSize }, stripeText));
14
14
  };
@@ -13,10 +13,12 @@ var PriceTag = function (_a) {
13
13
  var priceBase = Math.floor(price);
14
14
  var priceDecimals = (price % 1).toFixed(2).split('.')[1];
15
15
  var showPriceIndicator = priceDecimals === '00';
16
- var showUnit = pant || (unit !== undefined && !(isMultiPrice && unit === 'st'));
16
+ var showUnit = pant ||
17
+ (unit !== undefined &&
18
+ !((isMultiPrice && unit === 'st') || (isMultiPrice && unit === 'kg')));
17
19
  return (React.createElement(PriceTagWrapper, { fontColor: variantAttributes.fontColor },
18
20
  variant !== EPriceVariant.REGULAR && (React.createElement(PriceStripeContainer, null,
19
- React.createElement(PriceStripe, { multiPrice: multiPrice, size: size, variant: variant }))),
21
+ React.createElement(PriceStripe, { multiPrice: multiPrice, size: size, unit: unit, variant: variant }))),
20
22
  React.createElement(PriceTagContainer, { backgroundColor: variantAttributes.backgroundColor },
21
23
  React.createElement(PriceTag$1, null,
22
24
  React.createElement(PriceBase, { fontSize: sizeAttributes.baseFontSize }, priceBase),
@@ -1 +1 @@
1
- {"version":3,"file":"PriceTag.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"PriceTag.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -32,11 +32,7 @@ var PriceTagWrapper = styled.div(templateObject_3 || (templateObject_3 = __makeT
32
32
  var theme = _a.theme;
33
33
  return (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint;
34
34
  });
35
- var ButtonWrapper = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n grid-area: ButtonWrapper;\n display: flex;\n align-items: center;\n gap: ", "px;\n justify-self: end;\n min-width: ", "px;\n\n @media (min-width: ", "px) {\n flex-direction: column;\n gap: ", "px;\n margin-top: -", "px;\n }\n"], ["\n grid-area: ButtonWrapper;\n display: flex;\n align-items: center;\n gap: ", "px;\n justify-self: end;\n min-width: ", "px;\n\n @media (min-width: ", "px) {\n flex-direction: column;\n gap: ", "px;\n margin-top: -", "px;\n }\n"])), function (_a) {
36
- var _b;
37
- var theme = _a.theme;
38
- return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.sm;
39
- }, function (_a) {
35
+ var ButtonWrapper = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n grid-area: ButtonWrapper;\n display: flex;\n align-items: center;\n justify-self: end;\n min-width: ", "px;\n\n @media (min-width: ", "px) {\n flex-direction: column;\n gap: ", "px;\n margin-top: -", "px;\n }\n"], ["\n grid-area: ButtonWrapper;\n display: flex;\n align-items: center;\n justify-self: end;\n min-width: ", "px;\n\n @media (min-width: ", "px) {\n flex-direction: column;\n gap: ", "px;\n margin-top: -", "px;\n }\n"])), function (_a) {
40
36
  var _b;
41
37
  var theme = _a.theme;
42
38
  return (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.buttonWrapperMinWidth;
@@ -1 +1 @@
1
- {"version":3,"file":"SearchListItem.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SearchListItem.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.8.74",
3
+ "version": "0.8.76",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -76,5 +76,5 @@
76
76
  "react-slick": "^0.30.1",
77
77
  "slick-carousel": "^1.8.1"
78
78
  },
79
- "gitHead": "81095e84486838ae5831c60cbb7a864be61447b8"
79
+ "gitHead": "725e7473ce780ffc1ee4885f0f1ccdc3e28a30bb"
80
80
  }