@faststore/components 2.0.93-alpha.0 → 2.0.94-alpha.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.
- package/dist/atoms/Price/index.d.ts +1 -1
- package/dist/molecules/CartItem/CartItem.d.ts +7 -12
- package/dist/molecules/CartItem/CartItem.js.map +1 -1
- package/dist/molecules/Gift/GiftContent.d.ts +2 -8
- package/dist/molecules/Gift/GiftContent.js.map +1 -1
- package/dist/molecules/ProductCard/ProductCardContent.d.ts +7 -12
- package/dist/molecules/ProductCard/ProductCardContent.js.map +1 -1
- package/dist/molecules/SearchProducts/SearchProductItemContent.d.ts +2 -8
- package/dist/molecules/SearchProducts/SearchProductItemContent.js.map +1 -1
- package/dist/organisms/Filter/FilterSlider.d.ts +11 -11
- package/dist/organisms/Filter/FilterSlider.js +2 -2
- package/dist/organisms/Filter/FilterSlider.js.map +1 -1
- package/dist/organisms/SlideOver/SlideOver.d.ts +3 -3
- package/dist/organisms/SlideOver/SlideOverHeader.d.ts +4 -1
- package/dist/organisms/SlideOver/SlideOverHeader.js +1 -1
- package/dist/organisms/SlideOver/SlideOverHeader.js.map +1 -1
- package/dist/typings/PriceDefinition.d.ts +6 -0
- package/dist/typings/PriceDefinition.js +2 -0
- package/dist/typings/PriceDefinition.js.map +1 -0
- package/dist/typings/index.d.ts +1 -0
- package/package.json +2 -2
- package/src/atoms/Price/index.ts +1 -1
- package/src/molecules/CartItem/CartItem.tsx +6 -12
- package/src/molecules/Gift/GiftContent.tsx +2 -8
- package/src/molecules/ProductCard/ProductCardContent.tsx +6 -12
- package/src/molecules/SearchProducts/SearchProductItemContent.tsx +2 -7
- package/src/organisms/Filter/FilterSlider.tsx +14 -14
- package/src/organisms/SlideOver/SlideOver.tsx +2 -2
- package/src/organisms/SlideOver/SlideOverHeader.tsx +4 -2
- package/src/typings/PriceDefinition.ts +7 -0
- package/src/typings/index.ts +2 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './Price';
|
|
2
|
-
export type { PriceProps } from './Price';
|
|
2
|
+
export type { PriceProps, PriceFormatter } from './Price';
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { IconButtonProps
|
|
4
|
-
import type {
|
|
5
|
-
interface Price {
|
|
6
|
-
value: number;
|
|
7
|
-
listPrice: number;
|
|
8
|
-
formatter: PriceFormatter;
|
|
9
|
-
}
|
|
3
|
+
import { IconButtonProps } from '../../';
|
|
4
|
+
import type { PriceDefinition } from '../../typings/PriceDefinition';
|
|
10
5
|
export interface CartItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
11
6
|
/**
|
|
12
7
|
* ID to find this component in testing tools (e.g.: Cypress, Testing Library, and Jest).
|
|
@@ -15,7 +10,7 @@ export interface CartItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
15
10
|
/**
|
|
16
11
|
* Specifies product Price.
|
|
17
12
|
*/
|
|
18
|
-
price?:
|
|
13
|
+
price?: PriceDefinition;
|
|
19
14
|
/**
|
|
20
15
|
* Specifies the quantity of items of the same product.
|
|
21
16
|
*/
|
|
@@ -24,14 +19,14 @@ export interface CartItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
24
19
|
* Specifies that this product is unavailable.
|
|
25
20
|
*/
|
|
26
21
|
unavailable?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Event emitted when product quantity value is changed.
|
|
29
|
-
*/
|
|
30
|
-
onQuantityChange?: (value: number) => void;
|
|
31
22
|
/**
|
|
32
23
|
* Props for the Remove from cart IconButton component.
|
|
33
24
|
*/
|
|
34
25
|
removeBtnProps?: Partial<IconButtonProps>;
|
|
26
|
+
/**
|
|
27
|
+
* Event emitted when product quantity value is changed.
|
|
28
|
+
*/
|
|
29
|
+
onQuantityChange?: (value: number) => void;
|
|
35
30
|
}
|
|
36
31
|
declare const CartItem: React.ForwardRefExoticComponent<CartItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
37
32
|
export default CartItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartItem.js","sourceRoot":"","sources":["../../../src/molecules/CartItem/CartItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,UAAU,EAAmB,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"CartItem.js","sourceRoot":"","sources":["../../../src/molecules/CartItem/CartItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,UAAU,EAAmB,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AA+B7E,MAAM,QAAQ,GAAG,UAAU,CAAgC,SAAS,QAAQ,CAC1E,EACE,MAAM,GAAG,cAAc,EACvB,KAAK,EACL,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,GAAG,UAAU,EACd,EACD,GAAG;IAEH,OAAO,CACL,iCACE,GAAG,EAAE,GAAG,uBACW,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,iBAC1C,MAAM,KACf,UAAU;QAEd,kEAAgC,QAAQ,CAAO;QAC/C,oBAAC,UAAU,6CAET,IAAI,EAAE,oBAAC,OAAO,OAAG,gBACN,QAAQ,KACf,cAAc,GAClB;QACF;YACE,oBAAC,gBAAgB,IACf,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,gBAAgB,GAC1B;YACF;gBACE,oBAAC,KAAK,IACJ,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAC7C,SAAS,EAAE,KAAK,EAAE,SAAS,EAC3B,OAAO,EAAC,SAAS,EACjB,MAAM,EAAC,iBAAiB,GACxB;gBACF,oBAAC,KAAK,IACJ,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACrC,SAAS,EAAE,KAAK,EAAE,SAAS,EAC3B,OAAO,EAAC,MAAM,EACd,MAAM,EAAC,QAAQ,GACf,CACG,CACH,CACE,CACX,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,QAAQ,CAAA"}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type {
|
|
4
|
-
import { Price } from '../../';
|
|
5
|
-
interface Price {
|
|
6
|
-
value: number;
|
|
7
|
-
listPrice: number;
|
|
8
|
-
formatter: PriceFormatter;
|
|
9
|
-
}
|
|
3
|
+
import type { PriceDefinition } from '../../typings/PriceDefinition';
|
|
10
4
|
export interface GiftContentProps extends HTMLAttributes<HTMLElement> {
|
|
11
5
|
/**
|
|
12
6
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
@@ -19,7 +13,7 @@ export interface GiftContentProps extends HTMLAttributes<HTMLElement> {
|
|
|
19
13
|
/**
|
|
20
14
|
* Specifies product's prices.
|
|
21
15
|
*/
|
|
22
|
-
price:
|
|
16
|
+
price: PriceDefinition;
|
|
23
17
|
/**
|
|
24
18
|
* Badge's label
|
|
25
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GiftContent.js","sourceRoot":"","sources":["../../../src/molecules/Gift/GiftContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"GiftContent.js","sourceRoot":"","sources":["../../../src/molecules/Gift/GiftContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AA2BrC,MAAM,WAAW,GAAG,UAAU,CAC5B,SAAS,WAAW,CAClB,EACE,KAAK,EACL,WAAW,EACX,YAAY,GAAG,OAAO,EACtB,UAAU,GAAG,MAAM,EACnB,MAAM,GAAG,iBAAiB,EAC1B,GAAG,UAAU,EACd,EACD,GAAG;IAEH,OAAO,CACL,iCACE,GAAG,EAAE,GAAG,+CAEK,MAAM,KACf,UAAU;QAEd;YACG,YAAY;;YAAG,WAAW,CACxB;QACL;YACE,oBAAC,KAAK,IACJ,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAC7C,SAAS,EAAE,KAAK,EAAE,SAAS,EAC3B,MAAM,EAAC,YAAY,gBACP,KAAK,EAAE,SAAS,EAC5B,OAAO,EAAC,SAAS,EACjB,MAAM,EAAC,iBAAiB,GACxB;YACF,oBAAC,KAAK,QAAE,UAAU,CAAS,CACtB,CACC,CACX,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type {
|
|
4
|
-
import {
|
|
5
|
-
interface Price {
|
|
6
|
-
value: number;
|
|
7
|
-
listPrice: number;
|
|
8
|
-
formatter: PriceFormatter;
|
|
9
|
-
}
|
|
3
|
+
import type { PriceDefinition } from '../../typings/PriceDefinition';
|
|
4
|
+
import { LinkProps, LinkElementType } from '../../';
|
|
10
5
|
export interface ProductCardContentProps extends HTMLAttributes<HTMLElement> {
|
|
11
6
|
/**
|
|
12
7
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
@@ -23,7 +18,7 @@ export interface ProductCardContentProps extends HTMLAttributes<HTMLElement> {
|
|
|
23
18
|
/**
|
|
24
19
|
* Specifies product's prices.
|
|
25
20
|
*/
|
|
26
|
-
price?:
|
|
21
|
+
price?: PriceDefinition;
|
|
27
22
|
/**
|
|
28
23
|
* Enables a outOfStock status.
|
|
29
24
|
*/
|
|
@@ -36,10 +31,6 @@ export interface ProductCardContentProps extends HTMLAttributes<HTMLElement> {
|
|
|
36
31
|
* Specifies Rating Value of the product.
|
|
37
32
|
*/
|
|
38
33
|
ratingValue?: number;
|
|
39
|
-
/**
|
|
40
|
-
* Callback function when button is clicked.
|
|
41
|
-
*/
|
|
42
|
-
onButtonClick?: () => void;
|
|
43
34
|
/**
|
|
44
35
|
* Specifies the button's label.
|
|
45
36
|
*/
|
|
@@ -48,6 +39,10 @@ export interface ProductCardContentProps extends HTMLAttributes<HTMLElement> {
|
|
|
48
39
|
* Enables a DiscountBadge to the component.
|
|
49
40
|
*/
|
|
50
41
|
showDiscountBadge?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Callback function when button is clicked.
|
|
44
|
+
*/
|
|
45
|
+
onButtonClick?: () => void;
|
|
51
46
|
}
|
|
52
47
|
declare const ProductCardContent: React.ForwardRefExoticComponent<ProductCardContentProps & React.RefAttributes<HTMLElement>>;
|
|
53
48
|
export default ProductCardContent;
|
|
@@ -1 +1 @@
|
|
|
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,IAAI,EACJ,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,aAAa,GAGd,MAAM,QAAQ,CAAA;AACf,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,cAAc,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,IAAI,EACJ,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,aAAa,GAGd,MAAM,QAAQ,CAAA;AACf,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AA6CjD,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,GAAG,UAAU,EACd,EACD,GAAG;IAEH,OAAO,CACL,iCACE,GAAG,EAAE,GAAG,sEAEoB,iBAAiB,iBAChC,MAAM,KACf,UAAU;QAEd;YACE;gBACE,oBAAC,IAAI,OAAK,SAAS,EAAE,KAAK,EAAE,KAAK,IAC9B,KAAK,CACD,CACJ;YACL;gBACE,oBAAC,KAAK,IACJ,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAC7C,SAAS,EAAE,KAAK,EAAE,SAAS,EAC3B,MAAM,EAAC,YAAY,gBACP,KAAK,EAAE,SAAS,EAC5B,OAAO,EAAC,SAAS,EACjB,MAAM,EAAC,iBAAiB,GACxB;gBACF,oBAAC,KAAK,IACJ,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACrC,SAAS,EAAE,KAAK,EAAE,SAAS,EAC3B,MAAM,EAAC,OAAO,gBACF,KAAK,EAAE,KAAK,EACxB,OAAO,EAAC,MAAM,EACd,MAAM,EAAC,aAAa,GACpB,CACE;YACL,WAAW,IAAI,oBAAC,MAAM,IAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,oBAAC,IAAI,OAAG,GAAI,CAC1D;QACL,iBAAiB,IAAI,CAAC,UAAU,IAAI,CACnC,oBAAC,aAAa,IACZ,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EACjD,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GACzC,CACH;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,YAAY,OAAG,EACtB,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,11 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import type { PriceFormatter } from '../../atoms/Price/Price';
|
|
4
|
-
interface Price {
|
|
5
|
-
value: number;
|
|
6
|
-
listPrice: number;
|
|
7
|
-
formatter: PriceFormatter;
|
|
8
|
-
}
|
|
2
|
+
import type { PriceDefinition } from '../../typings/PriceDefinition';
|
|
9
3
|
export interface SearchProductItemContentProps {
|
|
10
4
|
/**
|
|
11
5
|
* Specifies the product's title.
|
|
@@ -14,7 +8,7 @@ export interface SearchProductItemContentProps {
|
|
|
14
8
|
/**
|
|
15
9
|
* Specifies product's prices.
|
|
16
10
|
*/
|
|
17
|
-
price:
|
|
11
|
+
price: PriceDefinition;
|
|
18
12
|
}
|
|
19
13
|
declare const SearchProductItemContent: React.ForwardRefExoticComponent<SearchProductItemContentProps & React.RefAttributes<HTMLElement>>;
|
|
20
14
|
export default SearchProductItemContent;
|
|
@@ -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,KAAK,EAAE,MAAM,OAAO,CAAA;
|
|
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,KAAK,EAAE,MAAM,OAAO,CAAA;AAe7B,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;QAChD;YACE,oBAAC,KAAK,IACJ,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAC7C,SAAS,EAAE,KAAK,EAAE,SAAS,EAC3B,MAAM,EAAC,YAAY,gBACP,KAAK,EAAE,SAAS,EAC5B,OAAO,EAAC,SAAS,EACjB,MAAM,EAAC,iBAAiB,GACxB;YACF,oBAAC,KAAK,IACJ,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACrC,SAAS,EAAE,KAAK,EAAE,SAAS,EAC3B,MAAM,EAAC,OAAO,gBACF,KAAK,EAAE,KAAK,EACxB,OAAO,EAAC,MAAM,EACd,MAAM,EAAC,QAAQ,GACf,CACG,CACC,CACX,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,wBAAwB,CAAA"}
|
|
@@ -7,25 +7,25 @@ export interface FilterSliderProps {
|
|
|
7
7
|
*/
|
|
8
8
|
title?: string;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Represents the side that the FilterSlider comes from.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
direction: SlideOverDirection;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Represents the size of the FilterSlider.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
size: SlideOverWidthSize;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Props for the Apply Button from FilterSlider component.
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
applyBtnProps?: Partial<ButtonProps>;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Props for the Clear Button from FilterSlider component.
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
clearBtnProps?: Partial<ButtonProps>;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Function called when Close Button is clicked.
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
onClose: () => void;
|
|
29
29
|
}
|
|
30
|
-
declare function FilterSlider({ title,
|
|
30
|
+
declare function FilterSlider({ title, size, direction, children, applyBtnProps, clearBtnProps, onClose, }: PropsWithChildren<FilterSliderProps>): JSX.Element;
|
|
31
31
|
export default FilterSlider;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button, SlideOver, SlideOverHeader, useFadeEffect, useUI, } from '../../';
|
|
3
|
-
function FilterSlider({ title,
|
|
4
|
-
const { closeFilter } = useUI();
|
|
3
|
+
function FilterSlider({ title, size, direction, children, applyBtnProps, clearBtnProps, onClose, }) {
|
|
5
4
|
const { fade, fadeOut } = useFadeEffect();
|
|
5
|
+
const { closeFilter } = useUI();
|
|
6
6
|
return (React.createElement(SlideOver, { "data-fs-filter-slider": true, isOpen: true, fade: fade, onDismiss: fadeOut, size: size, direction: direction, onTransitionEnd: () => fade === 'out' && closeFilter() },
|
|
7
7
|
React.createElement("div", { "data-fs-filter-slider-content": true },
|
|
8
8
|
React.createElement(SlideOverHeader, { onClose: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterSlider.js","sourceRoot":"","sources":["../../../src/organisms/Filter/FilterSlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAEhD,OAAO,EACL,MAAM,EAEN,SAAS,EACT,eAAe,EACf,aAAa,EACb,KAAK,GACN,MAAM,QAAQ,CAAA;AA+Bf,SAAS,YAAY,CAAC,EACpB,KAAK,EACL,
|
|
1
|
+
{"version":3,"file":"FilterSlider.js","sourceRoot":"","sources":["../../../src/organisms/Filter/FilterSlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAEhD,OAAO,EACL,MAAM,EAEN,SAAS,EACT,eAAe,EACf,aAAa,EACb,KAAK,GACN,MAAM,QAAQ,CAAA;AA+Bf,SAAS,YAAY,CAAC,EACpB,KAAK,EACL,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,aAAa,EACb,aAAa,EACb,OAAO,GAC8B;IACrC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,aAAa,EAAE,CAAA;IACzC,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,CAAA;IAE/B,OAAO,CACL,oBAAC,SAAS,mCAER,MAAM,QACN,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,OAAO,EAClB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,GAAG,EAAE,CAAC,IAAI,KAAK,KAAK,IAAI,WAAW,EAAE;QAEtD;YACE,oBAAC,eAAe,IACd,OAAO,EAAE,GAAG,EAAE;oBACZ,OAAO,EAAE,CAAA;oBACT,OAAO,EAAE,CAAA;gBACX,CAAC;gBAED,mEAAiC,KAAK,CAAM,CAC5B;YACjB,QAAQ,CACL;QACN;YACE,oBAAC,MAAM,0DAA+C,aAAa,GAAI;YACvE,oBAAC,MAAM,sEAEO,4BAA4B,KACpC,aAAa,EACjB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oBACb,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAA;oBAC3B,OAAO,EAAE,CAAA;gBACX,CAAC,GACD,CACK,CACC,CACb,CAAA;AACH,CAAC;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -2,7 +2,7 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
import type { ModalProps } from '../../';
|
|
3
3
|
export type Direction = 'leftSide' | 'rightSide';
|
|
4
4
|
export type WidthSize = 'full' | 'partial';
|
|
5
|
-
export
|
|
5
|
+
export interface SlideOverProps extends Omit<ModalProps, 'title'> {
|
|
6
6
|
/**
|
|
7
7
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
8
8
|
*/
|
|
@@ -23,12 +23,12 @@ export type SlideOverProps = Omit<ModalProps, 'title'> & {
|
|
|
23
23
|
* Represents the fade effect of the SlideOver.
|
|
24
24
|
*/
|
|
25
25
|
fade: 'in' | 'out';
|
|
26
|
+
children: ReactNode;
|
|
26
27
|
/**
|
|
27
28
|
* This function is called whenever the user clicks outside.
|
|
28
29
|
* the modal content
|
|
29
30
|
*/
|
|
30
31
|
onDismiss?: () => void;
|
|
31
|
-
|
|
32
|
-
};
|
|
32
|
+
}
|
|
33
33
|
declare function SlideOver({ isOpen, direction, size, fade, children, onDismiss, testId, ...otherProps }: SlideOverProps): JSX.Element;
|
|
34
34
|
export default SlideOver;
|
|
@@ -10,7 +10,10 @@ export interface SlideOverHeaderProps extends Omit<HTMLAttributes<HTMLDivElement
|
|
|
10
10
|
* Props for the Close Button component.
|
|
11
11
|
*/
|
|
12
12
|
closeBtnProps?: Partial<Omit<IconButtonProps, 'onClick'>>;
|
|
13
|
+
/**
|
|
14
|
+
* Function called when Close Button is clicked.
|
|
15
|
+
*/
|
|
13
16
|
onClose: () => void;
|
|
14
17
|
}
|
|
15
|
-
declare const SlideOverHeader: ({
|
|
18
|
+
declare const SlideOverHeader: ({ children, closeBtnProps, onClose, }: SlideOverHeaderProps) => JSX.Element;
|
|
16
19
|
export default SlideOverHeader;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { X } from '../../assets';
|
|
3
3
|
import { IconButton } from '../../';
|
|
4
|
-
const SlideOverHeader = ({
|
|
4
|
+
const SlideOverHeader = ({ children, closeBtnProps = {}, onClose, }) => {
|
|
5
5
|
return (React.createElement("header", { "data-fs-slide-over-header": true },
|
|
6
6
|
children,
|
|
7
7
|
React.createElement(IconButton, { "data-fs-slide-over-header-icon": true, "aria-label": "Close", icon: React.createElement(X, null), onClick: onClose, ...closeBtnProps })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlideOverHeader.js","sourceRoot":"","sources":["../../../src/organisms/SlideOver/SlideOverHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAA;AAE7C,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"SlideOverHeader.js","sourceRoot":"","sources":["../../../src/organisms/SlideOver/SlideOverHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAA;AAE7C,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAmBnC,MAAM,eAAe,GAAG,CAAC,EACvB,QAAQ,EACR,aAAa,GAAG,EAAE,EAClB,OAAO,GACc,EAAE,EAAE;IACzB,OAAO,CACL;QACG,QAAQ;QACT,oBAAC,UAAU,0DAEE,OAAO,EAClB,IAAI,EAAE,oBAAC,CAAC,OAAG,EACX,OAAO,EAAE,OAAO,KACZ,aAAa,GACjB,CACK,CACV,CAAA;AACH,CAAC,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PriceDefinition.js","sourceRoot":"","sources":["../../src/typings/PriceDefinition.ts"],"names":[],"mappings":""}
|
package/dist/typings/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/components",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.94-alpha.0",
|
|
4
4
|
"module": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"author": "Emerson Laurentino @emersonlaurentino",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"node": "16.18.0",
|
|
31
31
|
"yarn": "1.19.1"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "8ca8da8718c287610dd6858b1e552f3af81c6c5a"
|
|
34
34
|
}
|
package/src/atoms/Price/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './Price'
|
|
2
|
-
export type { PriceProps } from './Price'
|
|
2
|
+
export type { PriceProps, PriceFormatter } from './Price'
|
|
@@ -4,13 +4,7 @@ import React, { forwardRef } from 'react'
|
|
|
4
4
|
import { XCircle } from '../../assets'
|
|
5
5
|
import { IconButton, IconButtonProps, Price, QuantitySelector } from '../../'
|
|
6
6
|
|
|
7
|
-
import type {
|
|
8
|
-
|
|
9
|
-
interface Price {
|
|
10
|
-
value: number
|
|
11
|
-
listPrice: number
|
|
12
|
-
formatter: PriceFormatter
|
|
13
|
-
}
|
|
7
|
+
import type { PriceDefinition } from '../../typings/PriceDefinition'
|
|
14
8
|
|
|
15
9
|
export interface CartItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
16
10
|
/**
|
|
@@ -20,7 +14,7 @@ export interface CartItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
20
14
|
/**
|
|
21
15
|
* Specifies product Price.
|
|
22
16
|
*/
|
|
23
|
-
price?:
|
|
17
|
+
price?: PriceDefinition
|
|
24
18
|
/**
|
|
25
19
|
* Specifies the quantity of items of the same product.
|
|
26
20
|
*/
|
|
@@ -29,14 +23,14 @@ export interface CartItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
29
23
|
* Specifies that this product is unavailable.
|
|
30
24
|
*/
|
|
31
25
|
unavailable?: boolean
|
|
32
|
-
/**
|
|
33
|
-
* Event emitted when product quantity value is changed.
|
|
34
|
-
*/
|
|
35
|
-
onQuantityChange?: (value: number) => void
|
|
36
26
|
/**
|
|
37
27
|
* Props for the Remove from cart IconButton component.
|
|
38
28
|
*/
|
|
39
29
|
removeBtnProps?: Partial<IconButtonProps>
|
|
30
|
+
/**
|
|
31
|
+
* Event emitted when product quantity value is changed.
|
|
32
|
+
*/
|
|
33
|
+
onQuantityChange?: (value: number) => void
|
|
40
34
|
}
|
|
41
35
|
|
|
42
36
|
const CartItem = forwardRef<HTMLDivElement, CartItemProps>(function CartItem(
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
3
|
|
|
4
|
-
import type { PriceFormatter } from '../../atoms/Price/Price'
|
|
5
|
-
|
|
6
4
|
import { Price, Badge } from '../../'
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
value: number
|
|
10
|
-
listPrice: number
|
|
11
|
-
formatter: PriceFormatter
|
|
12
|
-
}
|
|
6
|
+
import type { PriceDefinition } from '../../typings/PriceDefinition'
|
|
13
7
|
|
|
14
8
|
export interface GiftContentProps extends HTMLAttributes<HTMLElement> {
|
|
15
9
|
/**
|
|
@@ -23,7 +17,7 @@ export interface GiftContentProps extends HTMLAttributes<HTMLElement> {
|
|
|
23
17
|
/**
|
|
24
18
|
* Specifies product's prices.
|
|
25
19
|
*/
|
|
26
|
-
price:
|
|
20
|
+
price: PriceDefinition
|
|
27
21
|
/**
|
|
28
22
|
* Badge's label
|
|
29
23
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
3
|
|
|
4
|
-
import type {
|
|
4
|
+
import type { PriceDefinition } from '../../typings/PriceDefinition'
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
Link,
|
|
@@ -15,12 +15,6 @@ import {
|
|
|
15
15
|
} from '../../'
|
|
16
16
|
import { Star, ShoppingCart } from '../../assets'
|
|
17
17
|
|
|
18
|
-
interface Price {
|
|
19
|
-
value: number
|
|
20
|
-
listPrice: number
|
|
21
|
-
formatter: PriceFormatter
|
|
22
|
-
}
|
|
23
|
-
|
|
24
18
|
export interface ProductCardContentProps extends HTMLAttributes<HTMLElement> {
|
|
25
19
|
/**
|
|
26
20
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
@@ -37,7 +31,7 @@ export interface ProductCardContentProps extends HTMLAttributes<HTMLElement> {
|
|
|
37
31
|
/**
|
|
38
32
|
* Specifies product's prices.
|
|
39
33
|
*/
|
|
40
|
-
price?:
|
|
34
|
+
price?: PriceDefinition
|
|
41
35
|
/**
|
|
42
36
|
* Enables a outOfStock status.
|
|
43
37
|
*/
|
|
@@ -50,10 +44,6 @@ export interface ProductCardContentProps extends HTMLAttributes<HTMLElement> {
|
|
|
50
44
|
* Specifies Rating Value of the product.
|
|
51
45
|
*/
|
|
52
46
|
ratingValue?: number
|
|
53
|
-
/**
|
|
54
|
-
* Callback function when button is clicked.
|
|
55
|
-
*/
|
|
56
|
-
onButtonClick?: () => void
|
|
57
47
|
/**
|
|
58
48
|
* Specifies the button's label.
|
|
59
49
|
*/
|
|
@@ -62,6 +52,10 @@ export interface ProductCardContentProps extends HTMLAttributes<HTMLElement> {
|
|
|
62
52
|
* Enables a DiscountBadge to the component.
|
|
63
53
|
*/
|
|
64
54
|
showDiscountBadge?: boolean
|
|
55
|
+
/**
|
|
56
|
+
* Callback function when button is clicked.
|
|
57
|
+
*/
|
|
58
|
+
onButtonClick?: () => void
|
|
65
59
|
}
|
|
66
60
|
|
|
67
61
|
const ProductCardContent = forwardRef<HTMLElement, ProductCardContentProps>(
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react'
|
|
2
2
|
import { Price } from '../..'
|
|
3
|
-
import type { PriceFormatter } from '../../atoms/Price/Price'
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
value: number
|
|
7
|
-
listPrice: number
|
|
8
|
-
formatter: PriceFormatter
|
|
9
|
-
}
|
|
4
|
+
import type { PriceDefinition } from '../../typings/PriceDefinition'
|
|
10
5
|
|
|
11
6
|
export interface SearchProductItemContentProps {
|
|
12
7
|
/**
|
|
@@ -16,7 +11,7 @@ export interface SearchProductItemContentProps {
|
|
|
16
11
|
/**
|
|
17
12
|
* Specifies product's prices.
|
|
18
13
|
*/
|
|
19
|
-
price:
|
|
14
|
+
price: PriceDefinition
|
|
20
15
|
}
|
|
21
16
|
|
|
22
17
|
const SearchProductItemContent = forwardRef<
|
|
@@ -17,38 +17,38 @@ export interface FilterSliderProps {
|
|
|
17
17
|
*/
|
|
18
18
|
title?: string
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Represents the side that the FilterSlider comes from.
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
direction: SlideOverDirection
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Represents the size of the FilterSlider.
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
size: SlideOverWidthSize
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Props for the Apply Button from FilterSlider component.
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
applyBtnProps?: Partial<ButtonProps>
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Props for the Clear Button from FilterSlider component.
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
clearBtnProps?: Partial<ButtonProps>
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Function called when Close Button is clicked.
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
onClose: () => void
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
function FilterSlider({
|
|
42
42
|
title,
|
|
43
|
-
clearBtnProps,
|
|
44
|
-
applyBtnProps,
|
|
45
|
-
onClose,
|
|
46
43
|
size,
|
|
47
44
|
direction,
|
|
48
45
|
children,
|
|
46
|
+
applyBtnProps,
|
|
47
|
+
clearBtnProps,
|
|
48
|
+
onClose,
|
|
49
49
|
}: PropsWithChildren<FilterSliderProps>) {
|
|
50
|
-
const { closeFilter } = useUI()
|
|
51
50
|
const { fade, fadeOut } = useFadeEffect()
|
|
51
|
+
const { closeFilter } = useUI()
|
|
52
52
|
|
|
53
53
|
return (
|
|
54
54
|
<SlideOver
|
|
@@ -7,7 +7,7 @@ import { Modal } from '../../'
|
|
|
7
7
|
export type Direction = 'leftSide' | 'rightSide'
|
|
8
8
|
export type WidthSize = 'full' | 'partial'
|
|
9
9
|
|
|
10
|
-
export
|
|
10
|
+
export interface SlideOverProps extends Omit<ModalProps, 'title'> {
|
|
11
11
|
/**
|
|
12
12
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
13
13
|
*/
|
|
@@ -28,12 +28,12 @@ export type SlideOverProps = Omit<ModalProps, 'title'> & {
|
|
|
28
28
|
* Represents the fade effect of the SlideOver.
|
|
29
29
|
*/
|
|
30
30
|
fade: 'in' | 'out'
|
|
31
|
+
children: ReactNode
|
|
31
32
|
/**
|
|
32
33
|
* This function is called whenever the user clicks outside.
|
|
33
34
|
* the modal content
|
|
34
35
|
*/
|
|
35
36
|
onDismiss?: () => void
|
|
36
|
-
children: ReactNode
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
function SlideOver({
|
|
@@ -14,14 +14,16 @@ export interface SlideOverHeaderProps
|
|
|
14
14
|
* Props for the Close Button component.
|
|
15
15
|
*/
|
|
16
16
|
closeBtnProps?: Partial<Omit<IconButtonProps, 'onClick'>>
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Function called when Close Button is clicked.
|
|
19
|
+
*/
|
|
18
20
|
onClose: () => void
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
const SlideOverHeader = ({
|
|
22
|
-
onClose,
|
|
23
24
|
children,
|
|
24
25
|
closeBtnProps = {},
|
|
26
|
+
onClose,
|
|
25
27
|
}: SlideOverHeaderProps) => {
|
|
26
28
|
return (
|
|
27
29
|
<header data-fs-slide-over-header>
|