@faststore/ui 2.0.99-alpha.0 → 2.0.103-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 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,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAG7E,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"}
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.99-alpha.0",
3
+ "version": "2.0.103-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": "66eb3557fc7b19e210fee38eda199d5e1b18b1a3"
61
+ "gitHead": "cac804588d1f91794f39bf7b7ce8e18234a7286a"
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
+ }
@@ -0,0 +1,209 @@
1
+ [data-fs-image-gallery] {
2
+ // --------------------------------------------------------
3
+ // Design Tokens for Image Gallery
4
+ // --------------------------------------------------------
5
+
6
+ // Default properties
7
+ --fs-image-gallery-width : calc(100% + (2 * var(--fs-grid-padding)));
8
+ --fs-image-gallery-transition-timing : var(--fs-transition-timing);
9
+ --fs-image-gallery-transition-function : var(--fs-transition-function);
10
+ --fs-image-gallery-gap-mobile : var(--fs-spacing-2);
11
+ --fs-image-gallery-gap-notebook : var(--fs-spacing-3);
12
+
13
+ // Controls
14
+ --fs-image-gallery-selector-control-bkg-color : var(--fs-control-bkg);
15
+ --fs-image-gallery-selector-control-border-radius : var(--fs-border-radius-circle);
16
+ --fs-image-gallery-selector-control-shadow : var(--fs-shadow-darker);
17
+ --fs-image-gallery-selector-control-gradient-bkg-color : var(--fs-color-body-bkg);
18
+
19
+ // Current Selected Image
20
+ --fs-image-gallery-current-height : 33.125rem; // 530px
21
+ --fs-image-gallery-current-border-radius : var(--fs-border-radius);
22
+
23
+ // Image Gallery Selector
24
+ --fs-image-gallery-selector-max-height : var(--fs-image-gallery-current-height);
25
+
26
+ // Image Gallery Selector Elements
27
+ --fs-image-gallery-selector-elements-gap : var(--fs-spacing-1);
28
+ --fs-image-gallery-selector-elements-gap-notebook : var(--fs-spacing-2);
29
+ --fs-image-gallery-selector-elements-padding : var(--fs-spacing-0) var(--fs-spacing-2);
30
+
31
+ // Image Gallery Selector Thumbnail
32
+ --fs-image-gallery-selector-thumbnail-width-mobile : var(--fs-spacing-8);
33
+ --fs-image-gallery-selector-thumbnail-height-mobile : var(--fs-image-gallery-selector-thumbnail-width-mobile);
34
+ --fs-image-gallery-selector-thumbnail-width-notebook : var(--fs-spacing-10);
35
+ --fs-image-gallery-selector-thumbnail-height-notebook : var(--fs-image-gallery-selector-thumbnail-width-notebook);
36
+ --fs-image-gallery-selector-thumbnail-border-radius : var(--fs-border-radius);
37
+ --fs-image-gallery-selector-thumbnail-border-width : var(--fs-border-width-thick);
38
+ --fs-image-gallery-selector-thumbnail-selected-border-color : var(--fs-border-color-active);
39
+ --fs-image-gallery-selector-thumbnail-selected-border-width : var(--fs-border-width-thickest);
40
+ --fs-image-gallery-selector-thumbnail-image-border-radius : var(--fs-border-radius-small);
41
+
42
+ // --------------------------------------------------------
43
+ // Structural Styles
44
+ // --------------------------------------------------------
45
+
46
+ // Image Gallery
47
+
48
+ position: relative;
49
+ left: calc(-1 * var(--fs-grid-padding));
50
+ display: flex;
51
+ flex-direction: column;
52
+ row-gap: var(--fs-image-gallery-gap-mobile);
53
+ width: var(--fs-image-gallery-width);
54
+
55
+ @include media(">=tablet") {
56
+ left: 0;
57
+ width: 100%;
58
+
59
+ > [data-fs-image] {
60
+ grid-column: 2 / span 7;
61
+ border-radius: var(--fs-image-gallery-current-border-radius);
62
+ }
63
+ }
64
+
65
+ @include media(">=notebook") {
66
+ >[data-fs-image] {
67
+ height: var(--fs-image-gallery-current-height);
68
+ }
69
+ }
70
+
71
+ // Image Gallery Selector
72
+
73
+ [data-fs-image-gallery-selector] {
74
+ position: relative;
75
+ display: flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ max-height: var(--fs-image-gallery-selector-max-height);
79
+
80
+ @include media("<notebook") { overflow: hidden; }
81
+
82
+ @include media(">=notebook") {
83
+ flex-direction: column;
84
+ grid-row: 1;
85
+ justify-content: space-between;
86
+ }
87
+ }
88
+
89
+ [data-fs-image-gallery-selector-elements] {
90
+ display: flex;
91
+ column-gap: var(--fs-image-gallery-selector-elements-gap);
92
+ padding: var(--fs-image-gallery-selector-elements-padding);
93
+ overflow-x: auto;
94
+ scroll-behavior: smooth;
95
+
96
+ &::-webkit-scrollbar { display: none; }
97
+
98
+ @include media(">=notebook") {
99
+ flex-direction: column;
100
+ row-gap: var(--fs-image-gallery-selector-elements-gap-notebook);
101
+ overflow-y: hidden;
102
+ }
103
+ }
104
+
105
+ [data-fs-image-gallery-selector-thumbnail] {
106
+ flex-shrink: 0;
107
+ width: var(--fs-image-gallery-selector-thumbnail-width-mobile);
108
+ height: var(--fs-image-gallery-selector-thumbnail-height-mobile);
109
+ padding: 0;
110
+ overflow: hidden;
111
+ background-color: transparent;
112
+ border: var(--fs-image-gallery-selector-thumbnail-border-width) solid transparent;
113
+ border-radius: var(--fs-image-gallery-selector-thumbnail-border-radius);
114
+ transition: all var(--fs-image-gallery-transition-timing) var(--fs-image-gallery-transition-function);
115
+
116
+ &:hover:not([data-fs-image-gallery-selector-thumbnail="selected"]) {
117
+ border-color: var(--fs-image-gallery-selector-thumbnail-selected-border-color);
118
+ }
119
+
120
+ &[data-fs-image-gallery-selector-thumbnail="selected"] {
121
+ border-color: var(--fs-image-gallery-selector-thumbnail-selected-border-color);
122
+ box-shadow: 0 0 0 var(--fs-image-gallery-selector-thumbnail-selected-border-width) var(--fs-color-focus-ring-outline);
123
+ }
124
+
125
+ > span {
126
+ width: 100%;
127
+ height: 100%;
128
+ }
129
+
130
+ [data-fs-image] {
131
+ border-radius: var(--fs-image-gallery-selector-thumbnail-image-border-radius);
132
+ transform: scale(0.95);
133
+ }
134
+
135
+ @include focus-ring-visible;
136
+
137
+ @include media(">=notebook") {
138
+ width: var(--fs-image-gallery-selector-thumbnail-width-notebook);
139
+ height: var(--fs-image-gallery-selector-thumbnail-height-notebook);
140
+ }
141
+ }
142
+
143
+ [data-fs-image-gallery-selector-control] {
144
+ position: absolute;
145
+ display: flex;
146
+ align-items: center;
147
+ z-index: 1;
148
+
149
+ &::after {
150
+ background: linear-gradient(90deg, var(--fs-image-gallery-selector-control-gradient-bkg-color) 55%, transparent);
151
+ content: '';
152
+ width: 100%;
153
+ height: 100%;
154
+ position: absolute;
155
+ left: 0;
156
+ z-index: -1;
157
+ @include media(">=notebook") { background: linear-gradient(180deg, var(--fs-image-gallery-selector-control-gradient-bkg-color) 55%, transparent); }
158
+ }
159
+
160
+ @include media("<notebook") {
161
+ height: 100%;
162
+ padding-left: var(--fs-grid-padding);
163
+
164
+ &::after { left: calc(-1 * var(--fs-grid-padding)); }
165
+
166
+ &:first-child { left: 0; }
167
+
168
+ &:last-child {
169
+ right: 0;
170
+ transform: scaleX(-1);
171
+ }
172
+ }
173
+
174
+ @include media(">=notebook") {
175
+ justify-content: center;
176
+ width: 100%;
177
+
178
+ &::after { top: calc(-1 * var(--fs-spacing-3)); }
179
+
180
+ &:last-child {
181
+ bottom: 0;
182
+ transform: scaleY(-1);
183
+ }
184
+ }
185
+
186
+ }
187
+
188
+ [data-fs-image-gallery-selector-control-button] {
189
+ background-color: var(--fs-image-gallery-selector-control-bkg-color);
190
+ border-radius: var(--fs-image-gallery-selector-control-border-radius);
191
+ box-shadow: var(--fs-image-gallery-selector-control-shadow);
192
+
193
+ @include media(">=notebook") {
194
+ transform: rotate(90deg);
195
+ }
196
+ }
197
+
198
+ // --------------------------------------------------------
199
+ // Variants Styles
200
+ // --------------------------------------------------------
201
+
202
+ &[data-fs-image-gallery="with-selector"] {
203
+ @include media(">=notebook") {
204
+ display: grid;
205
+ grid-template-columns: repeat(8, 1fr);
206
+ column-gap: var(--fs-image-gallery-gap-notebook);
207
+ }
208
+ }
209
+ }
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,9 +50,11 @@
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";
57
+ @import "../components/organisms/ImageGallery/styles";
55
58
  @import "../components/organisms/OutOfStock/styles";
56
59
  @import "../components/organisms/PaymentMethods/styles";
57
60
  @import "../components/organisms/PriceRange/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,2 +0,0 @@
1
- export { default } from './OrderSummary';
2
- export type { OrderSummaryProps } from './OrderSummary';
@@ -1,2 +0,0 @@
1
- export { default } from './OrderSummary';
2
- //# sourceMappingURL=index.js.map
@@ -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
@@ -1,2 +0,0 @@
1
- export { default } from './OrderSummary'
2
- export type { OrderSummaryProps } from './OrderSummary'