@faststore/core 0.3.16 → 2.0.65-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/.storybook/storybook.css +1 -0
- package/.turbo/turbo-build.log +50 -0
- package/.turbo/turbo-lint.log +2 -0
- package/@generated/graphql/index.ts +27 -3
- package/@generated/graphql/persisted.json +1 -1
- package/CHANGELOG.md +127 -169
- package/README.md +2 -2
- package/cypress/integration/analytics.test.js +4 -4
- package/cypress/integration/cart.test.js +2 -2
- package/cypress/integration/plp.test.js +9 -9
- package/package.json +9 -10
- package/src/Layout.tsx +7 -2
- package/src/components/cart/CartItem/CartItem.tsx +30 -71
- package/src/components/cart/CartSidebar/CartSidebar.stories.mdx +1 -1
- package/src/components/cart/CartSidebar/CartSidebar.tsx +13 -17
- package/src/components/cart/CartSidebar/cart-sidebar.module.scss +2 -0
- package/src/components/common/Alert/Alert.tsx +6 -22
- package/src/components/common/Footer/Footer.stories.mdx +1 -1
- package/src/components/common/Footer/Footer.tsx +5 -38
- package/src/components/common/Footer/FooterFlags.tsx +23 -0
- package/src/components/common/Footer/FooterLinks.tsx +16 -12
- package/src/components/common/Footer/footer.module.scss +2 -28
- package/src/components/common/Footer/index.ts +1 -0
- package/src/components/common/Navbar/NavLinks.stories.mdx +1 -1
- package/src/components/common/Navbar/Navbar.stories.mdx +1 -1
- package/src/components/common/Navbar/Navbar.tsx +1 -1
- package/src/components/common/Navbar/NavbarSlider.stories.mdx +1 -1
- package/src/components/common/Navbar/NavbarSlider.tsx +2 -2
- package/src/components/common/Toast/Toast.tsx +1 -1
- package/src/components/product/ProductCard/ProductCard.tsx +44 -59
- package/src/components/product/ProductGrid/ProductGrid.tsx +7 -1
- package/src/components/regionalization/Regionalization.stories.mdx +24 -6
- package/src/components/regionalization/RegionalizationBar/RegionalizationBar.stories.mdx +1 -1
- package/src/components/regionalization/RegionalizationBar/RegionalizationBar.tsx +1 -1
- package/src/components/regionalization/RegionalizationButton/RegionalizationButton.tsx +1 -1
- package/src/components/regionalization/RegionalizationModal/RegionalizationModal.stories.mdx +17 -4
- package/src/components/regionalization/RegionalizationModal/RegionalizationModal.tsx +4 -5
- package/src/components/regionalization/RegionalizationModal/RegionalizationModalContent.tsx +19 -26
- package/src/components/regionalization/RegionalizationModal/regionalization-modal-body.module.scss +25 -0
- package/src/components/search/Filter/Facets.stories.mdx +10 -10
- package/src/components/search/Filter/Facets.tsx +69 -61
- package/src/components/search/Filter/Filter.stories.mdx +1 -1
- package/src/components/search/Filter/Filter.tsx +1 -1
- package/src/components/search/Filter/FilterSlider.stories.mdx +1 -1
- package/src/components/search/Filter/FilterSlider.tsx +2 -2
- package/src/components/search/Filter/facets.module.scss +16 -16
- package/src/components/search/Search.stories.mdx +28 -24
- package/src/components/search/SearchDropdown/SearchDropdown.stories.mdx +0 -1
- package/src/components/search/SearchInput/SearchInput.stories.mdx +0 -1
- package/src/components/search/SearchTop/SearchTop.stories.mdx +0 -1
- package/src/components/sections/Newsletter/Newsletter.stories.mdx +1 -1
- package/src/components/sections/Newsletter/Newsletter.tsx +1 -1
- package/src/components/sections/ProducDetailsContent/ProductDetailsContent.tsx +146 -146
- package/src/components/sections/ProductDetails/ProductDetails.tsx +4 -4
- package/src/components/sections/ProductGallery/ProductGallery.tsx +18 -18
- package/src/components/sections/ProductShelf/ProductShelf.tsx +10 -2
- package/src/components/sections/ProductTiles/ProductTiles.tsx +2 -2
- package/src/components/skeletons/FilterSkeleton/FilterSkeleton.stories.mdx +1 -1
- package/src/components/skeletons/FilterSkeleton/FilterSkeleton.tsx +20 -8
- package/src/components/skeletons/FilterSkeleton/filter-skeleton.module.scss +2 -2
- package/src/components/skeletons/ProductCardSkeleton/ProductCardSkeleton.stories.mdx +6 -69
- package/src/components/skeletons/ProductCardSkeleton/ProductCardSkeleton.tsx +36 -9
- package/src/components/skeletons/ProductCardSkeleton/product-card-skeleton.module.scss +16 -55
- package/src/components/skeletons/ProductGridSkeleton/ProductGridSkeleton.tsx +3 -1
- package/src/components/skeletons/ProductShelfSkeleton/ProductShelfSkeleton.tsx +3 -1
- package/src/components/skeletons/ProductTilesSkeleton/ProductTileSkeleton/ProductTileSkeleton.tsx +18 -17
- package/src/components/skeletons/ProductTilesSkeleton/ProductTileSkeleton/product-tile-skeleton.module.scss +37 -174
- package/src/components/skeletons/ProductTilesSkeleton/ProductTilesSkeleton.tsx +18 -3
- package/src/components/ui/Breadcrumb/Breadcrumb.tsx +17 -16
- package/src/components/ui/Gift/Gift.tsx +18 -27
- package/src/components/ui/SkuSelector/sku-selector.module.scss +1 -1
- package/src/components/ui/SlideOver/SlideOver.stories.mdx +2 -2
- package/src/components/ui/SlideOver/SlideOver.tsx +1 -0
- package/src/components/ui/Tiles/Tiles.stories.mdx +1 -3
- package/src/components/ui/Tiles/tiles.module.scss +11 -13
- package/src/components/ui/Toast/Toast.stories.mdx +1 -1
- package/src/components/ui/Toast/Toast.tsx +1 -1
- package/src/pages/_app.tsx +1 -1
- package/src/sdk/cart/index.ts +5 -0
- package/src/sdk/cart/useBuyButton.ts +1 -1
- package/src/sdk/cart/useCartToggleButton.ts +1 -1
- package/src/styles/vendors/include-media.scss +1 -1
- package/tsconfig.json +4 -6
- package/.eslintrc.json +0 -3
- package/.github/CODEOWNERS +0 -2
- package/.github/workflows/release.yml +0 -42
- package/.release-it.json +0 -32
- package/src/components/cart/CartItem/cart-item.module.scss +0 -68
- package/src/components/product/ProductCard/product-card.module.scss +0 -254
- package/src/components/regionalization/RegionalizationModal/regionalization-modal-content.module.scss +0 -79
- package/src/components/skeletons/Shimmer/Shimmer.tsx +0 -11
- package/src/components/skeletons/Shimmer/index.ts +0 -1
- package/src/components/skeletons/Shimmer/shimmer.module.scss +0 -43
- package/src/components/skeletons/Skeleton/Skeleton.tsx +0 -49
- package/src/components/skeletons/Skeleton/index.ts +0 -1
- package/src/components/skeletons/Skeleton/skeleton.module.scss +0 -77
- package/src/components/skeletons/Skeletons.stories.mdx +0 -177
- package/src/components/ui/Accordion/Accordion.stories.mdx +0 -222
- package/src/components/ui/Accordion/Accordion.tsx +0 -39
- package/src/components/ui/Accordion/AccordionItem.stories.mdx +0 -116
- package/src/components/ui/Accordion/AccordionItem.tsx +0 -82
- package/src/components/ui/Accordion/accordion.module.scss +0 -65
- package/src/components/ui/Accordion/index.ts +0 -2
- package/src/components/ui/Alert/Alert.stories.mdx +0 -164
- package/src/components/ui/Alert/Alert.tsx +0 -81
- package/src/components/ui/Alert/alert.module.scss +0 -93
- package/src/components/ui/Alert/index.ts +0 -1
- package/src/components/ui/Dropdown/Dropdown.stories.mdx +0 -232
- package/src/components/ui/Dropdown/Dropdown.tsx +0 -12
- package/src/components/ui/Dropdown/DropdownButton.tsx +0 -20
- package/src/components/ui/Dropdown/DropdownItem.stories.mdx +0 -139
- package/src/components/ui/Dropdown/DropdownItem.tsx +0 -26
- package/src/components/ui/Dropdown/DropdownMenu.stories.mdx +0 -115
- package/src/components/ui/Dropdown/DropdownMenu.tsx +0 -34
- package/src/components/ui/Dropdown/dropdown.module.scss +0 -101
- package/src/components/ui/Dropdown/index.ts +0 -4
- package/src/components/ui/Gift/Gift.stories.mdx +0 -99
- package/src/components/ui/Gift/gift.module.scss +0 -94
- package/src/components/ui/Modal/Modal.stories.mdx +0 -144
- package/src/components/ui/Modal/Modal.tsx +0 -43
- package/src/components/ui/Modal/index.ts +0 -1
- package/src/components/ui/Modal/modal.module.scss +0 -46
- package/src/components/ui/PriceRange/PriceRange.stories.mdx +0 -192
- package/src/components/ui/PriceRange/PriceRange.tsx +0 -140
- package/src/components/ui/PriceRange/index.ts +0 -1
- package/src/components/ui/PriceRange/price-range.module.scss +0 -176
- package/src/components/ui/ProductTitle/ProductTitle.stories.mdx +0 -105
- package/src/components/ui/ProductTitle/ProductTitle.tsx +0 -11
- package/src/components/ui/ProductTitle/index.ts +0 -1
- package/src/components/ui/ProductTitle/product-title.module.scss +0 -48
- package/src/components/ui/QuantitySelector/QuantitySelector.stories.mdx +0 -246
- package/src/components/ui/QuantitySelector/QuantitySelector.tsx +0 -103
- package/src/components/ui/QuantitySelector/index.ts +0 -1
- package/src/components/ui/QuantitySelector/quantity-selector.module.scss +0 -155
- package/src/sdk/ui/Provider.tsx +0 -151
- package/src/sdk/ui/useFadeEffect.ts +0 -21
|
@@ -6,9 +6,12 @@ import {
|
|
|
6
6
|
TableCell as UITableCell,
|
|
7
7
|
TableRow as UITableRow,
|
|
8
8
|
Icon as UIIcon,
|
|
9
|
+
Accordion as UIAccordion,
|
|
10
|
+
AccordionItem as UIAccordionItem,
|
|
11
|
+
AccordionButton as UIAccordionButton,
|
|
12
|
+
AccordionPanel as UIAccordionPanel,
|
|
9
13
|
} from '@faststore/ui'
|
|
10
14
|
|
|
11
|
-
import Accordion, { AccordionItem } from 'src/components/ui/Accordion'
|
|
12
15
|
import Icon from 'src/components/ui/Icon'
|
|
13
16
|
|
|
14
17
|
import Section from '../Section'
|
|
@@ -100,175 +103,172 @@ function ProductDetailsContent({
|
|
|
100
103
|
|
|
101
104
|
return (
|
|
102
105
|
<Section data-fs-product-details-content>
|
|
103
|
-
<
|
|
104
|
-
|
|
106
|
+
<UIAccordion
|
|
107
|
+
indices={indices}
|
|
105
108
|
onChange={onChange}
|
|
106
109
|
aria-label="Product Details Content"
|
|
107
110
|
>
|
|
108
|
-
<
|
|
111
|
+
<UIAccordionItem
|
|
109
112
|
as="article"
|
|
110
113
|
index={0}
|
|
111
|
-
isExpanded={indices.has(0)}
|
|
112
|
-
buttonLabel={
|
|
113
|
-
<h2 className="text__title-subsection">{labels.description}</h2>
|
|
114
|
-
}
|
|
115
114
|
data-fs-product-details-description
|
|
116
115
|
prefixId="product-details-content"
|
|
117
116
|
>
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
<UIAccordionButton>{labels.description}</UIAccordionButton>
|
|
118
|
+
<UIAccordionPanel>
|
|
119
|
+
<p className="text__body">
|
|
120
|
+
Sony WH-1000XM4 Wireless Industry Leading Noise Canceling Overhead
|
|
121
|
+
Headphones with Mic for Phone-Call and Alexa Voice Control, Black.
|
|
122
|
+
</p>
|
|
123
|
+
</UIAccordionPanel>
|
|
124
|
+
</UIAccordionItem>
|
|
125
|
+
<UIAccordionItem
|
|
124
126
|
as="article"
|
|
125
127
|
index={1}
|
|
126
|
-
isExpanded={indices.has(1)}
|
|
127
|
-
buttonLabel={
|
|
128
|
-
<h2 className="text__title-subsection">{labels.about}</h2>
|
|
129
|
-
}
|
|
130
128
|
data-fs-product-details-about
|
|
131
129
|
prefixId="product-details-content"
|
|
132
130
|
>
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
131
|
+
<UIAccordionButton>{labels.about}</UIAccordionButton>
|
|
132
|
+
<UIAccordionPanel>
|
|
133
|
+
<UITable
|
|
134
|
+
cellPadding={0}
|
|
135
|
+
cellSpacing={0}
|
|
136
|
+
className="text__title-mini-alt"
|
|
137
|
+
>
|
|
138
|
+
<UITableBody>
|
|
139
|
+
<UITableRow>
|
|
140
|
+
<UITableCell variant="header" align="left">
|
|
141
|
+
<UIIcon
|
|
142
|
+
data-fs-accordion-item-button-icon
|
|
143
|
+
component={<Icon name="Ruler" width={18} height={18} />}
|
|
144
|
+
/>
|
|
145
|
+
<span>Width</span>
|
|
146
|
+
</UITableCell>
|
|
147
|
+
<UITableCell align="right">1.50m</UITableCell>
|
|
148
|
+
</UITableRow>
|
|
149
|
+
<UITableRow>
|
|
150
|
+
<UITableCell variant="header" align="left">
|
|
151
|
+
<UIIcon
|
|
152
|
+
data-fs-accordion-item-button-icon
|
|
153
|
+
component={<Icon name="Ruler" width={18} height={18} />}
|
|
154
|
+
/>
|
|
155
|
+
Height
|
|
156
|
+
</UITableCell>
|
|
157
|
+
<UITableCell align="right">1.50m</UITableCell>
|
|
158
|
+
</UITableRow>
|
|
159
|
+
<UITableRow>
|
|
160
|
+
<UITableCell variant="header" align="left">
|
|
161
|
+
<UIIcon
|
|
162
|
+
data-fs-accordion-item-button-icon
|
|
163
|
+
component={<Icon name="Ruler" width={18} height={18} />}
|
|
164
|
+
/>
|
|
165
|
+
Dimensions
|
|
166
|
+
</UITableCell>
|
|
167
|
+
<UITableCell align="right">
|
|
168
|
+
7.27 x 3.03 x 9.94 inches
|
|
169
|
+
</UITableCell>
|
|
170
|
+
</UITableRow>
|
|
171
|
+
<UITableRow>
|
|
172
|
+
<UITableCell variant="header" align="left">
|
|
173
|
+
<UIIcon
|
|
174
|
+
data-fs-accordion-item-button-icon
|
|
175
|
+
component={<Icon name="Bag" width={18} height={18} />}
|
|
176
|
+
/>
|
|
177
|
+
Weight
|
|
178
|
+
</UITableCell>
|
|
179
|
+
<UITableCell align="right">12oz</UITableCell>
|
|
180
|
+
</UITableRow>
|
|
181
|
+
<UITableRow>
|
|
182
|
+
<UITableCell variant="header" align="left">
|
|
183
|
+
<UIIcon
|
|
184
|
+
data-fs-accordion-item-button-icon
|
|
185
|
+
component={
|
|
186
|
+
<Icon name="RocketLaunch" width={18} height={18} />
|
|
187
|
+
}
|
|
188
|
+
/>
|
|
189
|
+
Days to ship
|
|
190
|
+
</UITableCell>
|
|
191
|
+
<UITableCell align="right">11 Days</UITableCell>
|
|
192
|
+
</UITableRow>
|
|
193
|
+
<UITableRow>
|
|
194
|
+
<UITableCell variant="header" align="left">
|
|
195
|
+
<UIIcon
|
|
196
|
+
data-fs-accordion-item-button-icon
|
|
197
|
+
component={
|
|
198
|
+
<Icon name="CircleWavyCheck" width={18} height={18} />
|
|
199
|
+
}
|
|
200
|
+
/>
|
|
201
|
+
Estimated
|
|
202
|
+
</UITableCell>
|
|
203
|
+
<UITableCell align="right">Nov 10th</UITableCell>
|
|
204
|
+
</UITableRow>
|
|
205
|
+
</UITableBody>
|
|
206
|
+
</UITable>
|
|
207
|
+
</UIAccordionPanel>
|
|
208
|
+
</UIAccordionItem>
|
|
209
|
+
<UIAccordionItem
|
|
209
210
|
as="article"
|
|
210
211
|
className="text__body"
|
|
211
212
|
index={2}
|
|
212
|
-
isExpanded={indices.has(2)}
|
|
213
|
-
buttonLabel={
|
|
214
|
-
<h2 className="text__title-subsection">{labels.highlights}</h2>
|
|
215
|
-
}
|
|
216
213
|
data-fs-product-details-highlights
|
|
217
214
|
prefixId="product-details-content"
|
|
218
215
|
>
|
|
219
|
-
<
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
216
|
+
<UIAccordionButton>{labels.highlights}</UIAccordionButton>
|
|
217
|
+
<UIAccordionPanel>
|
|
218
|
+
<UIList marker>
|
|
219
|
+
<li>
|
|
220
|
+
Industry-leading noise canceling with Dual Noise Sensor
|
|
221
|
+
technology
|
|
222
|
+
</li>
|
|
223
|
+
<li>
|
|
224
|
+
Next-level music with Edge-AI, co-developed with Sony Music
|
|
225
|
+
Studios Tokyo
|
|
226
|
+
</li>
|
|
227
|
+
<li>
|
|
228
|
+
Up to 30-hour battery life with quick charging (10 min charge
|
|
229
|
+
for 5 hours of playback)
|
|
230
|
+
</li>
|
|
231
|
+
<li>
|
|
232
|
+
Touch Sensor controls to pause play skip tracks, control volume,
|
|
233
|
+
activate your voice assistant, and answer phone calls
|
|
234
|
+
</li>
|
|
235
|
+
<li>
|
|
236
|
+
Speak-to-chat technology automatically reduces volume during
|
|
237
|
+
conversations
|
|
238
|
+
</li>
|
|
239
|
+
<li>Superior call quality with precise voice pickup</li>
|
|
240
|
+
<li>
|
|
241
|
+
Wearing detection pauses playback when headphones are removed
|
|
242
|
+
</li>
|
|
243
|
+
<li>Seamless multiple-device pairing</li>
|
|
244
|
+
<li>
|
|
245
|
+
Adaptive Sound Control provides a personalized listening
|
|
246
|
+
experience
|
|
247
|
+
</li>
|
|
248
|
+
<li>Updated design relieves pressure for long-lasting comfort</li>
|
|
249
|
+
</UIList>
|
|
250
|
+
</UIAccordionPanel>
|
|
251
|
+
</UIAccordionItem>
|
|
252
|
+
<UIAccordionItem
|
|
252
253
|
as="article"
|
|
253
254
|
index={3}
|
|
254
|
-
isExpanded={indices.has(3)}
|
|
255
|
-
buttonLabel={
|
|
256
|
-
<h2 className="text__title-subsection">{labels.learnMore}</h2>
|
|
257
|
-
}
|
|
258
255
|
data-fs-product-details-learn-more
|
|
259
256
|
prefixId="product-details-content"
|
|
260
257
|
>
|
|
261
|
-
<
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
258
|
+
<UIAccordionButton>{labels.learnMore}</UIAccordionButton>
|
|
259
|
+
<UIAccordionPanel>
|
|
260
|
+
<p className="text__body">
|
|
261
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
262
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
|
|
263
|
+
enim ad minim veniam, quis nostrud exercitation ullamco laboris
|
|
264
|
+
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
265
|
+
reprehenderit in voluptate velit esse cillum dolore eu fugiat
|
|
266
|
+
nulla pariatur. Excepteur sint occaecat cupidatat non proident,
|
|
267
|
+
sunt in culpa qui officia deserunt mollit anim id est laboru.
|
|
268
|
+
</p>
|
|
269
|
+
</UIAccordionPanel>
|
|
270
|
+
</UIAccordionItem>
|
|
271
|
+
</UIAccordion>
|
|
272
272
|
</Section>
|
|
273
273
|
)
|
|
274
274
|
}
|
|
@@ -5,6 +5,8 @@ import { useEffect, useState } from 'react'
|
|
|
5
5
|
import {
|
|
6
6
|
BuyButton as UIBuyButton,
|
|
7
7
|
DiscountBadge as UIDiscountBadge,
|
|
8
|
+
QuantitySelector as UIQuantitySelector,
|
|
9
|
+
ProductTitle as UIProductTitle,
|
|
8
10
|
} from '@faststore/ui'
|
|
9
11
|
|
|
10
12
|
import type { ProductDetailsFragment_ProductFragment } from '@generated/graphql'
|
|
@@ -12,8 +14,6 @@ import OutOfStock from 'src/components/product/OutOfStock'
|
|
|
12
14
|
import Breadcrumb from 'src/components/ui/Breadcrumb'
|
|
13
15
|
import { ImageGallery } from 'src/components/ui/ImageGallery'
|
|
14
16
|
import Price from 'src/components/ui/Price'
|
|
15
|
-
import ProductTitle from 'src/components/ui/ProductTitle'
|
|
16
|
-
import QuantitySelector from 'src/components/ui/QuantitySelector'
|
|
17
17
|
import ShippingSimulation from 'src/components/ui/ShippingSimulation'
|
|
18
18
|
import Selectors from 'src/components/ui/SkuSelector'
|
|
19
19
|
import type { AnalyticsItem } from 'src/sdk/analytics/types'
|
|
@@ -122,7 +122,7 @@ function ProductDetails({ context: staleProduct }: Props) {
|
|
|
122
122
|
|
|
123
123
|
<section data-fs-product-details-body>
|
|
124
124
|
<header data-fs-product-details-title data-fs-product-details-section>
|
|
125
|
-
<
|
|
125
|
+
<UIProductTitle
|
|
126
126
|
title={<h1>{name}</h1>}
|
|
127
127
|
label={
|
|
128
128
|
<UIDiscountBadge
|
|
@@ -167,7 +167,7 @@ function ProductDetails({ context: staleProduct }: Props) {
|
|
|
167
167
|
<p className="price__old text__legend">{formattedListPrice}</p>
|
|
168
168
|
<p className="price__new">{isValidating ? '' : formattedPrice}</p>
|
|
169
169
|
</div> */}
|
|
170
|
-
<
|
|
170
|
+
<UIQuantitySelector min={1} max={10} onChange={setAddQuantity} />
|
|
171
171
|
</section>
|
|
172
172
|
{skuVariants && (
|
|
173
173
|
<Selectors
|
|
@@ -2,16 +2,19 @@ import { useSearch } from '@faststore/sdk'
|
|
|
2
2
|
import { NextSeo } from 'next-seo'
|
|
3
3
|
import { lazy, Suspense } from 'react'
|
|
4
4
|
import type { MouseEvent } from 'react'
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
Button as UIButton,
|
|
7
|
+
LinkButton as UILinkButton,
|
|
8
|
+
Skeleton as UISkeleton,
|
|
9
|
+
} from '@faststore/ui'
|
|
6
10
|
|
|
7
11
|
import Filter from 'src/components/search/Filter'
|
|
8
12
|
import Sort from 'src/components/search/Sort'
|
|
9
13
|
import FilterSkeleton from 'src/components/skeletons/FilterSkeleton'
|
|
10
14
|
import ProductGridSkeleton from 'src/components/skeletons/ProductGridSkeleton'
|
|
11
|
-
import Skeleton from 'src/components/skeletons/Skeleton'
|
|
12
15
|
import Icon from 'src/components/ui/Icon'
|
|
13
16
|
import { mark } from 'src/sdk/tests/mark'
|
|
14
|
-
import { useUI } from '
|
|
17
|
+
import { useUI } from '@faststore/ui'
|
|
15
18
|
|
|
16
19
|
import Section from '../Section'
|
|
17
20
|
import EmptyGallery from './EmptyGallery'
|
|
@@ -74,31 +77,28 @@ function ProductGallery({ title, searchTerm }: Props) {
|
|
|
74
77
|
</div>
|
|
75
78
|
|
|
76
79
|
<div data-fs-product-listing-results-count data-count={totalCount}>
|
|
77
|
-
<
|
|
78
|
-
shimmer
|
|
79
|
-
variant="text"
|
|
80
|
-
loading={!data}
|
|
80
|
+
<UISkeleton
|
|
81
81
|
data-fs-product-listing-results-count-skeleton
|
|
82
|
+
loading={!data}
|
|
83
|
+
size={{ width: '100%', height: '1.5rem' }}
|
|
82
84
|
>
|
|
83
85
|
<h2 data-testid="total-product-count">{totalCount} Results</h2>
|
|
84
|
-
</
|
|
86
|
+
</UISkeleton>
|
|
85
87
|
</div>
|
|
86
88
|
|
|
87
89
|
<div data-fs-product-listing-sort>
|
|
88
|
-
<
|
|
89
|
-
shimmer
|
|
90
|
-
variant="text"
|
|
91
|
-
loading={facets?.length === 0}
|
|
90
|
+
<UISkeleton
|
|
92
91
|
data-fs-product-listing-sort-skeleton
|
|
92
|
+
loading={facets?.length === 0}
|
|
93
|
+
size={{ width: 'auto', height: '1.5rem' }}
|
|
93
94
|
>
|
|
94
95
|
<Sort />
|
|
95
|
-
</
|
|
96
|
+
</UISkeleton>
|
|
96
97
|
|
|
97
|
-
<
|
|
98
|
-
shimmer
|
|
99
|
-
variant="button"
|
|
100
|
-
loading={facets?.length === 0}
|
|
98
|
+
<UISkeleton
|
|
101
99
|
data-fs-product-listing-filter-button-skeleton
|
|
100
|
+
loading={facets?.length === 0}
|
|
101
|
+
size={{ width: '6rem', height: '1.5rem' }}
|
|
102
102
|
>
|
|
103
103
|
<UIButton
|
|
104
104
|
variant="tertiary"
|
|
@@ -110,7 +110,7 @@ function ProductGallery({ title, searchTerm }: Props) {
|
|
|
110
110
|
>
|
|
111
111
|
Filters
|
|
112
112
|
</UIButton>
|
|
113
|
-
</
|
|
113
|
+
</UISkeleton>
|
|
114
114
|
</div>
|
|
115
115
|
|
|
116
116
|
<div data-fs-product-listing-results>
|
|
@@ -24,6 +24,7 @@ function ProductShelf({
|
|
|
24
24
|
const { ref, inView } = useInView()
|
|
25
25
|
const products = useProductsQuery(variables)
|
|
26
26
|
const productEdges = products?.edges ?? []
|
|
27
|
+
const aspectRatio = 1
|
|
27
28
|
|
|
28
29
|
const { sendViewItemListEvent } = useViewItemListEvent({
|
|
29
30
|
products: productEdges,
|
|
@@ -51,11 +52,18 @@ function ProductShelf({
|
|
|
51
52
|
>
|
|
52
53
|
<h2 className="text__title-section layout__content">{title}</h2>
|
|
53
54
|
<div className={styles.fsProductShelf} data-fs-product-shelf>
|
|
54
|
-
<ProductShelfSkeleton
|
|
55
|
+
<ProductShelfSkeleton
|
|
56
|
+
aspectRatio={aspectRatio}
|
|
57
|
+
loading={products === undefined}
|
|
58
|
+
>
|
|
55
59
|
<ul data-fs-product-shelf-items className="layout__content">
|
|
56
60
|
{productEdges.map((product, idx) => (
|
|
57
61
|
<li key={`${product.node.id}`}>
|
|
58
|
-
<ProductCard
|
|
62
|
+
<ProductCard
|
|
63
|
+
product={product.node}
|
|
64
|
+
index={idx + 1}
|
|
65
|
+
aspectRatio={aspectRatio}
|
|
66
|
+
/>
|
|
59
67
|
</li>
|
|
60
68
|
))}
|
|
61
69
|
</ul>
|
|
@@ -25,7 +25,7 @@ const getRatio = (products: number, idx: number) => {
|
|
|
25
25
|
products === NUMBER_ITEMS_TO_EXPAND_FIRST_TWO && (idx === 0 || idx === 1)
|
|
26
26
|
|
|
27
27
|
if (expandsFirstTile || expandsFirstTwoTile) {
|
|
28
|
-
return
|
|
28
|
+
return 5 / 3
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
return 3 / 4
|
|
@@ -60,7 +60,7 @@ const ProductTiles = ({ title, ...variables }: ProductTilesProps) => {
|
|
|
60
60
|
<Section className="layout__section layout__content" ref={ref}>
|
|
61
61
|
<h2 className="text__title-section">{title}</h2>
|
|
62
62
|
<div>
|
|
63
|
-
<ProductTilesSkeleton
|
|
63
|
+
<ProductTilesSkeleton loading={!products}>
|
|
64
64
|
<Tiles>
|
|
65
65
|
{productEdges.map((product, idx) => (
|
|
66
66
|
<Tile key={product.node.id}>
|
|
@@ -31,7 +31,7 @@ The loading placeholder for the <code>Filter</code> component used in PLP.
|
|
|
31
31
|
|
|
32
32
|
## Overview
|
|
33
33
|
|
|
34
|
-
The `FilterSkeleton` component is part of
|
|
34
|
+
The `FilterSkeleton` component is part of Skeletons feature.
|
|
35
35
|
|
|
36
36
|
---
|
|
37
37
|
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react'
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import Skeleton from '../Skeleton'
|
|
3
|
+
import { Skeleton as UISkeleton } from '@faststore/ui'
|
|
5
4
|
import styles from './filter-skeleton.module.scss'
|
|
6
|
-
|
|
7
5
|
interface FilterSkeletonProps {
|
|
8
6
|
/**
|
|
9
7
|
* Control whether skeleton should be visible or not.
|
|
@@ -17,13 +15,27 @@ function FilterSkeleton({
|
|
|
17
15
|
}: PropsWithChildren<FilterSkeletonProps>) {
|
|
18
16
|
return loading ? (
|
|
19
17
|
<div className={styles.fsFilterSkeleton} data-fs-filter-skeleton>
|
|
20
|
-
<
|
|
18
|
+
<UISkeleton
|
|
19
|
+
data-fs-filter-skeleton-text
|
|
20
|
+
size={{ width: '100%', height: '1.5rem' }}
|
|
21
|
+
/>
|
|
21
22
|
|
|
22
23
|
<div data-fs-filter-skeleton-content>
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
<UISkeleton
|
|
25
|
+
data-fs-filter-skeleton-text
|
|
26
|
+
size={{ width: '100%', height: '1.5rem' }}
|
|
27
|
+
shimmer={false}
|
|
28
|
+
/>
|
|
29
|
+
<UISkeleton
|
|
30
|
+
data-fs-filter-skeleton-text
|
|
31
|
+
size={{ width: '100%', height: '1.5rem' }}
|
|
32
|
+
shimmer={false}
|
|
33
|
+
/>
|
|
34
|
+
<UISkeleton
|
|
35
|
+
data-fs-filter-skeleton-text
|
|
36
|
+
size={{ width: '100%', height: '1.5rem' }}
|
|
37
|
+
shimmer={false}
|
|
38
|
+
/>
|
|
27
39
|
</div>
|
|
28
40
|
</div>
|
|
29
41
|
) : (
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
@include media("<notebook") { display: none; }
|
|
30
30
|
|
|
31
|
-
[data-fs-skeleton-
|
|
31
|
+
[data-fs-filter-skeleton-text] {
|
|
32
32
|
max-width: var(--fs-filter-skeleton-title-max-width);
|
|
33
33
|
margin-bottom: var(--fs-filter-skeleton-title-margin-bottom);
|
|
34
34
|
}
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
border: var(--fs-filter-skeleton-content-border-width) solid var(--fs-filter-skeleton-content-border-color);
|
|
43
43
|
border-radius: var(--fs-filter-skeleton-content-border-radius);
|
|
44
44
|
|
|
45
|
-
[data-fs-skeleton
|
|
45
|
+
[data-fs-skeleton] {
|
|
46
46
|
min-width: 100%;
|
|
47
47
|
min-height: var(--fs-filter-skeleton-content-min-height);
|
|
48
48
|
margin-bottom: var(--fs-filter-skeleton-content-margin-bottom);
|