@faststore/core 2.0.83-alpha.0 → 2.0.87-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 (166) hide show
  1. package/.turbo/turbo-build.log +6 -7
  2. package/CHANGELOG.md +12 -0
  3. package/package.json +4 -4
  4. package/src/Layout.tsx +2 -2
  5. package/src/components/common/Toast/Toast.tsx +2 -4
  6. package/src/components/sections/Newsletter/Newsletter.tsx +5 -5
  7. package/src/components/sections/ProductDetails/ProductDetails.tsx +7 -5
  8. package/src/components/sections/ProductDetails/product-details.module.scss +0 -5
  9. package/src/components/ui/SkuSelector/Selectors.stories.mdx +5 -1
  10. package/src/components/ui/SkuSelector/Selectors.tsx +40 -54
  11. package/src/components/ui/SkuSelector/index.ts +0 -2
  12. package/src/sdk/cart/index.ts +2 -2
  13. package/.next/BUILD_ID +0 -1
  14. package/.next/build-manifest.json +0 -103
  15. package/.next/cache/.tsbuildinfo +0 -1
  16. package/.next/cache/config.json +0 -7
  17. package/.next/cache/eslint/.cache_1gneedd +0 -1
  18. package/.next/cache/next-server.js.nft.json +0 -1
  19. package/.next/cache/webpack/client-production/0.pack +0 -0
  20. package/.next/cache/webpack/client-production/index.pack +0 -0
  21. package/.next/cache/webpack/server-production/0.pack +0 -0
  22. package/.next/cache/webpack/server-production/index.pack +0 -0
  23. package/.next/export-marker.json +0 -1
  24. package/.next/images-manifest.json +0 -1
  25. package/.next/next-server.js.nft.json +0 -1
  26. package/.next/package.json +0 -1
  27. package/.next/prerender-manifest.json +0 -1
  28. package/.next/react-loadable-manifest.json +0 -52
  29. package/.next/required-server-files.json +0 -1
  30. package/.next/routes-manifest.json +0 -1
  31. package/.next/server/chunks/1317.js +0 -125
  32. package/.next/server/chunks/1394.js +0 -3801
  33. package/.next/server/chunks/1444.js +0 -464
  34. package/.next/server/chunks/1608.js +0 -515
  35. package/.next/server/chunks/2154.js +0 -206
  36. package/.next/server/chunks/2439.js +0 -175
  37. package/.next/server/chunks/247.js +0 -61
  38. package/.next/server/chunks/2914.js +0 -96
  39. package/.next/server/chunks/3264.js +0 -67
  40. package/.next/server/chunks/350.js +0 -120
  41. package/.next/server/chunks/3746.js +0 -237
  42. package/.next/server/chunks/3898.js +0 -240
  43. package/.next/server/chunks/4312.js +0 -712
  44. package/.next/server/chunks/4371.js +0 -1467
  45. package/.next/server/chunks/4849.js +0 -664
  46. package/.next/server/chunks/5098.js +0 -124
  47. package/.next/server/chunks/5576.js +0 -72
  48. package/.next/server/chunks/6280.js +0 -417
  49. package/.next/server/chunks/6307.js +0 -109
  50. package/.next/server/chunks/6465.js +0 -91
  51. package/.next/server/chunks/650.js +0 -216
  52. package/.next/server/chunks/676.js +0 -32
  53. package/.next/server/chunks/6859.js +0 -959
  54. package/.next/server/chunks/6881.js +0 -320
  55. package/.next/server/chunks/7104.js +0 -196
  56. package/.next/server/chunks/7183.js +0 -72
  57. package/.next/server/chunks/7377.js +0 -82
  58. package/.next/server/chunks/7732.js +0 -51
  59. package/.next/server/chunks/7992.js +0 -562
  60. package/.next/server/chunks/8098.js +0 -266
  61. package/.next/server/chunks/8287.js +0 -79
  62. package/.next/server/chunks/8872.js +0 -378
  63. package/.next/server/chunks/9143.js +0 -106
  64. package/.next/server/chunks/953.js +0 -674
  65. package/.next/server/chunks/9854.js +0 -72
  66. package/.next/server/chunks/font-manifest.json +0 -1
  67. package/.next/server/font-manifest.json +0 -1
  68. package/.next/server/middleware-build-manifest.js +0 -1
  69. package/.next/server/middleware-manifest.json +0 -6
  70. package/.next/server/middleware-react-loadable-manifest.js +0 -1
  71. package/.next/server/pages/404.js.nft.json +0 -1
  72. package/.next/server/pages/500.js.nft.json +0 -1
  73. package/.next/server/pages/[...slug].js +0 -633
  74. package/.next/server/pages/[...slug].js.nft.json +0 -1
  75. package/.next/server/pages/[slug]/p.js +0 -2586
  76. package/.next/server/pages/[slug]/p.js.nft.json +0 -1
  77. package/.next/server/pages/_app.js +0 -2082
  78. package/.next/server/pages/_app.js.nft.json +0 -1
  79. package/.next/server/pages/_document.js +0 -304
  80. package/.next/server/pages/_document.js.nft.json +0 -1
  81. package/.next/server/pages/_error.js +0 -164
  82. package/.next/server/pages/_error.js.nft.json +0 -1
  83. package/.next/server/pages/account.js.nft.json +0 -1
  84. package/.next/server/pages/api/graphql.js +0 -259
  85. package/.next/server/pages/api/graphql.js.nft.json +0 -1
  86. package/.next/server/pages/api/preview.js +0 -118
  87. package/.next/server/pages/api/preview.js.nft.json +0 -1
  88. package/.next/server/pages/checkout.js.nft.json +0 -1
  89. package/.next/server/pages/en-US/404.html +0 -81
  90. package/.next/server/pages/en-US/500.html +0 -81
  91. package/.next/server/pages/en-US/account.html +0 -81
  92. package/.next/server/pages/en-US/checkout.html +0 -81
  93. package/.next/server/pages/en-US/login.html +0 -81
  94. package/.next/server/pages/en-US/s.html +0 -81
  95. package/.next/server/pages/en-US.html +0 -81
  96. package/.next/server/pages/en-US.json +0 -1
  97. package/.next/server/pages/index.js +0 -428
  98. package/.next/server/pages/index.js.nft.json +0 -1
  99. package/.next/server/pages/login.js.nft.json +0 -1
  100. package/.next/server/pages/s.js.nft.json +0 -1
  101. package/.next/server/pages-manifest.json +0 -16
  102. package/.next/server/webpack-api-runtime.js +0 -229
  103. package/.next/server/webpack-runtime.js +0 -229
  104. package/.next/static/chunks/143.dd8a556e6957baa1.js +0 -1
  105. package/.next/static/chunks/153-a20e3f2da180607e.js +0 -1
  106. package/.next/static/chunks/29.8b3dad75b915d222.js +0 -1
  107. package/.next/static/chunks/307.10facde65af3066a.js +0 -1
  108. package/.next/static/chunks/337-cf283e91e431869b.js +0 -1
  109. package/.next/static/chunks/351-a4e28d64f48c5269.js +0 -1
  110. package/.next/static/chunks/380-efd3541ef85300d5.js +0 -1
  111. package/.next/static/chunks/608.59e69b83f35d9c44.js +0 -1
  112. package/.next/static/chunks/650.807852d1c36bfe44.js +0 -1
  113. package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
  114. package/.next/static/chunks/686.41582b9e75eaba89.js +0 -1
  115. package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
  116. package/.next/static/chunks/817-f2821b9a40663949.js +0 -1
  117. package/.next/static/chunks/843.fab5a00e170b4f11.js +0 -1
  118. package/.next/static/chunks/909.787de82e0ed9eea3.js +0 -1
  119. package/.next/static/chunks/98.97381d2021f86cd9.js +0 -1
  120. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
  121. package/.next/static/chunks/main-9746772201fe3ac1.js +0 -1
  122. package/.next/static/chunks/pages/404-ba608a2a9f0c420a.js +0 -1
  123. package/.next/static/chunks/pages/500-910883c20541d9ce.js +0 -1
  124. package/.next/static/chunks/pages/[...slug]-51896262f6760bf1.js +0 -1
  125. package/.next/static/chunks/pages/[slug]/p-08c1f443f7d84d0d.js +0 -1
  126. package/.next/static/chunks/pages/_app-81a4a14c7f15c641.js +0 -1
  127. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
  128. package/.next/static/chunks/pages/account-f19102933e6fd84c.js +0 -1
  129. package/.next/static/chunks/pages/checkout-f8cb7cb22225ef9d.js +0 -1
  130. package/.next/static/chunks/pages/index-912d65fde37706bb.js +0 -1
  131. package/.next/static/chunks/pages/login-0b9ea80d9fa0f91b.js +0 -1
  132. package/.next/static/chunks/pages/s-86fe1e3303388123.js +0 -1
  133. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
  134. package/.next/static/chunks/webpack-1352532ac51c6a2d.js +0 -1
  135. package/.next/static/css/430b8cafbf7c23c1.css +0 -1
  136. package/.next/static/css/43d61b402f41569b.css +0 -1
  137. package/.next/static/css/4d7e7f156483493d.css +0 -1
  138. package/.next/static/css/6507cb48401e73a4.css +0 -1
  139. package/.next/static/css/9dd1d1084d254c66.css +0 -1
  140. package/.next/static/css/9e7c9877b9f78c63.css +0 -1
  141. package/.next/static/css/9e8d9784094a047f.css +0 -1
  142. package/.next/static/css/b2f16bd4b93e0aca.css +0 -1
  143. package/.next/static/css/bd743407c8049677.css +0 -1
  144. package/.next/static/dh7cD3fiozdMG3HhpxK6m/_buildManifest.js +0 -1
  145. package/.next/static/dh7cD3fiozdMG3HhpxK6m/_ssgManifest.js +0 -1
  146. package/.next/static/media/brandless-neutral.76ddf63a.png +0 -0
  147. package/.next/trace +0 -65
  148. package/public/~partytown/debug/partytown-atomics.js +0 -556
  149. package/public/~partytown/debug/partytown-media.js +0 -374
  150. package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
  151. package/public/~partytown/debug/partytown-sw.js +0 -59
  152. package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
  153. package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
  154. package/public/~partytown/debug/partytown.js +0 -72
  155. package/public/~partytown/partytown-atomics.js +0 -2
  156. package/public/~partytown/partytown-media.js +0 -2
  157. package/public/~partytown/partytown-sw.js +0 -2
  158. package/public/~partytown/partytown.js +0 -2
  159. package/src/components/ui/SkuSelector/SkuSelector.stories.mdx +0 -345
  160. package/src/components/ui/SkuSelector/SkuSelector.tsx +0 -46
  161. package/src/components/ui/SkuSelector/sku-selector.module.scss +0 -172
  162. package/src/components/ui/SkuSelector/skuVariants.ts +0 -59
  163. package/src/components/ui/Toast/Toast.stories.mdx +0 -158
  164. package/src/components/ui/Toast/Toast.tsx +0 -56
  165. package/src/components/ui/Toast/index.ts +0 -1
  166. package/src/components/ui/Toast/toast.module.scss +0 -112
@@ -17,7 +17,6 @@ info - Generating static pages (0/13)
17
17
  info - Generating static pages (3/13)
18
18
  info - Generating static pages (6/13)
19
19
  info - Generating static pages (9/13)
20
- warn - CallToAction not found. Add a new component for this section or remove it from the CMS
21
20
  info - Generating static pages (13/13)
22
21
  info - Finalizing page optimization...
23
22
 
@@ -27,8 +26,8 @@ Route (pages) Size First Load JS
27
26
  ├ /_app 0 B 100 kB
28
27
  ├ ● /[...slug] 6.82 kB 131 kB
29
28
  ├ └ css/430b8cafbf7c23c1.css 2.53 kB
30
- ├ ● /[slug]/p 11.7 kB 135 kB
31
- ├ └ css/9e7c9877b9f78c63.css 3.87 kB
29
+ ├ ● /[slug]/p 11.5 kB 135 kB
30
+ ├ └ css/a3aac8b785a9dfe2.css 3.22 kB
32
31
  ├ ○ /404 431 B 106 kB
33
32
  ├ ○ /500 439 B 106 kB
34
33
  ├ ○ /account 369 B 106 kB
@@ -38,12 +37,12 @@ Route (pages) Size First Load JS
38
37
  ├ ○ /login 368 B 106 kB
39
38
  └ ○ /s 6.14 kB 122 kB
40
39
  └ css/9dd1d1084d254c66.css 2.33 kB
41
- + First Load JS shared by all 120 kB
40
+ + First Load JS shared by all 121 kB
42
41
  ├ chunks/framework-dfd14d7ce6600b03.js 45.3 kB
43
42
  ├ chunks/main-9746772201fe3ac1.js 23.9 kB
44
- ├ chunks/pages/_app-81a4a14c7f15c641.js 28.9 kB
45
- ├ chunks/webpack-1352532ac51c6a2d.js 2.23 kB
46
- └ css/9e8d9784094a047f.css 19.9 kB
43
+ ├ chunks/pages/_app-0effc9759a3900cf.js 29.1 kB
44
+ ├ chunks/webpack-97e00fea9c2bafa8.js 2.19 kB
45
+ └ css/eb3e5d97ea879fee.css 21 kB
47
46
 
48
47
  λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
49
48
  ○ (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.87-alpha.0](https://github.com/vtex/faststore/compare/v2.0.86-alpha.0...v2.0.87-alpha.0) (2023-03-24)
7
+
8
+ ### Features
9
+
10
+ - Adds `SkuSelector` component ([#1677](https://github.com/vtex/faststore/issues/1677)) ([696a14e](https://github.com/vtex/faststore/commit/696a14e6d9633ececcd2818e4a32b32ce8ad2e2b))
11
+
12
+ ## [2.0.85-alpha.0](https://github.com/vtex/faststore/compare/v2.0.84-alpha.0...v2.0.85-alpha.0) (2023-03-22)
13
+
14
+ ### Features
15
+
16
+ - Adds `Toast` Component ([#1672](https://github.com/vtex/faststore/issues/1672)) ([5338c46](https://github.com/vtex/faststore/commit/5338c466d9fb326c3c85acee3c1049f954afd42a))
17
+
6
18
  ## [2.0.83-alpha.0](https://github.com/vtex/faststore/compare/v2.0.82-alpha.0...v2.0.83-alpha.0) (2023-03-21)
7
19
 
8
20
  **Note:** Version bump only for package @faststore/core
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "2.0.83-alpha.0",
3
+ "version": "2.0.87-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.3-alpha.0",
33
- "@faststore/components": "^2.0.83-alpha.0",
33
+ "@faststore/components": "^2.0.87-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.81-alpha.0",
36
+ "@faststore/ui": "^2.0.87-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": "018596959417f3e625287927598cd087fde5307e"
111
+ "gitHead": "b3bf59d620318b0bd4511eb4731eb716006c0fb4"
112
112
  }
package/src/Layout.tsx CHANGED
@@ -1,13 +1,13 @@
1
- import { lazy, Suspense } from 'react'
2
1
  import type { PropsWithChildren } from 'react'
2
+ import { lazy, Suspense } from 'react'
3
3
 
4
+ import { useUI } from '@faststore/ui'
4
5
  import Alert from 'src/components/common/Alert'
5
6
  import Footer from 'src/components/common/Footer'
6
7
  import Navbar from 'src/components/common/Navbar'
7
8
  import Toast from 'src/components/common/Toast'
8
9
  import RegionalizationBar from 'src/components/regionalization/RegionalizationBar'
9
10
  import Icon from 'src/components/ui/Icon'
10
- import { useUI } from '@faststore/ui'
11
11
 
12
12
  const CartSidebar = lazy(() => import('src/components/cart/CartSidebar'))
13
13
  const RegionModal = lazy(
@@ -1,9 +1,7 @@
1
- import { lazy, Suspense, useEffect } from 'react'
1
+ import { Suspense, useEffect } from 'react'
2
2
 
3
+ import { Toast as UIToast, useUI } from '@faststore/ui'
3
4
  import { useCart } from 'src/sdk/cart'
4
- import { useUI } from '@faststore/ui'
5
-
6
- const UIToast = lazy(() => import('src/components/ui/Toast'))
7
5
 
8
6
  function Toast() {
9
7
  const { toasts, pushToast } = useUI()
@@ -1,10 +1,10 @@
1
- import type { ComponentPropsWithRef, FormEvent, ReactNode } from 'react'
2
- import { forwardRef, useRef } from 'react'
3
1
  import {
4
- Form,
5
2
  Button as UIButton,
3
+ Form,
6
4
  InputField as UIInputField,
7
5
  } from '@faststore/ui'
6
+ import type { ComponentPropsWithRef, FormEvent, ReactNode } from 'react'
7
+ import { forwardRef, useRef } from 'react'
8
8
 
9
9
  import { useUI } from '@faststore/ui'
10
10
  import Icon from 'src/components/ui/Icon'
@@ -59,14 +59,14 @@ const Newsletter = forwardRef<HTMLFormElement, NewsletterProps>(
59
59
  title: 'Hooray!',
60
60
  message: 'Thank for your subscription.',
61
61
  status: 'INFO',
62
- icon: 'CircleWavyCheck',
62
+ icon: <Icon name="CircleWavyCheck" width={30} height={30} />,
63
63
  })
64
64
  } else {
65
65
  pushToast({
66
66
  title: 'Oops.',
67
67
  message: 'Something went wrong. Please Try again.',
68
68
  status: 'ERROR',
69
- icon: 'CircleWavyWarning',
69
+ icon: <Icon name="CircleWavyWarning" width={30} height={30} />,
70
70
  })
71
71
  }
72
72
 
@@ -170,10 +170,12 @@ function ProductDetails({ context: staleProduct }: Props) {
170
170
  </section>
171
171
  {skuVariants && (
172
172
  <Selectors
173
- slugsMap={skuVariants.slugsMap}
174
- availableVariations={skuVariants.availableVariations}
175
- activeVariations={skuVariants.activeVariations}
176
173
  data-fs-product-details-selectors
174
+ slugsMap={isVariantOf.skuVariants.slugsMap}
175
+ activeVariations={isVariantOf.skuVariants.activeVariations}
176
+ availableVariations={
177
+ isVariantOf.skuVariants.availableVariations
178
+ }
177
179
  />
178
180
  )}
179
181
  {/* NOTE: A loading skeleton had to be used to avoid a Lighthouse's
@@ -284,8 +286,8 @@ export const fragment = gql`
284
286
  productGroupID
285
287
  skuVariants {
286
288
  activeVariations
287
- slugsMap(dominantVariantName: "Color")
288
- availableVariations(dominantVariantName: "Color")
289
+ slugsMap
290
+ availableVariations
289
291
  }
290
292
  }
291
293
 
@@ -38,11 +38,6 @@
38
38
  [data-fs-product-details-section] {
39
39
  height: fit-content;
40
40
 
41
- [data-fs-sku-selector] {
42
- margin-bottom: var(--fs-product-details-vertical-spacing);
43
- &:last-of-type { margin-bottom: var(--fs-spacing-7); }
44
- }
45
-
46
41
  [data-fs-buy-button] {
47
42
  width: 100%;
48
43
  margin-top: var(--fs-spacing-3);
@@ -39,12 +39,16 @@ The code snippet below is an example of what `Selectors` props should look like,
39
39
  ]}
40
40
  >
41
41
  <Selectors
42
- activeVariations={{ Size: '41', Color: 'White' }}
42
+ activeVariations={{
43
+ Color: 'White',
44
+ Size: '42',
45
+ }}
43
46
  slugsMap={{
44
47
  'Color-Pink-Size-42': 'classic-shoes-37',
45
48
  'Color-White-Size-42': 'classic-shoes-36',
46
49
  'Color-White-Size-41': 'classic-shoes-310124175',
47
50
  }}
51
+ dominantVariation: 'Color'
48
52
  availableVariations={{
49
53
  Size: [
50
54
  {
@@ -1,9 +1,17 @@
1
- import { useRouter } from 'next/router'
2
- import type { ChangeEvent, HTMLAttributes } from 'react'
1
+ import { HTMLAttributes, useCallback, useMemo } from 'react'
3
2
 
4
- import SkuSelector from './SkuSelector'
5
- import { navigateToSku } from './skuVariants'
6
- import type { SkuVariantsByName } from './skuVariants'
3
+ import { Image } from '../Image'
4
+ import {
5
+ SkuSelector as UISkuSelector,
6
+ SkuSelectorProps,
7
+ SkuOption,
8
+ } from '@faststore/ui'
9
+ import NextLink from 'next/link'
10
+
11
+ export type SkuVariantsByName = Record<
12
+ string,
13
+ Array<{ alt: string; label: string; value: string; src?: string }>
14
+ >
7
15
 
8
16
  interface Props extends HTMLAttributes<HTMLDivElement> {
9
17
  /**
@@ -20,64 +28,42 @@ interface Props extends HTMLAttributes<HTMLDivElement> {
20
28
  activeVariations: Record<string, string>
21
29
  }
22
30
 
23
- /**
24
- * Name of the property that's considered **dominant**. Which means that all
25
- * other varying properties will be filtered according to the current value
26
- * of this property.
27
- *
28
- * Ex: If `Red` is the current value for the 'Color' variation, we'll only
29
- * render possible values for 'Size' that are available in `Red`.
30
- */
31
- const DOMINANT_SKU_SELECTOR_PROPERTY = 'Color'
31
+ const ImageComponent: SkuSelectorProps['ImageComponent'] = ({
32
+ src,
33
+ alt,
34
+ ...otherProps
35
+ }) => (
36
+ <Image
37
+ src={src}
38
+ alt={alt}
39
+ width={20}
40
+ height={20}
41
+ loading="lazy"
42
+ {...otherProps}
43
+ />
44
+ )
32
45
 
33
46
  function Selectors({
34
47
  slugsMap,
35
- availableVariations,
36
48
  activeVariations,
49
+ availableVariations,
37
50
  ...otherProps
38
51
  }: Props) {
39
- const router = useRouter()
40
-
41
- // 'Color' variants are singled-out here because they will always be rendered
42
- // as 'image' variants. And they're also the 'dominant' variants in our store.
43
- const { Color: colorOptions, ...otherSkuVariants } = availableVariations
44
-
45
- function handleOnChange(
46
- e: ChangeEvent<HTMLInputElement>,
47
- updatedVariationName: string
48
- ) {
49
- const newVariationValue = e.currentTarget.value
50
-
51
- navigateToSku({
52
- router,
53
- slugsMap,
54
- updatedVariationName,
55
- selectorsState: activeVariations,
56
- updatedVariationValue: newVariationValue,
57
- dominantSku: DOMINANT_SKU_SELECTOR_PROPERTY,
58
- })
59
- }
60
-
61
52
  return (
62
53
  <section {...otherProps}>
63
- {colorOptions && (
64
- <SkuSelector
65
- label="Color"
66
- variant="image"
67
- options={colorOptions}
68
- activeValue={activeVariations.Color}
69
- onChange={(e) => handleOnChange(e, 'Color')}
70
- />
71
- )}
72
- {otherSkuVariants &&
73
- Object.keys(otherSkuVariants).map((skuVariant) => (
74
- <SkuSelector
75
- variant="label"
54
+ {availableVariations &&
55
+ Object.keys(availableVariations).map((skuVariant) => (
56
+ <UISkuSelector
76
57
  key={skuVariant}
77
- label={skuVariant}
78
- options={otherSkuVariants[skuVariant]}
79
- activeValue={activeVariations[skuVariant]}
80
- onChange={(e) => handleOnChange(e, skuVariant)}
58
+ skuPropertyName={skuVariant}
59
+ availableVariations={availableVariations}
60
+ ImageComponent={ImageComponent}
61
+ activeVariations={activeVariations}
62
+ slugsMap={slugsMap}
63
+ linkProps={{
64
+ as: NextLink,
65
+ legacyBehavior: false,
66
+ }}
81
67
  />
82
68
  ))}
83
69
  </section>
@@ -1,3 +1 @@
1
- export { default as SkuSelector } from './SkuSelector'
2
-
3
1
  export { default } from './Selectors'
@@ -68,8 +68,8 @@ export const ValidateCartMutation = gql`
68
68
  name
69
69
  skuVariants {
70
70
  activeVariations
71
- slugsMap(dominantVariantName: "Color")
72
- availableVariations(dominantVariantName: "Color")
71
+ slugsMap
72
+ availableVariations
73
73
  }
74
74
  }
75
75
  gtin
package/.next/BUILD_ID DELETED
@@ -1 +0,0 @@
1
- dh7cD3fiozdMG3HhpxK6m
@@ -1,103 +0,0 @@
1
- {
2
- "polyfillFiles": [
3
- "static/chunks/polyfills-c67a75d1b6f99dc8.js"
4
- ],
5
- "devFiles": [],
6
- "ampDevFiles": [],
7
- "lowPriorityFiles": [
8
- "static/dh7cD3fiozdMG3HhpxK6m/_buildManifest.js",
9
- "static/dh7cD3fiozdMG3HhpxK6m/_ssgManifest.js"
10
- ],
11
- "rootMainFiles": [],
12
- "pages": {
13
- "/": [
14
- "static/chunks/webpack-1352532ac51c6a2d.js",
15
- "static/chunks/framework-dfd14d7ce6600b03.js",
16
- "static/chunks/main-9746772201fe3ac1.js",
17
- "static/chunks/351-a4e28d64f48c5269.js",
18
- "static/chunks/380-efd3541ef85300d5.js",
19
- "static/chunks/817-f2821b9a40663949.js",
20
- "static/css/43d61b402f41569b.css",
21
- "static/chunks/pages/index-912d65fde37706bb.js"
22
- ],
23
- "/404": [
24
- "static/chunks/webpack-1352532ac51c6a2d.js",
25
- "static/chunks/framework-dfd14d7ce6600b03.js",
26
- "static/chunks/main-9746772201fe3ac1.js",
27
- "static/chunks/351-a4e28d64f48c5269.js",
28
- "static/chunks/pages/404-ba608a2a9f0c420a.js"
29
- ],
30
- "/500": [
31
- "static/chunks/webpack-1352532ac51c6a2d.js",
32
- "static/chunks/framework-dfd14d7ce6600b03.js",
33
- "static/chunks/main-9746772201fe3ac1.js",
34
- "static/chunks/351-a4e28d64f48c5269.js",
35
- "static/chunks/pages/500-910883c20541d9ce.js"
36
- ],
37
- "/[...slug]": [
38
- "static/chunks/webpack-1352532ac51c6a2d.js",
39
- "static/chunks/framework-dfd14d7ce6600b03.js",
40
- "static/chunks/main-9746772201fe3ac1.js",
41
- "static/chunks/351-a4e28d64f48c5269.js",
42
- "static/chunks/380-efd3541ef85300d5.js",
43
- "static/chunks/337-cf283e91e431869b.js",
44
- "static/css/430b8cafbf7c23c1.css",
45
- "static/chunks/pages/[...slug]-51896262f6760bf1.js"
46
- ],
47
- "/[slug]/p": [
48
- "static/chunks/webpack-1352532ac51c6a2d.js",
49
- "static/chunks/framework-dfd14d7ce6600b03.js",
50
- "static/chunks/main-9746772201fe3ac1.js",
51
- "static/chunks/351-a4e28d64f48c5269.js",
52
- "static/chunks/380-efd3541ef85300d5.js",
53
- "static/chunks/817-f2821b9a40663949.js",
54
- "static/css/9e7c9877b9f78c63.css",
55
- "static/chunks/pages/[slug]/p-08c1f443f7d84d0d.js"
56
- ],
57
- "/_app": [
58
- "static/chunks/webpack-1352532ac51c6a2d.js",
59
- "static/chunks/framework-dfd14d7ce6600b03.js",
60
- "static/chunks/main-9746772201fe3ac1.js",
61
- "static/css/9e8d9784094a047f.css",
62
- "static/chunks/pages/_app-81a4a14c7f15c641.js"
63
- ],
64
- "/_error": [
65
- "static/chunks/webpack-1352532ac51c6a2d.js",
66
- "static/chunks/framework-dfd14d7ce6600b03.js",
67
- "static/chunks/main-9746772201fe3ac1.js",
68
- "static/chunks/pages/_error-a7a0c1d9bfbb4f38.js"
69
- ],
70
- "/account": [
71
- "static/chunks/webpack-1352532ac51c6a2d.js",
72
- "static/chunks/framework-dfd14d7ce6600b03.js",
73
- "static/chunks/main-9746772201fe3ac1.js",
74
- "static/chunks/351-a4e28d64f48c5269.js",
75
- "static/chunks/pages/account-f19102933e6fd84c.js"
76
- ],
77
- "/checkout": [
78
- "static/chunks/webpack-1352532ac51c6a2d.js",
79
- "static/chunks/framework-dfd14d7ce6600b03.js",
80
- "static/chunks/main-9746772201fe3ac1.js",
81
- "static/chunks/351-a4e28d64f48c5269.js",
82
- "static/chunks/pages/checkout-f8cb7cb22225ef9d.js"
83
- ],
84
- "/login": [
85
- "static/chunks/webpack-1352532ac51c6a2d.js",
86
- "static/chunks/framework-dfd14d7ce6600b03.js",
87
- "static/chunks/main-9746772201fe3ac1.js",
88
- "static/chunks/351-a4e28d64f48c5269.js",
89
- "static/chunks/pages/login-0b9ea80d9fa0f91b.js"
90
- ],
91
- "/s": [
92
- "static/chunks/webpack-1352532ac51c6a2d.js",
93
- "static/chunks/framework-dfd14d7ce6600b03.js",
94
- "static/chunks/main-9746772201fe3ac1.js",
95
- "static/chunks/351-a4e28d64f48c5269.js",
96
- "static/chunks/153-a20e3f2da180607e.js",
97
- "static/chunks/337-cf283e91e431869b.js",
98
- "static/css/9dd1d1084d254c66.css",
99
- "static/chunks/pages/s-86fe1e3303388123.js"
100
- ]
101
- },
102
- "ampFirstPages": []
103
- }