@faststore/components 3.0.160 → 3.1.0

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.
@@ -48,9 +48,17 @@ export interface ProductCardContentProps extends HTMLAttributes<HTMLElement> {
48
48
  */
49
49
  includeTaxes?: boolean;
50
50
  /**
51
- * Label to determine if the price includes taxes.
51
+ * Specifies the include taxes label, if taxes are included.
52
52
  */
53
53
  includeTaxesLabel?: string;
54
+ /**
55
+ * Specifies if the displayed product is sponsored.
56
+ */
57
+ sponsored?: boolean;
58
+ /**
59
+ * Specifies the sponsored label, if advertisement is applicable.
60
+ */
61
+ sponsoredLabel?: string;
54
62
  }
55
63
  declare const ProductCardContent: React.ForwardRefExoticComponent<ProductCardContentProps & React.RefAttributes<HTMLElement>>;
56
64
  export default ProductCardContent;
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
5
  const __1 = require("../../");
6
- const ProductCardContent = (0, react_1.forwardRef)(function CardContent({ testId = 'fs-product-card-content', title, linkProps, price, outOfStock, outOfStockLabel = 'Out of stock', ratingValue, showDiscountBadge, buttonLabel = 'Add', onButtonClick, children, includeTaxes = false, includeTaxesLabel = "Tax included", ...otherProps }, ref) {
6
+ const ProductCardContent = (0, react_1.forwardRef)(function CardContent({ testId = 'fs-product-card-content', title, linkProps, price, outOfStock, outOfStockLabel = 'Out of stock', ratingValue, showDiscountBadge, buttonLabel = 'Add', onButtonClick, children, includeTaxes = false, includeTaxesLabel = 'Tax included', sponsored = false, sponsoredLabel = 'Sponsored', ...otherProps }, ref) {
7
7
  const listingPrice = price?.listPrice ? price.listPrice : 0;
8
8
  const sellingPrice = price?.value ? price.value : 0;
9
9
  return (react_1.default.createElement("section", { ref: ref, "data-fs-product-card-content": true, "data-fs-product-card-badge": showDiscountBadge, "data-testid": testId, ...otherProps },
10
+ sponsored && (react_1.default.createElement("span", { "data-fs-product-card-sponsored-label": true }, sponsoredLabel)),
10
11
  react_1.default.createElement("div", { "data-fs-product-card-heading": true },
11
12
  react_1.default.createElement("h3", { "data-fs-product-card-title": true },
12
13
  react_1.default.createElement(__1.Link, { ...linkProps, title: title },
@@ -1 +1 @@
1
- {"version":3,"file":"ProductCardContent.js","sourceRoot":"","sources":["../../../../src/molecules/ProductCard/ProductCardContent.tsx"],"names":[],"mappings":";;;AACA,uDAAyC;AAIzC,8BAWe;AAqDf,MAAM,kBAAkB,GAAG,IAAA,kBAAU,EACnC,SAAS,WAAW,CAClB,EACE,MAAM,GAAG,yBAAyB,EAClC,KAAK,EACL,SAAS,EACT,KAAK,EACL,UAAU,EACV,eAAe,GAAG,cAAc,EAChC,WAAW,EACX,iBAAiB,EACjB,WAAW,GAAG,KAAK,EACnB,aAAa,EACb,QAAQ,EACR,YAAY,GAAG,KAAK,EACpB,iBAAiB,GAAG,cAAc,EAClC,GAAG,UAAU,EACd,EACD,GAAG;IAEH,MAAM,YAAY,GAAG,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3D,MAAM,YAAY,GAAG,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IAEnD,OAAO,CACL,2CACE,GAAG,EAAE,GAAG,sEAEoB,iBAAiB,iBAChC,MAAM,KACf,UAAU;QAEd;YACE;gBACE,8BAAC,QAAI,OAAK,SAAS,EAAE,KAAK,EAAE,KAAK;oBAC/B,4CAAO,KAAK,CAAQ,CACf,CACJ;YACJ,CAAC,UAAU,IAAI,CACd,8BAAC,gBAAY,yCAEX,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,KAAK,EAAE,SAAS,GAC3B,CACH;YACA,YAAY,IAAI,CACf,8BAAC,SAAK,gDACH,iBAAiB,CACZ,CACT;YACA,WAAW,IAAI,CACd,8BAAC,UAAM,IAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,8BAAC,QAAI,IAAC,IAAI,EAAC,MAAM,GAAG,GAAI,CAC3D,CACG;QACL,iBAAiB,IAAI,CAAC,UAAU,IAAI,CACnC,8BAAC,iBAAa,IAAC,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,GAAI,CACpE;QACA,UAAU,IAAI,8BAAC,SAAK,QAAE,eAAe,CAAS;QAC9C,aAAa,IAAI,CAAC,UAAU,IAAI,CAC/B;YACE,8BAAC,UAAM,IACL,OAAO,EAAC,SAAS,EACjB,IAAI,EAAE,8BAAC,QAAI,IAAC,IAAI,EAAC,cAAc,GAAG,EAClC,YAAY,EAAC,MAAM,EACnB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,aAAa,IAErB,WAAW,CACL,CACL,CACP,CACO,CACX,CAAA;AACH,CAAC,CACF,CAAA;AAED,kBAAe,kBAAkB,CAAA"}
1
+ {"version":3,"file":"ProductCardContent.js","sourceRoot":"","sources":["../../../../src/molecules/ProductCard/ProductCardContent.tsx"],"names":[],"mappings":";;;AACA,uDAAyC;AAIzC,8BAWe;AA6Df,MAAM,kBAAkB,GAAG,IAAA,kBAAU,EACnC,SAAS,WAAW,CAClB,EACE,MAAM,GAAG,yBAAyB,EAClC,KAAK,EACL,SAAS,EACT,KAAK,EACL,UAAU,EACV,eAAe,GAAG,cAAc,EAChC,WAAW,EACX,iBAAiB,EACjB,WAAW,GAAG,KAAK,EACnB,aAAa,EACb,QAAQ,EACR,YAAY,GAAG,KAAK,EACpB,iBAAiB,GAAG,cAAc,EAClC,SAAS,GAAG,KAAK,EACjB,cAAc,GAAG,WAAW,EAC5B,GAAG,UAAU,EACd,EACD,GAAG;IAEH,MAAM,YAAY,GAAG,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3D,MAAM,YAAY,GAAG,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IAEnD,OAAO,CACL,2CACE,GAAG,EAAE,GAAG,sEAEoB,iBAAiB,iBAChC,MAAM,KACf,UAAU;QAEb,SAAS,IAAI,CACZ,wFAA4C,cAAc,CAAQ,CACnE;QACD;YACE;gBACE,8BAAC,QAAI,OAAK,SAAS,EAAE,KAAK,EAAE,KAAK;oBAC/B,4CAAO,KAAK,CAAQ,CACf,CACJ;YACJ,CAAC,UAAU,IAAI,CACd,8BAAC,gBAAY,yCAEX,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,KAAK,EAAE,SAAS,GAC3B,CACH;YACA,YAAY,IAAI,CACf,8BAAC,SAAK,gDAAmC,iBAAiB,CAAS,CACpE;YACA,WAAW,IAAI,CACd,8BAAC,UAAM,IAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,8BAAC,QAAI,IAAC,IAAI,EAAC,MAAM,GAAG,GAAI,CAC3D,CACG;QACL,iBAAiB,IAAI,CAAC,UAAU,IAAI,CACnC,8BAAC,iBAAa,IAAC,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,GAAI,CACpE;QACA,UAAU,IAAI,8BAAC,SAAK,QAAE,eAAe,CAAS;QAC9C,aAAa,IAAI,CAAC,UAAU,IAAI,CAC/B;YACE,8BAAC,UAAM,IACL,OAAO,EAAC,SAAS,EACjB,IAAI,EAAE,8BAAC,QAAI,IAAC,IAAI,EAAC,cAAc,GAAG,EAClC,YAAY,EAAC,MAAM,EACnB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,aAAa,IAErB,WAAW,CACL,CACL,CACP,CACO,CACX,CAAA;AACH,CAAC,CACF,CAAA;AAED,kBAAe,kBAAkB,CAAA"}
@@ -48,9 +48,17 @@ export interface ProductCardContentProps extends HTMLAttributes<HTMLElement> {
48
48
  */
49
49
  includeTaxes?: boolean;
50
50
  /**
51
- * Label to determine if the price includes taxes.
51
+ * Specifies the include taxes label, if taxes are included.
52
52
  */
53
53
  includeTaxesLabel?: string;
54
+ /**
55
+ * Specifies if the displayed product is sponsored.
56
+ */
57
+ sponsored?: boolean;
58
+ /**
59
+ * Specifies the sponsored label, if advertisement is applicable.
60
+ */
61
+ sponsoredLabel?: string;
54
62
  }
55
63
  declare const ProductCardContent: React.ForwardRefExoticComponent<ProductCardContentProps & React.RefAttributes<HTMLElement>>;
56
64
  export default ProductCardContent;
@@ -1,9 +1,10 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { Badge, Button, DiscountBadge, Icon, Label, Link, ProductPrice, Rating, } from '../../';
3
- const ProductCardContent = forwardRef(function CardContent({ testId = 'fs-product-card-content', title, linkProps, price, outOfStock, outOfStockLabel = 'Out of stock', ratingValue, showDiscountBadge, buttonLabel = 'Add', onButtonClick, children, includeTaxes = false, includeTaxesLabel = "Tax included", ...otherProps }, ref) {
3
+ const ProductCardContent = forwardRef(function CardContent({ testId = 'fs-product-card-content', title, linkProps, price, outOfStock, outOfStockLabel = 'Out of stock', ratingValue, showDiscountBadge, buttonLabel = 'Add', onButtonClick, children, includeTaxes = false, includeTaxesLabel = 'Tax included', sponsored = false, sponsoredLabel = 'Sponsored', ...otherProps }, ref) {
4
4
  const listingPrice = price?.listPrice ? price.listPrice : 0;
5
5
  const sellingPrice = price?.value ? price.value : 0;
6
6
  return (React.createElement("section", { ref: ref, "data-fs-product-card-content": true, "data-fs-product-card-badge": showDiscountBadge, "data-testid": testId, ...otherProps },
7
+ sponsored && (React.createElement("span", { "data-fs-product-card-sponsored-label": true }, sponsoredLabel)),
7
8
  React.createElement("div", { "data-fs-product-card-heading": true },
8
9
  React.createElement("h3", { "data-fs-product-card-title": true },
9
10
  React.createElement(Link, { ...linkProps, title: title },
@@ -1 +1 @@
1
- {"version":3,"file":"ProductCardContent.js","sourceRoot":"","sources":["../../../../src/molecules/ProductCard/ProductCardContent.tsx"],"names":[],"mappings":"A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,CACG;QACL,iBAAiB,IAAI,CAAC,UAAU,IAAI,CACnC,oBAAC,aAAa,IAAC,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,GAAI,CACpE;QACA,UAAU,IAAI,oBAAC,KAAK,QAAE,eAAe,CAAS;QAC9C,aAAa,IAAI,CAAC,UAAU,IAAI,CAC/B;YACE,oBAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,IAAI,EAAE,oBAAC,IAAI,IAAC,IAAI,EAAC,cAAc,GAAG,EAClC,YAAY,EAAC,MAAM,EACnB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,aAAa,IAErB,WAAW,CACL,CACL,CACP,CACO,CACX,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,kBAAkB,CAAA"}
1
+ {"version":3,"file":"ProductCardContent.js","sourceRoot":"","sources":["../../../../src/molecules/ProductCard/ProductCardContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAIzC,OAAO,EACL,KAAK,EACL,MAAM,EACN,aAAa,EACb,IAAI,EACJ,KAAK,EACL,IAAI,EAGJ,YAAY,EACZ,MAAM,GACP,MAAM,QAAQ,CAAA;AA6Df,MAAM,kBAAkB,GAAG,UAAU,CACnC,SAAS,WAAW,CAClB,EACE,MAAM,GAAG,yBAAyB,EAClC,KAAK,EACL,SAAS,EACT,KAAK,EACL,UAAU,EACV,eAAe,GAAG,cAAc,EAChC,WAAW,EACX,iBAAiB,EACjB,WAAW,GAAG,KAAK,EACnB,aAAa,EACb,QAAQ,EACR,YAAY,GAAG,KAAK,EACpB,iBAAiB,GAAG,cAAc,EAClC,SAAS,GAAG,KAAK,EACjB,cAAc,GAAG,WAAW,EAC5B,GAAG,UAAU,EACd,EACD,GAAG;IAEH,MAAM,YAAY,GAAG,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3D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0.160",
3
+ "version": "3.1.0",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "typings": "dist/esm/index.d.ts",
@@ -52,5 +52,5 @@
52
52
  "volta": {
53
53
  "extends": "../../package.json"
54
54
  },
55
- "gitHead": "6fab6a4747bac2555a38adc9ad6c6ecfa71e8761"
55
+ "gitHead": "f3cbb155a5cd6ecf7b48bc2eb7b24e83f6125c7b"
56
56
  }
@@ -62,9 +62,17 @@ export interface ProductCardContentProps extends HTMLAttributes<HTMLElement> {
62
62
  */
63
63
  includeTaxes?: boolean
64
64
  /**
65
- * Label to determine if the price includes taxes.
65
+ * Specifies the include taxes label, if taxes are included.
66
66
  */
67
67
  includeTaxesLabel?: string
68
+ /**
69
+ * Specifies if the displayed product is sponsored.
70
+ */
71
+ sponsored?: boolean
72
+ /**
73
+ * Specifies the sponsored label, if advertisement is applicable.
74
+ */
75
+ sponsoredLabel?: string
68
76
  }
69
77
 
70
78
  const ProductCardContent = forwardRef<HTMLElement, ProductCardContentProps>(
@@ -82,7 +90,9 @@ const ProductCardContent = forwardRef<HTMLElement, ProductCardContentProps>(
82
90
  onButtonClick,
83
91
  children,
84
92
  includeTaxes = false,
85
- includeTaxesLabel = "Tax included",
93
+ includeTaxesLabel = 'Tax included',
94
+ sponsored = false,
95
+ sponsoredLabel = 'Sponsored',
86
96
  ...otherProps
87
97
  },
88
98
  ref
@@ -98,6 +108,9 @@ const ProductCardContent = forwardRef<HTMLElement, ProductCardContentProps>(
98
108
  data-testid={testId}
99
109
  {...otherProps}
100
110
  >
111
+ {sponsored && (
112
+ <span data-fs-product-card-sponsored-label>{sponsoredLabel}</span>
113
+ )}
101
114
  <div data-fs-product-card-heading>
102
115
  <h3 data-fs-product-card-title>
103
116
  <Link {...linkProps} title={title}>
@@ -113,9 +126,7 @@ const ProductCardContent = forwardRef<HTMLElement, ProductCardContentProps>(
113
126
  />
114
127
  )}
115
128
  {includeTaxes && (
116
- <Label data-fs-product-card-taxes-label>
117
- {includeTaxesLabel}
118
- </Label>
129
+ <Label data-fs-product-card-taxes-label>{includeTaxesLabel}</Label>
119
130
  )}
120
131
  {ratingValue && (
121
132
  <Rating value={ratingValue} icon={<Icon name="Star" />} />