@faststore/ui 2.0.99-alpha.0 → 2.0.102-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/index.d.ts +0 -2
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/molecules/OrderSummary/styles.scss +38 -0
- package/src/components/organisms/CartSidebar/styles.scss +67 -0
- package/src/index.ts +0 -3
- package/src/styles/components.scss +2 -0
- package/dist/components/molecules/OrderSummary/OrderSummary.d.ts +0 -35
- package/dist/components/molecules/OrderSummary/OrderSummary.js +0 -16
- package/dist/components/molecules/OrderSummary/OrderSummary.js.map +0 -1
- package/dist/components/molecules/OrderSummary/index.d.ts +0 -2
- package/dist/components/molecules/OrderSummary/index.js +0 -2
- package/dist/components/molecules/OrderSummary/index.js.map +0 -1
- package/src/components/molecules/OrderSummary/OrderSummary.tsx +0 -110
- package/src/components/molecules/OrderSummary/index.tsx +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ export { default as TextArea } from './components/atoms/TextArea';
|
|
|
3
3
|
export type { TextAreaProps } from './components/atoms/TextArea';
|
|
4
4
|
export { default as Incentive } from './components/atoms/Incentive';
|
|
5
5
|
export type { IncentiveProps } from './components/atoms/Incentive';
|
|
6
|
-
export { default as OrderSummary } from './components/molecules/OrderSummary';
|
|
7
|
-
export type { OrderSummaryProps } from './components/molecules/OrderSummary';
|
|
8
6
|
export { default as Bullets } from './components/molecules/Bullets';
|
|
9
7
|
export type { BulletsProps } from './components/molecules/Bullets';
|
|
10
8
|
export { default as Carousel } from './components/molecules/Carousel';
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,6 @@ export * from '@faststore/components';
|
|
|
3
3
|
export { default as TextArea } from './components/atoms/TextArea';
|
|
4
4
|
export { default as Incentive } from './components/atoms/Incentive';
|
|
5
5
|
// Molecules
|
|
6
|
-
export { default as OrderSummary } from './components/molecules/OrderSummary';
|
|
7
6
|
export { default as Bullets } from './components/molecules/Bullets';
|
|
8
7
|
export { default as Carousel } from './components/molecules/Carousel';
|
|
9
8
|
export { default as Banner, BannerContent, BannerImage, BannerLink, } from './components/molecules/Banner';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AAErC,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAGjE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAGnE,YAAY;AAEZ,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AAErC,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAGjE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAGnE,YAAY;AAEZ,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAGnE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAGrE,OAAO,EACL,OAAO,IAAI,MAAM,EACjB,aAAa,EACb,WAAW,EACX,UAAU,GACX,MAAM,+BAA+B,CAAA;AAQtC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAG7D,YAAY;AACZ,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAG1D,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.102-alpha.0",
|
|
4
4
|
"description": "A lightweight, framework agnostic component library for React",
|
|
5
5
|
"author": "emersonlaurentino",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"node": "16.18.0",
|
|
59
59
|
"yarn": "1.19.1"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "c9841c86822020c65161193647edf280cd765efa"
|
|
62
62
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[data-fs-order-summary] {
|
|
2
|
+
// --------------------------------------------------------
|
|
3
|
+
// Design Tokens for Order Summary
|
|
4
|
+
// --------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
// Default properties
|
|
7
|
+
--fs-order-summary-padding : var(--fs-spacing-3);
|
|
8
|
+
--fs-order-summary-margin-bottom : var(--fs-spacing-2);
|
|
9
|
+
|
|
10
|
+
--fs-order-summary-discount-text-color : var(--fs-color-success-text);
|
|
11
|
+
|
|
12
|
+
--fs-order-summary-total-text-size : var(--fs-text-size-3);
|
|
13
|
+
--fs-order-summary-total-text-font-weight : var(--fs-text-weight-bold);
|
|
14
|
+
|
|
15
|
+
// --------------------------------------------------------
|
|
16
|
+
// Structural Styles
|
|
17
|
+
// --------------------------------------------------------
|
|
18
|
+
padding: var(--fs-order-summary-padding);
|
|
19
|
+
|
|
20
|
+
li {
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
line-height: 1.5;
|
|
24
|
+
|
|
25
|
+
&[data-fs-order-summary-discount] {
|
|
26
|
+
color: var(--fs-order-summary-discount-text-color);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&[data-fs-order-summary-total] {
|
|
30
|
+
font-size: var(--fs-order-summary-total-text-size);
|
|
31
|
+
font-weight: var(--fs-order-summary-total-text-font-weight);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:last-of-type {
|
|
35
|
+
margin-bottom: var(--fs-order-summary-margin-bottom);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
[data-fs-cart-sidebar] {
|
|
2
|
+
// --------------------------------------------------------
|
|
3
|
+
// Design Tokens for Cart Sidebar
|
|
4
|
+
// --------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
// Default properties
|
|
7
|
+
--fs-cart-sidebar-bkg-color : var(--fs-color-neutral-bkg);
|
|
8
|
+
|
|
9
|
+
--fs-cart-sidebar-header-title-column-gap : var(--fs-spacing-2);
|
|
10
|
+
|
|
11
|
+
// List
|
|
12
|
+
--fs-cart-sidebar-list-padding : var(--fs-spacing-3);
|
|
13
|
+
|
|
14
|
+
// Footer
|
|
15
|
+
--fs-cart-sidebar-footer-bkg-color : var(--fs-color-neutral-0);
|
|
16
|
+
--fs-cart-sidebar-footer-box-shadow : 0 0 6px rgb(0 0 0 / 20%);
|
|
17
|
+
|
|
18
|
+
// --------------------------------------------------------
|
|
19
|
+
// Structural Styles
|
|
20
|
+
// --------------------------------------------------------
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
height: 100%;
|
|
24
|
+
overflow: auto;
|
|
25
|
+
|
|
26
|
+
&[data-fs-slide-over] {
|
|
27
|
+
background-color: var(--fs-cart-sidebar-bkg-color);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
> * { flex-shrink: 0; }
|
|
31
|
+
|
|
32
|
+
[data-fs-cart-sidebar-title] {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
|
|
36
|
+
font-size: var(--fs-text-size-4);
|
|
37
|
+
font-weight: var(--fs-text-weight-bold);
|
|
38
|
+
line-height: 1.12;
|
|
39
|
+
|
|
40
|
+
column-gap: var(--fs-cart-sidebar-header-title-column-gap);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[data-fs-cart-sidebar-list] {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
row-gap: var(--fs-spacing-2);
|
|
47
|
+
padding: var(--fs-cart-sidebar-list-padding);
|
|
48
|
+
overflow: auto;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[data-fs-cart-sidebar-footer] {
|
|
52
|
+
padding: var(--fs-spacing-3);
|
|
53
|
+
position: sticky;
|
|
54
|
+
bottom: 0;
|
|
55
|
+
margin-top: auto;
|
|
56
|
+
background-color: var(--fs-cart-sidebar-footer-bkg-color);
|
|
57
|
+
box-shadow: var(--fs-cart-sidebar-footer-box-shadow);
|
|
58
|
+
|
|
59
|
+
[data-fs-order-summary] {
|
|
60
|
+
padding: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
[data-fs-button] {
|
|
64
|
+
width: 100%;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -9,9 +9,6 @@ export type { IncentiveProps } from './components/atoms/Incentive'
|
|
|
9
9
|
|
|
10
10
|
// Molecules
|
|
11
11
|
|
|
12
|
-
export { default as OrderSummary } from './components/molecules/OrderSummary'
|
|
13
|
-
export type { OrderSummaryProps } from './components/molecules/OrderSummary'
|
|
14
|
-
|
|
15
12
|
export { default as Bullets } from './components/molecules/Bullets'
|
|
16
13
|
export type { BulletsProps } from './components/molecules/Bullets'
|
|
17
14
|
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
@import "../components/molecules/InputField/styles";
|
|
29
29
|
@import "../components/molecules/LinkButton/styles";
|
|
30
30
|
@import "../components/molecules/Modal/styles";
|
|
31
|
+
@import "../components/molecules/OrderSummary/styles";
|
|
31
32
|
@import "../components/molecules/ProductCard/styles";
|
|
32
33
|
@import "../components/molecules/ProductTitle/styles";
|
|
33
34
|
@import "../components/molecules/QuantitySelector/styles";
|
|
@@ -49,6 +50,7 @@
|
|
|
49
50
|
@import "../components/molecules/ToggleField/styles";
|
|
50
51
|
|
|
51
52
|
// Organisms
|
|
53
|
+
@import "../components/organisms/CartSidebar/styles";
|
|
52
54
|
@import "../components/organisms/Filter/styles";
|
|
53
55
|
@import "../components/organisms/FilterSlider/styles";
|
|
54
56
|
@import "../components/organisms/Hero/styles";
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { HTMLAttributes } from 'react';
|
|
3
|
-
export interface OrderSummaryProps extends HTMLAttributes<HTMLUListElement> {
|
|
4
|
-
/**
|
|
5
|
-
* ID to find this component in testing tools (e.g.: cypress,
|
|
6
|
-
* testing-library, and jest).
|
|
7
|
-
*/
|
|
8
|
-
testId?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Label for the subtotal value of the order. Will only show if subtotalValue is provided.
|
|
11
|
-
*/
|
|
12
|
-
subtotalLabel?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Subtotal value of the order. If provided, subtotal label and value will be shown.
|
|
15
|
-
*/
|
|
16
|
-
subtotalValue?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Label for the discount value for the order. Will only show if discountValue is provided.
|
|
19
|
-
*/
|
|
20
|
-
discountLabel?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Discount value for the order. If provided, discount label and value will be shown.
|
|
23
|
-
*/
|
|
24
|
-
discountValue?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Label for the total value of the order.
|
|
27
|
-
*/
|
|
28
|
-
totalLabel?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Total value of the order.
|
|
31
|
-
*/
|
|
32
|
-
totalValue?: string;
|
|
33
|
-
}
|
|
34
|
-
declare const OrderSummary: React.ForwardRefExoticComponent<OrderSummaryProps & React.RefAttributes<HTMLUListElement>>;
|
|
35
|
-
export default OrderSummary;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
|
-
import { List } from '@faststore/components';
|
|
3
|
-
const OrderSummary = forwardRef(function OrderSummary({ testId = 'store-order-summary', subtotalLabel, subtotalValue, discountLabel, discountValue, totalLabel, totalValue, ...otherProps }, ref) {
|
|
4
|
-
return (React.createElement(List, { ref: ref, "data-fs-order-summary": true, "data-testid": testId, ...otherProps },
|
|
5
|
-
subtotalValue ? (React.createElement("li", { "data-fs-order-summary-subtotal": true },
|
|
6
|
-
React.createElement("span", { "data-fs-order-summary-subtotal-label": true, "data-testid": `${testId}-subtotal-label` }, subtotalLabel),
|
|
7
|
-
React.createElement("span", { "data-fs-order-summary-subtotal-value": true, "data-testid": `${testId}-subtotal-value` }, subtotalValue))) : null,
|
|
8
|
-
discountValue ? (React.createElement("li", { "data-fs-order-summary-discount": true },
|
|
9
|
-
React.createElement("span", { "data-fs-order-summary-discount-label": true, "data-testid": `${testId}-discount-label` }, discountLabel),
|
|
10
|
-
React.createElement("span", { "data-fs-order-summary-discount-value": true, "data-testid": `${testId}-discount-value` }, discountValue))) : null,
|
|
11
|
-
React.createElement("li", { "data-fs-order-summary-total": true },
|
|
12
|
-
React.createElement("span", { "data-fs-order-summary-total-label": true, "data-testid": `${testId}-total-label` }, totalLabel),
|
|
13
|
-
React.createElement("span", { "data-fs-order-summary-total-value": true, "data-testid": `${testId}-total-value` }, totalValue))));
|
|
14
|
-
});
|
|
15
|
-
export default OrderSummary;
|
|
16
|
-
//# sourceMappingURL=OrderSummary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OrderSummary.js","sourceRoot":"","sources":["../../../../src/components/molecules/OrderSummary/OrderSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAkC5C,MAAM,YAAY,GAAG,UAAU,CAC7B,SAAS,YAAY,CACnB,EACE,MAAM,GAAG,qBAAqB,EAC9B,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,EACV,UAAU,EACV,GAAG,UAAU,EACd,EACD,GAAG;IAEH,OAAO,CACL,oBAAC,IAAI,IACH,GAAG,EAAE,GAAG,gDAEK,MAAM,KACf,UAAU;QAEb,aAAa,CAAC,CAAC,CAAC,CACf;YACE,2FAEe,GAAG,MAAM,iBAAiB,IAEtC,aAAa,CACT;YACP,2FAEe,GAAG,MAAM,iBAAiB,IAEtC,aAAa,CACT,CACJ,CACN,CAAC,CAAC,CAAC,IAAI;QACP,aAAa,CAAC,CAAC,CAAC,CACf;YACE,2FAEe,GAAG,MAAM,iBAAiB,IAEtC,aAAa,CACT;YACP,2FAEe,GAAG,MAAM,iBAAiB,IAEtC,aAAa,CACT,CACJ,CACN,CAAC,CAAC,CAAC,IAAI;QACR;YACE,wFAEe,GAAG,MAAM,cAAc,IAEnC,UAAU,CACN;YACP,wFAEe,GAAG,MAAM,cAAc,IAEnC,UAAU,CACN,CACJ,CACA,CACR,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/molecules/OrderSummary/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react'
|
|
2
|
-
import type { HTMLAttributes } from 'react'
|
|
3
|
-
|
|
4
|
-
import { List } from '@faststore/components'
|
|
5
|
-
|
|
6
|
-
export interface OrderSummaryProps extends HTMLAttributes<HTMLUListElement> {
|
|
7
|
-
/**
|
|
8
|
-
* ID to find this component in testing tools (e.g.: cypress,
|
|
9
|
-
* testing-library, and jest).
|
|
10
|
-
*/
|
|
11
|
-
testId?: string
|
|
12
|
-
/**
|
|
13
|
-
* Label for the subtotal value of the order. Will only show if subtotalValue is provided.
|
|
14
|
-
*/
|
|
15
|
-
subtotalLabel?: string
|
|
16
|
-
/**
|
|
17
|
-
* Subtotal value of the order. If provided, subtotal label and value will be shown.
|
|
18
|
-
*/
|
|
19
|
-
subtotalValue?: string
|
|
20
|
-
/**
|
|
21
|
-
* Label for the discount value for the order. Will only show if discountValue is provided.
|
|
22
|
-
*/
|
|
23
|
-
discountLabel?: string
|
|
24
|
-
/**
|
|
25
|
-
* Discount value for the order. If provided, discount label and value will be shown.
|
|
26
|
-
*/
|
|
27
|
-
discountValue?: string
|
|
28
|
-
/**
|
|
29
|
-
* Label for the total value of the order.
|
|
30
|
-
*/
|
|
31
|
-
totalLabel?: string
|
|
32
|
-
/**
|
|
33
|
-
* Total value of the order.
|
|
34
|
-
*/
|
|
35
|
-
totalValue?: string
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const OrderSummary = forwardRef<HTMLUListElement, OrderSummaryProps>(
|
|
39
|
-
function OrderSummary(
|
|
40
|
-
{
|
|
41
|
-
testId = 'store-order-summary',
|
|
42
|
-
subtotalLabel,
|
|
43
|
-
subtotalValue,
|
|
44
|
-
discountLabel,
|
|
45
|
-
discountValue,
|
|
46
|
-
totalLabel,
|
|
47
|
-
totalValue,
|
|
48
|
-
...otherProps
|
|
49
|
-
},
|
|
50
|
-
ref
|
|
51
|
-
) {
|
|
52
|
-
return (
|
|
53
|
-
<List
|
|
54
|
-
ref={ref}
|
|
55
|
-
data-fs-order-summary
|
|
56
|
-
data-testid={testId}
|
|
57
|
-
{...otherProps}
|
|
58
|
-
>
|
|
59
|
-
{subtotalValue ? (
|
|
60
|
-
<li data-fs-order-summary-subtotal>
|
|
61
|
-
<span
|
|
62
|
-
data-fs-order-summary-subtotal-label
|
|
63
|
-
data-testid={`${testId}-subtotal-label`}
|
|
64
|
-
>
|
|
65
|
-
{subtotalLabel}
|
|
66
|
-
</span>
|
|
67
|
-
<span
|
|
68
|
-
data-fs-order-summary-subtotal-value
|
|
69
|
-
data-testid={`${testId}-subtotal-value`}
|
|
70
|
-
>
|
|
71
|
-
{subtotalValue}
|
|
72
|
-
</span>
|
|
73
|
-
</li>
|
|
74
|
-
) : null}
|
|
75
|
-
{discountValue ? (
|
|
76
|
-
<li data-fs-order-summary-discount>
|
|
77
|
-
<span
|
|
78
|
-
data-fs-order-summary-discount-label
|
|
79
|
-
data-testid={`${testId}-discount-label`}
|
|
80
|
-
>
|
|
81
|
-
{discountLabel}
|
|
82
|
-
</span>
|
|
83
|
-
<span
|
|
84
|
-
data-fs-order-summary-discount-value
|
|
85
|
-
data-testid={`${testId}-discount-value`}
|
|
86
|
-
>
|
|
87
|
-
{discountValue}
|
|
88
|
-
</span>
|
|
89
|
-
</li>
|
|
90
|
-
) : null}
|
|
91
|
-
<li data-fs-order-summary-total>
|
|
92
|
-
<span
|
|
93
|
-
data-fs-order-summary-total-label
|
|
94
|
-
data-testid={`${testId}-total-label`}
|
|
95
|
-
>
|
|
96
|
-
{totalLabel}
|
|
97
|
-
</span>
|
|
98
|
-
<span
|
|
99
|
-
data-fs-order-summary-total-value
|
|
100
|
-
data-testid={`${testId}-total-value`}
|
|
101
|
-
>
|
|
102
|
-
{totalValue}
|
|
103
|
-
</span>
|
|
104
|
-
</li>
|
|
105
|
-
</List>
|
|
106
|
-
)
|
|
107
|
-
}
|
|
108
|
-
)
|
|
109
|
-
|
|
110
|
-
export default OrderSummary
|