@faststore/core 2.0.100-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.
Files changed (154) hide show
  1. package/.turbo/turbo-build.log +6 -6
  2. package/CHANGELOG.md +12 -0
  3. package/cypress/integration/analytics.test.js +78 -63
  4. package/cypress/integration/cart.test.js +13 -12
  5. package/cypress/integration/search.test.js +4 -4
  6. package/package.json +4 -4
  7. package/src/components/cart/CartSidebar/CartSidebar.tsx +16 -40
  8. package/src/components/cart/OrderSummary/OrderSummary.tsx +2 -6
  9. package/src/components/search/Filter/FilterSlider.tsx +2 -2
  10. package/.next/BUILD_ID +0 -1
  11. package/.next/build-manifest.json +0 -99
  12. package/.next/cache/.tsbuildinfo +0 -1
  13. package/.next/cache/config.json +0 -7
  14. package/.next/cache/eslint/.cache_1gneedd +0 -1
  15. package/.next/cache/next-server.js.nft.json +0 -1
  16. package/.next/cache/webpack/client-production/0.pack +0 -0
  17. package/.next/cache/webpack/client-production/index.pack +0 -0
  18. package/.next/cache/webpack/server-production/0.pack +0 -0
  19. package/.next/cache/webpack/server-production/index.pack +0 -0
  20. package/.next/export-marker.json +0 -1
  21. package/.next/images-manifest.json +0 -1
  22. package/.next/next-server.js.nft.json +0 -1
  23. package/.next/package.json +0 -1
  24. package/.next/prerender-manifest.json +0 -1
  25. package/.next/react-loadable-manifest.json +0 -44
  26. package/.next/required-server-files.json +0 -1
  27. package/.next/routes-manifest.json +0 -1
  28. package/.next/server/chunks/120.js +0 -435
  29. package/.next/server/chunks/123.js +0 -58
  30. package/.next/server/chunks/1394.js +0 -3801
  31. package/.next/server/chunks/1608.js +0 -515
  32. package/.next/server/chunks/2154.js +0 -206
  33. package/.next/server/chunks/247.js +0 -61
  34. package/.next/server/chunks/2914.js +0 -95
  35. package/.next/server/chunks/2922.js +0 -7293
  36. package/.next/server/chunks/3264.js +0 -67
  37. package/.next/server/chunks/3431.js +0 -7241
  38. package/.next/server/chunks/350.js +0 -142
  39. package/.next/server/chunks/3746.js +0 -237
  40. package/.next/server/chunks/3898.js +0 -240
  41. package/.next/server/chunks/4312.js +0 -674
  42. package/.next/server/chunks/4371.js +0 -1473
  43. package/.next/server/chunks/5098.js +0 -124
  44. package/.next/server/chunks/5576.js +0 -72
  45. package/.next/server/chunks/6280.js +0 -322
  46. package/.next/server/chunks/6465.js +0 -91
  47. package/.next/server/chunks/676.js +0 -32
  48. package/.next/server/chunks/6859.js +0 -959
  49. package/.next/server/chunks/6881.js +0 -320
  50. package/.next/server/chunks/6898.js +0 -149
  51. package/.next/server/chunks/7104.js +0 -196
  52. package/.next/server/chunks/7181.js +0 -658
  53. package/.next/server/chunks/7183.js +0 -72
  54. package/.next/server/chunks/7992.js +0 -570
  55. package/.next/server/chunks/8098.js +0 -246
  56. package/.next/server/chunks/810.js +0 -432
  57. package/.next/server/chunks/8287.js +0 -58
  58. package/.next/server/chunks/9143.js +0 -106
  59. package/.next/server/chunks/9152.js +0 -213
  60. package/.next/server/chunks/953.js +0 -646
  61. package/.next/server/chunks/9557.js +0 -117
  62. package/.next/server/chunks/9854.js +0 -72
  63. package/.next/server/chunks/font-manifest.json +0 -1
  64. package/.next/server/font-manifest.json +0 -1
  65. package/.next/server/middleware-build-manifest.js +0 -1
  66. package/.next/server/middleware-manifest.json +0 -6
  67. package/.next/server/middleware-react-loadable-manifest.js +0 -1
  68. package/.next/server/pages/404.js.nft.json +0 -1
  69. package/.next/server/pages/500.js.nft.json +0 -1
  70. package/.next/server/pages/[...slug].js +0 -671
  71. package/.next/server/pages/[...slug].js.nft.json +0 -1
  72. package/.next/server/pages/[slug]/p.js +0 -2393
  73. package/.next/server/pages/[slug]/p.js.nft.json +0 -1
  74. package/.next/server/pages/_app.js +0 -2369
  75. package/.next/server/pages/_app.js.nft.json +0 -1
  76. package/.next/server/pages/_document.js +0 -304
  77. package/.next/server/pages/_document.js.nft.json +0 -1
  78. package/.next/server/pages/_error.js +0 -164
  79. package/.next/server/pages/_error.js.nft.json +0 -1
  80. package/.next/server/pages/account.js.nft.json +0 -1
  81. package/.next/server/pages/api/graphql.js +0 -315
  82. package/.next/server/pages/api/graphql.js.nft.json +0 -1
  83. package/.next/server/pages/api/preview.js +0 -118
  84. package/.next/server/pages/api/preview.js.nft.json +0 -1
  85. package/.next/server/pages/checkout.js.nft.json +0 -1
  86. package/.next/server/pages/en-US/404.html +0 -81
  87. package/.next/server/pages/en-US/500.html +0 -81
  88. package/.next/server/pages/en-US/account.html +0 -81
  89. package/.next/server/pages/en-US/checkout.html +0 -81
  90. package/.next/server/pages/en-US/login.html +0 -81
  91. package/.next/server/pages/en-US/s.html +0 -81
  92. package/.next/server/pages/en-US.html +0 -81
  93. package/.next/server/pages/en-US.json +0 -1
  94. package/.next/server/pages/index.js +0 -428
  95. package/.next/server/pages/index.js.nft.json +0 -1
  96. package/.next/server/pages/login.js.nft.json +0 -1
  97. package/.next/server/pages/s.js.nft.json +0 -1
  98. package/.next/server/pages-manifest.json +0 -16
  99. package/.next/server/webpack-api-runtime.js +0 -229
  100. package/.next/server/webpack-runtime.js +0 -229
  101. package/.next/static/_W6shnELbnMsH_iBfBVBe/_buildManifest.js +0 -1
  102. package/.next/static/_W6shnELbnMsH_iBfBVBe/_ssgManifest.js +0 -1
  103. package/.next/static/chunks/143.dd8a556e6957baa1.js +0 -1
  104. package/.next/static/chunks/152.57849458d8337a92.js +0 -1
  105. package/.next/static/chunks/264-25ec99bbaf5d02b4.js +0 -1
  106. package/.next/static/chunks/351-a4e28d64f48c5269.js +0 -1
  107. package/.next/static/chunks/608.59e69b83f35d9c44.js +0 -1
  108. package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
  109. package/.next/static/chunks/686.6c345856d484363b.js +0 -1
  110. package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
  111. package/.next/static/chunks/781-7df372b5b56e3f96.js +0 -1
  112. package/.next/static/chunks/843.e1d0f9260a52f32c.js +0 -1
  113. package/.next/static/chunks/98.97381d2021f86cd9.js +0 -1
  114. package/.next/static/chunks/996.64460309250b214c.js +0 -1
  115. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
  116. package/.next/static/chunks/main-9746772201fe3ac1.js +0 -1
  117. package/.next/static/chunks/pages/404-ba608a2a9f0c420a.js +0 -1
  118. package/.next/static/chunks/pages/500-910883c20541d9ce.js +0 -1
  119. package/.next/static/chunks/pages/[...slug]-417e3b51bda1f5f3.js +0 -1
  120. package/.next/static/chunks/pages/[slug]/p-cbb4ca8d57bafa9f.js +0 -1
  121. package/.next/static/chunks/pages/_app-d757170e632a6003.js +0 -1
  122. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
  123. package/.next/static/chunks/pages/account-b8fc5222ffe89b60.js +0 -1
  124. package/.next/static/chunks/pages/checkout-f8cb7cb22225ef9d.js +0 -1
  125. package/.next/static/chunks/pages/index-9ea3f7868f5ed138.js +0 -1
  126. package/.next/static/chunks/pages/login-33954810b200eca8.js +0 -1
  127. package/.next/static/chunks/pages/s-ba2868e14fedb65b.js +0 -1
  128. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
  129. package/.next/static/chunks/webpack-65b155971f3eac57.js +0 -1
  130. package/.next/static/css/10db3bc7ecdf0556.css +0 -1
  131. package/.next/static/css/43d61b402f41569b.css +0 -1
  132. package/.next/static/css/4899c3cc356704f9.css +0 -1
  133. package/.next/static/css/6507cb48401e73a4.css +0 -1
  134. package/.next/static/css/8ea129ea90e49e98.css +0 -1
  135. package/.next/static/css/b2f16bd4b93e0aca.css +0 -1
  136. package/.next/static/css/db63ea05e98cb7e8.css +0 -1
  137. package/.next/static/css/ea60a7e6c07ee644.css +0 -1
  138. package/.next/static/media/brandless-neutral.76ddf63a.png +0 -0
  139. package/.next/trace +0 -65
  140. package/public/~partytown/debug/partytown-atomics.js +0 -556
  141. package/public/~partytown/debug/partytown-media.js +0 -374
  142. package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
  143. package/public/~partytown/debug/partytown-sw.js +0 -59
  144. package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
  145. package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
  146. package/public/~partytown/debug/partytown.js +0 -72
  147. package/public/~partytown/partytown-atomics.js +0 -2
  148. package/public/~partytown/partytown-media.js +0 -2
  149. package/public/~partytown/partytown-sw.js +0 -2
  150. package/public/~partytown/partytown.js +0 -2
  151. package/src/components/cart/CartItem/CartItem.stories.mdx +0 -134
  152. package/src/components/cart/CartSidebar/CartSidebar.stories.mdx +0 -105
  153. package/src/components/cart/CartSidebar/cart-sidebar.module.scss +0 -57
  154. package/src/components/cart/OrderSummary/order-summary.module.scss +0 -22
@@ -24,7 +24,7 @@ info - Finalizing page optimization...
24
24
  Route (pages) Size First Load JS
25
25
  ┌ ● / 8.59 kB 117 kB
26
26
  ├ └ css/43d61b402f41569b.css 1.84 kB
27
- ├ /_app 0 B 96.6 kB
27
+ ├ /_app 0 B 96.7 kB
28
28
  ├ ● /[...slug] 9.48 kB 122 kB
29
29
  ├ └ css/8ea129ea90e49e98.css 1.83 kB
30
30
  ├ ● /[slug]/p 16.8 kB 125 kB
@@ -32,8 +32,8 @@ Route (pages) Size First Load JS
32
32
  ├ ○ /404 431 B 102 kB
33
33
  ├ ○ /500 439 B 102 kB
34
34
  ├ ○ /account 383 B 102 kB
35
- ├ λ /api/graphql 0 B 96.6 kB
36
- ├ λ /api/preview 0 B 96.6 kB
35
+ ├ λ /api/graphql 0 B 96.7 kB
36
+ ├ λ /api/preview 0 B 96.7 kB
37
37
  ├ ○ /checkout 371 B 102 kB
38
38
  ├ ○ /login 385 B 102 kB
39
39
  └ ○ /s 895 B 113 kB
@@ -41,9 +41,9 @@ Route (pages) Size First Load JS
41
41
  + First Load JS shared by all 119 kB
42
42
  ├ chunks/framework-dfd14d7ce6600b03.js 45.3 kB
43
43
  ├ chunks/main-9746772201fe3ac1.js 23.9 kB
44
- ├ chunks/pages/_app-d757170e632a6003.js 25.3 kB
45
- ├ chunks/webpack-65b155971f3eac57.js 2.18 kB
46
- └ css/ea60a7e6c07ee644.css 22 kB
44
+ ├ chunks/pages/_app-b7c1de35514e9970.js 25.3 kB
45
+ ├ chunks/webpack-6f37e8a1cc679711.js 2.18 kB
46
+ └ css/3e9574c21348f15a.css 22.3 kB
47
47
 
48
48
  λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
49
49
  ○ (Static) automatically rendered as static HTML (uses no initial props)
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.102-alpha.0](https://github.com/vtex/faststore/compare/v2.0.101-alpha.0...v2.0.102-alpha.0) (2023-04-06)
7
+
8
+ ### Features
9
+
10
+ - Adds `CartSidebar` and `OrderSummary` ([#1704](https://github.com/vtex/faststore/issues/1704)) ([a16e168](https://github.com/vtex/faststore/commit/a16e1683816ef84866de4cd7f8d8a64f951b98c6))
11
+
12
+ ## [2.0.101-alpha.0](https://github.com/vtex/faststore/compare/v2.0.100-alpha.0...v2.0.101-alpha.0) (2023-04-05)
13
+
14
+ ### Bug Fixes
15
+
16
+ - fix tests ([#1705](https://github.com/vtex/faststore/issues/1705)) ([8990310](https://github.com/vtex/faststore/commit/899031022bf6514797f24895ffb7c97e46726217))
17
+
6
18
  ## [2.0.100-alpha.0](https://github.com/vtex/faststore/compare/v2.0.99-alpha.0...v2.0.100-alpha.0) (2023-04-05)
7
19
 
8
20
  **Note:** Version bump only for package @faststore/core
@@ -75,12 +75,15 @@ describe('add_to_cart event', () => {
75
75
  cy.getById('buy-button')
76
76
  .should('be.visible')
77
77
  .scrollIntoView({ duration: 500 })
78
- .click()
79
- .then(($btn) => {
80
- cy.itemsInCart(1)
81
- const skuId = $btn.attr('data-sku')
78
+ .then(() => {
79
+ cy.getById('buy-button')
80
+ .click({ force: true })
81
+ .then(($btn) => {
82
+ cy.itemsInCart(1)
83
+ const skuId = $btn.attr('data-sku')
82
84
 
83
- testAddToCartEvent({ skuId, numberOfEvents: 1 })
85
+ testAddToCartEvent({ skuId, numberOfEvents: 1 })
86
+ })
84
87
  })
85
88
  })
86
89
  })
@@ -96,21 +99,24 @@ describe('add_to_cart event', () => {
96
99
  cy.getById('buy-button')
97
100
  .should('be.visible')
98
101
  .scrollIntoView({ duration: 500 })
99
- .click()
100
- .then(($btn) => {
101
- cy.itemsInCart(1)
102
- const skuId = $btn.attr('data-sku')
102
+ .then(() => {
103
+ cy.getById('buy-button')
104
+ .click({ force: true })
105
+ .then(($btn) => {
106
+ cy.itemsInCart(1)
107
+ const skuId = $btn.attr('data-sku')
103
108
 
104
- testAddToCartEvent({ skuId, numberOfEvents: 1 })
109
+ testAddToCartEvent({ skuId, numberOfEvents: 1 })
105
110
 
106
- cy.get(
107
- '[data-testid=fs-cart-item] [data-testid=fs-quantity-selector-right-button]'
108
- )
109
- .click()
110
- .then(() => {
111
- cy.itemsInCart(2)
111
+ cy.get(
112
+ '[data-testid=fs-cart-item] [data-testid=fs-quantity-selector-right-button]'
113
+ )
114
+ .click()
115
+ .then(() => {
116
+ cy.itemsInCart(2)
112
117
 
113
- testAddToCartEvent({ skuId, numberOfEvents: 2 })
118
+ testAddToCartEvent({ skuId, numberOfEvents: 2 })
119
+ })
114
120
  })
115
121
  })
116
122
  })
@@ -160,26 +166,29 @@ describe('remove_from_cart event', () => {
160
166
  cy.getById('buy-button')
161
167
  .should('be.visible')
162
168
  .scrollIntoView({ duration: 500 })
163
- .click()
164
169
  .then(() => {
165
- cy.itemsInCart(1)
166
- cy.getById('checkout-button')
167
- .should('be.visible')
168
- .should('be.enabled')
169
- cy.itemsInCart(1)
170
+ cy.getById('buy-button')
171
+ .click({ force: true })
172
+ .then(() => {
173
+ cy.itemsInCart(1)
174
+ cy.getById('checkout-button')
175
+ .should('be.visible')
176
+ .should('be.enabled')
177
+ cy.itemsInCart(1)
170
178
 
171
- // Remove the added item
172
- cy.getById('remove-from-cart-button')
173
- .click()
174
- .then(($btn) => {
175
- cy.itemsInCart(0)
176
- const skuId = $btn.attr('data-sku')
179
+ // Remove the added item
180
+ cy.getById('remove-from-cart-button')
181
+ .click({ force: true })
182
+ .then(($btn) => {
183
+ cy.itemsInCart(0)
184
+ const skuId = $btn.attr('data-sku')
177
185
 
178
- testRemoveFromCartEvent({
179
- skuId,
180
- numberOfEvents: 1,
181
- quantity: 1,
182
- })
186
+ testRemoveFromCartEvent({
187
+ skuId,
188
+ numberOfEvents: 1,
189
+ quantity: 1,
190
+ })
191
+ })
183
192
  })
184
193
  })
185
194
  })
@@ -194,13 +203,13 @@ describe('remove_from_cart event', () => {
194
203
 
195
204
  // Add item to cart
196
205
  cy.get('[data-testid=fs-quantity-selector-right-button]')
197
- .click()
206
+ .click({ force: true })
198
207
  .then(() => {
199
208
  cy.getById('buy-button')
200
209
  .should('be.visible')
201
210
  .scrollIntoView({ duration: 500 })
202
- .click()
203
211
  .then(($btn) => {
212
+ cy.getById('buy-button').click({ force: true })
204
213
  cy.itemsInCart(2)
205
214
  cy.getById('checkout-button')
206
215
  .should('be.visible')
@@ -211,7 +220,7 @@ describe('remove_from_cart event', () => {
211
220
  cy.get(
212
221
  '[data-testid=fs-cart-item] [data-testid=fs-quantity-selector-left-button]'
213
222
  )
214
- .click()
223
+ .click({ force: true })
215
224
  .then(() => {
216
225
  cy.itemsInCart(1)
217
226
  cy.getById('checkout-button')
@@ -254,22 +263,26 @@ describe('select_item event', () => {
254
263
 
255
264
  let skuId
256
265
 
257
- cy.getById('fs-product-card').first().click()
258
- cy.getById('buy-button')
259
- .should('be.visible')
260
- .scrollIntoView({ duration: 500 })
261
- .then(($btn) => {
262
- skuId = $btn.attr('data-sku')
263
- })
266
+ cy.getById('fs-product-card')
267
+ .first()
268
+ .click()
264
269
  .then(() => {
265
- cy.window().then((window) => {
266
- const event = window.dataLayer.find(
267
- ({ event: eventName }) => eventName === 'select_item'
268
- )
270
+ cy.getById('buy-button')
271
+ .should('be.visible')
272
+ .scrollIntoView({ duration: 0 })
273
+ .then(($btn) => {
274
+ skuId = $btn.attr('data-sku')
275
+ })
276
+ .then(() => {
277
+ cy.window().then((window) => {
278
+ const event = window.dataLayer.find(
279
+ ({ event: eventName }) => eventName === 'select_item'
280
+ )
269
281
 
270
- expect(event).to.exist
271
- expect(skuId).to.equal(event.ecommerce.items[0].item_variant)
272
- })
282
+ expect(event).to.exist
283
+ expect(skuId).to.equal(event.ecommerce.items[0].item_variant)
284
+ })
285
+ })
273
286
  })
274
287
  })
275
288
  })
@@ -347,7 +360,7 @@ describe('search event', () => {
347
360
  .click()
348
361
  .type('shirt')
349
362
  .within(() => {
350
- cy.getById('fs-button')
363
+ cy.getById('store-input-mobile-button')
351
364
  .click()
352
365
  .then(() => {
353
366
  dataLayerHasEvent('search')
@@ -362,7 +375,7 @@ describe('view_cart event', () => {
362
375
  cy.waitForHydration()
363
376
 
364
377
  cy.getById('cart-toggle').click()
365
- cy.getById('cart-sidebar').should('be.visible')
378
+ cy.getById('fs-cart-sidebar').should('be.visible')
366
379
 
367
380
  dataLayerHasEvent('view_cart')
368
381
 
@@ -383,18 +396,20 @@ describe('view_cart event', () => {
383
396
  cy.getById('buy-button')
384
397
  .should('be.visible')
385
398
  .scrollIntoView({ duration: 500 })
386
- .click()
387
- cy.getById('cart-sidebar').should('be.visible')
399
+ .then(() => {
400
+ cy.getById('buy-button').click({ force: true })
401
+ cy.getById('fs-cart-sidebar').should('be.visible')
388
402
 
389
- dataLayerHasEvent('view_cart')
403
+ dataLayerHasEvent('view_cart')
390
404
 
391
- cy.window().then((window) => {
392
- const event = window.dataLayer.find(
393
- ({ event: eventName }) => eventName === 'view_cart'
394
- )
405
+ cy.window().then((window) => {
406
+ const event = window.dataLayer.find(
407
+ ({ event: eventName }) => eventName === 'view_cart'
408
+ )
395
409
 
396
- expect(event.ecommerce.value).to.equal(950)
397
- expect(event.ecommerce.items.length).to.equal(1)
398
- })
410
+ expect(event.ecommerce.value).to.equal(950)
411
+ expect(event.ecommerce.items.length).to.equal(1)
412
+ })
413
+ })
399
414
  })
400
415
  })
@@ -19,9 +19,9 @@ describe('Cart Sidebar', () => {
19
19
  cy.waitForHydration()
20
20
 
21
21
  cy.getById('cart-toggle').first().click()
22
- cy.getById('cart-sidebar').should('exist')
23
- cy.getById('cart-sidebar-button-close').first().click()
24
- cy.getById('cart-sidebar').should('not.exist')
22
+ cy.getById('fs-cart-sidebar').should('exist')
23
+ cy.getById('fs-cart-sidebar-button-close').first().click()
24
+ cy.getById('fs-cart-sidebar').should('not.exist')
25
25
  })
26
26
 
27
27
  context('when opening the cart sidebar', () => {
@@ -31,7 +31,7 @@ describe('Cart Sidebar', () => {
31
31
 
32
32
  // window scrolls to keep cart-toggle on the screen initially
33
33
  cy.getById('cart-toggle').click()
34
- cy.getById('cart-sidebar').should('exist')
34
+ cy.getById('fs-cart-sidebar').should('exist')
35
35
 
36
36
  // simulate touch scroll. Do not use window.scrollTo
37
37
  cy.get('[data-fs-empty-state]')
@@ -57,8 +57,9 @@ describe('On product description pages', () => {
57
57
 
58
58
  // Add to cart
59
59
  cy.getById('buy-button')
60
- .click()
60
+ .scrollIntoView({ duration: 500 })
61
61
  .then(($btn) => {
62
+ cy.getById('buy-button').click({ force: true })
62
63
  const skuId = $btn.attr('data-sku')
63
64
  const sellerId = $btn.attr('data-seller')
64
65
 
@@ -66,13 +67,13 @@ describe('On product description pages', () => {
66
67
  cy.getById('checkout-button')
67
68
  .should('be.visible')
68
69
  .should('be.enabled')
69
-
70
- cy.getById('fs-cart-item').should(($item) => {
71
- expect($item.attr('data-sku')).to.eq(skuId)
72
- expect($item.attr('data-seller')).to.eq(sellerId)
73
- })
74
-
75
- cy.itemsInCart(1)
70
+ .then(() => {
71
+ cy.getById('fs-cart-item').should(($item) => {
72
+ expect($item.attr('data-sku')).to.eq(skuId)
73
+ expect($item.attr('data-seller')).to.eq(sellerId)
74
+ })
75
+ cy.itemsInCart(1)
76
+ })
76
77
  })
77
78
  })
78
79
  })
@@ -23,16 +23,16 @@ describe('Search input', () => {
23
23
 
24
24
  cy.getById('store-input-mobile-button')
25
25
  .should('exist')
26
- .scrollIntoView({ duration: 500 })
26
+ .scrollIntoView({ duration: 0 })
27
27
  .click({ force: true })
28
28
 
29
29
  cy.getById('store-input-mobile')
30
30
  .should('exist')
31
- .scrollIntoView({ duration: 500 })
32
- .click()
31
+ .scrollIntoView({ duration: 0 })
32
+ .click({ force: true })
33
33
  .type(term)
34
34
  .within(() => {
35
- cy.getById('fs-button').click()
35
+ cy.getById('store-input-mobile-button').click()
36
36
  })
37
37
 
38
38
  cy.location('search').should((loc) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "2.0.100-alpha.0",
3
+ "version": "2.0.102-alpha.0",
4
4
  "license": "MIT",
5
5
  "browserslist": "supports es6-module and not dead",
6
6
  "scripts": {
@@ -30,10 +30,10 @@
30
30
  "@envelop/parser-cache": "^2.2.0",
31
31
  "@envelop/validation-cache": "^2.2.0",
32
32
  "@faststore/api": "^2.0.97-alpha.0",
33
- "@faststore/components": "^2.0.99-alpha.0",
33
+ "@faststore/components": "^2.0.102-alpha.0",
34
34
  "@faststore/graphql-utils": "^2.0.3-alpha.0",
35
35
  "@faststore/sdk": "^2.0.3-alpha.0",
36
- "@faststore/ui": "^2.0.99-alpha.0",
36
+ "@faststore/ui": "^2.0.102-alpha.0",
37
37
  "@types/react": "^18.0.14",
38
38
  "@vtex/client-cms": "^0.2.12",
39
39
  "autoprefixer": "^10.4.0",
@@ -108,5 +108,5 @@
108
108
  "msw": {
109
109
  "workerDirectory": "public"
110
110
  },
111
- "gitHead": "68d3a8bb6dc397014f6014ffd8223c0e2ef380ed"
111
+ "gitHead": "c9841c86822020c65161193647edf280cd765efa"
112
112
  }
@@ -1,11 +1,9 @@
1
1
  import { sendAnalyticsEvent } from '@faststore/sdk'
2
2
  import {
3
- Alert as UIAlert,
4
- Badge as UIBadge,
3
+ CartSidebar as UICartSidebar,
4
+ CartSidebarList as UICartSidebarList,
5
+ CartSidebarFooter as UICartSidebarFooter,
5
6
  Button as UIButton,
6
- List as UIList,
7
- SlideOver as UISlideOver,
8
- SlideOverHeader as UISlideOverHeader,
9
7
  } from '@faststore/ui'
10
8
 
11
9
  import type { CurrencyCode, ViewCartEvent } from '@faststore/sdk'
@@ -20,14 +18,13 @@ import Gift from '../../ui/Gift'
20
18
  import CartItem from '../CartItem'
21
19
  import EmptyCart from '../EmptyCart'
22
20
  import OrderSummary from '../OrderSummary'
23
- import styles from './cart-sidebar.module.scss'
24
21
 
25
22
  function CartSidebar() {
26
23
  const { currency } = useSession()
27
24
  const btnProps = useCheckoutButton()
28
25
  const cart = useCart()
29
- const { cart: displayCart, closeCart } = useUI()
30
- const { fade, fadeOut } = useFadeEffect()
26
+ const { closeCart } = useUI()
27
+ const { fadeOut } = useFadeEffect()
31
28
 
32
29
  const { items, gifts, totalItems, isValidating, subTotal, total } = cart
33
30
 
@@ -56,38 +53,18 @@ function CartSidebar() {
56
53
  // eslint-disable-next-line react-hooks/exhaustive-deps
57
54
  }, [])
58
55
 
59
- const closeBtnProps = {
60
- testId: 'cart-sidebar-button-close',
61
- }
62
-
63
56
  return (
64
- <UISlideOver
65
- fade={fade}
66
- isOpen={displayCart}
67
- onDismiss={() => fadeOut()}
68
- size="partial"
69
- direction="rightSide"
70
- className={styles.fsCartSidebar}
71
- onTransitionEnd={() => fade === 'out' && closeCart()}
72
- data-testid="cart-sidebar"
57
+ <UICartSidebar
58
+ totalItems={totalItems}
59
+ alertIcon={<Icon name="Truck" />}
60
+ alertText="Free shipping starts at $300"
61
+ onClose={fadeOut}
73
62
  >
74
- <UISlideOverHeader closeBtnProps={closeBtnProps} onClose={fadeOut}>
75
- <div data-fs-cart-sidebar-title>
76
- <p data-fs-cart-sidebar-title-text className="text__lead">
77
- Your Cart
78
- </p>
79
- <UIBadge variant="info">{totalItems}</UIBadge>
80
- </div>
81
- </UISlideOverHeader>
82
- <UIAlert icon={<Icon name="Truck" />}>
83
- Free shipping starts at $300
84
- </UIAlert>
85
-
86
63
  {isEmpty ? (
87
- <EmptyCart onDismiss={fadeOut} />
64
+ <EmptyCart onDismiss={closeCart} />
88
65
  ) : (
89
66
  <>
90
- <UIList data-fs-cart-sidebar-list>
67
+ <UICartSidebarList>
91
68
  {items.map((item) => (
92
69
  <li key={item.id}>
93
70
  <CartItem item={item} />
@@ -102,16 +79,15 @@ function CartSidebar() {
102
79
  ))}
103
80
  </>
104
81
  )}
105
- </UIList>
82
+ </UICartSidebarList>
106
83
 
107
- <footer data-fs-cart-sidebar-footer>
84
+ <UICartSidebarFooter>
108
85
  <OrderSummary
109
86
  subTotal={subTotal}
110
87
  total={total}
111
88
  numberOfItems={totalItems}
112
89
  checkoutButton={
113
90
  <UIButton
114
- data-fs-cart-sidebar-checkout-button
115
91
  variant="primary"
116
92
  icon={
117
93
  !isValidating && (
@@ -125,10 +101,10 @@ function CartSidebar() {
125
101
  </UIButton>
126
102
  }
127
103
  />
128
- </footer>
104
+ </UICartSidebarFooter>
129
105
  </>
130
106
  )}
131
- </UISlideOver>
107
+ </UICartSidebar>
132
108
  )
133
109
  }
134
110
 
@@ -3,8 +3,6 @@ import type { ReactNode } from 'react'
3
3
 
4
4
  import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
5
5
 
6
- import styles from './order-summary.module.scss'
7
-
8
6
  interface OrderSummaryProps {
9
7
  subTotal: number
10
8
  total: number
@@ -22,17 +20,15 @@ function OrderSummary({
22
20
  const formattedDiscount = useFormattedPrice(discount)
23
21
 
24
22
  return (
25
- <div className={styles.fsOrderSummary}>
23
+ <>
26
24
  <UIOrderSummary
27
25
  subtotalLabel={`Subtotal (${numberOfItems} products)`}
28
26
  subtotalValue={useFormattedPrice(subTotal)}
29
- discountLabel="Discount"
30
27
  discountValue={discount > 0 ? `-${formattedDiscount}` : undefined}
31
- totalLabel="Total"
32
28
  totalValue={useFormattedPrice(total)}
33
29
  />
34
30
  {checkoutButton}
35
- </div>
31
+ </>
36
32
  )
37
33
  }
38
34
 
@@ -82,7 +82,7 @@ function FilterSlider({
82
82
  return (
83
83
  <UIFilterFacets
84
84
  key={`${testId}-${label}-${index}`}
85
- testId={testId}
85
+ testId={`mobile-${testId}`}
86
86
  index={index}
87
87
  type={type}
88
88
  label={label}
@@ -93,7 +93,7 @@ function FilterSlider({
93
93
  <UIFilterFacetBooleanItem
94
94
  key={`${testId}-${facet.label}-${item.label}`}
95
95
  id={`${testId}-${facet.label}-${item.label}`}
96
- testId={testId}
96
+ testId={`mobile-${testId}`}
97
97
  onFacetChange={(facet) =>
98
98
  dispatch({ type: 'toggleFacet', payload: facet })
99
99
  }
package/.next/BUILD_ID DELETED
@@ -1 +0,0 @@
1
- _W6shnELbnMsH_iBfBVBe
@@ -1,99 +0,0 @@
1
- {
2
- "polyfillFiles": [
3
- "static/chunks/polyfills-c67a75d1b6f99dc8.js"
4
- ],
5
- "devFiles": [],
6
- "ampDevFiles": [],
7
- "lowPriorityFiles": [
8
- "static/_W6shnELbnMsH_iBfBVBe/_buildManifest.js",
9
- "static/_W6shnELbnMsH_iBfBVBe/_ssgManifest.js"
10
- ],
11
- "rootMainFiles": [],
12
- "pages": {
13
- "/": [
14
- "static/chunks/webpack-65b155971f3eac57.js",
15
- "static/chunks/framework-dfd14d7ce6600b03.js",
16
- "static/chunks/main-9746772201fe3ac1.js",
17
- "static/chunks/351-a4e28d64f48c5269.js",
18
- "static/chunks/781-7df372b5b56e3f96.js",
19
- "static/css/43d61b402f41569b.css",
20
- "static/chunks/pages/index-9ea3f7868f5ed138.js"
21
- ],
22
- "/404": [
23
- "static/chunks/webpack-65b155971f3eac57.js",
24
- "static/chunks/framework-dfd14d7ce6600b03.js",
25
- "static/chunks/main-9746772201fe3ac1.js",
26
- "static/chunks/351-a4e28d64f48c5269.js",
27
- "static/chunks/pages/404-ba608a2a9f0c420a.js"
28
- ],
29
- "/500": [
30
- "static/chunks/webpack-65b155971f3eac57.js",
31
- "static/chunks/framework-dfd14d7ce6600b03.js",
32
- "static/chunks/main-9746772201fe3ac1.js",
33
- "static/chunks/351-a4e28d64f48c5269.js",
34
- "static/chunks/pages/500-910883c20541d9ce.js"
35
- ],
36
- "/[...slug]": [
37
- "static/chunks/webpack-65b155971f3eac57.js",
38
- "static/chunks/framework-dfd14d7ce6600b03.js",
39
- "static/chunks/main-9746772201fe3ac1.js",
40
- "static/chunks/351-a4e28d64f48c5269.js",
41
- "static/chunks/264-25ec99bbaf5d02b4.js",
42
- "static/css/8ea129ea90e49e98.css",
43
- "static/chunks/pages/[...slug]-417e3b51bda1f5f3.js"
44
- ],
45
- "/[slug]/p": [
46
- "static/chunks/webpack-65b155971f3eac57.js",
47
- "static/chunks/framework-dfd14d7ce6600b03.js",
48
- "static/chunks/main-9746772201fe3ac1.js",
49
- "static/chunks/351-a4e28d64f48c5269.js",
50
- "static/chunks/781-7df372b5b56e3f96.js",
51
- "static/css/4899c3cc356704f9.css",
52
- "static/chunks/pages/[slug]/p-cbb4ca8d57bafa9f.js"
53
- ],
54
- "/_app": [
55
- "static/chunks/webpack-65b155971f3eac57.js",
56
- "static/chunks/framework-dfd14d7ce6600b03.js",
57
- "static/chunks/main-9746772201fe3ac1.js",
58
- "static/css/ea60a7e6c07ee644.css",
59
- "static/chunks/pages/_app-d757170e632a6003.js"
60
- ],
61
- "/_error": [
62
- "static/chunks/webpack-65b155971f3eac57.js",
63
- "static/chunks/framework-dfd14d7ce6600b03.js",
64
- "static/chunks/main-9746772201fe3ac1.js",
65
- "static/chunks/pages/_error-a7a0c1d9bfbb4f38.js"
66
- ],
67
- "/account": [
68
- "static/chunks/webpack-65b155971f3eac57.js",
69
- "static/chunks/framework-dfd14d7ce6600b03.js",
70
- "static/chunks/main-9746772201fe3ac1.js",
71
- "static/chunks/351-a4e28d64f48c5269.js",
72
- "static/chunks/pages/account-b8fc5222ffe89b60.js"
73
- ],
74
- "/checkout": [
75
- "static/chunks/webpack-65b155971f3eac57.js",
76
- "static/chunks/framework-dfd14d7ce6600b03.js",
77
- "static/chunks/main-9746772201fe3ac1.js",
78
- "static/chunks/351-a4e28d64f48c5269.js",
79
- "static/chunks/pages/checkout-f8cb7cb22225ef9d.js"
80
- ],
81
- "/login": [
82
- "static/chunks/webpack-65b155971f3eac57.js",
83
- "static/chunks/framework-dfd14d7ce6600b03.js",
84
- "static/chunks/main-9746772201fe3ac1.js",
85
- "static/chunks/351-a4e28d64f48c5269.js",
86
- "static/chunks/pages/login-33954810b200eca8.js"
87
- ],
88
- "/s": [
89
- "static/chunks/webpack-65b155971f3eac57.js",
90
- "static/chunks/framework-dfd14d7ce6600b03.js",
91
- "static/chunks/main-9746772201fe3ac1.js",
92
- "static/chunks/351-a4e28d64f48c5269.js",
93
- "static/chunks/264-25ec99bbaf5d02b4.js",
94
- "static/css/db63ea05e98cb7e8.css",
95
- "static/chunks/pages/s-ba2868e14fedb65b.js"
96
- ]
97
- },
98
- "ampFirstPages": []
99
- }