@citygross/components 0.8.58 → 0.8.60

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.
@@ -81,6 +81,7 @@ export * from './components/CgButton/CgButton';
81
81
  export * from './components/CartCardLabel/CartCardLabel';
82
82
  export * from './components/CartCard/CartCard';
83
83
  export * from './components/PriceTag/PriceTag';
84
+ export * from './components/PriceTag/PriceTag.types';
84
85
  export * from './components/PriceBanner/PriceBanner';
85
86
  export * from './components/Pill/Pill';
86
87
  export * from './components/SelectButton/SelectButton';
@@ -16,12 +16,12 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
16
  var PriceTag = function (_a) {
17
17
  var _b = _a.multiPrice, multiPrice = _b === void 0 ? 0 : _b, _c = _a.pant, pant = _c === void 0 ? false : _c, price$1 = _a.price, _d = _a.variant, variant = _d === void 0 ? PriceTag_types.EPriceVariant.REGULAR : _d, _e = _a.size, size = _e === void 0 ? PriceTag_types.EPriceSize.MEDIUM : _e, unit = _a.unit;
18
18
  var _f = price.getPriceTagAttributes(size, variant), sizeAttributes = _f.sizeAttributes, variantAttributes = _f.variantAttributes;
19
+ var isMultiPrice = multiPrice > 1;
20
+ var pantStr = '+pant';
19
21
  var priceBase = Math.floor(price$1);
20
22
  var priceDecimals = (price$1 % 1).toFixed(2).split('.')[1];
21
- var isMultiPrice = multiPrice > 1;
22
23
  var showPriceIndicator = priceDecimals === '00';
23
- var showUnit = pant || unit !== 'st';
24
- var pantStr = '+pant';
24
+ var showUnit = pant || !(isMultiPrice && unit === 'st');
25
25
  return (React__default["default"].createElement(PriceTag_styles.PriceTagWrapper, { fontColor: variantAttributes.fontColor },
26
26
  variant !== PriceTag_types.EPriceVariant.REGULAR && (React__default["default"].createElement(PriceTag_styles.PriceBannerContainer, null,
27
27
  React__default["default"].createElement(PriceBanner.PriceBanner, { multiPrice: multiPrice, size: size, variant: variant }))),
@@ -31,7 +31,7 @@ var PriceTag = function (_a) {
31
31
  React__default["default"].createElement(PriceTag_styles.PriceDetails, { pant: pant, width: sizeAttributes.detailsPantWidth },
32
32
  showPriceIndicator ? (React__default["default"].createElement(PriceTag_styles.PriceIndicatorContainer, { isSmall: size === PriceTag_types.EPriceSize.SMALL, showUnit: showUnit },
33
33
  React__default["default"].createElement(icons.Icons.PriceIndicator, { fill: variantAttributes.fontColor, size: sizeAttributes.indicatorSize }))) : (React__default["default"].createElement(PriceTag_styles.PriceDecimals, { fontSize: sizeAttributes.decimalsFontSize, isSmall: size === PriceTag_types.EPriceSize.SMALL }, priceDecimals)),
34
- showUnit && (React__default["default"].createElement(PriceTag_styles.PriceUnit, { fontSize: sizeAttributes.unitFontSize, isSmall: size === PriceTag_types.EPriceSize.SMALL, pant: pant }, pant ? pantStr : isMultiPrice ? '' : "/".concat(unit))))))));
34
+ React__default["default"].createElement(PriceTag_styles.PriceUnit, { fontSize: sizeAttributes.unitFontSize, isSmall: size === PriceTag_types.EPriceSize.SMALL, pant: pant }, pant ? pantStr : isMultiPrice ? '' : "/".concat(unit)))))));
35
35
  };
36
36
 
37
37
  exports.PriceTag = PriceTag;
@@ -56,14 +56,14 @@ var PriceDecimals = styled__default["default"].span(templateObject_8 || (templat
56
56
  return fontSize;
57
57
  }, function (_a) {
58
58
  var isSmall = _a.isSmall;
59
- return (isSmall ? -10 : -14);
59
+ return (isSmall ? -12 : -14);
60
60
  });
61
61
  var PriceUnit = styled__default["default"].span(templateObject_9 || (templateObject_9 = _tslib.__makeTemplateObject(["\n font-size: ", "px;\n position: absolute;\n bottom: ", "px;\n right: ", "px;\n"], ["\n font-size: ", "px;\n position: absolute;\n bottom: ", "px;\n right: ", "px;\n"])), function (_a) {
62
62
  var fontSize = _a.fontSize;
63
63
  return fontSize;
64
64
  }, function (_a) {
65
65
  var isSmall = _a.isSmall;
66
- return (isSmall ? 4 : 6);
66
+ return (isSmall ? 5 : 6);
67
67
  }, function (_a) {
68
68
  var pant = _a.pant;
69
69
  return (pant ? 3 : 5);
@@ -87,6 +87,7 @@ var CouponCode = require('./components/CouponCode/CouponCode.js');
87
87
  var CartCardLabel = require('./components/CartCardLabel/CartCardLabel.js');
88
88
  var CartCard = require('./components/CartCard/CartCard.js');
89
89
  var PriceTag = require('./components/PriceTag/PriceTag.js');
90
+ var PriceTag_types = require('./components/PriceTag/PriceTag.types.js');
90
91
  var PriceBanner = require('./components/PriceBanner/PriceBanner.js');
91
92
  var Pill = require('./components/Pill/Pill.js');
92
93
  var SelectButton = require('./components/SelectButton/SelectButton.js');
@@ -233,6 +234,14 @@ Object.defineProperty(exports, 'ECouponCodeStatus', {
233
234
  exports.CartCardLabel = CartCardLabel.CartCardLabel;
234
235
  exports.CartCard = CartCard.CartCard;
235
236
  exports.PriceTag = PriceTag.PriceTag;
237
+ Object.defineProperty(exports, 'EPriceSize', {
238
+ enumerable: true,
239
+ get: function () { return PriceTag_types.EPriceSize; }
240
+ });
241
+ Object.defineProperty(exports, 'EPriceVariant', {
242
+ enumerable: true,
243
+ get: function () { return PriceTag_types.EPriceVariant; }
244
+ });
236
245
  exports.PriceBanner = PriceBanner.PriceBanner;
237
246
  exports.Pill = Pill.Pill;
238
247
  exports.SelectButton = SelectButton.SelectButton;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -8,12 +8,12 @@ import { EPriceVariant, EPriceSize } from './PriceTag.types.js';
8
8
  var PriceTag = function (_a) {
9
9
  var _b = _a.multiPrice, multiPrice = _b === void 0 ? 0 : _b, _c = _a.pant, pant = _c === void 0 ? false : _c, price = _a.price, _d = _a.variant, variant = _d === void 0 ? EPriceVariant.REGULAR : _d, _e = _a.size, size = _e === void 0 ? EPriceSize.MEDIUM : _e, unit = _a.unit;
10
10
  var _f = getPriceTagAttributes(size, variant), sizeAttributes = _f.sizeAttributes, variantAttributes = _f.variantAttributes;
11
+ var isMultiPrice = multiPrice > 1;
12
+ var pantStr = '+pant';
11
13
  var priceBase = Math.floor(price);
12
14
  var priceDecimals = (price % 1).toFixed(2).split('.')[1];
13
- var isMultiPrice = multiPrice > 1;
14
15
  var showPriceIndicator = priceDecimals === '00';
15
- var showUnit = pant || unit !== 'st';
16
- var pantStr = '+pant';
16
+ var showUnit = pant || !(isMultiPrice && unit === 'st');
17
17
  return (React.createElement(PriceTagWrapper, { fontColor: variantAttributes.fontColor },
18
18
  variant !== EPriceVariant.REGULAR && (React.createElement(PriceBannerContainer, null,
19
19
  React.createElement(PriceBanner, { multiPrice: multiPrice, size: size, variant: variant }))),
@@ -23,7 +23,7 @@ var PriceTag = function (_a) {
23
23
  React.createElement(PriceDetails, { pant: pant, width: sizeAttributes.detailsPantWidth },
24
24
  showPriceIndicator ? (React.createElement(PriceIndicatorContainer, { isSmall: size === EPriceSize.SMALL, showUnit: showUnit },
25
25
  React.createElement(Icons.PriceIndicator, { fill: variantAttributes.fontColor, size: sizeAttributes.indicatorSize }))) : (React.createElement(PriceDecimals, { fontSize: sizeAttributes.decimalsFontSize, isSmall: size === EPriceSize.SMALL }, priceDecimals)),
26
- showUnit && (React.createElement(PriceUnit, { fontSize: sizeAttributes.unitFontSize, isSmall: size === EPriceSize.SMALL, pant: pant }, pant ? pantStr : isMultiPrice ? '' : "/".concat(unit))))))));
26
+ React.createElement(PriceUnit, { fontSize: sizeAttributes.unitFontSize, isSmall: size === EPriceSize.SMALL, pant: pant }, pant ? pantStr : isMultiPrice ? '' : "/".concat(unit)))))));
27
27
  };
28
28
 
29
29
  export { PriceTag };
@@ -48,14 +48,14 @@ var PriceDecimals = styled.span(templateObject_8 || (templateObject_8 = __makeTe
48
48
  return fontSize;
49
49
  }, function (_a) {
50
50
  var isSmall = _a.isSmall;
51
- return (isSmall ? -10 : -14);
51
+ return (isSmall ? -12 : -14);
52
52
  });
53
53
  var PriceUnit = styled.span(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n font-size: ", "px;\n position: absolute;\n bottom: ", "px;\n right: ", "px;\n"], ["\n font-size: ", "px;\n position: absolute;\n bottom: ", "px;\n right: ", "px;\n"])), function (_a) {
54
54
  var fontSize = _a.fontSize;
55
55
  return fontSize;
56
56
  }, function (_a) {
57
57
  var isSmall = _a.isSmall;
58
- return (isSmall ? 4 : 6);
58
+ return (isSmall ? 5 : 6);
59
59
  }, function (_a) {
60
60
  var pant = _a.pant;
61
61
  return (pant ? 3 : 5);
@@ -83,6 +83,7 @@ export { CouponCode, ECouponCodeStatus } from './components/CouponCode/CouponCod
83
83
  export { CartCardLabel } from './components/CartCardLabel/CartCardLabel.js';
84
84
  export { CartCard } from './components/CartCard/CartCard.js';
85
85
  export { PriceTag } from './components/PriceTag/PriceTag.js';
86
+ export { EPriceSize, EPriceVariant } from './components/PriceTag/PriceTag.types.js';
86
87
  export { PriceBanner } from './components/PriceBanner/PriceBanner.js';
87
88
  export { Pill } from './components/Pill/Pill.js';
88
89
  export { SelectButton } from './components/SelectButton/SelectButton.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.8.58",
3
+ "version": "0.8.60",
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": "ceee5e52199d19291cae1fbfe8d6004830b03cb5"
79
+ "gitHead": "547bbd7051f70a9c74b09602de91412260f05a57"
80
80
  }