@faststore/core 2.0.146-alpha.0 → 2.0.151-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +15 -15
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/eslint/.cache_1gneedd +1 -1
- package/.next/cache/next-server.js.nft.json +1 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/401.js +5 -5
- package/.next/server/chunks/907.js +4 -4
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.js.nft.json +1 -1
- package/.next/server/pages/[...slug].js +1 -1
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js +1027 -955
- package/.next/server/pages/[slug]/p.js.nft.json +1 -1
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/account.js.nft.json +1 -1
- package/.next/server/pages/checkout.js.nft.json +1 -1
- package/.next/server/pages/en-US/404.html +2 -2
- package/.next/server/pages/en-US/500.html +2 -2
- package/.next/server/pages/en-US/account.html +2 -2
- package/.next/server/pages/en-US/checkout.html +2 -2
- package/.next/server/pages/en-US/login.html +2 -2
- package/.next/server/pages/en-US/s.html +2 -2
- package/.next/server/pages/en-US/s.json +1 -1
- package/.next/server/pages/en-US.html +2 -2
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/login.js.nft.json +1 -1
- package/.next/server/pages/s.js +1 -1
- package/.next/server/pages/s.js.nft.json +1 -1
- package/.next/server/pages-manifest.json +4 -4
- package/.next/static/{QGL3gfKa2F4ppozosZML6 → SPkTG9-gxU2UejLG7FvOw}/_buildManifest.js +1 -1
- package/.next/static/chunks/pages/[slug]/p-fa35dd93d53f75f6.js +1 -0
- package/.next/static/chunks/webpack-5051dce9659282f3.js +1 -0
- package/.next/static/css/{7701d01af31e31d1.css → 1de3e7b6ba8daaac.css} +1 -1
- package/.next/trace +69 -68
- package/.turbo/turbo-build.log +3 -3
- package/CHANGELOG.md +12 -0
- package/cms/faststore/sections.json +26 -20
- package/package.json +4 -4
- package/src/components/sections/ProductDetails/ProductDetails.tsx +106 -165
- package/src/components/{sections/ProducDetailsContent/ProductDetailsContent.tsx → ui/ProductDescription/ProductDescription.tsx} +7 -7
- package/src/components/ui/ProductDescription/index.ts +1 -0
- package/src/components/ui/ProductDetails/AddToCartLoadingSkeleton.tsx +57 -0
- package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +125 -0
- package/src/components/ui/ProductDetails/index.ts +2 -0
- package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +18 -2
- package/.next/static/chunks/pages/[slug]/p-6597f93c2bfe07b3.js +0 -1
- package/.next/static/chunks/webpack-4e162ac7f81d85d4.js +0 -1
- package/src/components/sections/ProducDetailsContent/index.ts +0 -1
- /package/.next/static/{QGL3gfKa2F4ppozosZML6 → SPkTG9-gxU2UejLG7FvOw}/_ssgManifest.js +0 -0
- /package/src/components/{sections/ProducDetailsContent/ProductDetailsContent.stories.mdx → ui/ProductDescription/ProductDescription.stories.mdx} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -28,8 +28,8 @@ Route (pages) Size First Load JS
|
|
|
28
28
|
├ /_app 0 B 77.9 kB
|
|
29
29
|
├ ● /[...slug] 9.9 kB 133 kB
|
|
30
30
|
├ └ css/2e9de35e0cb999e0.css 7.9 kB
|
|
31
|
-
├ ● /[slug]/p 11.
|
|
32
|
-
├ └ css/
|
|
31
|
+
├ ● /[slug]/p 11.7 kB 135 kB
|
|
32
|
+
├ └ css/1de3e7b6ba8daaac.css 10.9 kB
|
|
33
33
|
├ ○ /404 1.09 kB 113 kB
|
|
34
34
|
├ ● /500 1.11 kB 113 kB
|
|
35
35
|
├ ● /account 672 B 113 kB
|
|
@@ -42,7 +42,7 @@ Route (pages) Size First Load JS
|
|
|
42
42
|
├ chunks/framework-dfd14d7ce6600b03.js 45.3 kB
|
|
43
43
|
├ chunks/main-fd466221927468fd.js 23.9 kB
|
|
44
44
|
├ chunks/pages/_app-3e4e7e579cb0681a.js 6.43 kB
|
|
45
|
-
├ chunks/webpack-
|
|
45
|
+
├ chunks/webpack-5051dce9659282f3.js 2.27 kB
|
|
46
46
|
└ css/923c4a942e57bc91.css 2.81 kB
|
|
47
47
|
|
|
48
48
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
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.151-alpha.0](https://github.com/vtex/faststore/compare/v2.0.150-alpha.0...v2.0.151-alpha.0) (2023-05-22)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- Adjust `ProductDetails` for CMS ([#1740](https://github.com/vtex/faststore/issues/1740)) ([5cbd315](https://github.com/vtex/faststore/commit/5cbd31544bf57336f6d53780142338f80b61226b))
|
|
11
|
+
|
|
12
|
+
## [2.0.147-alpha.0](https://github.com/vtex/faststore/compare/v2.0.146-alpha.0...v2.0.147-alpha.0) (2023-05-19)
|
|
13
|
+
|
|
14
|
+
### Chores
|
|
15
|
+
|
|
16
|
+
- removes required button props ([#1781](https://github.com/vtex/faststore/issues/1781)) ([b2758ee](https://github.com/vtex/faststore/commit/b2758ee37ae4737b3b59a7b6634baec138fe02f6))
|
|
17
|
+
|
|
6
18
|
## [2.0.146-alpha.0](https://github.com/vtex/faststore/compare/v2.0.145-alpha.0...v2.0.146-alpha.0) (2023-05-19)
|
|
7
19
|
|
|
8
20
|
### Features
|
|
@@ -661,7 +661,6 @@
|
|
|
661
661
|
"link": {
|
|
662
662
|
"title": "Call to Action",
|
|
663
663
|
"type": "object",
|
|
664
|
-
"required": ["text", "url"],
|
|
665
664
|
"properties": {
|
|
666
665
|
"text": {
|
|
667
666
|
"type": "string",
|
|
@@ -1142,9 +1141,21 @@
|
|
|
1142
1141
|
"type": "object",
|
|
1143
1142
|
"properties": {
|
|
1144
1143
|
"discountBadge": {
|
|
1145
|
-
"title": "
|
|
1146
|
-
"type": "
|
|
1147
|
-
"
|
|
1144
|
+
"title": "Discount Badge",
|
|
1145
|
+
"type": "object",
|
|
1146
|
+
"properties": {
|
|
1147
|
+
"showDiscountBadge": {
|
|
1148
|
+
"title": "Show Discount Badge?",
|
|
1149
|
+
"type": "boolean",
|
|
1150
|
+
"default": false
|
|
1151
|
+
},
|
|
1152
|
+
"size": {
|
|
1153
|
+
"title": "Size",
|
|
1154
|
+
"type": "string",
|
|
1155
|
+
"enumNames": ["Big", "Small"],
|
|
1156
|
+
"enum": ["big", "small"]
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1148
1159
|
},
|
|
1149
1160
|
"refNumber": {
|
|
1150
1161
|
"title": "Show Reference Number?",
|
|
@@ -1216,8 +1227,8 @@
|
|
|
1216
1227
|
}
|
|
1217
1228
|
}
|
|
1218
1229
|
},
|
|
1219
|
-
"
|
|
1220
|
-
"title": "Product
|
|
1230
|
+
"productDescription": {
|
|
1231
|
+
"title": "Product Description",
|
|
1221
1232
|
"type": "object",
|
|
1222
1233
|
"properties": {
|
|
1223
1234
|
"initiallyExpanded": {
|
|
@@ -1226,20 +1237,15 @@
|
|
|
1226
1237
|
"enumNames": ["First", "All", "None"],
|
|
1227
1238
|
"enum": ["first", "all", "none"]
|
|
1228
1239
|
},
|
|
1229
|
-
"
|
|
1230
|
-
"
|
|
1231
|
-
"
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
"title": "Description section title",
|
|
1239
|
-
"type": "string",
|
|
1240
|
-
"default": "Description"
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1240
|
+
"displayDescription": {
|
|
1241
|
+
"title": "Should display description?",
|
|
1242
|
+
"type": "boolean",
|
|
1243
|
+
"default": true
|
|
1244
|
+
},
|
|
1245
|
+
"title": {
|
|
1246
|
+
"title": "Description section title",
|
|
1247
|
+
"type": "string",
|
|
1248
|
+
"default": "Description"
|
|
1243
1249
|
}
|
|
1244
1250
|
}
|
|
1245
1251
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.151-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.140-alpha.0",
|
|
33
|
-
"@faststore/components": "^2.0.
|
|
33
|
+
"@faststore/components": "^2.0.151-alpha.0",
|
|
34
34
|
"@faststore/graphql-utils": "^2.0.3-alpha.0",
|
|
35
35
|
"@faststore/sdk": "^2.0.118-alpha.0",
|
|
36
|
-
"@faststore/ui": "^2.0.
|
|
36
|
+
"@faststore/ui": "^2.0.151-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": "
|
|
111
|
+
"gitHead": "6e3e406c91c7dd87beff20ddf090f4ad724b3a7d"
|
|
112
112
|
}
|
|
@@ -1,38 +1,88 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react'
|
|
2
|
+
|
|
1
3
|
import { gql } from '@faststore/graphql-utils'
|
|
2
|
-
import type { CurrencyCode, ViewItemEvent } from '@faststore/sdk'
|
|
3
4
|
import { sendAnalyticsEvent } from '@faststore/sdk'
|
|
5
|
+
import type { CurrencyCode, ViewItemEvent } from '@faststore/sdk'
|
|
6
|
+
import type { ProductDetailsFragment_ProductFragment } from '@generated/graphql'
|
|
4
7
|
import {
|
|
5
|
-
|
|
8
|
+
Link as UILink,
|
|
6
9
|
ProductTitle as UIProductTitle,
|
|
7
|
-
|
|
10
|
+
DiscountBadge as UIDiscountBadge,
|
|
8
11
|
} from '@faststore/ui'
|
|
9
|
-
import { useEffect, useState } from 'react'
|
|
10
12
|
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
+
import { useSession } from 'src/sdk/session'
|
|
14
|
+
import { useProduct } from 'src/sdk/product/useProduct'
|
|
15
|
+
import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
|
|
16
|
+
import type { AnalyticsItem } from 'src/sdk/analytics/types'
|
|
13
17
|
|
|
14
|
-
import
|
|
18
|
+
import Section from '../Section'
|
|
15
19
|
import OutOfStock from 'src/components/product/OutOfStock'
|
|
16
20
|
import ImageGallery from 'src/components/ui/ImageGallery'
|
|
17
21
|
import ShippingSimulation from 'src/components/ui/ShippingSimulation'
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import { useBuyButton } from 'src/sdk/cart/useBuyButton'
|
|
21
|
-
import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
|
|
22
|
-
import { useProduct } from 'src/sdk/product/useProduct'
|
|
23
|
-
import { useSession } from 'src/sdk/session'
|
|
22
|
+
import ProductDescription from 'src/components/ui/ProductDescription'
|
|
23
|
+
import { ProductDetailsSettings } from 'src/components/ui/ProductDetails'
|
|
24
24
|
|
|
25
|
-
import ProductDetailsContent from '../ProducDetailsContent'
|
|
26
|
-
import Section from '../Section'
|
|
27
25
|
import styles from './section.module.scss'
|
|
28
26
|
|
|
29
|
-
interface
|
|
27
|
+
interface ProductDetailsContextProps {
|
|
30
28
|
context: ProductDetailsFragment_ProductFragment
|
|
31
29
|
}
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
export interface ProductDetailsProps {
|
|
32
|
+
productTitle: {
|
|
33
|
+
refNumber: boolean
|
|
34
|
+
discountBadge: {
|
|
35
|
+
size: 'big' | 'small'
|
|
36
|
+
showDiscountBadge: boolean
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
buyButton: {
|
|
40
|
+
title: string
|
|
41
|
+
icon: {
|
|
42
|
+
alt: string
|
|
43
|
+
icon: string
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
shippingSimulator: {
|
|
47
|
+
title: string
|
|
48
|
+
inputLabel: string
|
|
49
|
+
link: {
|
|
50
|
+
to: string
|
|
51
|
+
text: string
|
|
52
|
+
}
|
|
53
|
+
shippingOptionsTableTitle: string
|
|
54
|
+
}
|
|
55
|
+
productDescription: {
|
|
56
|
+
title: string
|
|
57
|
+
displayDescription: boolean
|
|
58
|
+
initiallyExpanded: 'first' | 'all' | 'none'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function ProductDetails({
|
|
63
|
+
context: staleProduct,
|
|
64
|
+
productTitle: {
|
|
65
|
+
refNumber: showRefNumber,
|
|
66
|
+
discountBadge: { showDiscountBadge, size: discountBadgeSize },
|
|
67
|
+
},
|
|
68
|
+
buyButton: {
|
|
69
|
+
title: buyButtonTitle,
|
|
70
|
+
icon: { icon: buyButtonIconName, alt: buyButtonIconAlt },
|
|
71
|
+
},
|
|
72
|
+
shippingSimulator: {
|
|
73
|
+
title: shippingSimulatorTitle,
|
|
74
|
+
inputLabel: shippingSimulatorInputLabel,
|
|
75
|
+
shippingOptionsTableTitle: shippingSimulatorOptionsTableTitle,
|
|
76
|
+
link: { to: shippingSimulatorLinkUrl, text: shippingSimulatorLinkText },
|
|
77
|
+
},
|
|
78
|
+
productDescription: {
|
|
79
|
+
title: productDescriptionDetailsTitle,
|
|
80
|
+
initiallyExpanded: productDescriptionInitiallyExpanded,
|
|
81
|
+
displayDescription: shouldDisplayProductDescription,
|
|
82
|
+
},
|
|
83
|
+
}: ProductDetailsProps & ProductDetailsContextProps) {
|
|
34
84
|
const { currency } = useSession()
|
|
35
|
-
const [
|
|
85
|
+
const [quantity, setQuantity] = useState(1)
|
|
36
86
|
|
|
37
87
|
// Stale while revalidate the product for fetching the new price etc
|
|
38
88
|
const { data, isValidating } = useProduct(staleProduct.id, {
|
|
@@ -51,86 +101,15 @@ function ProductDetails({ context: staleProduct }: Props) {
|
|
|
51
101
|
name: variantName,
|
|
52
102
|
brand,
|
|
53
103
|
isVariantOf,
|
|
54
|
-
isVariantOf: { name, productGroupID: productId
|
|
104
|
+
isVariantOf: { name, productGroupID: productId },
|
|
55
105
|
image: productImages,
|
|
56
106
|
offers: {
|
|
57
107
|
offers: [{ availability, price, listPrice, seller }],
|
|
58
108
|
lowPrice,
|
|
59
109
|
},
|
|
60
|
-
breadcrumbList: breadcrumbs,
|
|
61
|
-
additionalProperty,
|
|
62
110
|
},
|
|
63
111
|
} = data
|
|
64
112
|
|
|
65
|
-
const buyDisabled = availability !== 'https://schema.org/InStock'
|
|
66
|
-
|
|
67
|
-
const buyProps = useBuyButton({
|
|
68
|
-
id,
|
|
69
|
-
price,
|
|
70
|
-
listPrice,
|
|
71
|
-
seller,
|
|
72
|
-
quantity: addQuantity,
|
|
73
|
-
itemOffered: {
|
|
74
|
-
sku,
|
|
75
|
-
name: variantName,
|
|
76
|
-
gtin,
|
|
77
|
-
image: productImages,
|
|
78
|
-
brand,
|
|
79
|
-
isVariantOf,
|
|
80
|
-
additionalProperty,
|
|
81
|
-
},
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
const ProductDetailsSection = () => {
|
|
85
|
-
return (
|
|
86
|
-
<>
|
|
87
|
-
<section data-fs-product-details-values>
|
|
88
|
-
<div data-fs-product-details-prices>
|
|
89
|
-
<Price
|
|
90
|
-
value={listPrice}
|
|
91
|
-
formatter={useFormattedPrice}
|
|
92
|
-
testId="list-price"
|
|
93
|
-
data-value={listPrice}
|
|
94
|
-
variant="listing"
|
|
95
|
-
SRText="Original price:"
|
|
96
|
-
/>
|
|
97
|
-
<Price
|
|
98
|
-
value={lowPrice}
|
|
99
|
-
formatter={useFormattedPrice}
|
|
100
|
-
testId="price"
|
|
101
|
-
data-value={lowPrice}
|
|
102
|
-
variant="spot"
|
|
103
|
-
className="text__lead"
|
|
104
|
-
SRText="Sale Price:"
|
|
105
|
-
/>
|
|
106
|
-
</div>
|
|
107
|
-
<UIQuantitySelector min={1} max={10} onChange={setAddQuantity} />
|
|
108
|
-
</section>
|
|
109
|
-
{skuVariants && (
|
|
110
|
-
<Selectors
|
|
111
|
-
slugsMap={skuVariants.slugsMap}
|
|
112
|
-
availableVariations={skuVariants.availableVariations}
|
|
113
|
-
activeVariations={skuVariants.activeVariations}
|
|
114
|
-
data-fs-product-details-selectors
|
|
115
|
-
/>
|
|
116
|
-
)}
|
|
117
|
-
{
|
|
118
|
-
/* NOTE: A loading skeleton had to be used to avoid a Lighthouse's
|
|
119
|
-
non-composited animation violation due to the button transitioning its
|
|
120
|
-
background color when changing from its initial disabled to active state.
|
|
121
|
-
See full explanation on commit https://git.io/JyXV5. */
|
|
122
|
-
isValidating ? (
|
|
123
|
-
<AddToCartLoadingSkeleton />
|
|
124
|
-
) : (
|
|
125
|
-
<UIBuyButton disabled={buyDisabled} {...buyProps}>
|
|
126
|
-
Add to Cart
|
|
127
|
-
</UIBuyButton>
|
|
128
|
-
)
|
|
129
|
-
}
|
|
130
|
-
</>
|
|
131
|
-
)
|
|
132
|
-
}
|
|
133
|
-
|
|
134
113
|
useEffect(() => {
|
|
135
114
|
sendAnalyticsEvent<ViewItemEvent<AnalyticsItem>>({
|
|
136
115
|
name: 'view_item',
|
|
@@ -174,13 +153,15 @@ function ProductDetails({ context: staleProduct }: Props) {
|
|
|
174
153
|
<UIProductTitle
|
|
175
154
|
title={<h1>{name}</h1>}
|
|
176
155
|
label={
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
156
|
+
showDiscountBadge && (
|
|
157
|
+
<UIDiscountBadge
|
|
158
|
+
listPrice={listPrice}
|
|
159
|
+
spotPrice={lowPrice}
|
|
160
|
+
size={discountBadgeSize}
|
|
161
|
+
/>
|
|
162
|
+
)
|
|
182
163
|
}
|
|
183
|
-
refNumber={productId}
|
|
164
|
+
refNumber={showRefNumber && productId}
|
|
184
165
|
/>
|
|
185
166
|
</header>
|
|
186
167
|
<ImageGallery
|
|
@@ -192,86 +173,54 @@ function ProductDetails({ context: staleProduct }: Props) {
|
|
|
192
173
|
data-fs-product-details-settings
|
|
193
174
|
data-fs-product-details-section
|
|
194
175
|
>
|
|
195
|
-
{availability ?
|
|
176
|
+
{availability ? (
|
|
177
|
+
<ProductDetailsSettings
|
|
178
|
+
product={data.product}
|
|
179
|
+
isValidating={isValidating}
|
|
180
|
+
buyButtonTitle={buyButtonTitle}
|
|
181
|
+
quantity={quantity}
|
|
182
|
+
setQuantity={setQuantity}
|
|
183
|
+
buyButtonIcon={buyButtonIconName}
|
|
184
|
+
/>
|
|
185
|
+
) : (
|
|
186
|
+
<OutOfStock />
|
|
187
|
+
)}
|
|
196
188
|
</section>
|
|
189
|
+
|
|
197
190
|
{availability && (
|
|
198
191
|
<ShippingSimulation
|
|
199
192
|
data-fs-product-details-section
|
|
200
193
|
data-fs-product-details-shipping
|
|
201
194
|
productShippingInfo={{
|
|
202
195
|
id,
|
|
203
|
-
quantity
|
|
196
|
+
quantity,
|
|
204
197
|
seller: seller.identifier,
|
|
205
198
|
}}
|
|
206
199
|
formatter={useFormattedPrice}
|
|
200
|
+
title={shippingSimulatorTitle}
|
|
201
|
+
inputLabel={shippingSimulatorInputLabel}
|
|
202
|
+
idkPostalCodeLinkProps={
|
|
203
|
+
<UILink href={shippingSimulatorLinkUrl}>
|
|
204
|
+
{shippingSimulatorLinkText}
|
|
205
|
+
</UILink>
|
|
206
|
+
}
|
|
207
|
+
optionsLabel={shippingSimulatorOptionsTableTitle}
|
|
207
208
|
/>
|
|
208
209
|
)}
|
|
209
210
|
</section>
|
|
210
|
-
|
|
211
|
+
|
|
212
|
+
{shouldDisplayProductDescription && (
|
|
213
|
+
<ProductDescription
|
|
214
|
+
labels={{ description: productDescriptionDetailsTitle }}
|
|
215
|
+
initiallyExpanded={productDescriptionInitiallyExpanded}
|
|
216
|
+
/>
|
|
217
|
+
)}
|
|
211
218
|
</section>
|
|
212
219
|
</section>
|
|
213
220
|
</Section>
|
|
214
221
|
)
|
|
215
222
|
}
|
|
216
223
|
|
|
217
|
-
function AddToCartLoadingSkeleton() {
|
|
218
|
-
// Generated via https://skeletonreact.com/.
|
|
219
|
-
return (
|
|
220
|
-
<svg
|
|
221
|
-
role="img"
|
|
222
|
-
width="100%"
|
|
223
|
-
height="48"
|
|
224
|
-
aria-labelledby="loading-aria"
|
|
225
|
-
viewBox="0 0 112 48"
|
|
226
|
-
preserveAspectRatio="none"
|
|
227
|
-
>
|
|
228
|
-
<title id="loading-aria">Loading...</title>
|
|
229
|
-
<rect
|
|
230
|
-
x="0"
|
|
231
|
-
y="0"
|
|
232
|
-
width="100%"
|
|
233
|
-
height="100%"
|
|
234
|
-
clipPath="url(#clip-path)"
|
|
235
|
-
style={{ fill: 'url("#fill")' }}
|
|
236
|
-
/>
|
|
237
|
-
<defs>
|
|
238
|
-
<clipPath id="clip-path">
|
|
239
|
-
<rect x="0" y="0" rx="2" ry="2" width="112" height="48" />
|
|
240
|
-
</clipPath>
|
|
241
|
-
<linearGradient id="fill">
|
|
242
|
-
<stop offset="0.599964" stopColor="#f3f3f3" stopOpacity="1">
|
|
243
|
-
<animate
|
|
244
|
-
attributeName="offset"
|
|
245
|
-
values="-2; -2; 1"
|
|
246
|
-
keyTimes="0; 0.25; 1"
|
|
247
|
-
dur="2s"
|
|
248
|
-
repeatCount="indefinite"
|
|
249
|
-
/>
|
|
250
|
-
</stop>
|
|
251
|
-
<stop offset="1.59996" stopColor="#ecebeb" stopOpacity="1">
|
|
252
|
-
<animate
|
|
253
|
-
attributeName="offset"
|
|
254
|
-
values="-1; -1; 2"
|
|
255
|
-
keyTimes="0; 0.25; 1"
|
|
256
|
-
dur="2s"
|
|
257
|
-
repeatCount="indefinite"
|
|
258
|
-
/>
|
|
259
|
-
</stop>
|
|
260
|
-
<stop offset="2.59996" stopColor="#f3f3f3" stopOpacity="1">
|
|
261
|
-
<animate
|
|
262
|
-
attributeName="offset"
|
|
263
|
-
values="0; 0; 3"
|
|
264
|
-
keyTimes="0; 0.25; 1"
|
|
265
|
-
dur="2s"
|
|
266
|
-
repeatCount="indefinite"
|
|
267
|
-
/>
|
|
268
|
-
</stop>
|
|
269
|
-
</linearGradient>
|
|
270
|
-
</defs>
|
|
271
|
-
</svg>
|
|
272
|
-
)
|
|
273
|
-
}
|
|
274
|
-
|
|
275
224
|
export const fragment = gql`
|
|
276
225
|
fragment ProductDetailsFragment_product on StoreProduct {
|
|
277
226
|
id: productID
|
|
@@ -311,14 +260,6 @@ export const fragment = gql`
|
|
|
311
260
|
}
|
|
312
261
|
}
|
|
313
262
|
|
|
314
|
-
breadcrumbList {
|
|
315
|
-
itemListElement {
|
|
316
|
-
item
|
|
317
|
-
name
|
|
318
|
-
position
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
263
|
# Contains necessary info to add this item to cart
|
|
323
264
|
...CartProductItem
|
|
324
265
|
}
|
|
@@ -73,7 +73,7 @@ const DEFAULT_LABELS: ArticleLabels = {
|
|
|
73
73
|
learnMore: 'Learn More',
|
|
74
74
|
} as const
|
|
75
75
|
|
|
76
|
-
function
|
|
76
|
+
function ProductDescription({
|
|
77
77
|
initiallyExpanded = 'first',
|
|
78
78
|
labels: propLabels = {},
|
|
79
79
|
}: Props) {
|
|
@@ -98,7 +98,7 @@ function ProductDetailsContent({
|
|
|
98
98
|
const labels = { ...DEFAULT_LABELS, ...propLabels }
|
|
99
99
|
|
|
100
100
|
return (
|
|
101
|
-
<section data-fs-product-
|
|
101
|
+
<section data-fs-product-description>
|
|
102
102
|
<UIAccordion
|
|
103
103
|
indices={indices}
|
|
104
104
|
onChange={onChange}
|
|
@@ -108,7 +108,7 @@ function ProductDetailsContent({
|
|
|
108
108
|
as="article"
|
|
109
109
|
index={0}
|
|
110
110
|
data-fs-product-details-description
|
|
111
|
-
prefixId="product-
|
|
111
|
+
prefixId="product-description"
|
|
112
112
|
>
|
|
113
113
|
<UIAccordionButton>{labels.description}</UIAccordionButton>
|
|
114
114
|
<UIAccordionPanel>
|
|
@@ -122,7 +122,7 @@ function ProductDetailsContent({
|
|
|
122
122
|
as="article"
|
|
123
123
|
index={1}
|
|
124
124
|
data-fs-product-details-about
|
|
125
|
-
prefixId="product-
|
|
125
|
+
prefixId="product-description"
|
|
126
126
|
>
|
|
127
127
|
<UIAccordionButton>{labels.about}</UIAccordionButton>
|
|
128
128
|
<UIAccordionPanel>
|
|
@@ -215,7 +215,7 @@ function ProductDetailsContent({
|
|
|
215
215
|
className="text__body"
|
|
216
216
|
index={2}
|
|
217
217
|
data-fs-product-details-highlights
|
|
218
|
-
prefixId="product-
|
|
218
|
+
prefixId="product-description"
|
|
219
219
|
>
|
|
220
220
|
<UIAccordionButton>{labels.highlights}</UIAccordionButton>
|
|
221
221
|
<UIAccordionPanel>
|
|
@@ -257,7 +257,7 @@ function ProductDetailsContent({
|
|
|
257
257
|
as="article"
|
|
258
258
|
index={3}
|
|
259
259
|
data-fs-product-details-learn-more
|
|
260
|
-
prefixId="product-
|
|
260
|
+
prefixId="product-description"
|
|
261
261
|
>
|
|
262
262
|
<UIAccordionButton>{labels.learnMore}</UIAccordionButton>
|
|
263
263
|
<UIAccordionPanel>
|
|
@@ -277,4 +277,4 @@ function ProductDetailsContent({
|
|
|
277
277
|
)
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
export default
|
|
280
|
+
export default ProductDescription
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ProductDescription'
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export default function AddToCartLoadingSkeleton() {
|
|
2
|
+
return (
|
|
3
|
+
// Generated via https://skeletonreact.com/.
|
|
4
|
+
<svg
|
|
5
|
+
role="img"
|
|
6
|
+
width="100%"
|
|
7
|
+
height="48"
|
|
8
|
+
aria-labelledby="loading-aria"
|
|
9
|
+
viewBox="0 0 112 48"
|
|
10
|
+
preserveAspectRatio="none"
|
|
11
|
+
>
|
|
12
|
+
<title id="loading-aria">Loading...</title>
|
|
13
|
+
<rect
|
|
14
|
+
x="0"
|
|
15
|
+
y="0"
|
|
16
|
+
width="100%"
|
|
17
|
+
height="100%"
|
|
18
|
+
clipPath="url(#clip-path)"
|
|
19
|
+
style={{ fill: 'url("#fill")' }}
|
|
20
|
+
/>
|
|
21
|
+
<defs>
|
|
22
|
+
<clipPath id="clip-path">
|
|
23
|
+
<rect x="0" y="0" rx="2" ry="2" width="112" height="48" />
|
|
24
|
+
</clipPath>
|
|
25
|
+
<linearGradient id="fill">
|
|
26
|
+
<stop offset="0.599964" stopColor="#f3f3f3" stopOpacity="1">
|
|
27
|
+
<animate
|
|
28
|
+
attributeName="offset"
|
|
29
|
+
values="-2; -2; 1"
|
|
30
|
+
keyTimes="0; 0.25; 1"
|
|
31
|
+
dur="2s"
|
|
32
|
+
repeatCount="indefinite"
|
|
33
|
+
/>
|
|
34
|
+
</stop>
|
|
35
|
+
<stop offset="1.59996" stopColor="#ecebeb" stopOpacity="1">
|
|
36
|
+
<animate
|
|
37
|
+
attributeName="offset"
|
|
38
|
+
values="-1; -1; 2"
|
|
39
|
+
keyTimes="0; 0.25; 1"
|
|
40
|
+
dur="2s"
|
|
41
|
+
repeatCount="indefinite"
|
|
42
|
+
/>
|
|
43
|
+
</stop>
|
|
44
|
+
<stop offset="2.59996" stopColor="#f3f3f3" stopOpacity="1">
|
|
45
|
+
<animate
|
|
46
|
+
attributeName="offset"
|
|
47
|
+
values="0; 0; 3"
|
|
48
|
+
keyTimes="0; 0.25; 1"
|
|
49
|
+
dur="2s"
|
|
50
|
+
repeatCount="indefinite"
|
|
51
|
+
/>
|
|
52
|
+
</stop>
|
|
53
|
+
</linearGradient>
|
|
54
|
+
</defs>
|
|
55
|
+
</svg>
|
|
56
|
+
)
|
|
57
|
+
}
|