@faststore/components 2.2.56 → 2.2.67
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.
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.js +10 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/molecules/CartItem/CartItem.js +1 -3
- package/dist/cjs/molecules/CartItem/CartItem.js.map +1 -1
- package/dist/cjs/molecules/ProductCard/ProductCardContent.js +4 -8
- package/dist/cjs/molecules/ProductCard/ProductCardContent.js.map +1 -1
- package/dist/cjs/molecules/ProductPrice/ProductPrice.d.ts +24 -0
- package/dist/cjs/molecules/ProductPrice/ProductPrice.js +14 -0
- package/dist/cjs/molecules/ProductPrice/ProductPrice.js.map +1 -0
- package/dist/cjs/molecules/ProductPrice/index.d.ts +2 -0
- package/dist/cjs/molecules/ProductPrice/index.js +9 -0
- package/dist/cjs/molecules/ProductPrice/index.js.map +1 -0
- package/dist/cjs/molecules/SearchProducts/SearchProductItemContent.js +1 -3
- package/dist/cjs/molecules/SearchProducts/SearchProductItemContent.js.map +1 -1
- package/dist/cjs/organisms/BannerText/BannerText.js +1 -1
- package/dist/cjs/organisms/BannerText/BannerText.js.map +1 -1
- package/dist/cjs/organisms/Newsletter/Newsletter.d.ts +19 -0
- package/dist/cjs/organisms/Newsletter/Newsletter.js +9 -0
- package/dist/cjs/organisms/Newsletter/Newsletter.js.map +1 -0
- package/dist/cjs/organisms/Newsletter/NewsletterAddendum.d.ts +14 -0
- package/dist/cjs/organisms/Newsletter/NewsletterAddendum.js +9 -0
- package/dist/cjs/organisms/Newsletter/NewsletterAddendum.js.map +1 -0
- package/dist/cjs/organisms/Newsletter/NewsletterContent.d.ts +10 -0
- package/dist/cjs/organisms/Newsletter/NewsletterContent.js +9 -0
- package/dist/cjs/organisms/Newsletter/NewsletterContent.js.map +1 -0
- package/dist/cjs/organisms/Newsletter/NewsletterForm.d.ts +14 -0
- package/dist/cjs/organisms/Newsletter/NewsletterForm.js +9 -0
- package/dist/cjs/organisms/Newsletter/NewsletterForm.js.map +1 -0
- package/dist/cjs/organisms/Newsletter/NewsletterHeader.d.ts +22 -0
- package/dist/cjs/organisms/Newsletter/NewsletterHeader.js +13 -0
- package/dist/cjs/organisms/Newsletter/NewsletterHeader.js.map +1 -0
- package/dist/cjs/organisms/Newsletter/index.d.ts +10 -0
- package/dist/cjs/organisms/Newsletter/index.js +17 -0
- package/dist/cjs/organisms/Newsletter/index.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/molecules/CartItem/CartItem.js +2 -4
- package/dist/esm/molecules/CartItem/CartItem.js.map +1 -1
- package/dist/esm/molecules/ProductCard/ProductCardContent.js +5 -9
- package/dist/esm/molecules/ProductCard/ProductCardContent.js.map +1 -1
- package/dist/esm/molecules/ProductPrice/ProductPrice.d.ts +24 -0
- package/dist/esm/molecules/ProductPrice/ProductPrice.js +11 -0
- package/dist/esm/molecules/ProductPrice/ProductPrice.js.map +1 -0
- package/dist/esm/molecules/ProductPrice/index.d.ts +2 -0
- package/dist/esm/molecules/ProductPrice/index.js +2 -0
- package/dist/esm/molecules/ProductPrice/index.js.map +1 -0
- package/dist/esm/molecules/SearchProducts/SearchProductItemContent.js +2 -4
- package/dist/esm/molecules/SearchProducts/SearchProductItemContent.js.map +1 -1
- package/dist/esm/organisms/BannerText/BannerText.js +1 -1
- package/dist/esm/organisms/BannerText/BannerText.js.map +1 -1
- package/dist/esm/organisms/Newsletter/Newsletter.d.ts +19 -0
- package/dist/esm/organisms/Newsletter/Newsletter.js +6 -0
- package/dist/esm/organisms/Newsletter/Newsletter.js.map +1 -0
- package/dist/esm/organisms/Newsletter/NewsletterAddendum.d.ts +14 -0
- package/dist/esm/organisms/Newsletter/NewsletterAddendum.js +6 -0
- package/dist/esm/organisms/Newsletter/NewsletterAddendum.js.map +1 -0
- package/dist/esm/organisms/Newsletter/NewsletterContent.d.ts +10 -0
- package/dist/esm/organisms/Newsletter/NewsletterContent.js +6 -0
- package/dist/esm/organisms/Newsletter/NewsletterContent.js.map +1 -0
- package/dist/esm/organisms/Newsletter/NewsletterForm.d.ts +14 -0
- package/dist/esm/organisms/Newsletter/NewsletterForm.js +6 -0
- package/dist/esm/organisms/Newsletter/NewsletterForm.js.map +1 -0
- package/dist/esm/organisms/Newsletter/NewsletterHeader.d.ts +22 -0
- package/dist/esm/organisms/Newsletter/NewsletterHeader.js +10 -0
- package/dist/esm/organisms/Newsletter/NewsletterHeader.js.map +1 -0
- package/dist/esm/organisms/Newsletter/index.d.ts +10 -0
- package/dist/esm/organisms/Newsletter/index.js +6 -0
- package/dist/esm/organisms/Newsletter/index.js.map +1 -0
- package/package.json +2 -2
- package/src/index.ts +17 -0
- package/src/molecules/CartItem/CartItem.tsx +13 -15
- package/src/molecules/ProductCard/ProductCardContent.tsx +10 -40
- package/src/molecules/ProductPrice/ProductPrice.tsx +71 -0
- package/src/molecules/ProductPrice/index.ts +2 -0
- package/src/molecules/SearchProducts/SearchProductItemContent.tsx +9 -18
- package/src/organisms/BannerText/BannerText.tsx +1 -0
- package/src/organisms/Newsletter/Newsletter.tsx +48 -0
- package/src/organisms/Newsletter/NewsletterAddendum.tsx +34 -0
- package/src/organisms/Newsletter/NewsletterContent.tsx +30 -0
- package/src/organisms/Newsletter/NewsletterForm.tsx +38 -0
- package/src/organisms/Newsletter/NewsletterHeader.tsx +55 -0
- package/src/organisms/Newsletter/index.ts +14 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { HTMLAttributes } from 'react';
|
|
3
|
+
import type { PriceFormatter } from '../../atoms/Price';
|
|
4
|
+
export interface ProductPriceProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/**
|
|
6
|
+
* Specifies product's raw price value.
|
|
7
|
+
*/
|
|
8
|
+
value: number;
|
|
9
|
+
/**
|
|
10
|
+
* Specifies product's listing price.
|
|
11
|
+
*/
|
|
12
|
+
listPrice: number;
|
|
13
|
+
/**
|
|
14
|
+
* Formatter function that transforms the raw price value and render the result.
|
|
15
|
+
*/
|
|
16
|
+
formatter?: PriceFormatter;
|
|
17
|
+
/**
|
|
18
|
+
* ID to find this component in testing tools (e.g.: cypress,
|
|
19
|
+
* testing-library, and jest).
|
|
20
|
+
*/
|
|
21
|
+
testId?: string;
|
|
22
|
+
}
|
|
23
|
+
declare const ProductPrice: React.ForwardRefExoticComponent<ProductPriceProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
export default ProductPrice;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { Price } from '../../';
|
|
3
|
+
const ProductPrice = forwardRef(function ProductCard({ testId = 'fs-product-price', value, listPrice, formatter, ...otherProps }, ref) {
|
|
4
|
+
const listingPrice = listPrice ?? 0;
|
|
5
|
+
const sellingPrice = value ?? 0;
|
|
6
|
+
return (React.createElement("div", { ref: ref, "data-fs-product-price": true, "data-testid": testId, ...otherProps }, sellingPrice !== listingPrice && listingPrice !== 0 ? (React.createElement(React.Fragment, null,
|
|
7
|
+
React.createElement(Price, { value: listingPrice, formatter: formatter, testId: "list-price", "data-value": listingPrice, variant: "listing", SRText: "Original price:" }),
|
|
8
|
+
React.createElement(Price, { value: sellingPrice, formatter: formatter, testId: "price", "data-value": sellingPrice, variant: "spot", SRText: "Price:" }))) : (React.createElement(Price, { value: sellingPrice, formatter: formatter, testId: "price", "data-value": sellingPrice, variant: "spot", SRText: "Price:" }))));
|
|
9
|
+
});
|
|
10
|
+
export default ProductPrice;
|
|
11
|
+
//# sourceMappingURL=ProductPrice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductPrice.js","sourceRoot":"","sources":["../../../../src/molecules/ProductPrice/ProductPrice.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAIzC,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAsB9B,MAAM,YAAY,GAAG,UAAU,CAC7B,SAAS,WAAW,CAClB,EAAE,MAAM,GAAG,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,UAAU,EAAE,EAC3E,GAAG;IAEH,MAAM,YAAY,GAAG,SAAS,IAAI,CAAC,CAAA;IACnC,MAAM,YAAY,GAAG,KAAK,IAAI,CAAC,CAAA;IAE/B,OAAO,CACL,6BAAK,GAAG,EAAE,GAAG,gDAAqC,MAAM,KAAM,UAAU,IACrE,YAAY,KAAK,YAAY,IAAI,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CACrD;QACE,oBAAC,KAAK,IACJ,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAC,YAAY,gBACP,YAAY,EACxB,OAAO,EAAC,SAAS,EACjB,MAAM,EAAC,iBAAiB,GACxB;QACF,oBAAC,KAAK,IACJ,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAC,OAAO,gBACF,YAAY,EACxB,OAAO,EAAC,MAAM,EACd,MAAM,EAAC,QAAQ,GACf,CACD,CACJ,CAAC,CAAC,CAAC,CACF,oBAAC,KAAK,IACJ,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAC,OAAO,gBACF,YAAY,EACxB,OAAO,EAAC,MAAM,EACd,MAAM,EAAC,QAAQ,GACf,CACH,CACG,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/molecules/ProductPrice/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ProductPrice } from '../..';
|
|
3
3
|
const SearchProductItemContent = forwardRef(function SearchProductItemContent({ price, title, ...otherProps }, ref) {
|
|
4
4
|
return (React.createElement("section", { ref: ref, "data-fs-search-product-item-content": true, ...otherProps },
|
|
5
5
|
React.createElement("p", { "data-fs-search-product-item-title": true }, title),
|
|
6
|
-
React.createElement(
|
|
7
|
-
React.createElement(Price, { value: price?.listPrice ? price.listPrice : 0, formatter: price?.formatter, testId: "list-price", "data-value": price?.listPrice, variant: "listing", SRText: "Original price:" }),
|
|
8
|
-
React.createElement(Price, { value: price?.value ? price.value : 0, formatter: price?.formatter, testId: "price", "data-value": price?.value, variant: "spot", SRText: "Price:" }))));
|
|
6
|
+
price.value !== 0 && (React.createElement(ProductPrice, { "data-fs-search-product-item-prices": true, listPrice: price.listPrice, value: price.value, formatter: price.formatter }))));
|
|
9
7
|
});
|
|
10
8
|
export default SearchProductItemContent;
|
|
11
9
|
//# sourceMappingURL=SearchProductItemContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchProductItemContent.js","sourceRoot":"","sources":["../../../../src/molecules/SearchProducts/SearchProductItemContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SearchProductItemContent.js","sourceRoot":"","sources":["../../../../src/molecules/SearchProducts/SearchProductItemContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAepC,MAAM,wBAAwB,GAAG,UAAU,CAGzC,SAAS,wBAAwB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG;IACtE,OAAO,CACL,iCAAS,GAAG,EAAE,GAAG,kDAA0C,UAAU;QACnE,wEAAsC,KAAK,CAAK;QAE/C,KAAK,CAAC,KAAK,KAAK,CAAC,IAAI,CACpB,oBAAC,YAAY,gDAEX,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,SAAS,EAAE,KAAK,CAAC,SAAS,GAC1B,CACH,CACO,CACX,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,wBAAwB,CAAA"}
|
|
@@ -3,7 +3,7 @@ const BannerTextContext = createContext(undefined);
|
|
|
3
3
|
const BannerText = forwardRef(function BannerText({ children, testId = 'fs-banner-text', variant = 'primary', colorVariant = 'main', ...otherProps }, ref) {
|
|
4
4
|
const context = { variant, colorVariant };
|
|
5
5
|
return (React.createElement(BannerTextContext.Provider, { value: context },
|
|
6
|
-
React.createElement("article", { ref: ref, "data-fs-banner-text": true, "data-fs-banner-text-variant": variant, "data-fs-banner-text-color-variant": colorVariant, "data-testid": testId, ...otherProps }, children)));
|
|
6
|
+
React.createElement("article", { ref: ref, "data-fs-banner-text": true, "data-fs-content": "banner-text", "data-fs-banner-text-variant": variant, "data-fs-banner-text-color-variant": colorVariant, "data-testid": testId, ...otherProps }, children)));
|
|
7
7
|
});
|
|
8
8
|
export function useBannerText() {
|
|
9
9
|
const context = useContext(BannerTextContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerText.js","sourceRoot":"","sources":["../../../../src/organisms/BannerText/BannerText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAWpE,MAAM,iBAAiB,GAAG,aAAa,CACrC,SAAS,CACV,CAAA;AAkBD,MAAM,UAAU,GAAG,UAAU,CAC3B,SAAS,UAAU,CACjB,EACE,QAAQ,EACR,MAAM,GAAG,gBAAgB,EACzB,OAAO,GAAG,SAAS,EACnB,YAAY,GAAG,MAAM,EACrB,GAAG,UAAU,EACd,EACD,GAAG;IAEH,MAAM,OAAO,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,CAAA;IAEzC,OAAO,CACL,oBAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO;QACxC,iCACE,GAAG,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"BannerText.js","sourceRoot":"","sources":["../../../../src/organisms/BannerText/BannerText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAWpE,MAAM,iBAAiB,GAAG,aAAa,CACrC,SAAS,CACV,CAAA;AAkBD,MAAM,UAAU,GAAG,UAAU,CAC3B,SAAS,UAAU,CACjB,EACE,QAAQ,EACR,MAAM,GAAG,gBAAgB,EACzB,OAAO,GAAG,SAAS,EACnB,YAAY,GAAG,MAAM,EACrB,GAAG,UAAU,EACd,EACD,GAAG;IAEH,MAAM,OAAO,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,CAAA;IAEzC,OAAO,CACL,oBAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO;QACxC,iCACE,GAAG,EAAE,GAAG,kDAEQ,aAAa,iCACA,OAAO,uCACD,YAAY,iBAClC,MAAM,KACf,UAAU,IAEb,QAAQ,CACD,CACiB,CAC9B,CAAA;AACH,CAAC,CACF,CAAA;AAED,MAAM,UAAU,aAAa;IAC3B,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAE7C,IAAI,OAAO,KAAK,SAAS,EAAE;QACzB,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAA;KACF;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { HTMLAttributes, DetailedHTMLProps } from 'react';
|
|
3
|
+
type ColorVariant = 'main' | 'light' | 'accent';
|
|
4
|
+
export interface NewsletterProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
5
|
+
/**
|
|
6
|
+
* Enables the card Variant.
|
|
7
|
+
*/
|
|
8
|
+
card: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Specifies the component's color variant combination.
|
|
11
|
+
*/
|
|
12
|
+
colorVariant?: ColorVariant;
|
|
13
|
+
/**
|
|
14
|
+
* ID to find this component in testing tools (e.g.: Cypress, Testing Library, and Jest).
|
|
15
|
+
*/
|
|
16
|
+
testId?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const Newsletter: React.ForwardRefExoticComponent<Omit<NewsletterProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export default Newsletter;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
const Newsletter = forwardRef(function Newsletter({ card, children, colorVariant = 'main', testId = 'fs-newsletter', ...otherProps }, ref) {
|
|
3
|
+
return (React.createElement("div", { ref: ref, "data-testid": testId, "data-fs-content": "newsletter", "data-fs-newsletter": card ? 'card' : '', "data-fs-newsletter-color-variant": colorVariant, ...otherProps }, children));
|
|
4
|
+
});
|
|
5
|
+
export default Newsletter;
|
|
6
|
+
//# sourceMappingURL=Newsletter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Newsletter.js","sourceRoot":"","sources":["../../../../src/organisms/Newsletter/Newsletter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAqBzC,MAAM,UAAU,GAAG,UAAU,CAC3B,SAAS,UAAU,CACjB,EACE,IAAI,EACJ,QAAQ,EACR,YAAY,GAAG,MAAM,EACrB,MAAM,GAAG,eAAe,EACxB,GAAG,UAAU,EACd,EACD,GAAG;IAEH,OAAO,CACL,6BACE,GAAG,EAAE,GAAG,iBACK,MAAM,qBACH,YAAY,wBACR,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,sCACJ,YAAY,KAC1C,UAAU,IAEb,QAAQ,CACL,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { HTMLAttributes, DetailedHTMLProps } from 'react';
|
|
3
|
+
export interface NewsletterAddendumProps extends DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Specifies the addendum for the subscription.
|
|
6
|
+
*/
|
|
7
|
+
addendum?: string;
|
|
8
|
+
/**
|
|
9
|
+
* ID to find this component in testing tools (e.g.: Cypress, Testing Library, and Jest).
|
|
10
|
+
*/
|
|
11
|
+
testId?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const NewsletterAddendum: React.ForwardRefExoticComponent<Omit<NewsletterAddendumProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
14
|
+
export default NewsletterAddendum;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
const NewsletterAddendum = forwardRef(function NewsletterAddendum({ addendum, testId = 'fs-newsletter-addendum', ...otherProps }, ref) {
|
|
3
|
+
return (React.createElement("span", { ref: ref, "data-testid": testId, "data-fs-newsletter-addendum": true, ...otherProps }, addendum));
|
|
4
|
+
});
|
|
5
|
+
export default NewsletterAddendum;
|
|
6
|
+
//# sourceMappingURL=NewsletterAddendum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NewsletterAddendum.js","sourceRoot":"","sources":["../../../../src/organisms/Newsletter/NewsletterAddendum.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAezC,MAAM,kBAAkB,GAAG,UAAU,CACnC,SAAS,kBAAkB,CACzB,EAAE,QAAQ,EAAE,MAAM,GAAG,wBAAwB,EAAE,GAAG,UAAU,EAAE,EAC9D,GAAG;IAEH,OAAO,CACL,8BACE,GAAG,EAAE,GAAG,iBACK,MAAM,0CAEf,UAAU,IAEb,QAAQ,CACJ,CACR,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { HTMLAttributes, DetailedHTMLProps } from 'react';
|
|
3
|
+
export interface NewsletterContentProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* ID to find this component in testing tools (e.g.: Cypress, Testing Library, and Jest).
|
|
6
|
+
*/
|
|
7
|
+
testId?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const NewsletterContent: React.ForwardRefExoticComponent<Omit<NewsletterContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export default NewsletterContent;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
const NewsletterContent = forwardRef(function NewsletterContent({ children, testId = 'fs-newsletter-content', ...otherProps }, ref) {
|
|
3
|
+
return (React.createElement("div", { ref: ref, "data-testid": testId, "data-fs-newsletter-content": true, ...otherProps }, children));
|
|
4
|
+
});
|
|
5
|
+
export default NewsletterContent;
|
|
6
|
+
//# sourceMappingURL=NewsletterContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NewsletterContent.js","sourceRoot":"","sources":["../../../../src/organisms/Newsletter/NewsletterContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAWzC,MAAM,iBAAiB,GAAG,UAAU,CAClC,SAAS,iBAAiB,CACxB,EAAE,QAAQ,EAAE,MAAM,GAAG,uBAAuB,EAAE,GAAG,UAAU,EAAE,EAC7D,GAAG;IAEH,OAAO,CACL,6BACE,GAAG,EAAE,GAAG,iBACK,MAAM,yCAEf,UAAU,IAEb,QAAQ,CACL,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FormEvent, HTMLAttributes, DetailedHTMLProps } from 'react';
|
|
3
|
+
export interface NewsletterFormProps extends DetailedHTMLProps<Omit<HTMLAttributes<HTMLFormElement>, 'onSubmit'>, HTMLFormElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Function called when submit button is clicked.
|
|
6
|
+
*/
|
|
7
|
+
onSubmit: (event: FormEvent) => void;
|
|
8
|
+
/**
|
|
9
|
+
* ID to find this component in testing tools (e.g.: Cypress, Testing Library, and Jest).
|
|
10
|
+
*/
|
|
11
|
+
testId?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const NewsletterForm: React.ForwardRefExoticComponent<Omit<NewsletterFormProps, "ref"> & React.RefAttributes<HTMLFormElement>>;
|
|
14
|
+
export default NewsletterForm;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
const NewsletterForm = forwardRef(function NewsletterForm({ children, onSubmit, testId = 'fs-newsletter-form', ...otherProps }, ref) {
|
|
3
|
+
return (React.createElement("form", { ref: ref, "data-testid": testId, "data-fs-newsletter-form": true, onSubmit: onSubmit, ...otherProps }, children));
|
|
4
|
+
});
|
|
5
|
+
export default NewsletterForm;
|
|
6
|
+
//# sourceMappingURL=NewsletterForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NewsletterForm.js","sourceRoot":"","sources":["../../../../src/organisms/Newsletter/NewsletterForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAkBzC,MAAM,cAAc,GAAG,UAAU,CAC/B,SAAS,cAAc,CACrB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,oBAAoB,EAAE,GAAG,UAAU,EAAE,EACpE,GAAG;IAEH,OAAO,CACL,8BACE,GAAG,EAAE,GAAG,iBACK,MAAM,mCAEnB,QAAQ,EAAE,QAAQ,KACd,UAAU,IAEb,QAAQ,CACJ,CACR,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode, HTMLAttributes, DetailedHTMLProps } from 'react';
|
|
3
|
+
export interface NewsletterHeaderProps extends DetailedHTMLProps<HTMLAttributes<HTMLHeadElement>, HTMLHeadElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Icon for the section.
|
|
6
|
+
*/
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Title for the section.
|
|
10
|
+
*/
|
|
11
|
+
title: string;
|
|
12
|
+
/**
|
|
13
|
+
* A description for the section.
|
|
14
|
+
*/
|
|
15
|
+
description?: string;
|
|
16
|
+
/**
|
|
17
|
+
* ID to find this component in testing tools (e.g.: Cypress, Testing Library, and Jest).
|
|
18
|
+
*/
|
|
19
|
+
testId?: string;
|
|
20
|
+
}
|
|
21
|
+
declare const NewsletterHeader: React.ForwardRefExoticComponent<Omit<NewsletterHeaderProps, "ref"> & React.RefAttributes<HTMLHeadElement>>;
|
|
22
|
+
export default NewsletterHeader;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
const NewsletterHeader = forwardRef(function NewsletterHeader({ icon, title, description, testId = 'fs-newsletter-header', ...otherProps }, ref) {
|
|
3
|
+
return (React.createElement("header", { ref: ref, "data-testid": testId, "data-fs-newsletter-header": true, ...otherProps },
|
|
4
|
+
React.createElement("h3", { "data-fs-newsletter-header-title": true },
|
|
5
|
+
icon,
|
|
6
|
+
title),
|
|
7
|
+
description && (React.createElement("span", { "data-fs-newsletter-header-description": true }, description))));
|
|
8
|
+
});
|
|
9
|
+
export default NewsletterHeader;
|
|
10
|
+
//# sourceMappingURL=NewsletterHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NewsletterHeader.js","sourceRoot":"","sources":["../../../../src/organisms/Newsletter/NewsletterHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAuBzC,MAAM,gBAAgB,GAAG,UAAU,CACjC,SAAS,gBAAgB,CACvB,EACE,IAAI,EACJ,KAAK,EACL,WAAW,EACX,MAAM,GAAG,sBAAsB,EAC/B,GAAG,UAAU,EACd,EACD,GAAG;IAEH,OAAO,CACL,gCACE,GAAG,EAAE,GAAG,iBACK,MAAM,wCAEf,UAAU;QAEd;YACG,IAAI;YACJ,KAAK,CACH;QAEJ,WAAW,IAAI,CACd,+EAA6C,WAAW,CAAQ,CACjE,CACM,CACV,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default } from './Newsletter';
|
|
2
|
+
export type { NewsletterProps } from './Newsletter';
|
|
3
|
+
export { default as NewsletterAddendum } from './NewsletterAddendum';
|
|
4
|
+
export type { NewsletterAddendumProps } from './NewsletterAddendum';
|
|
5
|
+
export { default as NewsletterContent } from './NewsletterContent';
|
|
6
|
+
export type { NewsletterContentProps } from './NewsletterContent';
|
|
7
|
+
export { default as NewsletterForm } from './NewsletterForm';
|
|
8
|
+
export type { NewsletterFormProps } from './NewsletterForm';
|
|
9
|
+
export { default as NewsletterHeader } from './NewsletterHeader';
|
|
10
|
+
export type { NewsletterHeaderProps } from './NewsletterHeader';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default } from './Newsletter';
|
|
2
|
+
export { default as NewsletterAddendum } from './NewsletterAddendum';
|
|
3
|
+
export { default as NewsletterContent } from './NewsletterContent';
|
|
4
|
+
export { default as NewsletterForm } from './NewsletterForm';
|
|
5
|
+
export { default as NewsletterHeader } from './NewsletterHeader';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/organisms/Newsletter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAGpE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGlE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAG5D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/components",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.67",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"typings": "dist/esm/index.d.ts",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"volta": {
|
|
45
45
|
"extends": "../../package.json"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "2e3616dde052d47d898067f985b4b0e067311495"
|
|
48
48
|
}
|
package/src/index.ts
CHANGED
|
@@ -129,6 +129,8 @@ export type {
|
|
|
129
129
|
ProductCardImageProps,
|
|
130
130
|
ProductCardContentProps,
|
|
131
131
|
} from './molecules/ProductCard'
|
|
132
|
+
export { default as ProductPrice } from './molecules/ProductPrice'
|
|
133
|
+
export type { ProductPriceProps } from './molecules/ProductPrice'
|
|
132
134
|
export { default as ProductTitle } from './molecules/ProductTitle'
|
|
133
135
|
export type { ProductTitleProps } from './molecules/ProductTitle'
|
|
134
136
|
export { default as RadioField } from './molecules/RadioField'
|
|
@@ -293,6 +295,21 @@ export type {
|
|
|
293
295
|
NavbarSliderFooterProps,
|
|
294
296
|
} from './organisms/NavbarSlider'
|
|
295
297
|
|
|
298
|
+
export {
|
|
299
|
+
default as Newsletter,
|
|
300
|
+
NewsletterAddendum,
|
|
301
|
+
NewsletterContent,
|
|
302
|
+
NewsletterForm,
|
|
303
|
+
NewsletterHeader,
|
|
304
|
+
} from './organisms/Newsletter'
|
|
305
|
+
export type {
|
|
306
|
+
NewsletterProps,
|
|
307
|
+
NewsletterAddendumProps,
|
|
308
|
+
NewsletterContentProps,
|
|
309
|
+
NewsletterFormProps,
|
|
310
|
+
NewsletterHeaderProps,
|
|
311
|
+
} from './organisms/Newsletter'
|
|
312
|
+
|
|
296
313
|
export { default as OutOfStock } from './organisms/OutOfStock'
|
|
297
314
|
export type { OutOfStockProps } from './organisms/OutOfStock'
|
|
298
315
|
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
Icon,
|
|
6
|
+
IconButton,
|
|
7
|
+
IconButtonProps,
|
|
8
|
+
ProductPrice,
|
|
9
|
+
QuantitySelector,
|
|
10
|
+
} from '../../'
|
|
5
11
|
|
|
6
12
|
import type { PriceDefinition } from '../../typings/PriceDefinition'
|
|
7
13
|
|
|
@@ -65,20 +71,12 @@ const CartItem = forwardRef<HTMLDivElement, CartItemProps>(function CartItem(
|
|
|
65
71
|
initial={quantity}
|
|
66
72
|
onChange={onQuantityChange}
|
|
67
73
|
/>
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
/>
|
|
75
|
-
<Price
|
|
76
|
-
value={price?.value ? price.value : 0}
|
|
77
|
-
formatter={price?.formatter}
|
|
78
|
-
variant="spot"
|
|
79
|
-
SRText="Price:"
|
|
80
|
-
/>
|
|
81
|
-
</span>
|
|
74
|
+
<ProductPrice
|
|
75
|
+
data-fs-cart-item-prices
|
|
76
|
+
listPrice={price?.listPrice ? price.listPrice : 0}
|
|
77
|
+
value={price?.value ? price.value : 0}
|
|
78
|
+
formatter={price?.formatter}
|
|
79
|
+
/>
|
|
82
80
|
</div>
|
|
83
81
|
</article>
|
|
84
82
|
)
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
Link,
|
|
12
12
|
LinkElementType,
|
|
13
13
|
LinkProps,
|
|
14
|
-
|
|
14
|
+
ProductPrice,
|
|
15
15
|
Rating,
|
|
16
16
|
} from '../../'
|
|
17
17
|
|
|
@@ -76,8 +76,8 @@ const ProductCardContent = forwardRef<HTMLElement, ProductCardContentProps>(
|
|
|
76
76
|
},
|
|
77
77
|
ref
|
|
78
78
|
) {
|
|
79
|
-
const
|
|
80
|
-
const sellingPrice = price?.value
|
|
79
|
+
const listingPrice = price?.listPrice ? price.listPrice : 0
|
|
80
|
+
const sellingPrice = price?.value ? price.value : 0
|
|
81
81
|
|
|
82
82
|
return (
|
|
83
83
|
<section
|
|
@@ -94,49 +94,19 @@ const ProductCardContent = forwardRef<HTMLElement, ProductCardContentProps>(
|
|
|
94
94
|
</Link>
|
|
95
95
|
</h3>
|
|
96
96
|
{!outOfStock && (
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
formatter={price?.formatter}
|
|
104
|
-
testId="list-price"
|
|
105
|
-
data-value={listPrice}
|
|
106
|
-
variant="listing"
|
|
107
|
-
SRText="Original price:"
|
|
108
|
-
/>
|
|
109
|
-
<Price
|
|
110
|
-
value={sellingPrice}
|
|
111
|
-
formatter={price?.formatter}
|
|
112
|
-
testId="price"
|
|
113
|
-
data-value={sellingPrice}
|
|
114
|
-
variant="spot"
|
|
115
|
-
SRText="Sale Price:"
|
|
116
|
-
/>
|
|
117
|
-
</>
|
|
118
|
-
)
|
|
119
|
-
: (
|
|
120
|
-
<Price
|
|
121
|
-
value={sellingPrice}
|
|
122
|
-
formatter={price?.formatter}
|
|
123
|
-
testId="price"
|
|
124
|
-
data-value={sellingPrice}
|
|
125
|
-
variant="spot"
|
|
126
|
-
SRText="Sale Price:"
|
|
127
|
-
/>
|
|
128
|
-
)}
|
|
129
|
-
</div>
|
|
97
|
+
<ProductPrice
|
|
98
|
+
data-fs-product-card-prices
|
|
99
|
+
value={sellingPrice}
|
|
100
|
+
listPrice={listingPrice}
|
|
101
|
+
formatter={price?.formatter}
|
|
102
|
+
/>
|
|
130
103
|
)}
|
|
131
104
|
{ratingValue && (
|
|
132
105
|
<Rating value={ratingValue} icon={<Icon name="Star" />} />
|
|
133
106
|
)}
|
|
134
107
|
</div>
|
|
135
108
|
{showDiscountBadge && !outOfStock && (
|
|
136
|
-
<DiscountBadge
|
|
137
|
-
listPrice={price?.listPrice ? price.listPrice : 0}
|
|
138
|
-
spotPrice={price?.value ? price.value : 0}
|
|
139
|
-
/>
|
|
109
|
+
<DiscountBadge listPrice={listingPrice} spotPrice={sellingPrice} />
|
|
140
110
|
)}
|
|
141
111
|
{outOfStock && <Badge>{outOfStockLabel}</Badge>}
|
|
142
112
|
{onButtonClick && !outOfStock && (
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react'
|
|
2
|
+
import type { HTMLAttributes } from 'react'
|
|
3
|
+
|
|
4
|
+
import type { PriceFormatter } from '../../atoms/Price'
|
|
5
|
+
import { Price } from '../../'
|
|
6
|
+
|
|
7
|
+
export interface ProductPriceProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
/**
|
|
9
|
+
* Specifies product's raw price value.
|
|
10
|
+
*/
|
|
11
|
+
value: number
|
|
12
|
+
/**
|
|
13
|
+
* Specifies product's listing price.
|
|
14
|
+
*/
|
|
15
|
+
listPrice: number
|
|
16
|
+
/**
|
|
17
|
+
* Formatter function that transforms the raw price value and render the result.
|
|
18
|
+
*/
|
|
19
|
+
formatter?: PriceFormatter
|
|
20
|
+
/**
|
|
21
|
+
* ID to find this component in testing tools (e.g.: cypress,
|
|
22
|
+
* testing-library, and jest).
|
|
23
|
+
*/
|
|
24
|
+
testId?: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const ProductPrice = forwardRef<HTMLDivElement, ProductPriceProps>(
|
|
28
|
+
function ProductCard(
|
|
29
|
+
{ testId = 'fs-product-price', value, listPrice, formatter, ...otherProps },
|
|
30
|
+
ref
|
|
31
|
+
) {
|
|
32
|
+
const listingPrice = listPrice ?? 0
|
|
33
|
+
const sellingPrice = value ?? 0
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<div ref={ref} data-fs-product-price data-testid={testId} {...otherProps}>
|
|
37
|
+
{sellingPrice !== listingPrice && listingPrice !== 0 ? (
|
|
38
|
+
<>
|
|
39
|
+
<Price
|
|
40
|
+
value={listingPrice}
|
|
41
|
+
formatter={formatter}
|
|
42
|
+
testId="list-price"
|
|
43
|
+
data-value={listingPrice}
|
|
44
|
+
variant="listing"
|
|
45
|
+
SRText="Original price:"
|
|
46
|
+
/>
|
|
47
|
+
<Price
|
|
48
|
+
value={sellingPrice}
|
|
49
|
+
formatter={formatter}
|
|
50
|
+
testId="price"
|
|
51
|
+
data-value={sellingPrice}
|
|
52
|
+
variant="spot"
|
|
53
|
+
SRText="Price:"
|
|
54
|
+
/>
|
|
55
|
+
</>
|
|
56
|
+
) : (
|
|
57
|
+
<Price
|
|
58
|
+
value={sellingPrice}
|
|
59
|
+
formatter={formatter}
|
|
60
|
+
testId="price"
|
|
61
|
+
data-value={sellingPrice}
|
|
62
|
+
variant="spot"
|
|
63
|
+
SRText="Price:"
|
|
64
|
+
/>
|
|
65
|
+
)}
|
|
66
|
+
</div>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
export default ProductPrice
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { ProductPrice } from '../..'
|
|
3
3
|
|
|
4
4
|
import type { PriceDefinition } from '../../typings/PriceDefinition'
|
|
5
5
|
|
|
@@ -21,24 +21,15 @@ const SearchProductItemContent = forwardRef<
|
|
|
21
21
|
return (
|
|
22
22
|
<section ref={ref} data-fs-search-product-item-content {...otherProps}>
|
|
23
23
|
<p data-fs-search-product-item-title>{title}</p>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
SRText="Original price:"
|
|
32
|
-
/>
|
|
33
|
-
<Price
|
|
34
|
-
value={price?.value ? price.value : 0}
|
|
35
|
-
formatter={price?.formatter}
|
|
36
|
-
testId="price"
|
|
37
|
-
data-value={price?.value}
|
|
38
|
-
variant="spot"
|
|
39
|
-
SRText="Price:"
|
|
24
|
+
|
|
25
|
+
{price.value !== 0 && (
|
|
26
|
+
<ProductPrice
|
|
27
|
+
data-fs-search-product-item-prices
|
|
28
|
+
listPrice={price.listPrice}
|
|
29
|
+
value={price.value}
|
|
30
|
+
formatter={price.formatter}
|
|
40
31
|
/>
|
|
41
|
-
|
|
32
|
+
)}
|
|
42
33
|
</section>
|
|
43
34
|
)
|
|
44
35
|
})
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react'
|
|
2
|
+
import type { HTMLAttributes, DetailedHTMLProps } from 'react'
|
|
3
|
+
|
|
4
|
+
type ColorVariant = 'main' | 'light' | 'accent'
|
|
5
|
+
|
|
6
|
+
export interface NewsletterProps
|
|
7
|
+
extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
8
|
+
/**
|
|
9
|
+
* Enables the card Variant.
|
|
10
|
+
*/
|
|
11
|
+
card: boolean
|
|
12
|
+
/**
|
|
13
|
+
* Specifies the component's color variant combination.
|
|
14
|
+
*/
|
|
15
|
+
colorVariant?: ColorVariant
|
|
16
|
+
/**
|
|
17
|
+
* ID to find this component in testing tools (e.g.: Cypress, Testing Library, and Jest).
|
|
18
|
+
*/
|
|
19
|
+
testId?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const Newsletter = forwardRef<HTMLDivElement, NewsletterProps>(
|
|
23
|
+
function Newsletter(
|
|
24
|
+
{
|
|
25
|
+
card,
|
|
26
|
+
children,
|
|
27
|
+
colorVariant = 'main',
|
|
28
|
+
testId = 'fs-newsletter',
|
|
29
|
+
...otherProps
|
|
30
|
+
},
|
|
31
|
+
ref
|
|
32
|
+
) {
|
|
33
|
+
return (
|
|
34
|
+
<div
|
|
35
|
+
ref={ref}
|
|
36
|
+
data-testid={testId}
|
|
37
|
+
data-fs-content="newsletter"
|
|
38
|
+
data-fs-newsletter={card ? 'card' : ''}
|
|
39
|
+
data-fs-newsletter-color-variant={colorVariant}
|
|
40
|
+
{...otherProps}
|
|
41
|
+
>
|
|
42
|
+
{children}
|
|
43
|
+
</div>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
export default Newsletter
|