@citygross/components 0.8.56 → 0.8.58

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 (56) hide show
  1. package/build/@types/components/ListItem/ListItem.d.ts +1 -1
  2. package/build/@types/components/PriceBanner/PriceBanner.d.ts +11 -0
  3. package/build/@types/components/PriceBanner/PriceBanner.styles.d.ts +3 -0
  4. package/build/@types/components/PriceTag/PriceTag.d.ts +1 -19
  5. package/build/@types/components/PriceTag/PriceTag.styles.d.ts +21 -15
  6. package/build/@types/components/PriceTag/PriceTag.types.d.ts +31 -0
  7. package/build/@types/components/SearchListItem/SearchListItem.d.ts +2 -1
  8. package/build/@types/helpers/price.d.ts +10 -0
  9. package/build/@types/index.d.ts +1 -0
  10. package/build/cjs/components/src/components/AddressBlock/AddressBlock.js +3 -1
  11. package/build/cjs/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
  12. package/build/cjs/components/src/components/ListItem/ListItem.js +12 -10
  13. package/build/cjs/components/src/components/ListItem/ListItem.js.map +1 -1
  14. package/build/cjs/components/src/components/PriceBanner/PriceBanner.js +25 -0
  15. package/build/cjs/components/src/components/PriceBanner/PriceBanner.js.map +1 -0
  16. package/build/cjs/components/src/components/PriceBanner/PriceBanner.styles.js +37 -0
  17. package/build/cjs/components/src/components/PriceBanner/PriceBanner.styles.js.map +1 -0
  18. package/build/cjs/components/src/components/PriceTag/PriceTag.js +20 -56
  19. package/build/cjs/components/src/components/PriceTag/PriceTag.js.map +1 -1
  20. package/build/cjs/components/src/components/PriceTag/PriceTag.styles.js +61 -23
  21. package/build/cjs/components/src/components/PriceTag/PriceTag.styles.js.map +1 -1
  22. package/build/cjs/components/src/components/PriceTag/PriceTag.types.js +18 -0
  23. package/build/cjs/components/src/components/PriceTag/PriceTag.types.js.map +1 -0
  24. package/build/cjs/components/src/components/SearchListItem/SearchListItem.js +2 -2
  25. package/build/cjs/components/src/components/WarningLabel/WarningLabel.js +3 -1
  26. package/build/cjs/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
  27. package/build/cjs/components/src/helpers/price.js +97 -0
  28. package/build/cjs/components/src/helpers/price.js.map +1 -0
  29. package/build/cjs/components/src/index.js +2 -4
  30. package/build/cjs/components/src/index.js.map +1 -1
  31. package/build/cjs/design-tokens/build/index.js +1 -1
  32. package/build/cjs/design-tokens/build/index.js.map +1 -1
  33. package/build/es/components/src/components/AddressBlock/AddressBlock.js +3 -1
  34. package/build/es/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
  35. package/build/es/components/src/components/ListItem/ListItem.js +12 -10
  36. package/build/es/components/src/components/ListItem/ListItem.js.map +1 -1
  37. package/build/es/components/src/components/PriceBanner/PriceBanner.js +17 -0
  38. package/build/es/components/src/components/PriceBanner/PriceBanner.js.map +1 -0
  39. package/build/es/components/src/components/PriceBanner/PriceBanner.styles.js +29 -0
  40. package/build/es/components/src/components/PriceBanner/PriceBanner.styles.js.map +1 -0
  41. package/build/es/components/src/components/PriceTag/PriceTag.js +19 -55
  42. package/build/es/components/src/components/PriceTag/PriceTag.js.map +1 -1
  43. package/build/es/components/src/components/PriceTag/PriceTag.styles.js +61 -17
  44. package/build/es/components/src/components/PriceTag/PriceTag.styles.js.map +1 -1
  45. package/build/es/components/src/components/PriceTag/PriceTag.types.js +16 -0
  46. package/build/es/components/src/components/PriceTag/PriceTag.types.js.map +1 -0
  47. package/build/es/components/src/components/SearchListItem/SearchListItem.js +2 -2
  48. package/build/es/components/src/components/WarningLabel/WarningLabel.js +3 -1
  49. package/build/es/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
  50. package/build/es/components/src/helpers/price.js +92 -0
  51. package/build/es/components/src/helpers/price.js.map +1 -0
  52. package/build/es/components/src/index.js +2 -1
  53. package/build/es/components/src/index.js.map +1 -1
  54. package/build/es/design-tokens/build/index.js +1 -1
  55. package/build/es/design-tokens/build/index.js.map +1 -1
  56. package/package.json +4 -4
@@ -22,4 +22,4 @@ export declare type TListItem = {
22
22
  alignment?: EListItemAlignment;
23
23
  textColor?: string;
24
24
  };
25
- export declare function ListItem({ item, loading, isSmall, fallBackImage, imageAutoHeight, boldHeader, smallSkeleton, children, alignment, textColor, usedInSearch }: TListItem): JSX.Element;
25
+ export declare const ListItem: ({ item, loading, isSmall, fallBackImage, imageAutoHeight, boldHeader, smallSkeleton, children, alignment, textColor, usedInSearch }: TListItem) => JSX.Element;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { EPriceSize, EPriceVariant } from '../PriceTag/PriceTag.types';
3
+ export declare type TPriceBannerSizeAttributes = {
4
+ fontSize?: number;
5
+ };
6
+ export declare type TPriceBanner = {
7
+ multiPrice?: number;
8
+ size?: EPriceSize;
9
+ variant?: EPriceVariant;
10
+ };
11
+ export declare const PriceBanner: React.FunctionComponent<TPriceBanner>;
@@ -0,0 +1,3 @@
1
+ import { TPriceBannerSizeAttributes } from './PriceBanner';
2
+ import { TPriceVariantAttributes } from '../PriceTag/PriceTag.types';
3
+ export declare const PriceBanner: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TPriceBannerSizeAttributes & Pick<TPriceVariantAttributes, "backgroundColor" | "fontColor">, never>;
@@ -1,21 +1,3 @@
1
1
  import React from 'react';
2
- export declare enum EPriceVariant {
3
- KLIPP = "klipp",
4
- PRIO = "prio",
5
- REGULAR_OFFER = "regular-offer"
6
- }
7
- export declare type TPriceTag = {
8
- multiPrice?: number;
9
- pant?: boolean;
10
- price: number;
11
- priceVariant?: EPriceVariant;
12
- unit: string;
13
- isInSmallContainer?: boolean;
14
- };
15
- export declare type TSplash = {
16
- backgroundColor?: string;
17
- badgeStr?: string;
18
- fontColor?: string;
19
- isInSmallContainer?: boolean;
20
- };
2
+ import { TPriceTag } from './PriceTag.types';
21
3
  export declare const PriceTag: React.FunctionComponent<TPriceTag>;
@@ -1,18 +1,24 @@
1
- import { TPriceTag, TSplash } from './PriceTag';
1
+ import { TPriceTag, TPriceVariantAttributes } from './PriceTag.types';
2
+ declare type TBackgroundColor = Pick<TPriceVariantAttributes, 'backgroundColor'>;
3
+ declare type TFontColor = Pick<TPriceVariantAttributes, 'fontColor'>;
4
+ declare type TFontSize = {
5
+ fontSize?: number;
6
+ };
7
+ declare type TIsSmall = {
8
+ isSmall?: boolean;
9
+ };
2
10
  declare type TPant = Pick<TPriceTag, 'pant'>;
3
- export declare const PriceTagComponent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TSplash, never>;
4
- export declare const PriceTagWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TSplash, never>;
5
- export declare const PriceSplashContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
6
- export declare const PriceTagContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
7
- export declare const PriceTagContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
8
- export declare const MultiPriceContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TPant, never>;
11
+ export declare const PriceTagWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TFontColor, never>;
12
+ export declare const PriceBannerContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
13
+ export declare const PriceTagContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TBackgroundColor, never>;
9
14
  export declare const PriceTag: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
10
- export declare const PriceBase: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
11
- export declare const PriceDetails: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
12
- export declare const PriceDecimals: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
13
- export declare const PriceUnit: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
14
- export declare const PriceIndicatorContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
15
- export declare const PriceIndicator: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, TPant, never>;
16
- export declare const Pant: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
17
- export declare const PriceVariantBadge: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TSplash, never>;
15
+ export declare const PriceBase: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, TFontSize, never>;
16
+ export declare const PriceDetails: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
17
+ width?: number | undefined;
18
+ } & TPant, never>;
19
+ export declare const PriceIndicatorContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
20
+ showUnit: boolean;
21
+ } & TIsSmall, never>;
22
+ export declare const PriceDecimals: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, TFontSize & TIsSmall, never>;
23
+ export declare const PriceUnit: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, TFontSize & TIsSmall & TPant, never>;
18
24
  export {};
@@ -0,0 +1,31 @@
1
+ export declare enum EPriceSize {
2
+ LARGE = "large",
3
+ MEDIUM = "medium",
4
+ SMALL = "small"
5
+ }
6
+ export declare enum EPriceVariant {
7
+ CAMPAIGN = "Kampanj",
8
+ KLIPP = "Klipp!",
9
+ PRIO = "Prio-pris",
10
+ REGULAR = "Ordinarie"
11
+ }
12
+ export declare type TPriceTag = {
13
+ multiPrice?: number;
14
+ pant?: boolean;
15
+ price: number;
16
+ variant?: EPriceVariant;
17
+ size?: EPriceSize;
18
+ unit: string;
19
+ };
20
+ export declare type TPriceVariantAttributes = {
21
+ backgroundColor?: string;
22
+ fontColor?: string;
23
+ };
24
+ export declare type TPriceTagSizeAttributes = {
25
+ baseFontSize?: number;
26
+ decimalsFontSize?: number;
27
+ detailsPantWidth?: number;
28
+ indicatorSize?: number;
29
+ padding?: number;
30
+ unitFontSize?: number;
31
+ };
@@ -11,5 +11,6 @@ export declare type TSearchListItem = {
11
11
  price: React.ReactNode;
12
12
  item: TItem;
13
13
  markings?: TMarking[];
14
+ fallBackImage?: string;
14
15
  };
15
- export declare const SearchListItem: ({ item, button, loading, price, markings }: TSearchListItem) => JSX.Element;
16
+ export declare const SearchListItem: ({ item, button, loading, price, markings, fallBackImage }: TSearchListItem) => JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { EPriceSize, EPriceVariant, TPriceTagSizeAttributes, TPriceVariantAttributes } from '../components/PriceTag/PriceTag.types';
2
+ import { TPriceBannerSizeAttributes } from '../components/PriceBanner/PriceBanner';
3
+ export declare const getPriceBannerAttributes: (priceSize?: EPriceSize, priceVariant?: EPriceVariant) => {
4
+ sizeAttributes: TPriceBannerSizeAttributes;
5
+ variantAttributes: TPriceVariantAttributes;
6
+ };
7
+ export declare const getPriceTagAttributes: (priceSize?: EPriceSize, priceVariant?: EPriceVariant) => {
8
+ sizeAttributes: TPriceTagSizeAttributes;
9
+ variantAttributes: TPriceVariantAttributes;
10
+ };
@@ -81,5 +81,6 @@ 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/PriceBanner/PriceBanner';
84
85
  export * from './components/Pill/Pill';
85
86
  export * from './components/SelectButton/SelectButton';
@@ -95,7 +95,9 @@ require('../CartSubTotal/CartSubTotal.js');
95
95
  require('../CouponCode/CouponCode.js');
96
96
  require('../CartCardLabel/CartCardLabel.styles.js');
97
97
  require('../CartCard/CartCard.styles.js');
98
- require('../PriceTag/PriceTag.js');
98
+ require('../PriceTag/PriceTag.types.js');
99
+ require('../PriceBanner/PriceBanner.styles.js');
100
+ require('../PriceTag/PriceTag.styles.js');
99
101
  require('../Pill/Pill.styles.js');
100
102
  require('../SelectButton/SelectButton.styles.js');
101
103
 
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var React = require('react');
6
6
  var typography = require('@citygross/typography');
7
7
  var Skeleton = require('react-loading-skeleton');
8
- var fallback_grocery = require('./assets/fallback_grocery.svg.js');
9
8
  var ListItem_styles = require('./ListItem.styles.js');
10
9
  var index = require('../../../../design-tokens/build/index.js');
11
10
 
@@ -19,26 +18,29 @@ exports.EListItemAlignment = void 0;
19
18
  EListItemAlignment["CENTER"] = "center";
20
19
  EListItemAlignment["TOP"] = "flex-start";
21
20
  })(exports.EListItemAlignment || (exports.EListItemAlignment = {}));
22
- function ListItem(_a) {
21
+ var ListItem = function (_a) {
23
22
  var _b, _c;
24
23
  var item = _a.item, loading = _a.loading, isSmall = _a.isSmall, fallBackImage = _a.fallBackImage, imageAutoHeight = _a.imageAutoHeight, boldHeader = _a.boldHeader, smallSkeleton = _a.smallSkeleton, children = _a.children, _d = _a.alignment, alignment = _d === void 0 ? exports.EListItemAlignment.CENTER : _d, textColor = _a.textColor, usedInSearch = _a.usedInSearch;
25
24
  return (React__default["default"].createElement(ListItem_styles.ListItemContainer, null,
26
25
  React__default["default"].createElement(ListItem_styles.ListLeft, { usedInSearch: usedInSearch, alignment: alignment },
27
26
  React__default["default"].createElement(ListItem_styles.ListImageContainer, { isSmall: isSmall },
28
- React__default["default"].createElement(ListItem_styles.ListImage, { autoHeight: imageAutoHeight, src: (item === null || item === void 0 ? void 0 : item.image) || fallBackImage || fallback_grocery, alt: item === null || item === void 0 ? void 0 : item.name, isSmall: isSmall, onError: function (e) {
29
- var target = e.target;
30
- target.onerror = null;
31
- target.src = fallBackImage || fallback_grocery;
27
+ React__default["default"].createElement(ListItem_styles.ListImage, { autoHeight: imageAutoHeight, src: item === null || item === void 0 ? void 0 : item.image, alt: item === null || item === void 0 ? void 0 : item.name, isSmall: isSmall, onError: function (e) {
28
+ if (fallBackImage) {
29
+ var target = e.target;
30
+ if (!target.dataset.fallback) {
31
+ target.dataset.fallback = 'true';
32
+ target.onerror = null;
33
+ target.src = fallBackImage;
34
+ }
35
+ }
32
36
  } })),
33
37
  React__default["default"].createElement(ListItem_styles.ItemInformationContainer, { usedInSearch: usedInSearch, alignment: alignment },
34
- React__default["default"].createElement(typography.BodyText, { fontWeight: boldHeader ? 'semiBold' : 'regular', color: textColor || ((_b = index.theme.palette) === null || _b === void 0 ? void 0 : _b.darkest), size: isSmall
35
- ? typography.TextTypes.TextSize.EXTRASMALL
36
- : typography.TextTypes.TextSize.REGULAR }, (item === null || item === void 0 ? void 0 : item.name) || React__default["default"].createElement(Skeleton__default["default"], { width: smallSkeleton ? 150 : 250 })),
38
+ React__default["default"].createElement(typography.BodyText, { fontWeight: boldHeader ? 'semiBold' : 'regular', color: textColor || ((_b = index.theme.palette) === null || _b === void 0 ? void 0 : _b.darkest), size: isSmall ? typography.TextTypes.TextSize.EXTRASMALL : typography.TextTypes.TextSize.REGULAR }, (item === null || item === void 0 ? void 0 : item.name) || React__default["default"].createElement(Skeleton__default["default"], { width: smallSkeleton ? 150 : 250 })),
37
39
  loading ? (React__default["default"].createElement(typography.BodyText, { size: typography.TextTypes.TextSize.SMALL },
38
40
  React__default["default"].createElement(Skeleton__default["default"], { width: smallSkeleton ? 150 : 250 }))) : (item === null || item === void 0 ? void 0 : item.description) ? (React__default["default"].createElement(typography.BodyText, { size: isSmall ? typography.TextTypes.TextSize.TINY : typography.TextTypes.TextSize.SMALL, color: textColor || ((_c = index.theme.palette) === null || _c === void 0 ? void 0 : _c.dark) }, item === null || item === void 0 ? void 0 : item.description)) : null,
39
41
  (item === null || item === void 0 ? void 0 : item.secondaryDescription) && item.secondaryDescription)),
40
42
  children && (React__default["default"].createElement(ListItem_styles.ListRight, { alignment: alignment }, children))));
41
- }
43
+ };
42
44
 
43
45
  exports.ListItem = ListItem;
44
46
  //# sourceMappingURL=ListItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var price = require('../../helpers/price.js');
7
+ var PriceBanner_styles = require('./PriceBanner.styles.js');
8
+ var PriceTag_types = require('../PriceTag/PriceTag.types.js');
9
+
10
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
+
12
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
+
14
+ var PriceBanner = function (_a) {
15
+ var multiPrice = _a.multiPrice, _b = _a.size, size = _b === void 0 ? PriceTag_types.EPriceSize.MEDIUM : _b, variant = _a.variant;
16
+ var _c = price.getPriceBannerAttributes(size, variant), sizeAttributes = _c.sizeAttributes, variantAttributes = _c.variantAttributes;
17
+ var isMultiPrice = multiPrice && multiPrice > 1;
18
+ var bannerText = isMultiPrice
19
+ ? "".concat(variant === PriceTag_types.EPriceVariant.KLIPP ? variant + ' ' : '').concat(multiPrice, " f\u00F6r")
20
+ : variant;
21
+ return (React__default["default"].createElement(PriceBanner_styles.PriceBanner, { backgroundColor: variantAttributes.backgroundColor, fontColor: variantAttributes.fontColor, fontSize: sizeAttributes.fontSize }, bannerText));
22
+ };
23
+
24
+ exports.PriceBanner = PriceBanner;
25
+ //# sourceMappingURL=PriceBanner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PriceBanner.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,37 @@
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 PriceBanner = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n padding: 0 ", "px;\n width: fit-content;\n"], ["\n background-color: ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n padding: 0 ", "px;\n width: fit-content;\n"])), function (_a) {
13
+ var backgroundColor = _a.backgroundColor;
14
+ return backgroundColor;
15
+ }, function (_a) {
16
+ var fontColor = _a.fontColor;
17
+ return fontColor;
18
+ }, function (_a) {
19
+ var _b;
20
+ var theme = _a.theme;
21
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.type.primary;
22
+ }, function (_a) {
23
+ var fontSize = _a.fontSize;
24
+ return fontSize;
25
+ }, function (_a) {
26
+ var _b;
27
+ var theme = _a.theme;
28
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.weight.bold;
29
+ }, function (_a) {
30
+ var _b;
31
+ var theme = _a.theme;
32
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
33
+ });
34
+ var templateObject_1;
35
+
36
+ exports.PriceBanner = PriceBanner;
37
+ //# sourceMappingURL=PriceBanner.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PriceBanner.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,71 +3,35 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var PriceTag_styles = require('./PriceTag.styles.js');
7
6
  var icons = require('@citygross/icons');
8
- var designTokens = require('@citygross/design-tokens');
7
+ var price = require('../../helpers/price.js');
8
+ var PriceBanner = require('../PriceBanner/PriceBanner.js');
9
+ var PriceTag_styles = require('./PriceTag.styles.js');
10
+ var PriceTag_types = require('./PriceTag.types.js');
9
11
 
10
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
13
 
12
14
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
15
 
14
- exports.EPriceVariant = void 0;
15
- (function (EPriceVariant) {
16
- EPriceVariant["KLIPP"] = "klipp";
17
- EPriceVariant["PRIO"] = "prio";
18
- EPriceVariant["REGULAR_OFFER"] = "regular-offer";
19
- })(exports.EPriceVariant || (exports.EPriceVariant = {}));
20
- var getSplash = function (priceVariant) {
21
- var _a, _b, _c, _d, _e, _f, _g;
22
- switch (priceVariant) {
23
- case exports.EPriceVariant.KLIPP:
24
- return {
25
- backgroundColor: (_a = designTokens.theme.palette) === null || _a === void 0 ? void 0 : _a.alertRed,
26
- badgeStr: 'Klipp!',
27
- fontColor: (_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.white
28
- };
29
- case exports.EPriceVariant.PRIO:
30
- return {
31
- backgroundColor: (_c = designTokens.theme.palette) === null || _c === void 0 ? void 0 : _c.brandPrio,
32
- badgeStr: 'PRIO',
33
- fontColor: (_d = designTokens.theme.palette) === null || _d === void 0 ? void 0 : _d.white
34
- };
35
- case exports.EPriceVariant.REGULAR_OFFER:
36
- return {
37
- backgroundColor: (_e = designTokens.theme.palette) === null || _e === void 0 ? void 0 : _e.brandYellow,
38
- fontColor: (_f = designTokens.theme.palette) === null || _f === void 0 ? void 0 : _f.alertRed
39
- };
40
- default:
41
- return {
42
- fontColor: (_g = designTokens.theme.palette) === null || _g === void 0 ? void 0 : _g.darkest
43
- };
44
- }
45
- };
46
16
  var PriceTag = function (_a) {
47
- var _b = _a.multiPrice, multiPrice = _b === void 0 ? 0 : _b, _c = _a.pant, pant = _c === void 0 ? false : _c, price = _a.price, priceVariant = _a.priceVariant, unit = _a.unit, _d = _a.isInSmallContainer, isInSmallContainer = _d === void 0 ? false : _d;
48
- var splash = getSplash(priceVariant);
49
- var priceBase = Math.floor(price);
50
- var priceDecimals = (price % 1).toFixed(2).split('.')[1];
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
+ var _f = price.getPriceTagAttributes(size, variant), sizeAttributes = _f.sizeAttributes, variantAttributes = _f.variantAttributes;
19
+ var priceBase = Math.floor(price$1);
20
+ var priceDecimals = (price$1 % 1).toFixed(2).split('.')[1];
51
21
  var isMultiPrice = multiPrice > 1;
52
- var showPriceIndicator = priceDecimals === '00' && unit === 'st';
53
- var multiPriceStr = multiPrice + ' för';
54
- var priceIndicator = ':-';
22
+ var showPriceIndicator = priceDecimals === '00';
23
+ var showUnit = pant || unit !== 'st';
55
24
  var pantStr = '+pant';
56
- return (React__default["default"].createElement(PriceTag_styles.PriceTagComponent, { badgeStr: splash.badgeStr },
57
- React__default["default"].createElement(PriceTag_styles.PriceTagWrapper, { fontColor: splash.fontColor },
58
- splash.backgroundColor && (React__default["default"].createElement(PriceTag_styles.PriceSplashContainer, null,
59
- React__default["default"].createElement(icons.Icons.PriceSplash, { backgroundColor: splash.backgroundColor }))),
60
- React__default["default"].createElement(PriceTag_styles.PriceTagContainer, null,
61
- React__default["default"].createElement(PriceTag_styles.PriceTagContent, null,
62
- isMultiPrice && (React__default["default"].createElement(PriceTag_styles.MultiPriceContainer, { pant: pant }, multiPriceStr)),
63
- React__default["default"].createElement(PriceTag_styles.PriceTag, null,
64
- React__default["default"].createElement(PriceTag_styles.PriceBase, null, priceBase),
65
- showPriceIndicator ? (React__default["default"].createElement(PriceTag_styles.PriceIndicatorContainer, null,
66
- React__default["default"].createElement(PriceTag_styles.PriceIndicator, { pant: pant }, priceIndicator),
67
- pant && React__default["default"].createElement(PriceTag_styles.Pant, null, pantStr))) : (React__default["default"].createElement(PriceTag_styles.PriceDetails, null,
68
- React__default["default"].createElement(PriceTag_styles.PriceDecimals, null, priceDecimals),
69
- React__default["default"].createElement(PriceTag_styles.PriceUnit, null, pant ? pantStr : isMultiPrice ? '' : "/".concat(unit))))))),
70
- splash.badgeStr && (React__default["default"].createElement(PriceTag_styles.PriceVariantBadge, { backgroundColor: splash.backgroundColor, isInSmallContainer: isInSmallContainer }, splash.badgeStr)))));
25
+ return (React__default["default"].createElement(PriceTag_styles.PriceTagWrapper, { fontColor: variantAttributes.fontColor },
26
+ variant !== PriceTag_types.EPriceVariant.REGULAR && (React__default["default"].createElement(PriceTag_styles.PriceBannerContainer, null,
27
+ React__default["default"].createElement(PriceBanner.PriceBanner, { multiPrice: multiPrice, size: size, variant: variant }))),
28
+ React__default["default"].createElement(PriceTag_styles.PriceTagContainer, { backgroundColor: variantAttributes.backgroundColor },
29
+ React__default["default"].createElement(PriceTag_styles.PriceTag, null,
30
+ React__default["default"].createElement(PriceTag_styles.PriceBase, { fontSize: sizeAttributes.baseFontSize }, priceBase),
31
+ React__default["default"].createElement(PriceTag_styles.PriceDetails, { pant: pant, width: sizeAttributes.detailsPantWidth },
32
+ showPriceIndicator ? (React__default["default"].createElement(PriceTag_styles.PriceIndicatorContainer, { isSmall: size === PriceTag_types.EPriceSize.SMALL, showUnit: showUnit },
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))))))));
71
35
  };
72
36
 
73
37
  exports.PriceTag = PriceTag;
@@ -1 +1 @@
1
- {"version":3,"file":"PriceTag.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"PriceTag.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -9,36 +9,74 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
11
11
 
12
- var PriceTagComponent = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n padding-top: ", "px;\n"], ["\n padding-top: ", "px;\n"])), function (props) { var _a; return (props.badgeStr ? (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm2 : 0); });
13
- var PriceTagWrapper = styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n color: ", ";\n display: grid;\n font-family: ", ";\n height: fit-content;\n width: fit-content;\n position: relative;\n"], ["\n color: ", ";\n display: grid;\n font-family: ", ";\n height: fit-content;\n width: fit-content;\n position: relative;\n"])), function (props) { return props.fontColor; }, function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.type.display; });
14
- var PriceSplashContainer = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n grid-area: 1 / 1 / 1 / 1;\n position: absolute;\n bottom: 0;\n top: 0;\n right: 0;\n left: 0;\n\n svg {\n width: 100%;\n height: 100%;\n }\n"], ["\n grid-area: 1 / 1 / 1 / 1;\n position: absolute;\n bottom: 0;\n top: 0;\n right: 0;\n left: 0;\n\n svg {\n width: 100%;\n height: 100%;\n }\n"])));
15
- var PriceTagContainer = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n grid-area: 1 / 1 / 1 / 1;\n padding: 0 ", "px\n ", "px\n ", "px;\n position: relative;\n z-index: 1;\n"], ["\n grid-area: 1 / 1 / 1 / 1;\n padding: 0 ", "px\n ", "px\n ", "px;\n position: relative;\n z-index: 1;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs2; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs2; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
16
- var PriceTagContent = styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n padding: ", "px;\n"], ["\n display: flex;\n flex-direction: column;\n padding: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; });
17
- var MultiPriceContainer = styled__default["default"].div(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n font-size: ", "px;\n margin-bottom: -", "px;\n margin-left: ", "px;\n padding-top: ", "px;\n transform: rotate(-", "deg);\n width: fit-content;\n"], ["\n font-size: ", "px;\n margin-bottom: -", "px;\n margin-left: ", "px;\n padding-top: ", "px;\n transform: rotate(-", "deg);\n width: fit-content;\n"])), 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.xxs2; }, 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.xxs2; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.priceRotate; });
18
- var PriceTag = styled__default["default"].div(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", "px;\n"], ["\n display: flex;\n align-items: center;\n gap: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxxs; });
19
- var PriceBase = styled__default["default"].span(templateObject_8 || (templateObject_8 = _tslib.__makeTemplateObject(["\n font-size: ", "px;\n line-height: 1;\n"], ["\n font-size: ", "px;\n line-height: 1;\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.l1; });
20
- var PriceDetails = styled__default["default"].div(templateObject_9 || (templateObject_9 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n"], ["\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n"])));
21
- var PriceDecimals = styled__default["default"].span(templateObject_10 || (templateObject_10 = _tslib.__makeTemplateObject(["\n font-size: ", "px;\n margin-top: ", "px;\n"], ["\n font-size: ", "px;\n margin-top: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s4; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxxs; });
22
- var PriceUnit = styled__default["default"].span(templateObject_11 || (templateObject_11 = _tslib.__makeTemplateObject(["\n font-size: ", "px;\n margin-top: ", "px;\n"], ["\n font-size: ", "px;\n margin-top: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s3; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxxs; });
23
- var PriceIndicatorContainer = styled__default["default"].div(templateObject_12 || (templateObject_12 = _tslib.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
24
- var PriceIndicator = styled__default["default"].span(templateObject_13 || (templateObject_13 = _tslib.__makeTemplateObject(["\n font-size: ", "px;\n margin-top: -", "px;\n transform: rotate(", "deg);\n"], ["\n font-size: ", "px;\n margin-top: -", "px;\n transform: rotate(", "deg);\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.l1; }, function (props) { return (props.pant ? 0 : function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs2; }); }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.priceIndicatorRotate; });
25
- var Pant = styled__default["default"].span(templateObject_14 || (templateObject_14 = _tslib.__makeTemplateObject(["\n font-size: ", "px;\n margin-top: -", "px;\n"], ["\n font-size: ", "px;\n margin-top: -", "px;\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s3; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; });
26
- var PriceVariantBadge = styled__default["default"].div(templateObject_15 || (templateObject_15 = _tslib.__makeTemplateObject(["\n background-color: ", ";\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n height: ", "px;\n width: ", "px;\n position: absolute;\n right: -", "px;\n top: -", "px;\n"], ["\n background-color: ", ";\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n height: ", "px;\n width: ", "px;\n position: absolute;\n right: -", "px;\n top: -", "px;\n"])), function (props) { return props.backgroundColor; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.priceVariantBadgeSize; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.priceVariantBadgeSize; }, function (props) { var _a, _b; return (props.isInSmallContainer ? (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs2 : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.md); }, function (props) { var _a, _b; return (props.isInSmallContainer ? (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xl : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.lg); });
27
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15;
12
+ var PriceTagWrapper = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n color: ", ";\n display: inline-flex;\n align-items: flex-start;\n flex-direction: column;\n font-family: ", ";\n font-weight: ", ";\n"], ["\n color: ", ";\n display: inline-flex;\n align-items: flex-start;\n flex-direction: column;\n font-family: ", ";\n font-weight: ", ";\n"])), function (_a) {
13
+ var fontColor = _a.fontColor;
14
+ return fontColor;
15
+ }, function (_a) {
16
+ var _b;
17
+ var theme = _a.theme;
18
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.type.primary;
19
+ }, function (_a) {
20
+ var _b;
21
+ var theme = _a.theme;
22
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.weight.bold;
23
+ });
24
+ var PriceBannerContainer = styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n margin-bottom: 1px;\n transform: rotate(-", "deg);\n"], ["\n margin-bottom: 1px;\n transform: rotate(-", "deg);\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.priceRotate; });
25
+ var PriceTagContainer = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n background-color: ", ";\n padding: ", "px;\n position: relative;\n"], ["\n background-color: ", ";\n padding: ", "px;\n position: relative;\n"])), function (_a) {
26
+ var backgroundColor = _a.backgroundColor;
27
+ return backgroundColor;
28
+ }, function (_a) {
29
+ var _b;
30
+ var theme = _a.theme;
31
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
32
+ });
33
+ var PriceTag = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", "px;\n"], ["\n display: flex;\n align-items: center;\n gap: ", "px;\n"])), function (_a) {
34
+ var _b;
35
+ var theme = _a.theme;
36
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxxs;
37
+ });
38
+ var PriceBase = styled__default["default"].span(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n font-size: ", "px;\n line-height: 1;\n"], ["\n font-size: ", "px;\n line-height: 1;\n"])), function (_a) {
39
+ var fontSize = _a.fontSize;
40
+ return fontSize;
41
+ });
42
+ var PriceDetails = styled__default["default"].div(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: ", ";\n"], ["\n display: flex;\n flex-direction: column;\n width: ", ";\n"])), function (_a) {
43
+ var pant = _a.pant, width = _a.width;
44
+ return (pant ? width + 'px' : 'fit-content');
45
+ });
46
+ var PriceIndicatorContainer = styled__default["default"].div(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n margin-top: ", "px;\n padding-right: ", "px;\n"], ["\n margin-top: ", "px;\n padding-right: ", "px;\n"])), function (_a) {
47
+ var isSmall = _a.isSmall, showUnit = _a.showUnit;
48
+ return showUnit ? (isSmall ? -4 : -5) : isSmall ? 3 : 5;
49
+ }, function (_a) {
50
+ var _b;
51
+ var theme = _a.theme;
52
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
53
+ });
54
+ var PriceDecimals = styled__default["default"].span(templateObject_8 || (templateObject_8 = _tslib.__makeTemplateObject(["\n font-size: ", "px;\n margin-top: ", "px;\n"], ["\n font-size: ", "px;\n margin-top: ", "px;\n"])), function (_a) {
55
+ var fontSize = _a.fontSize;
56
+ return fontSize;
57
+ }, function (_a) {
58
+ var isSmall = _a.isSmall;
59
+ return (isSmall ? -10 : -14);
60
+ });
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
+ var fontSize = _a.fontSize;
63
+ return fontSize;
64
+ }, function (_a) {
65
+ var isSmall = _a.isSmall;
66
+ return (isSmall ? 4 : 6);
67
+ }, function (_a) {
68
+ var pant = _a.pant;
69
+ return (pant ? 3 : 5);
70
+ });
71
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
28
72
 
29
- exports.MultiPriceContainer = MultiPriceContainer;
30
- exports.Pant = Pant;
73
+ exports.PriceBannerContainer = PriceBannerContainer;
31
74
  exports.PriceBase = PriceBase;
32
75
  exports.PriceDecimals = PriceDecimals;
33
76
  exports.PriceDetails = PriceDetails;
34
- exports.PriceIndicator = PriceIndicator;
35
77
  exports.PriceIndicatorContainer = PriceIndicatorContainer;
36
- exports.PriceSplashContainer = PriceSplashContainer;
37
78
  exports.PriceTag = PriceTag;
38
- exports.PriceTagComponent = PriceTagComponent;
39
79
  exports.PriceTagContainer = PriceTagContainer;
40
- exports.PriceTagContent = PriceTagContent;
41
80
  exports.PriceTagWrapper = PriceTagWrapper;
42
81
  exports.PriceUnit = PriceUnit;
43
- exports.PriceVariantBadge = PriceVariantBadge;
44
82
  //# sourceMappingURL=PriceTag.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PriceTag.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"PriceTag.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ exports.EPriceSize = void 0;
6
+ (function (EPriceSize) {
7
+ EPriceSize["LARGE"] = "large";
8
+ EPriceSize["MEDIUM"] = "medium";
9
+ EPriceSize["SMALL"] = "small";
10
+ })(exports.EPriceSize || (exports.EPriceSize = {}));
11
+ exports.EPriceVariant = void 0;
12
+ (function (EPriceVariant) {
13
+ EPriceVariant["CAMPAIGN"] = "Kampanj";
14
+ EPriceVariant["KLIPP"] = "Klipp!";
15
+ EPriceVariant["PRIO"] = "Prio-pris";
16
+ EPriceVariant["REGULAR"] = "Ordinarie";
17
+ })(exports.EPriceVariant || (exports.EPriceVariant = {}));
18
+ //# sourceMappingURL=PriceTag.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PriceTag.types.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
@@ -11,13 +11,13 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
11
11
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
12
 
13
13
  var SearchListItem = function (_a) {
14
- var item = _a.item, button = _a.button, loading = _a.loading, price = _a.price, markings = _a.markings;
14
+ var item = _a.item, button = _a.button, loading = _a.loading, price = _a.price, markings = _a.markings, fallBackImage = _a.fallBackImage;
15
15
  return (React__default["default"].createElement(SearchListItem_styles.SearchListItemWrapper, null,
16
16
  markings && (React__default["default"].createElement(SearchListItem_styles.MarkingWrapper, null, markings === null || markings === void 0 ? void 0 : markings.map(function (marking, index) { return (React__default["default"].createElement(SearchListItem_styles.Marking, { key: index },
17
17
  React__default["default"].createElement(SearchListItem_styles.ToolTip, { backgroundColor: marking === null || marking === void 0 ? void 0 : marking.backgroundColor, left: (index + 1) * 25 }, marking.tooltipText),
18
18
  marking.image)); }))),
19
19
  React__default["default"].createElement(SearchListItem_styles.ListItemWrapper, null,
20
- React__default["default"].createElement(ListItem.ListItem, { usedInSearch: true, loading: loading, item: item })),
20
+ React__default["default"].createElement(ListItem.ListItem, { usedInSearch: true, loading: loading, item: item, fallBackImage: fallBackImage })),
21
21
  React__default["default"].createElement(SearchListItem_styles.PriceTagWrapper, null, price),
22
22
  React__default["default"].createElement(SearchListItem_styles.ButtonWrapper, null, button)));
23
23
  };
@@ -95,7 +95,9 @@ require('../CartSubTotal/CartSubTotal.js');
95
95
  require('../CouponCode/CouponCode.js');
96
96
  require('../CartCardLabel/CartCardLabel.styles.js');
97
97
  require('../CartCard/CartCard.styles.js');
98
- require('../PriceTag/PriceTag.js');
98
+ require('../PriceTag/PriceTag.types.js');
99
+ require('../PriceBanner/PriceBanner.styles.js');
100
+ require('../PriceTag/PriceTag.styles.js');
99
101
  require('../Pill/Pill.styles.js');
100
102
  require('../SelectButton/SelectButton.styles.js');
101
103
 
@@ -1 +1 @@
1
- {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}