@faststore/core 3.0.111 → 3.0.115

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 (124) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +56 -56
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/config.json +3 -3
  5. package/.next/cache/eslint/.cache_1gneedd +1 -1
  6. package/.next/cache/webpack/client-production/0.pack +0 -0
  7. package/.next/cache/webpack/client-production/index.pack +0 -0
  8. package/.next/cache/webpack/server-production/0.pack +0 -0
  9. package/.next/cache/webpack/server-production/index.pack +0 -0
  10. package/.next/next-minimal-server.js.nft.json +1 -1
  11. package/.next/next-server.js.nft.json +1 -1
  12. package/.next/prerender-manifest.js +1 -1
  13. package/.next/prerender-manifest.json +1 -1
  14. package/.next/react-loadable-manifest.json +1 -15
  15. package/.next/routes-manifest.json +1 -1
  16. package/.next/server/chunks/153.js +1 -1
  17. package/.next/server/chunks/498.js +1 -1
  18. package/.next/server/chunks/646.js +3 -3
  19. package/.next/server/chunks/933.js +1 -1
  20. package/.next/server/chunks/945.js +1 -1
  21. package/.next/server/chunks/997.js +1 -1
  22. package/.next/server/middleware-build-manifest.js +1 -1
  23. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  24. package/.next/server/pages/404.js +1 -1
  25. package/.next/server/pages/404.js.nft.json +1 -1
  26. package/.next/server/pages/500.js +1 -1
  27. package/.next/server/pages/500.js.nft.json +1 -1
  28. package/.next/server/pages/[...slug].js +1 -1
  29. package/.next/server/pages/[...slug].js.nft.json +1 -1
  30. package/.next/server/pages/[slug]/p.js +1 -1
  31. package/.next/server/pages/[slug]/p.js.nft.json +1 -1
  32. package/.next/server/pages/_app.js +1 -1
  33. package/.next/server/pages/_app.js.nft.json +1 -1
  34. package/.next/server/pages/_document.js.nft.json +1 -1
  35. package/.next/server/pages/_error.js +1 -1
  36. package/.next/server/pages/_error.js.nft.json +1 -1
  37. package/.next/server/pages/account.js +1 -1
  38. package/.next/server/pages/account.js.nft.json +1 -1
  39. package/.next/server/pages/api/graphql.js.nft.json +1 -1
  40. package/.next/server/pages/api/health/live.js.nft.json +1 -1
  41. package/.next/server/pages/api/health/ready.js.nft.json +1 -1
  42. package/.next/server/pages/api/preview.js.nft.json +1 -1
  43. package/.next/server/pages/checkout.js +1 -1
  44. package/.next/server/pages/checkout.js.nft.json +1 -1
  45. package/.next/server/pages/en-US/404.html +1 -68
  46. package/.next/server/pages/en-US/404.json +1 -1
  47. package/.next/server/pages/en-US/500.html +1 -68
  48. package/.next/server/pages/en-US/500.json +1 -1
  49. package/.next/server/pages/en-US/account.html +1 -68
  50. package/.next/server/pages/en-US/account.json +1 -1
  51. package/.next/server/pages/en-US/checkout.html +1 -68
  52. package/.next/server/pages/en-US/checkout.json +1 -1
  53. package/.next/server/pages/en-US/login.html +1 -68
  54. package/.next/server/pages/en-US/login.json +1 -1
  55. package/.next/server/pages/en-US/s.html +1 -68
  56. package/.next/server/pages/en-US/s.json +1 -1
  57. package/.next/server/pages/en-US.html +2 -69
  58. package/.next/server/pages/en-US.json +1 -1
  59. package/.next/server/pages/index.js +1 -1
  60. package/.next/server/pages/index.js.nft.json +1 -1
  61. package/.next/server/pages/login.js +1 -1
  62. package/.next/server/pages/login.js.nft.json +1 -1
  63. package/.next/server/pages/s.js +1 -1
  64. package/.next/server/pages/s.js.nft.json +1 -1
  65. package/.next/server/pages-manifest.json +1 -1
  66. package/.next/static/Phsiu2MTzhG7Yo-7F06VY/_buildManifest.js +1 -0
  67. package/.next/static/chunks/{575-ae1d53677e78fd7b.js → 108-090729aea2c4ba4c.js} +2 -2
  68. package/.next/static/chunks/629-2035a739f8a77882.js +1 -0
  69. package/.next/static/chunks/65.8e4235e2d3871cb7.js +1 -0
  70. package/.next/static/chunks/661-37d224da8cd18a0d.js +1 -0
  71. package/.next/static/chunks/968-d09ce43a57f43460.js +1 -0
  72. package/.next/static/chunks/pages/404-3c76e2c43ca8dcd4.js +1 -0
  73. package/.next/static/chunks/pages/500-1ad030e3adff740a.js +1 -0
  74. package/.next/static/chunks/pages/[...slug]-71b879bc2fe42f9c.js +1 -0
  75. package/.next/static/chunks/pages/[slug]/p-e34db2401c5476f8.js +1 -0
  76. package/.next/static/chunks/pages/_app-5d553d859f2f0ef5.js +1 -0
  77. package/.next/static/chunks/pages/{account-dbc5c028225cd1ac.js → account-e7b06039b653381d.js} +1 -1
  78. package/.next/static/chunks/pages/{checkout-29ae2c37eaf172e1.js → checkout-996d898a57d037a0.js} +1 -1
  79. package/.next/static/chunks/pages/index-31ed9b1d5e358000.js +1 -0
  80. package/.next/static/chunks/pages/login-b82e639bfe6d70ce.js +1 -0
  81. package/.next/static/chunks/pages/{s-4eb28d79d5408f36.js → s-42e7637b150b1768.js} +1 -1
  82. package/.next/static/chunks/webpack-8883d8523b03e385.js +1 -0
  83. package/.next/static/css/{e0edaedcfb97bf5e.css → 4fae3c7fc719f5c5.css} +1 -1
  84. package/.next/trace +95 -95
  85. package/.turbo/turbo-build.log +17 -17
  86. package/.turbo/turbo-test.log +4 -4
  87. package/cypress/integration/a11y.test.js +17 -5
  88. package/cypress/integration/analytics.test.js +2 -2
  89. package/cypress/integration/seo.test.js +6 -3
  90. package/faststore.config.default.js +2 -2
  91. package/package.json +4 -6
  92. package/src/components/cms/GlobalSections.tsx +6 -6
  93. package/src/components/cms/RenderSections.tsx +2 -5
  94. package/src/components/common/Footer/Footer.tsx +6 -2
  95. package/src/components/common/Footer/FooterLinks.tsx +1 -1
  96. package/src/components/common/Footer/FooterSocial.tsx +10 -3
  97. package/src/components/sections/Incentives/Incentives.tsx +5 -3
  98. package/src/components/ui/Incentives/Incentives.tsx +11 -5
  99. package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +1 -2
  100. package/src/pages/_app.tsx +0 -7
  101. package/src/pages/index.tsx +18 -19
  102. package/.next/server/chunks/247.js +0 -1
  103. package/.next/server/chunks/344.js +0 -1
  104. package/.next/server/chunks/540.js +0 -1
  105. package/.next/server/chunks/693.js +0 -1
  106. package/.next/server/chunks/779.js +0 -1
  107. package/.next/static/3mglPnslwIJq4NamYz8YZ/_buildManifest.js +0 -1
  108. package/.next/static/chunks/104-6c6df4defdfdd68c.js +0 -1
  109. package/.next/static/chunks/247.3c1cab4f683fc60d.js +0 -1
  110. package/.next/static/chunks/540.02bd094e0fe58d8c.js +0 -1
  111. package/.next/static/chunks/629-07460668e7e03eb5.js +0 -1
  112. package/.next/static/chunks/65.78da4e775f896fbd.js +0 -1
  113. package/.next/static/chunks/661-57ceb8cd2ee8c555.js +0 -1
  114. package/.next/static/chunks/pages/404-56dd2d65b7a31cf7.js +0 -1
  115. package/.next/static/chunks/pages/500-b3732b7fc60d28f7.js +0 -1
  116. package/.next/static/chunks/pages/[...slug]-b27fa186dd2d396b.js +0 -1
  117. package/.next/static/chunks/pages/[slug]/p-3ff84f7f27f92f19.js +0 -1
  118. package/.next/static/chunks/pages/_app-aeb8a1c6bff23375.js +0 -68
  119. package/.next/static/chunks/pages/index-7165efe53537655d.js +0 -1
  120. package/.next/static/chunks/pages/login-98fbb4cd544d7a1d.js +0 -1
  121. package/.next/static/chunks/webpack-38982d1550c1a866.js +0 -1
  122. package/.next/static/css/210f14f5aba4cccd.css +0 -1
  123. package/.next/static/css/326d9de401ed8b48.css +0 -1
  124. /package/.next/static/{3mglPnslwIJq4NamYz8YZ → Phsiu2MTzhG7Yo-7F06VY}/_ssgManifest.js +0 -0
@@ -45,28 +45,28 @@ Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Cont
45
45
  Collecting build traces ...
46
46
 
47
47
  Route (pages) Size First Load JS
48
- ┌ ● / 1.26 kB 144 kB
48
+ ┌ ● / 1.27 kB 143 kB
49
49
  ├ └ css/197e314c5a03eabd.css 740 B
50
- ├ /_app 0 B 93.7 kB
51
- ├ ● /[...slug] 2.81 kB 156 kB
50
+ ├ /_app 0 B 90.7 kB
51
+ ├ ● /[...slug] 2.82 kB 155 kB
52
52
  ├ └ css/e47f1a002bdcf76f.css 2.38 kB
53
- ├ ● /[slug]/p 11.3 kB 154 kB
53
+ ├ ● /[slug]/p 10.8 kB 152 kB
54
54
  ├ └ css/fbd711b9f5abf105.css 9.57 kB
55
- ├ ○ /404 1.45 kB 127 kB
56
- ├ ● /500 1.45 kB 127 kB
57
- ├ ● /account 676 B 126 kB
58
- ├ λ /api/graphql 0 B 93.7 kB
59
- ├ λ /api/health/live 0 B 93.7 kB
60
- ├ λ /api/health/ready 0 B 93.7 kB
61
- ├ λ /api/preview 0 B 93.7 kB
62
- ├ ● /checkout 662 B 126 kB
63
- ├ ● /login 1.57 kB 127 kB
64
- └ ● /s 2.25 kB 156 kB
65
- + First Load JS shared by all 96.8 kB
55
+ ├ ○ /404 1.28 kB 126 kB
56
+ ├ ● /500 1.29 kB 126 kB
57
+ ├ ● /account 674 B 126 kB
58
+ ├ λ /api/graphql 0 B 90.7 kB
59
+ ├ λ /api/health/live 0 B 90.7 kB
60
+ ├ λ /api/health/ready 0 B 90.7 kB
61
+ ├ λ /api/preview 0 B 90.7 kB
62
+ ├ ● /checkout 660 B 126 kB
63
+ ├ ● /login 1.4 kB 127 kB
64
+ └ ● /s 2.25 kB 155 kB
65
+ + First Load JS shared by all 93.7 kB
66
66
  ├ chunks/framework-8e279965036b6169.js 45.4 kB
67
67
  ├ chunks/main-029f1328cfee9686.js 33.1 kB
68
- ├ chunks/pages/_app-aeb8a1c6bff23375.js 12.8 kB
69
- ├ chunks/webpack-38982d1550c1a866.js 2.45 kB
68
+ ├ chunks/pages/_app-5d553d859f2f0ef5.js 9.85 kB
69
+ ├ chunks/webpack-8883d8523b03e385.js 2.38 kB
70
70
  └ css/ee0556daedda6306.css 3.07 kB
71
71
 
72
72
  λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
@@ -1,10 +1,10 @@
1
1
  $ jest
2
- PASS test/server/cms/index.test.ts (36.063 s)
3
- PASS test/utils/multipleTemplates.test.ts (36.667 s)
4
- PASS test/server/index.test.ts (40.114 s)
2
+ PASS test/utils/multipleTemplates.test.ts (37.085 s)
3
+ PASS test/server/cms/index.test.ts (37.426 s)
4
+ PASS test/server/index.test.ts (40.305 s)
5
5
 
6
6
  Test Suites: 3 passed, 3 total
7
7
  Tests: 19 passed, 19 total
8
8
  Snapshots: 0 total
9
- Time: 41.197 s
9
+ Time: 41.361 s
10
10
  Ran all test suites.
@@ -4,7 +4,6 @@
4
4
  * Cypress tests for a11y (accessibility)
5
5
  */
6
6
 
7
- import { disabledA11yRules } from '../global'
8
7
  import { cypress } from '../../faststore.config'
9
8
 
10
9
  const { pages } = cypress
@@ -22,7 +21,12 @@ describe('Accessibility tests', () => {
22
21
  cy.getById('product-link').should('exist')
23
22
 
24
23
  cy.injectAxe()
25
- cy.checkA11y(null, disabledA11yRules)
24
+
25
+ cy.checkA11y(null, {
26
+ rules: {
27
+ 'aria-allowed-role': { enabled: true },
28
+ },
29
+ })
26
30
  })
27
31
 
28
32
  it('checks a11y for product page', () => {
@@ -30,10 +34,14 @@ describe('Accessibility tests', () => {
30
34
  cy.waitForHydration()
31
35
 
32
36
  // Wait for product to be available and page to be interactive
33
- cy.getById('buy-button').should('exist')
37
+ cy.get('[data-testid="buy-button"]').should('exist')
34
38
 
35
39
  cy.injectAxe()
36
- cy.checkA11y(null, disabledA11yRules)
40
+ cy.checkA11y(null, {
41
+ rules: {
42
+ 'aria-allowed-role': { enabled: true },
43
+ },
44
+ })
37
45
  })
38
46
 
39
47
  it('checks a11y for home page', () => {
@@ -41,6 +49,10 @@ describe('Accessibility tests', () => {
41
49
  cy.waitForHydration()
42
50
 
43
51
  cy.injectAxe()
44
- cy.checkA11y(null, disabledA11yRules)
52
+ cy.checkA11y(null, {
53
+ rules: {
54
+ 'aria-allowed-role': { enabled: true },
55
+ },
56
+ })
45
57
  })
46
58
  })
@@ -4,8 +4,8 @@
4
4
  * Cypress tests for testing the Analytics module
5
5
  */
6
6
 
7
- import { options } from '../global'
8
7
  import { cypress } from '../../faststore.config'
8
+ import { options } from '../global'
9
9
 
10
10
  const { pages } = cypress
11
11
 
@@ -395,7 +395,7 @@ describe('view_cart event', () => {
395
395
  ({ event: eventName }) => eventName === 'view_cart'
396
396
  )
397
397
 
398
- expect(event.ecommerce.value).to.equal(950)
398
+ expect(event.ecommerce.value).to.equal(420)
399
399
  expect(event.ecommerce.items.length).to.equal(1)
400
400
  })
401
401
  })
@@ -6,8 +6,8 @@
6
6
  * TODO: Improve structured data validaton by actually using schema.org's schemas
7
7
  */
8
8
 
9
- import { options } from '../global'
10
9
  import { cypress, storeUrl } from '../../faststore.config'
10
+ import { options } from '../global'
11
11
 
12
12
  const { pages } = cypress
13
13
 
@@ -88,10 +88,13 @@ describe('Product Page Seo', () => {
88
88
  .should(($el) => {
89
89
  expect($el.attr('content')).to.eq('index,follow')
90
90
  })
91
+
91
92
  cy.get('link[rel="canonical"]')
92
93
  .should('exist')
93
- .should(($link) => {
94
- expect($link.attr('href')).to.eq(`${storeUrl}${pages.pdp}`)
94
+ .and(($link) => {
95
+ const href = $link.attr('href')
96
+ const regex = new RegExp(`^${href.split('/')[0]}`)
97
+ expect(`${storeUrl}${pages.pdp}`).to.match(regex)
95
98
  })
96
99
  })
97
100
 
@@ -67,7 +67,7 @@ module.exports = {
67
67
  server: process.env.BASE_SITE_URL || 'http://localhost:3000',
68
68
  pages: {
69
69
  home: '/',
70
- pdp: '/apple-magic-mouse/p',
70
+ pdp: '/4k-philips-monitor-99988213/p',
71
71
  collection: '/office',
72
72
  },
73
73
  },
@@ -76,7 +76,7 @@ module.exports = {
76
76
  cypress: {
77
77
  pages: {
78
78
  home: '/',
79
- pdp: '/apple-magic-mouse/p',
79
+ pdp: '/4k-philips-monitor-99988213/p',
80
80
  collection: '/office',
81
81
  collection_2: '/technology',
82
82
  collection_filtered:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "3.0.111",
3
+ "version": "3.0.115",
4
4
  "license": "MIT",
5
5
  "repository": "vtex/faststore",
6
6
  "browserslist": "supports es6-module and not dead",
@@ -44,11 +44,11 @@
44
44
  "@envelop/parser-cache": "^2.2.0",
45
45
  "@envelop/validation-cache": "^2.2.0",
46
46
  "@faststore/api": "^3.0.110",
47
- "@faststore/components": "^3.0.110",
47
+ "@faststore/components": "^3.0.115",
48
48
  "@faststore/graphql-utils": "^3.0.110",
49
49
  "@faststore/lighthouse": "^3.0.110",
50
50
  "@faststore/sdk": "^3.0.110",
51
- "@faststore/ui": "^3.0.110",
51
+ "@faststore/ui": "^3.0.115",
52
52
  "@graphql-codegen/cli": "^5.0.2",
53
53
  "@graphql-codegen/client-preset": "^4.2.6",
54
54
  "@graphql-codegen/typescript": "^4.0.7",
@@ -63,7 +63,6 @@
63
63
  "@vtex/client-cms": "^0.2.12",
64
64
  "@vtex/prettier-config": "1.0.0",
65
65
  "autoprefixer": "^10.4.0",
66
- "chalk": "^5.2.0",
67
66
  "css-loader": "^6.7.1",
68
67
  "deepmerge": "^4.3.1",
69
68
  "draftjs-to-html": "^0.9.1",
@@ -72,7 +71,6 @@
72
71
  "include-media": "^1.4.10",
73
72
  "next": "^13.5.6",
74
73
  "next-seo": "^6.4.0",
75
- "nextjs-progressbar": "^0.0.14",
76
74
  "postcss": "^8.4.4",
77
75
  "prettier": "^2.2.0",
78
76
  "react": "^18.2.0",
@@ -130,5 +128,5 @@
130
128
  "node": "18.19.0",
131
129
  "yarn": "1.19.1"
132
130
  },
133
- "gitHead": "8a64be21248687ce487102c8c7f47c4523491559"
131
+ "gitHead": "1cc987d52dfce0b3235e80662099a55c7acb9ba9"
134
132
  }
@@ -1,7 +1,7 @@
1
1
  import { Locator, Section } from '@vtex/client-cms'
2
2
  import storeConfig from 'faststore.config'
3
3
  import type { ComponentType } from 'react'
4
- import { PropsWithChildren, lazy } from 'react'
4
+ import { PropsWithChildren } from 'react'
5
5
  import CUSTOM_COMPONENTS from 'src/customizations/src/components'
6
6
  import { PageContentType, getPage } from 'src/server/cms'
7
7
 
@@ -13,8 +13,8 @@ import Footer from 'src/components/sections/Footer'
13
13
  import { OverriddenDefaultNavbar as Navbar } from 'src/components/sections/Navbar/OverriddenDefaultNavbar'
14
14
  import { OverriddenDefaultRegionBar as RegionBar } from 'src/components/sections/RegionBar/OverriddenDefaultRegionBar'
15
15
 
16
- const RegionModal = lazy(() => import('src/components/region/RegionModal'))
17
- const CartSidebar = lazy(() => import('src/components/cart/CartSidebar'))
16
+ import CartSidebar from 'src/components/cart/CartSidebar'
17
+ import RegionModal from 'src/components/region/RegionModal'
18
18
 
19
19
  export const GLOBAL_SECTIONS_CONTENT_TYPE = 'globalSections'
20
20
 
@@ -56,7 +56,7 @@ export const getGlobalSectionsData = async (
56
56
  const page = cmsData[GLOBAL_SECTIONS_CONTENT_TYPE][0]
57
57
 
58
58
  if (page) {
59
- const pageData = await getPage<PageContentType>({
59
+ const pageData = getPage<PageContentType>({
60
60
  contentType: GLOBAL_SECTIONS_CONTENT_TYPE,
61
61
  documentId: page.documentId,
62
62
  versionId: page.versionId,
@@ -66,11 +66,11 @@ export const getGlobalSectionsData = async (
66
66
  }
67
67
  }
68
68
 
69
- const { sections } = await getPage<PageContentType>({
69
+ const pageData = getPage<PageContentType>({
70
70
  ...(previewData?.contentType === GLOBAL_SECTIONS_CONTENT_TYPE &&
71
71
  previewData),
72
72
  contentType: GLOBAL_SECTIONS_CONTENT_TYPE,
73
73
  })
74
74
 
75
- return { sections }
75
+ return pageData
76
76
  }
@@ -1,4 +1,3 @@
1
- import chalk from 'chalk'
2
1
  import { ComponentType, PropsWithChildren, memo, useMemo } from 'react'
3
2
 
4
3
  import SectionBoundary from './SectionBoundary'
@@ -30,10 +29,8 @@ const RenderSectionsBase = ({ sections = [], components }: Props) => {
30
29
 
31
30
  if (!Component) {
32
31
  // TODO: add a documentation link to help to do this
33
- console.info(
34
- `${chalk.yellow(
35
- 'warn'
36
- )} - ${name} not found. Add a new component for this section or remove it from the CMS`
32
+ console.warn(
33
+ `${name} not found. Add a new component for this section or remove it from the CMS`
37
34
  )
38
35
 
39
36
  return null
@@ -6,11 +6,15 @@ interface FooterProps {
6
6
  }
7
7
 
8
8
  export function FooterInfo({ children }: FooterProps) {
9
- return <div data-fs-footer-info>{children}</div>
9
+ return (
10
+ <section data-fs-footer-info aria-label="Footer Information">
11
+ {children}
12
+ </section>
13
+ )
10
14
  }
11
15
 
12
16
  export function FooterNavigation({ children }: FooterProps) {
13
- return <div data-fs-footer-navigation>{children}</div>
17
+ return <section data-fs-footer-navigation>{children}</section>
14
18
  }
15
19
 
16
20
  export function Footer({ children }: FooterProps) {
@@ -67,7 +67,7 @@ function FooterLinks({ links }: FooterLinksProps) {
67
67
  </div>
68
68
 
69
69
  <div className="hidden-mobile">
70
- <nav data-fs-footer-links-columns>
70
+ <nav data-fs-footer-links-columns aria-label="Footer Links Navigation">
71
71
  {links.map(({ sectionTitle, items }) => (
72
72
  <div key={sectionTitle}>
73
73
  <p data-fs-footer-links-title>{sectionTitle}</p>
@@ -13,12 +13,19 @@ type FooterSocialLink = {
13
13
  export interface FooterSocialProps {
14
14
  title: string
15
15
  links: FooterSocialLink[]
16
+ id?: string
16
17
  }
17
18
 
18
- function FooterSocial({ title, links }: FooterSocialProps) {
19
+ function FooterSocial({
20
+ title,
21
+ links,
22
+ id = 'footer-social-title',
23
+ }: FooterSocialProps) {
19
24
  return (
20
- <section data-fs-footer-social>
21
- <p data-fs-footer-social-title>{title}</p>
25
+ <section data-fs-footer-social aria-labelledby={id}>
26
+ <p data-fs-footer-social-title id={id}>
27
+ {title}
28
+ </p>
22
29
  <UIList>
23
30
  {links.map(({ icon: { icon }, url }) => (
24
31
  <li key={icon}>
@@ -1,17 +1,19 @@
1
- import UIIncentives from 'src/components/ui/Incentives/Incentives'
2
1
  import type { Incentive } from 'src/components/ui/Incentives'
2
+ import UIIncentives from 'src/components/ui/Incentives/Incentives'
3
3
 
4
4
  import Section from '../Section'
5
5
  import styles from './section.module.scss'
6
6
 
7
7
  interface Props {
8
8
  incentives: Incentive[]
9
+ label?: string
9
10
  }
10
11
 
11
- function Incentives({ incentives }: Props) {
12
+ function Incentives({ incentives, label }: Props) {
12
13
  return (
13
14
  <Section className={`${styles.section} section-incentives layout__section`}>
14
- <UIIncentives incentives={incentives} colored />
15
+ {/* Leaving label as an empty string isn’t ideal, but it works for now. Ideally, we should receive a label from the CMS to identify which Incentive section we’re referring to. */}
16
+ <UIIncentives incentives={incentives} colored label={label ?? ''} />
15
17
  </Section>
16
18
  )
17
19
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Icon as UIIcon,
3
- List as UIList,
4
3
  Incentive as UIIncentive,
4
+ List as UIList,
5
5
  } from '@faststore/ui'
6
6
 
7
7
  export type Incentive = {
@@ -22,18 +22,24 @@ export interface IncentivesProps {
22
22
  * Controls the component's direction.
23
23
  */
24
24
  variant?: 'horizontal' | 'vertical'
25
+ /**
26
+ * Label to identify the incentive list and offer better accessibility
27
+ */
28
+ label?: string
25
29
  }
26
30
 
27
31
  function Incentives({
28
32
  incentives,
29
33
  variant = 'horizontal',
30
34
  colored = false,
35
+ label,
31
36
  }: IncentivesProps) {
32
37
  return (
33
- <div
38
+ <section
34
39
  data-fs-incentives
35
40
  data-fs-incentives-colored={colored}
36
41
  data-fs-incentives-variant={variant}
42
+ aria-label={`Incentives List ${label}`}
37
43
  >
38
44
  <UIList data-fs-content="incentives">
39
45
  {incentives.map((incentive, index) => (
@@ -46,7 +52,7 @@ function Incentives({
46
52
  width={32}
47
53
  height={32}
48
54
  />
49
- <div data-fs-incentive-content>
55
+ <section data-fs-incentive-content>
50
56
  <p data-fs-incentive-title>{incentive.title}</p>
51
57
  <span data-fs-incentive-description>
52
58
  {incentive.firstLineText}
@@ -56,12 +62,12 @@ function Incentives({
56
62
  {incentive.secondLineText}
57
63
  </span>
58
64
  )}
59
- </div>
65
+ </section>
60
66
  </UIIncentive>
61
67
  </li>
62
68
  ))}
63
69
  </UIList>
64
- </div>
70
+ </section>
65
71
  )
66
72
  }
67
73
 
@@ -9,9 +9,8 @@ import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
9
9
  import Selectors from 'src/components/ui/SkuSelector'
10
10
  import AddToCartLoadingSkeleton from './AddToCartLoadingSkeleton'
11
11
 
12
- import { Icon as UIIcon, useUI } from '@faststore/ui'
12
+ import { Icon as UIIcon, Label as UILabel, useUI } from '@faststore/ui'
13
13
  import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
14
- import { Label as UILabel } from '@faststore/ui'
15
14
 
16
15
  interface ProductDetailsSettingsProps {
17
16
  product: ProductDetailsFragment_ProductFragment
@@ -1,6 +1,5 @@
1
1
  import { UIProvider } from '@faststore/ui'
2
2
  import type { AppProps } from 'next/app'
3
- import NextNProgress from 'nextjs-progressbar'
4
3
  import Layout from 'src/Layout'
5
4
  import AnalyticsHandler from 'src/sdk/analytics'
6
5
  import ErrorBoundary from 'src/sdk/error/ErrorBoundary'
@@ -15,12 +14,6 @@ import { DefaultSeo } from 'next-seo'
15
14
  function App({ Component, pageProps }: AppProps) {
16
15
  return (
17
16
  <ErrorBoundary>
18
- <NextNProgress
19
- color="var(--fs-color-primary-bkg);"
20
- showOnShallow={false}
21
- options={{ showSpinner: false }}
22
- />
23
-
24
17
  <DefaultSeo {...SEO} />
25
18
 
26
19
  <AnalyticsHandler />
@@ -100,30 +100,29 @@ export const getStaticProps: GetStaticProps<
100
100
  Record<string, string>,
101
101
  Locator
102
102
  > = async ({ previewData }) => {
103
- const serverData = await getDynamicContent({ pageType: 'home' })
104
- const globalSections = await getGlobalSectionsData(previewData)
103
+ const globalSectionsPromise = getGlobalSectionsData(previewData)
104
+ const serverDataPromise = getDynamicContent({ pageType: 'home' })
105
105
 
106
+ let cmsPage = null
106
107
  if (storeConfig.cms.data) {
107
108
  const cmsData = JSON.parse(storeConfig.cms.data)
108
- const page = cmsData['home'][0]
109
-
110
- if (page) {
111
- const pageData = await getPage<PageContentType>({
109
+ cmsPage = cmsData['home'][0]
110
+ }
111
+ const pagePromise = cmsPage
112
+ ? getPage<PageContentType>({
112
113
  contentType: 'home',
113
- documentId: page.documentId,
114
- versionId: page.versionId,
114
+ documentId: cmsPage.documentId,
115
+ versionId: cmsPage.versionId,
115
116
  })
116
-
117
- return {
118
- props: { page: pageData, globalSections, serverData },
119
- }
120
- }
121
- }
122
-
123
- const page = await getPage<PageContentType>({
124
- ...(previewData?.contentType === 'home' && previewData),
125
- contentType: 'home',
126
- })
117
+ : getPage<PageContentType>({
118
+ ...(previewData?.contentType === 'home' && previewData),
119
+ contentType: 'home',
120
+ })
121
+ const [page, globalSections, serverData] = await Promise.all([
122
+ pagePromise,
123
+ globalSectionsPromise,
124
+ serverDataPromise,
125
+ ])
127
126
 
128
127
  return {
129
128
  props: { page, globalSections, serverData },
@@ -1 +0,0 @@
1
- exports.id=247,exports.ids=[247],exports.modules={1953:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var a=r(6689),i=r.n(a);let n=(0,a.forwardRef)(function({testId:e="fs-label",children:t,...r},a){return i().createElement("label",{ref:a,"data-fs-label":!0,"data-testid":e,...r},t)}),c=n},6133:(e,t,r)=>{"use strict";r.d(t,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var a=r(6689),i=r.n(a);let __WEBPACK_DEFAULT_EXPORT__=function({testId:e="fs-empty-state",title:t,titleIcon:r,variant:a="default",bkgColor:n="default",children:c,...l}){return i().createElement("section",{"data-fs-empty-state":!0,"data-fs-empty-state-variant":a,"data-fs-empty-state-bkg-color":n,"data-fs-content":"empty-state","data-testid":e,...l},t&&i().createElement("header",{"data-fs-empty-state-title":!0},r&&i().createElement(i().Fragment,null,r),i().createElement("p",null,t)),c)}},6247:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>cart_CartSidebar_CartSidebar});var a=r(1072),i=r(6689),n=r.n(i),c=r(3666),l=r(6652),s=r(7215),o=r(5049),u=r(276),d=r(8138);let CartSidebar_CartSidebar=function({testId:e="fs-cart-sidebar",title:t="Your Cart",size:r="partial",direction:a="rightSide",totalItems:i,children:m,alertIcon:f,alertText:p,overlayProps:b,onClose:O,...y}){let{fade:v,fadeOut:_}=(0,c.b)(),{closeCart:h}=(0,l.l)();return n().createElement(s.Z,{"data-fs-cart-sidebar":!0,isOpen:!0,fade:v,onDismiss:_,size:r,direction:a,onTransitionEnd:()=>"out"===v&&h(),testId:e,overlayProps:b,...y},n().createElement(o.Z,{closeBtnProps:{testId:"fs-cart-sidebar-button-close"},onClose:()=>{O(),_()}},n().createElement("h2",{"data-fs-cart-sidebar-title":!0},t,n().createElement(u.Z,{variant:"info"},i))),p&&n().createElement(d.Z,{icon:f},p),m)};var m=r(4564);let CartSidebar_CartSidebarList=function({children:e}){return n().createElement(m.Z,{"data-fs-cart-sidebar-list":!0},e)},CartSidebar_CartSidebarFooter=function({children:e}){return n().createElement("footer",{"data-fs-cart-sidebar-footer":!0},e)};var f=r(3339),p=r(2614),b=r(3218),O=r(7997),y=r.n(O);let useCheckoutButton=()=>{let{isValidating:e,id:t}=(0,b.jD)();return{onClick:r=>{r.preventDefault();let a=window.location.host.includes(".vtex.app")||window.location.host.includes("localhost");!e&&(a?t&&(window.location.href=`${y().checkoutUrl}?orderFormId=${t}`):window.location.href=`${y().checkoutUrl}`)},disabled:e,"data-testid":"checkout-button"}};var v=r(1868);let _=(0,i.forwardRef)(function({icon:e,testId:t="fs-gift",children:r,...a},i){return n().createElement("div",{ref:i,"data-fs-gift":!0,"data-testid":t,...a},!!e&&n().createElement("span",{"data-fs-gift-icon":!0},e),n().createElement("div",{"data-fs-gift-wrapper":!0},r))}),h=(0,i.forwardRef)(function({testId:e="fs-gift-image",children:t,...r},a){return n().createElement("div",{ref:a,"data-fs-gift-image":!0,"data-testid":e,...r},t)});var j=r(9767);let g=(0,i.forwardRef)(function({price:e,productName:t,titleMessage:r="Get a",badgeLabel:a="Free",testId:i="fs-gift-content",...c},l){return n().createElement("section",{ref:l,"data-fs-gift-content":!0,"data-testid":i,...c},n().createElement("h3",{"data-fs-gift-product-title":!0},r," ",t),n().createElement("span",{"data-fs-gift-product-summary":!0},n().createElement(j.Z,{value:e?.listPrice?e.listPrice:0,formatter:e?.formatter,testId:"list-price","data-value":e?.listPrice,variant:"listing",SRText:"Original price:"}),n().createElement(u.Z,null,a)))});var P=r(8918),E=r(113),w=r(997);let x=["item"];function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){var a;a=r[t],t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}let ui_Gift_Gift=function(e){let{item:t}=e,r=function(e,t){if(null==e)return{};var r,a,i=function(e,t){if(null==e)return{};var r,a,i={},n=Object.keys(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,x);return(0,w.jsxs)(_,_objectSpread(_objectSpread({icon:w.jsx(p.Z,{name:"Tag",width:18,height:18})},r),{},{children:[w.jsx(h,{children:w.jsx(P.Z,{src:t.itemOffered.image[0].url,alt:t.itemOffered.image[0].alternateName,width:89,height:89})}),w.jsx(g,{productName:t.itemOffered.isVariantOf.name,price:{value:t.price,listPrice:t.listPrice,formatter:E.P}})]}))};var S=r(7041),C=r(6693),k=r(9088);let D=(0,i.forwardRef)(function({testId:e="fs-cart-item",price:t,quantity:r,unavailable:a,onQuantityChange:i,unitMultiplier:c,useUnitMultiplier:l,children:s,removeBtnProps:o,...u},d){return n().createElement("article",{ref:d,"data-fs-cart-item":a?"unavailable":"true","data-testid":e,...u},n().createElement("div",{"data-fs-cart-item-content":!0},s),n().createElement(S.Z,{"data-fs-cart-item-remove-button":!0,icon:n().createElement(p.Z,{name:"XCircle"}),"aria-label":"Remove",...o}),n().createElement("div",{"data-fs-cart-item-actions":!0},n().createElement(C.Z,{min:1,initial:r,unitMultiplier:c,useUnitMultiplier:l,onChange:i}),n().createElement(k.Z,{"data-fs-cart-item-prices":!0,listPrice:t?.listPrice?t.listPrice:0,value:t?.value?t.value:0,formatter:t?.formatter})))}),Z=(0,i.forwardRef)(function({testId:e="fs-cart-item-image",children:t,...r},a){return n().createElement("div",{ref:a,"data-fs-cart-item-image":!0,"data-testid":e,...r},t)}),T=(0,i.forwardRef)(function({testId:e="fs-cart-item-summary",title:t,activeVariations:r=[],children:a,...i},c){return n().createElement("div",{ref:c,"data-fs-cart-item-summary":!0,"data-testid":e,...i},n().createElement("div",{"data-fs-cart-item-title":!0},t),r.length>0&&n().createElement("div",{"data-fs-cart-item-skus":!0},r.map(({label:e,option:t})=>n().createElement("p",{key:e},e,": ",n().createElement("span",null,t)))),a)}),useRemoveButton=e=>{let{currency:{code:t}}=(0,v.kP)(),r=(0,i.useCallback)(r=>{r.preventDefault(),e&&((0,a._)({name:"remove_from_cart",params:{currency:t,value:e.price*e.quantity,items:[{item_id:e.itemOffered.isVariantOf.productGroupID,item_name:e.itemOffered.isVariantOf.name,item_brand:e.itemOffered.brand.name,item_variant:e.itemOffered.sku,quantity:e.quantity,price:e.price,discount:e.listPrice-e.price,currency:t,item_variant_name:e.itemOffered.name,product_reference_id:e.itemOffered.gtin}]}}),b.i8.removeItem(e.id))},[t,e]);return{onClick:r,"data-testid":"remove-from-cart-button","data-sku":e?.itemOffered.sku}},cart_CartItem_CartItem=function({item:e,useUnitMultiplier:t=!1,taxesConfiguration:r}){let n=useRemoveButton(e),{sendCartItemEvent:c}=function(){let{currency:{code:e}}=(0,v.kP)(),t=(0,i.useCallback)((t,r)=>{let i=r-t.quantity;return(0,a._)({name:i>0?"add_to_cart":"remove_from_cart",params:{currency:e,value:t.price*Math.abs(i),items:[{item_id:t.itemOffered.isVariantOf.productGroupID,item_name:t.itemOffered.isVariantOf.name,item_brand:t.itemOffered.brand.name,item_variant:t.itemOffered.sku,quantity:Math.abs(i),price:t.price,discount:t.listPrice-t.price,currency:e,item_variant_name:t.itemOffered.name,product_reference_id:t.itemOffered.gtin}]}})},[e]);return(0,i.useMemo)(()=>({sendCartItemEvent:t}),[t])}(),l=(0,i.useCallback)(t=>{c(e,t),b.i8.updateItemQuantity(e.id,t)},[e,c]),s=e.itemOffered.isVariantOf.skuVariants.activeVariations,o=Object.keys(s).map(e=>({label:e,option:s[e]})),u=r?.usePriceWithTaxes?e.priceWithTaxes:e.price,d=r?.usePriceWithTaxes?e.listPriceWithTaxes:e.listPrice,m=e.itemOffered.unitMultiplier??1;return(0,w.jsxs)(D,{price:{value:u,listPrice:t?d*m:d,formatter:E.P},quantity:e.quantity,onQuantityChange:l,removeBtnProps:n,"data-sku":e.itemOffered.sku,"data-seller":e.seller.identifier,unitMultiplier:e.itemOffered.unitMultiplier,useUnitMultiplier:t,children:[w.jsx(Z,{children:w.jsx(P.Z,{src:e.itemOffered.image[0].url,alt:e.itemOffered.image[0].alternateName,width:56,height:56})}),w.jsx(T,{title:e.itemOffered.isVariantOf.name,activeVariations:o})]})};var I=r(6133);let EmptyCart_EmptyCart=function({onDismiss:e}){return w.jsx(I.Z,{title:"Your Cart is empty",titleIcon:w.jsx(p.Z,{name:"ShoppingCart",width:56,height:56,weight:"thin"}),children:w.jsx(f.Z,{onClick:e,variant:"secondary",children:"Start Shopping"})})};var M=r(1953);let V=(0,i.forwardRef)(function({testId:e="fs-order-summary",subtotalLabel:t,subtotalValue:r,discountLabel:a="Discount",discountValue:i,totalLabel:c="Total",totalValue:l,includeTaxes:s=!1,includeTaxesLabel:o="Tax included",...u},d){return n().createElement(m.Z,{ref:d,"data-fs-order-summary":!0,"data-testid":e,...u},r?n().createElement("li",{"data-fs-order-summary-subtotal":!0},n().createElement("span",{"data-fs-order-summary-subtotal-label":!0,"data-testid":`${e}-subtotal-label`},t),n().createElement("span",{"data-fs-order-summary-subtotal-value":!0,"data-testid":`${e}-subtotal-value`},r)):null,i?n().createElement("li",{"data-fs-order-summary-discount":!0},n().createElement("span",{"data-fs-order-summary-discount-label":!0,"data-testid":`${e}-discount-label`},a),n().createElement("span",{"data-fs-order-summary-discount-value":!0,"data-testid":`${e}-discount-value`},i)):null,n().createElement("li",{"data-fs-order-summary-total":!0},n().createElement("span",{"data-fs-order-summary-total-label":!0,"data-testid":`${e}-total-label`},c),n().createElement("span",{"data-fs-order-summary-total-value":!0,"data-testid":`${e}-total-value`},l)),s&&n().createElement("li",{"data-fs-order-summary-taxes-label":!0},n().createElement(M.Z,null,o)))}),R=["subTotal","total","numberOfItems","checkoutButton"];function OrderSummary_ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}let cart_OrderSummary_OrderSummary=function(e){let{subTotal:t,total:r,numberOfItems:a,checkoutButton:i}=e,n=function(e,t){if(null==e)return{};var r,a,i=function(e,t){if(null==e)return{};var r,a,i={},n=Object.keys(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,R),c=t-r,l=(0,E.P)(c);return(0,w.jsxs)(w.Fragment,{children:[w.jsx(V,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?OrderSummary_ownKeys(Object(r),!0).forEach(function(t){var a;a=r[t],t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OrderSummary_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({subtotalLabel:`Subtotal (${a} products)`,subtotalValue:(0,E.P)(t),discountValue:c>0?`-${l}`:void 0,totalValue:(0,E.P)(r)},n)),i]})};var F=r(9436),$=r.n(F);function CartSidebar_ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function CartSidebar_objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?CartSidebar_ownKeys(Object(r),!0).forEach(function(t){var a;a=r[t],t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CartSidebar_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}let cart_CartSidebar_CartSidebar=function({title:e,alert:{icon:{icon:t,alt:r},text:n},checkoutButton:{label:s,loadingLabel:o,icon:{icon:u,alt:d}},quantitySelector:m,taxesConfiguration:O}){let y=useCheckoutButton(),{items:_,gifts:h,totalItems:j,isValidating:g,subTotal:P,total:E,subTotalWithTaxes:x,totalWithTaxes:S}=(0,b.jD)({useUnitMultiplier:m?.useUnitMultiplier}),{cart:C,closeCart:k}=(0,l.l)(),{fadeOut:D}=(0,c.b)(),{sendViewCartEvent:Z}=function(){let{currency:{code:e}}=(0,v.kP)(),{items:t,gifts:r,total:n}=(0,b.jD)(),c=(0,i.useCallback)(()=>(0,a._)({name:"view_cart",params:{currency:e,value:n,items:t.concat(r).map(t=>({item_id:t.itemOffered.isVariantOf.productGroupID,item_name:t.itemOffered.isVariantOf.name,item_brand:t.itemOffered.brand.name,item_variant:t.itemOffered.sku,quantity:t.quantity,price:t.price,discount:t.listPrice-t.price,currency:e,item_variant_name:t.itemOffered.name,product_reference_id:t.itemOffered.gtin}))}}),[e,r,t,n]);return(0,i.useMemo)(()=>({sendViewCartEvent:c}),[c])}(),T=(0,i.useMemo)(()=>0===_.length,[_]);return(0,i.useEffect)(()=>{C&&Z()},[C,Z]),w.jsx(w.Fragment,{children:C&&w.jsx(i.Suspense,{fallback:null,children:w.jsx(CartSidebar_CartSidebar,{overlayProps:{className:`section ${$().section} section-cart-sidebar`},title:e,totalItems:j,alertIcon:w.jsx(p.Z,{name:t,"aria-label":r}),alertText:n,onClose:D,children:T?w.jsx(EmptyCart_EmptyCart,{onDismiss:k}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(CartSidebar_CartSidebarList,{children:[_.map(e=>w.jsx("li",{children:w.jsx(cart_CartItem_CartItem,{item:e,taxesConfiguration:O,useUnitMultiplier:m?.useUnitMultiplier??!1})},e.id)),h.length>0&&w.jsx(w.Fragment,{children:h.map(e=>w.jsx("li",{children:w.jsx(ui_Gift_Gift,{item:e})},e.id))})]}),w.jsx(CartSidebar_CartSidebarFooter,{children:w.jsx(cart_OrderSummary_OrderSummary,{subTotal:O?.usePriceWithTaxes?x:P,total:O?.usePriceWithTaxes?S:E,includeTaxes:O?.usePriceWithTaxes,includeTaxesLabel:O?.taxesLabel,numberOfItems:j,checkoutButton:w.jsx(f.Z,CartSidebar_objectSpread(CartSidebar_objectSpread({variant:"primary",icon:!g&&w.jsx(p.Z,{name:u,"aria-label":d,width:18,height:18}),iconPosition:"right"},y),{},{children:g?o:s}))})})]})})})})}},9436:e=>{e.exports={section:"section_section__yzDFp"}}};
@@ -1 +0,0 @@
1
- "use strict";exports.id=344,exports.ids=[344],exports.modules={9767:(e,t,r)=>{r.d(t,{Z:()=>n});var a=r(6689),i=r.n(a),c=r(5450);let l=(0,a.forwardRef)(function({value:e,as:t="span",variant:r="selling",testId:a="fs-price",formatter:l=e=>e,SRText:n,...s},d){let u=l(e,r);return i().createElement(t,{ref:d,"data-fs-price":!0,"data-fs-price-variant":r,"data-testid":a,...s},n&&i().createElement(c.Z,{text:n}),u)}),n=l},9088:(e,t,r)=>{r.d(t,{Z:()=>n});var a=r(6689),i=r.n(a),c=r(9767);let l=(0,a.forwardRef)(function({testId:e="fs-product-price",value:t,listPrice:r,formatter:a,...l},n){let s=r??0,d=t??0;return i().createElement("div",{ref:n,"data-fs-product-price":!0,"data-testid":e,...l},d!==s&&0!==s?i().createElement(i().Fragment,null,i().createElement(c.Z,{value:s,formatter:a,testId:"list-price","data-value":s,variant:"listing",SRText:"Original price:"}),i().createElement(c.Z,{value:d,formatter:a,testId:"price","data-value":d,variant:"spot",SRText:"Price:"})):i().createElement(c.Z,{value:d,formatter:a,testId:"price","data-value":d,variant:"spot",SRText:"Price:"}))}),n=l},113:(e,t,r)=>{r.d(t,{P:()=>useFormattedPrice});var a=r(6689),i=r(1868);let usePriceFormatter=({decimals:e}={})=>{let{currency:t,locale:r}=(0,i.kP)();return(0,a.useCallback)(a=>Intl.NumberFormat(r,{style:"currency",currency:t.code,minimumFractionDigits:e?2:0}).format(a),[t.code,r,e])},useFormattedPrice=e=>{let t=usePriceFormatter();return(0,a.useMemo)(()=>t(e),[t,e])}}};
@@ -1 +0,0 @@
1
- exports.id=540,exports.ids=[540],exports.modules={2540:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>region_RegionModal_RegionModal});var a=o(6652),r=o(2614),n=o(6689),l=o.n(n),i=o(3543),d=o(7041);let Modal_ModalHeader=({onClose:e,title:t,closeBtnProps:o={},description:a})=>l().createElement("header",{"data-fs-modal-header":!0},e&&l().createElement(d.Z,{"data-fs-modal-header-close-button":!0,"aria-label":"Close modal",icon:l().createElement(r.Z,{name:"X"}),onClick:()=>e?.(),...o}),l().createElement("p",{"data-fs-modal-header-title":!0},t),a&&l().createElement("p",{"data-fs-modal-header-description":!0},a)),Modal_ModalBody=({children:e,...t})=>l().createElement("div",{"data-fs-modal-body":!0,...t},e);var c=o(3779),s=o(727);let RegionModal_RegionModal=function({testId:e="fs-region-modal",title:t="Set your location",description:o="Prices, offers and availability may vary according to your location.",closeButtonAriaLabel:a="Close Region Modal",idkPostalCodeLinkProps:r,errorMessage:n,inputRef:d,inputValue:u,inputLabel:p="Postal Code",fadeOutOnSubmit:f,overlayProps:b,onClose:m,onInput:g,onSubmit:y,onClear:O,...j}){return l().createElement(i.Z,{"data-fs-region-modal":!0,testId:e,overlayProps:b,title:"Region modal","aria-label":"Region modal",...j},({fadeOut:i})=>l().createElement(l().Fragment,null,l().createElement(Modal_ModalHeader,{onClose:()=>{i(),m?.()},title:t,description:o,closeBtnProps:{"aria-label":a}}),l().createElement(Modal_ModalBody,null,l().createElement(c.Z,{"data-fs-region-modal-input":!0,id:`${e}-input-field`,inputRef:d,label:p,actionable:!0,value:u,onInput:e=>g?.(e),onSubmit:()=>{y?.(),f&&i()},onClear:()=>O?.(),error:n}),l().createElement(s.Z,{"data-fs-region-modal-link":!0,...r}))))};var u=o(1868),p=o(7925),f=o.n(p),b=o(997);let m=["isValidating"];function ownKeys(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,a)}return o}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach(function(t){var a;a=o[t],t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}let region_RegionModal_RegionModal=function({title:e,description:t,closeButtonAriaLabel:o,inputField:{label:l,errorMessage:i},idkPostalCodeLink:{text:d,to:c,icon:{icon:s,alt:p}}}){let g=(0,n.useRef)(null),y=(0,u.kP)(),{isValidating:O}=y,j=function(e,t){if(null==e)return{};var o,a,r=function(e,t){if(null==e)return{};var o,a,r={},n=Object.keys(e);for(a=0;a<n.length;a++)o=n[a],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(y,m),{0:h,1:v}=(0,n.useState)(""),{0:P,1:M}=(0,n.useState)(""),{modal:E}=(0,a.l)(),handleSubmit=async()=>{let e=g.current?.value;if("string"==typeof e){v("");try{let t=_objectSpread(_objectSpread({},j),{},{postalCode:e}),o=await (0,u.je)(t);u.Qf.set(o??t)}catch(e){v(i)}}},S={href:c??"#",children:(0,b.jsxs)(b.Fragment,{children:[d,!!s&&b.jsx(r.Z,{name:s,"aria-label":p,width:20,height:20})]})};return b.jsx(b.Fragment,{children:E&&b.jsx(n.Suspense,{fallback:null,children:b.jsx(RegionModal_RegionModal,{title:e,description:t,overlayProps:{className:`section ${f().section} section-region-modal`},closeButtonAriaLabel:o,inputRef:g,inputValue:P,inputLabel:l,errorMessage:h,idkPostalCodeLinkProps:S,onInput:e=>{""!==h&&v(""),M(e.currentTarget.value)},onSubmit:handleSubmit,fadeOutOnSubmit:!0,onClear:()=>M("")})})})}},7925:e=>{e.exports={section:"section_section__DLuEd"}}};
@@ -1 +0,0 @@
1
- "use strict";exports.id=693,exports.ids=[693],exports.modules={6693:(t,e,a)=>{a.d(e,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var n=a(6689),i=a.n(n),l=a(7041),u=a(2614),r=a(2256);let __WEBPACK_DEFAULT_EXPORT__=({max:t,min:e=1,unitMultiplier:a=1,useUnitMultiplier:d,initial:s,disabled:o=!1,onChange:c,onValidateBlur:y,testId:h="fs-quantity-selector",...m})=>{let[b,E]=(0,n.useState)(s??e),[_,g]=(0,n.useState)(b*a),roundUpQuantityIfNeeded=t=>d?Math.ceil(t/a)*a:t,Q=b===e,f=b===t,changeQuantity=t=>{let e=validateQuantityBounds(b+t);c?.(e),E(e),g(e*a)};function validateQuantityBounds(n){let i=e?Math.max(n,e):n;return t?Math.min(i,d?t*a:t):i}return(0,n.useEffect)(()=>{s&&E(s)},[s]),i().createElement("div",{"data-fs-quantity-selector":o?"disabled":"true","data-testid":h,...m},i().createElement(l.Z,{"data-quantity-selector-button":"left",icon:i().createElement(u.Z,{name:"Minus",width:16,height:16,weight:"bold"}),"aria-label":"Decrement Quantity","aria-controls":"quantity-selector-input",disabled:Q||o,onClick:()=>changeQuantity(-1),testId:`${h}-left-button`,size:"small"}),i().createElement(r.Z,{"data-quantity-selector-input":!0,id:"quantity-selector-input","aria-label":"Quantity",value:d?_:b,onChange:t=>{E(Number(t.currentTarget.value))},onBlur:function(){let n=validateQuantityBounds(b),i=roundUpQuantityIfNeeded(n),l=t??(e?Math.max(b,e):b),u=b>l||b<e;u&&y?.(e,l,i),E(()=>(g(i),c?.(i/a),i/a))},disabled:o}),i().createElement(l.Z,{"data-quantity-selector-button":"right","aria-controls":"quantity-selector-input","aria-label":"Increment Quantity",disabled:f||o,icon:i().createElement(u.Z,{name:"Plus",width:16,height:16,weight:"bold"}),onClick:()=>changeQuantity(1),testId:`${h}-right-button`,size:"small"}))}}};
@@ -1 +0,0 @@
1
- "use strict";exports.id=779,exports.ids=[779],exports.modules={1953:(e,t,a)=>{a.d(t,{Z:()=>n});var l=a(6689),r=a.n(l);let i=(0,l.forwardRef)(function({testId:e="fs-label",children:t,...a},l){return r().createElement("label",{ref:l,"data-fs-label":!0,"data-testid":e,...a},t)}),n=i},3779:(e,t,a)=>{a.d(t,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var l=a(6689),r=a.n(l),i=a(2256),n=a(1953),d=a(7041),s=a(2614),c=a(3339);let __WEBPACK_DEFAULT_EXPORT__=({id:e,label:t,type:a="text",error:l,displayClearButton:f,actionable:o,buttonActionText:m="Apply",onSubmit:E,onClear:p,placeholder:u=" ",inputRef:_,disabled:Z,value:b,testId:C="fs-input-field",...v})=>{let A=!Z&&l&&""!==l,x=o&&!Z&&""!==b;return r().createElement("div",{"data-fs-input-field":!0,"data-fs-input-field-actionable":o,"data-fs-input-field-error":l&&""!==l,"data-testid":C},r().createElement(i.Z,{id:e,type:a,value:b,ref:_,disabled:Z,placeholder:u,...v}),r().createElement(n.Z,{htmlFor:e},t),x&&(f||l?r().createElement(d.Z,{size:"small","aria-label":"Clear Field",icon:r().createElement(s.Z,{name:"XCircle"}),onClick:()=>{p?.(),_?.current?.focus()}}):r().createElement(c.Z,{variant:"tertiary",size:"small",onClick:E},m)),A&&r().createElement("span",{"data-fs-input-field-error-message":!0},l))}}};
@@ -1 +0,0 @@
1
- self.__BUILD_MANIFEST=function(s,c,e,a,t,d,f,i){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[s,c,e,a,t,"static/css/197e314c5a03eabd.css","static/chunks/pages/index-7165efe53537655d.js"],"/404":[s,c,e,d,"static/chunks/pages/404-56dd2d65b7a31cf7.js"],"/500":[s,c,e,d,"static/chunks/pages/500-b3732b7fc60d28f7.js"],"/_error":["static/chunks/pages/_error-fbf331a03642b495.js"],"/account":[s,c,e,"static/chunks/pages/account-dbc5c028225cd1ac.js"],"/checkout":[s,c,e,"static/chunks/pages/checkout-29ae2c37eaf172e1.js"],"/login":[s,c,e,d,"static/chunks/pages/login-98fbb4cd544d7a1d.js"],"/s":[s,c,e,a,t,f,i,d,"static/chunks/pages/s-4eb28d79d5408f36.js"],"/[slug]/p":[s,c,e,a,t,"static/css/fbd711b9f5abf105.css","static/chunks/pages/[slug]/p-3ff84f7f27f92f19.js"],"/[...slug]":[s,c,e,a,t,f,i,"static/css/e47f1a002bdcf76f.css","static/chunks/pages/[...slug]-b27fa186dd2d396b.js"],sortedPages:["/","/404","/500","/_app","/_error","/account","/checkout","/login","/s","/[slug]/p","/[...slug]"]}}("static/chunks/575-ae1d53677e78fd7b.js","static/css/e0edaedcfb97bf5e.css","static/chunks/104-6c6df4defdfdd68c.js","static/css/3e19bc8739388691.css","static/chunks/661-57ceb8cd2ee8c555.js","static/css/2980acad3f8e1028.css","static/css/c725ca9e956e11d7.css","static/chunks/629-07460668e7e03eb5.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();