@faststore/core 2.0.110-alpha.0 → 2.0.113-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 +21 -21
- 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/react-loadable-manifest.json +3 -3
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/3746.js +25 -12
- package/.next/server/chunks/4312.js +1 -1
- package/.next/server/chunks/4371.js +1 -17
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-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.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js.nft.json +1 -1
- package/.next/server/pages/_app.js +415 -341
- package/.next/server/pages/_app.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.html +2 -2
- package/.next/server/pages/s.js.nft.json +1 -1
- package/.next/static/{Hvk4r07gh33rCEJoX5uZS → FoOP4frMbgwDj5doLKiqK}/_buildManifest.js +1 -1
- package/.next/static/chunks/170.79b2f8527e327bca.js +1 -0
- package/.next/static/chunks/{264-f45c6dcd6b439926.js → 264-5b07911df63b8601.js} +1 -1
- package/.next/static/chunks/{996.0cec637399d0f543.js → 996.98e590872c51f815.js} +1 -1
- package/.next/static/chunks/pages/[slug]/{p-9b24055cb30ee7a8.js → p-74cef56b58dadbab.js} +1 -1
- package/.next/static/chunks/pages/_app-501ccc46c846c040.js +1 -0
- package/.next/static/chunks/pages/{index-218f29b878a08dc6.js → index-3aae9f104d28d1a1.js} +1 -1
- package/.next/static/chunks/{webpack-561abbd401db03bc.js → webpack-855ba0986bd6023a.js} +1 -1
- package/.next/static/css/1f987650dd4e39d0.css +1 -0
- package/.next/static/css/231b8c31105a684a.css +1 -0
- package/.next/static/css/6f4d3e91f1d161a8.css +1 -0
- package/.next/trace +64 -64
- package/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +12 -0
- package/package.json +4 -4
- package/src/Layout.tsx +1 -1
- package/src/components/{common → navigation}/Navbar/Navbar.tsx +35 -26
- package/src/components/navigation/Navbar/index.ts +1 -0
- package/src/components/{common/Navbar/NavLinks.tsx → navigation/NavbarLinks/NavbarLinks.tsx} +18 -12
- package/src/components/navigation/NavbarLinks/index.ts +1 -0
- package/src/components/{common/Navbar → navigation/NavbarSlider}/NavbarSlider.tsx +18 -21
- package/src/components/navigation/NavbarSlider/index.ts +1 -0
- package/src/components/product/ProductGrid/ProductGrid.tsx +10 -5
- package/src/components/skeletons/ProductGridSkeleton/ProductGridSkeleton.tsx +1 -2
- package/.next/static/chunks/686.0136918bcab42e72.js +0 -1
- package/.next/static/chunks/pages/_app-9d067ed89f7a4001.js +0 -1
- package/.next/static/css/117ce6f20b7a2e6c.css +0 -1
- package/.next/static/css/70ac3b88af168a4b.css +0 -1
- package/.next/static/css/cf4c6e7294227fd7.css +0 -1
- package/src/components/common/Navbar/NavLinks.stories.mdx +0 -122
- package/src/components/common/Navbar/Navbar.stories.mdx +0 -179
- package/src/components/common/Navbar/NavbarSlider.stories.mdx +0 -108
- package/src/components/common/Navbar/index.ts +0 -3
- package/src/components/common/Navbar/navbar-slider.module.scss +0 -53
- package/src/components/common/Navbar/navbar.module.scss +0 -204
- package/src/components/common/Navbar/navlinks.module.scss +0 -96
- package/src/components/product/ProductGrid/ProductGrid.stories.mdx +0 -96
- package/src/components/product/ProductGrid/product-grid.module.scss +0 -39
- package/src/sdk/ui/useScrollDirection.ts +0 -31
- /package/.next/static/{Hvk4r07gh33rCEJoX5uZS → FoOP4frMbgwDj5doLKiqK}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -26,26 +26,26 @@ info - Finalizing page optimization...
|
|
|
26
26
|
Route (pages) Size First Load JS
|
|
27
27
|
┌ ● / 8.65 kB 117 kB
|
|
28
28
|
├ └ css/3a57acf6e411f24d.css 1.69 kB
|
|
29
|
-
├ /_app 0 B 96.
|
|
29
|
+
├ /_app 0 B 96.7 kB
|
|
30
30
|
├ ● /[...slug] 9.46 kB 122 kB
|
|
31
|
-
├ └ css/
|
|
31
|
+
├ └ css/1f987650dd4e39d0.css 1.33 kB
|
|
32
32
|
├ ● /[slug]/p 16.8 kB 125 kB
|
|
33
33
|
├ └ css/4abccf9803c3c356.css 1.82 kB
|
|
34
|
-
├ ○ /404 665 B
|
|
34
|
+
├ ○ /404 665 B 103 kB
|
|
35
35
|
├ ○ /500 439 B 102 kB
|
|
36
36
|
├ ○ /account 383 B 102 kB
|
|
37
|
-
├ λ /api/graphql 0 B 96.
|
|
38
|
-
├ λ /api/preview 0 B 96.
|
|
37
|
+
├ λ /api/graphql 0 B 96.7 kB
|
|
38
|
+
├ λ /api/preview 0 B 96.7 kB
|
|
39
39
|
├ ○ /checkout 371 B 102 kB
|
|
40
|
-
├ ○ /login 577 B
|
|
40
|
+
├ ○ /login 577 B 103 kB
|
|
41
41
|
└ ○ /s 895 B 113 kB
|
|
42
|
-
└ css/
|
|
42
|
+
└ css/6f4d3e91f1d161a8.css 1.29 kB
|
|
43
43
|
+ First Load JS shared by all 120 kB
|
|
44
44
|
├ chunks/framework-dfd14d7ce6600b03.js 45.3 kB
|
|
45
45
|
├ chunks/main-9746772201fe3ac1.js 23.9 kB
|
|
46
|
-
├ chunks/pages/_app-
|
|
47
|
-
├ chunks/webpack-
|
|
48
|
-
└ css/
|
|
46
|
+
├ chunks/pages/_app-501ccc46c846c040.js 25.4 kB
|
|
47
|
+
├ chunks/webpack-855ba0986bd6023a.js 2.15 kB
|
|
48
|
+
└ css/231b8c31105a684a.css 23.6 kB
|
|
49
49
|
|
|
50
50
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
|
51
51
|
○ (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.113-alpha.0](https://github.com/vtex/faststore/compare/v2.0.112-alpha.0...v2.0.113-alpha.0) (2023-04-24)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- Adds `Navbar` component ([#1720](https://github.com/vtex/faststore/issues/1720)) ([58aac03](https://github.com/vtex/faststore/commit/58aac0366f3a5df042cd46ce9525e5f1af7b9a38))
|
|
11
|
+
|
|
12
|
+
## [2.0.111-alpha.0](https://github.com/vtex/faststore/compare/v2.0.110-alpha.0...v2.0.111-alpha.0) (2023-04-18)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- Adds `ProductGrid` component ([#1719](https://github.com/vtex/faststore/issues/1719)) ([9cbe71f](https://github.com/vtex/faststore/commit/9cbe71f81395297c14b258efdd336b00f6b71071))
|
|
17
|
+
|
|
6
18
|
## [2.0.110-alpha.0](https://github.com/vtex/faststore/compare/v2.0.109-alpha.0...v2.0.110-alpha.0) (2023-04-18)
|
|
7
19
|
|
|
8
20
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.113-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.105-alpha.0",
|
|
33
|
-
"@faststore/components": "^2.0.
|
|
33
|
+
"@faststore/components": "^2.0.113-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.
|
|
36
|
+
"@faststore/ui": "^2.0.113-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": "d98da992d055d403b4beb5b15f74829a017bb763"
|
|
112
112
|
}
|
package/src/Layout.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { lazy, Suspense } from 'react'
|
|
|
4
4
|
import { Icon, useUI } from '@faststore/ui'
|
|
5
5
|
import Alert from 'src/components/common/Alert'
|
|
6
6
|
import Footer from 'src/components/common/Footer'
|
|
7
|
-
import Navbar from 'src/components/
|
|
7
|
+
import Navbar from 'src/components/navigation/Navbar'
|
|
8
8
|
import Toast from 'src/components/common/Toast'
|
|
9
9
|
import RegionBar from 'src/components/region/RegionBar'
|
|
10
10
|
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import { Suspense, useRef, useState } from 'react'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
useUI,
|
|
5
|
+
useScrollDirection,
|
|
6
|
+
Icon as UIIcon,
|
|
7
|
+
IconButton as UIIconButton,
|
|
8
|
+
Navbar as UINavbar,
|
|
9
|
+
NavbarHeader as UINavbarHeader,
|
|
10
|
+
NavbarRow as UINavbarRow,
|
|
11
|
+
NavbarButtons as UINavbarButtons,
|
|
12
|
+
} from '@faststore/ui'
|
|
13
|
+
|
|
4
14
|
import CartToggle from 'src/components/cart/CartToggle'
|
|
5
|
-
import type { SearchInputRef } from 'src/components/search/SearchInput'
|
|
6
15
|
import SearchInput from 'src/components/search/SearchInput'
|
|
7
|
-
import {
|
|
8
|
-
import Link from 'src/components/ui/Link'
|
|
16
|
+
import type { SearchInputRef } from 'src/components/search/SearchInput'
|
|
9
17
|
import Logo from 'src/components/ui/Logo'
|
|
18
|
+
import Link from 'src/components/ui/Link'
|
|
19
|
+
import { ButtonSignIn, ButtonSignInFallback } from 'src/components/ui/Button'
|
|
10
20
|
import { mark } from 'src/sdk/tests/mark'
|
|
11
|
-
import useScrollDirection from 'src/sdk/ui/useScrollDirection'
|
|
12
21
|
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import NavLinks from './NavLinks'
|
|
22
|
+
import NavbarSlider from '../NavbarSlider'
|
|
23
|
+
import NavbarLinks from '../NavbarLinks'
|
|
16
24
|
|
|
17
25
|
function Navbar() {
|
|
18
26
|
const scrollDirection = useScrollDirection()
|
|
@@ -26,19 +34,18 @@ function Navbar() {
|
|
|
26
34
|
}
|
|
27
35
|
|
|
28
36
|
return (
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
className={`${styles.fsNavbar} layout__content-full`}
|
|
37
|
+
<UINavbar
|
|
38
|
+
className="layout__content-full"
|
|
39
|
+
scrollDirection={scrollDirection}
|
|
33
40
|
>
|
|
34
|
-
<
|
|
35
|
-
<
|
|
41
|
+
<UINavbarHeader>
|
|
42
|
+
<UINavbarRow className="layout__content">
|
|
36
43
|
{!searchExpanded && (
|
|
37
44
|
<>
|
|
38
45
|
<UIIconButton
|
|
39
46
|
data-fs-navbar-button-menu
|
|
40
47
|
aria-label="Open Menu"
|
|
41
|
-
icon={<
|
|
48
|
+
icon={<UIIcon name="List" width={32} height={32} />}
|
|
42
49
|
onClick={openNavbar}
|
|
43
50
|
/>
|
|
44
51
|
<Link
|
|
@@ -51,22 +58,22 @@ function Navbar() {
|
|
|
51
58
|
</Link>
|
|
52
59
|
</>
|
|
53
60
|
)}
|
|
61
|
+
|
|
54
62
|
<SearchInput />
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
data-fs-navbar-search-expanded={searchExpanded}
|
|
58
|
-
>
|
|
63
|
+
|
|
64
|
+
<UINavbarButtons searchExpanded={searchExpanded}>
|
|
59
65
|
{searchExpanded && (
|
|
60
66
|
<UIIconButton
|
|
61
67
|
data-fs-button-collapse
|
|
62
68
|
aria-label="Collapse search bar"
|
|
63
|
-
icon={<
|
|
69
|
+
icon={<UIIcon name="CaretLeft" width={32} height={32} />}
|
|
64
70
|
onClick={() => {
|
|
65
71
|
setSearchExpanded(false)
|
|
66
72
|
searchMobileRef.current?.resetSearchInput()
|
|
67
73
|
}}
|
|
68
74
|
/>
|
|
69
75
|
)}
|
|
76
|
+
|
|
70
77
|
<SearchInput
|
|
71
78
|
placeholder=""
|
|
72
79
|
ref={searchMobileRef}
|
|
@@ -74,20 +81,22 @@ function Navbar() {
|
|
|
74
81
|
buttonTestId="store-input-mobile-button"
|
|
75
82
|
onSearchClick={handlerExpandSearch}
|
|
76
83
|
/>
|
|
84
|
+
|
|
77
85
|
<Suspense fallback={<ButtonSignInFallback />}>
|
|
78
86
|
<ButtonSignIn />
|
|
79
87
|
</Suspense>
|
|
88
|
+
|
|
80
89
|
<CartToggle />
|
|
81
|
-
</
|
|
82
|
-
</
|
|
83
|
-
</
|
|
84
|
-
|
|
90
|
+
</UINavbarButtons>
|
|
91
|
+
</UINavbarRow>
|
|
92
|
+
</UINavbarHeader>
|
|
93
|
+
|
|
94
|
+
<NavbarLinks className="hidden-mobile" />
|
|
85
95
|
|
|
86
96
|
{displayNavbar && <NavbarSlider />}
|
|
87
|
-
</
|
|
97
|
+
</UINavbar>
|
|
88
98
|
)
|
|
89
99
|
}
|
|
90
100
|
|
|
91
101
|
Navbar.displayName = 'Navbar'
|
|
92
|
-
|
|
93
102
|
export default mark(Navbar)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Navbar'
|
package/src/components/{common/Navbar/NavLinks.tsx → navigation/NavbarLinks/NavbarLinks.tsx}
RENAMED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import { List as UIList } from '@faststore/ui'
|
|
2
1
|
import type { AnchorHTMLAttributes } from 'react'
|
|
3
2
|
|
|
3
|
+
import type { NavbarLinksProps as UINavbarLinksProps } from '@faststore/ui'
|
|
4
|
+
import { List as UIList, NavbarLinks as UINavbarLinks } from '@faststore/ui'
|
|
5
|
+
|
|
4
6
|
import RegionButton from 'src/components/region/RegionButton'
|
|
5
7
|
import Link from 'src/components/ui/Link'
|
|
6
8
|
import { mark } from 'src/sdk/tests/mark'
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
export interface NavbarLinksProps extends UINavbarLinksProps {
|
|
11
|
+
/**
|
|
12
|
+
* Defines the classes to be applied.
|
|
13
|
+
*/
|
|
14
|
+
className?: string
|
|
15
|
+
/**
|
|
16
|
+
* Defines action to be performed when clicking on a link.
|
|
17
|
+
*/
|
|
11
18
|
onClickLink?: AnchorHTMLAttributes<HTMLAnchorElement>['onClick']
|
|
12
|
-
classes?: string
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
const collections = [
|
|
@@ -31,16 +37,16 @@ const collections = [
|
|
|
31
37
|
},
|
|
32
38
|
]
|
|
33
39
|
|
|
34
|
-
function
|
|
40
|
+
function NavbarLinks({ onClickLink, ...otherProps }: NavbarLinksProps) {
|
|
35
41
|
return (
|
|
36
|
-
<
|
|
42
|
+
<UINavbarLinks {...otherProps}>
|
|
37
43
|
<div className="layout__content">
|
|
38
44
|
<RegionButton />
|
|
39
|
-
<UIList data-fs-
|
|
45
|
+
<UIList data-fs-navbar-links-list>
|
|
40
46
|
{collections.map(({ href, name }) => (
|
|
41
|
-
<li key={name} data-fs-
|
|
47
|
+
<li key={name} data-fs-navbar-links-list-item>
|
|
42
48
|
<Link
|
|
43
|
-
data-fs-
|
|
49
|
+
data-fs-navbar-links-link
|
|
44
50
|
variant="display"
|
|
45
51
|
href={href}
|
|
46
52
|
onClick={onClickLink}
|
|
@@ -51,8 +57,8 @@ function NavLinks({ onClickLink, classes = '' }: NavLinksProps) {
|
|
|
51
57
|
))}
|
|
52
58
|
</UIList>
|
|
53
59
|
</div>
|
|
54
|
-
</
|
|
60
|
+
</UINavbarLinks>
|
|
55
61
|
)
|
|
56
62
|
}
|
|
57
63
|
|
|
58
|
-
export default mark(
|
|
64
|
+
export default mark(NavbarLinks)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './NavbarLinks'
|
|
@@ -1,34 +1,31 @@
|
|
|
1
1
|
import { Suspense } from 'react'
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
useUI,
|
|
4
|
+
useFadeEffect,
|
|
5
|
+
NavbarSlider as UINavbarSlider,
|
|
6
|
+
NavbarSliderHeader as UINavbarSliderHeader,
|
|
7
|
+
NavbarSliderContent as UINavbarSliderContent,
|
|
8
|
+
NavbarSliderFooter as UINavbarSliderFooter,
|
|
5
9
|
} from '@faststore/ui'
|
|
6
10
|
|
|
7
|
-
import {
|
|
11
|
+
import { mark } from 'src/sdk/tests/mark'
|
|
8
12
|
import Link from 'src/components/ui/Link'
|
|
9
13
|
import Logo from 'src/components/ui/Logo'
|
|
10
|
-
import {
|
|
11
|
-
import { useUI } from '@faststore/ui'
|
|
12
|
-
import { useFadeEffect } from '@faststore/ui'
|
|
14
|
+
import { ButtonSignIn, ButtonSignInFallback } from 'src/components/ui/Button'
|
|
13
15
|
|
|
14
|
-
import
|
|
15
|
-
import NavLinks from './NavLinks'
|
|
16
|
+
import NavbarLinks from '../NavbarLinks'
|
|
16
17
|
|
|
17
18
|
function NavbarSlider() {
|
|
18
19
|
const { closeNavbar } = useUI()
|
|
19
20
|
const { fade, fadeOut } = useFadeEffect()
|
|
20
21
|
|
|
21
22
|
return (
|
|
22
|
-
<
|
|
23
|
-
isOpen
|
|
23
|
+
<UINavbarSlider
|
|
24
24
|
fade={fade}
|
|
25
25
|
onDismiss={fadeOut}
|
|
26
|
-
size="full"
|
|
27
|
-
direction="leftSide"
|
|
28
|
-
className={styles.fsNavbarSlider}
|
|
29
26
|
onTransitionEnd={() => fade === 'out' && closeNavbar()}
|
|
30
27
|
>
|
|
31
|
-
<
|
|
28
|
+
<UINavbarSliderHeader onClose={fadeOut}>
|
|
32
29
|
<Link
|
|
33
30
|
href="/"
|
|
34
31
|
onClick={fadeOut}
|
|
@@ -38,16 +35,16 @@ function NavbarSlider() {
|
|
|
38
35
|
>
|
|
39
36
|
<Logo />
|
|
40
37
|
</Link>
|
|
41
|
-
</
|
|
42
|
-
<
|
|
43
|
-
<
|
|
44
|
-
</
|
|
45
|
-
<
|
|
38
|
+
</UINavbarSliderHeader>
|
|
39
|
+
<UINavbarSliderContent>
|
|
40
|
+
<NavbarLinks onClickLink={fadeOut} />
|
|
41
|
+
</UINavbarSliderContent>
|
|
42
|
+
<UINavbarSliderFooter>
|
|
46
43
|
<Suspense fallback={<ButtonSignInFallback />}>
|
|
47
44
|
<ButtonSignIn />
|
|
48
45
|
</Suspense>
|
|
49
|
-
</
|
|
50
|
-
</
|
|
46
|
+
</UINavbarSliderFooter>
|
|
47
|
+
</UINavbarSlider>
|
|
51
48
|
)
|
|
52
49
|
}
|
|
53
50
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './NavbarSlider'
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import ProductGridSkeleton from 'src/components/skeletons/ProductGridSkeleton'
|
|
2
2
|
import type { ProductSummary_ProductFragment } from '@generated/graphql'
|
|
3
|
-
import
|
|
3
|
+
import {
|
|
4
|
+
ProductGrid as UIProductGrid,
|
|
5
|
+
ProductGridItem as UIProductGridItem,
|
|
6
|
+
} from '@faststore/ui'
|
|
4
7
|
|
|
5
8
|
import ProductCard from '../ProductCard'
|
|
6
9
|
|
|
@@ -19,23 +22,25 @@ interface Props {
|
|
|
19
22
|
function ProductGrid({ products, page, pageSize }: Props) {
|
|
20
23
|
const aspectRatio = 1
|
|
21
24
|
|
|
25
|
+
console.log(products)
|
|
26
|
+
|
|
22
27
|
return (
|
|
23
28
|
<ProductGridSkeleton
|
|
24
29
|
aspectRatio={aspectRatio}
|
|
25
30
|
loading={products.length === 0}
|
|
26
31
|
>
|
|
27
|
-
<
|
|
32
|
+
<UIProductGrid>
|
|
28
33
|
{products.map(({ node: product }, idx) => (
|
|
29
|
-
<
|
|
34
|
+
<UIProductGridItem key={`${product.id}`}>
|
|
30
35
|
<ProductCard
|
|
31
36
|
product={product}
|
|
32
37
|
index={pageSize * page + idx + 1}
|
|
33
38
|
bordered
|
|
34
39
|
aspectRatio={aspectRatio}
|
|
35
40
|
/>
|
|
36
|
-
</
|
|
41
|
+
</UIProductGridItem>
|
|
37
42
|
))}
|
|
38
|
-
</
|
|
43
|
+
</UIProductGrid>
|
|
39
44
|
</ProductGridSkeleton>
|
|
40
45
|
)
|
|
41
46
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react'
|
|
2
2
|
|
|
3
3
|
import { ITEMS_PER_PAGE } from 'src/constants'
|
|
4
|
-
import styles from 'src/components/product/ProductGrid/product-grid.module.scss'
|
|
5
4
|
|
|
6
5
|
import ProductCardSkeleton from '../ProductCardSkeleton'
|
|
7
6
|
|
|
@@ -16,7 +15,7 @@ function ProductGridSkeleton({
|
|
|
16
15
|
loading = true,
|
|
17
16
|
}: PropsWithChildren<ProductGridSkeletonProps>) {
|
|
18
17
|
return loading ? (
|
|
19
|
-
<ul
|
|
18
|
+
<ul data-fs-product-grid>
|
|
20
19
|
{Array.from({ length: ITEMS_PER_PAGE }, (_, index) => (
|
|
21
20
|
<li key={String(index)}>
|
|
22
21
|
<ProductCardSkeleton aspectRatio={aspectRatio} bordered />
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[686],{7704:function(e,t,r){"use strict";r.d(t,{YD:function(){return g},df:function(){return h}});var n=r(2784);function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i.apply(this,arguments)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var o=new Map,s=new WeakMap,c=0,l=void 0;function d(e){return Object.keys(e).sort().filter((function(t){return void 0!==e[t]})).map((function(t){return t+"_"+("root"===t?(r=e.root)?(s.has(r)||(c+=1,s.set(r,c.toString())),s.get(r)):"0":e[t]);var r})).toString()}function u(e,t,r,n){if(void 0===r&&(r={}),void 0===n&&(n=l),"undefined"===typeof window.IntersectionObserver&&void 0!==n){var i=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"===typeof r.threshold?r.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),function(){}}var a=function(e){var t=d(e),r=o.get(t);if(!r){var n,i=new Map,a=new IntersectionObserver((function(t){t.forEach((function(t){var r,a=t.isIntersecting&&n.some((function(e){return t.intersectionRatio>=e}));e.trackVisibility&&"undefined"===typeof t.isVisible&&(t.isVisible=a),null==(r=i.get(t.target))||r.forEach((function(e){e(a,t)}))}))}),e);n=a.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),r={id:t,observer:a,elements:i},o.set(t,r)}return r}(r),s=a.id,c=a.observer,u=a.elements,f=u.get(e)||[];return u.has(e)||u.set(e,f),f.push(t),c.observe(e),function(){f.splice(f.indexOf(t),1),0===f.length&&(u.delete(e),c.unobserve(e)),0===u.size&&(c.disconnect(),o.delete(s))}}var f=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function p(e){return"function"!==typeof e.children}var h=function(e){var t,r;function o(t){var r;return(r=e.call(this,t)||this).node=null,r._unobserveCb=null,r.handleNode=function(e){r.node&&(r.unobserve(),e||r.props.triggerOnce||r.props.skip||r.setState({inView:!!r.props.initialInView,entry:void 0})),r.node=e||null,r.observeNode()},r.handleChange=function(e,t){e&&r.props.triggerOnce&&r.unobserve(),p(r.props)||r.setState({inView:e,entry:t}),r.props.onChange&&r.props.onChange(e,t)},r.state={inView:!!t.initialInView,entry:void 0},r}r=e,(t=o).prototype=Object.create(r.prototype),t.prototype.constructor=t,a(t,r);var s=o.prototype;return s.componentDidUpdate=function(e){e.rootMargin===this.props.rootMargin&&e.root===this.props.root&&e.threshold===this.props.threshold&&e.skip===this.props.skip&&e.trackVisibility===this.props.trackVisibility&&e.delay===this.props.delay||(this.unobserve(),this.observeNode())},s.componentWillUnmount=function(){this.unobserve(),this.node=null},s.observeNode=function(){if(this.node&&!this.props.skip){var e=this.props,t=e.threshold,r=e.root,n=e.rootMargin,i=e.trackVisibility,a=e.delay,o=e.fallbackInView;this._unobserveCb=u(this.node,this.handleChange,{threshold:t,root:r,rootMargin:n,trackVisibility:i,delay:a},o)}},s.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},s.render=function(){if(!p(this.props)){var e=this.state,t=e.inView,r=e.entry;return this.props.children({inView:t,entry:r,ref:this.handleNode})}var a=this.props,o=a.children,s=a.as,c=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(a,f);return n.createElement(s||"div",i({ref:this.handleNode},c),o)},o}(n.Component);function g(e){var t=void 0===e?{}:e,r=t.threshold,i=t.delay,a=t.trackVisibility,o=t.rootMargin,s=t.root,c=t.triggerOnce,l=t.skip,d=t.initialInView,f=t.fallbackInView,p=n.useRef(),h=n.useState({inView:!!d}),g=h[0],v=h[1],m=n.useCallback((function(e){void 0!==p.current&&(p.current(),p.current=void 0),l||e&&(p.current=u(e,(function(e,t){v({inView:e,entry:t}),t.isIntersecting&&c&&p.current&&(p.current(),p.current=void 0)}),{root:s,rootMargin:o,threshold:r,trackVisibility:a,delay:i},f))}),[Array.isArray(r)?r.toString():r,s,o,c,l,a,f,i]);(0,n.useEffect)((function(){p.current||!g.entry||c||l||v({inView:!!d})}));var b=[m,g.inView,g.entry];return b.ref=b[0],b.inView=b[1],b.entry=b[2],b}h.displayName="InView",h.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1}},9875:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(2784),i=r(44);var a=({listPrice:e,spotPrice:t,thresholdLow:r=15,thresholdHigh:a=40,size:o,testId:s="fs-discount-badge"})=>{const c=((e,t)=>(0,n.useMemo)((()=>{const r=100*(e-t)/e;return Math.round(r)}),[t,e]))(e,t);if(0===c)return n.createElement(n.Fragment,null);const l=c<=r?"low":c<=a?"medium":"high";return n.createElement(i.Z,{"data-fs-discount-badge":!0,"data-fs-discount-badge-variant":l,size:o,"data-testid":s},c,"% off")}},783:function(e,t,r){"use strict";var n=r(2784),i=r(5045),a=r(2765),o=r(1329);const s=(0,n.forwardRef)((function({children:e,testId:t="fs-rating",length:r=5,value:s=0,icon:c,onChange:l,...d},u){const[f,p]=(0,n.useState)(0),h={"data-fs-rating-icon-outline":!0},g=n.isValidElement(c)?c:n.createElement(i.Z,{name:"Star"});return n.createElement(o.Z,{ref:u,"data-fs-rating":!0,"data-fs-rating-actionable":"function"===typeof l,"data-testid":t,...d},Array.from({length:r}).map(((e,r)=>{const o=r+1;return n.createElement("li",{key:`rating-${r}`,"data-fs-rating-item":o<=(f||s)?"full":o-s>0&&o-s<1?"partial":"empty","data-testid":`${t}-item`},l?n.createElement(a.Z,{"data-fs-rating-button":!0,icon:g,size:"small","aria-label":"rate",onClick:()=>{l(o)},onMouseEnter:()=>p(o),onMouseLeave:()=>p(s)}):n.createElement(n.Fragment,null,n.createElement("div",{"data-fs-rating-icon-wrapper":!0},g),n.isValidElement(c)?n.cloneElement(c,h):n.createElement(i.Z,{name:"Star","data-fs-rating-icon-outline":!0})))})))}));t.Z=s},3432:function(e,t,r){"use strict";r.d(t,{Z:function(){return _}});var n=r(9499),i=r(4730),a=r(2784);var o=(0,a.forwardRef)((function({testId:e="fs-product-card",variant:t="default",bordered:r=!1,outOfStock:n,children:i,...o},s){return a.createElement("article",{ref:s,"data-fs-product-card":n?"out-of-stock":"","data-fs-product-card-variant":t,"data-fs-product-card-bordered":r,"data-testid":e,...o},i)}));var s=(0,a.forwardRef)((function({testId:e="fs-product-card-image",aspectRatio:t=1,children:r,...n},i){return a.createElement("div",{ref:i,"data-fs-product-card-image":!0,"data-testid":e,style:{"--fs-product-card-image-aspect-ratio":t},...n},r)})),c=r(7865),l=r(7549),d=r(783),u=r(5045),f=r(9875),p=r(44),h=r(7578);var g=(0,a.forwardRef)((function({testId:e="fs-product-card-content",title:t,linkProps:r,price:n,outOfStock:i,outOfStockLabel:o="Out of stock",ratingValue:s,showDiscountBadge:g,buttonLabel:v="Add",onButtonClick:m,children:b,...y},O){return a.createElement("section",{ref:O,"data-fs-product-card-content":!0,"data-fs-product-card-badge":g,"data-testid":e,...y},a.createElement("div",{"data-fs-product-card-heading":!0},a.createElement("h3",{"data-fs-product-card-title":!0},a.createElement(c.Z,{...r,title:t},t)),a.createElement("div",{"data-fs-product-card-prices":!0},a.createElement(l.Z,{value:n?.listPrice?n.listPrice:0,formatter:n?.formatter,testId:"list-price","data-value":n?.listPrice,variant:"listing",SRText:"Original price:"}),a.createElement(l.Z,{value:n?.value?n.value:0,formatter:n?.formatter,testId:"price","data-value":n?.value,variant:"spot",SRText:"Sale Price:"})),s&&a.createElement(d.Z,{value:s,icon:a.createElement(u.Z,{name:"Star"})})),g&&!i&&a.createElement(f.Z,{listPrice:n?.listPrice?n.listPrice:0,spotPrice:n?.value?n.value:0}),i&&a.createElement(p.Z,null,o),m&&!i&&a.createElement("div",{"data-fs-product-card-actions":!0},a.createElement(h.Z,{variant:"primary",icon:a.createElement(u.Z,{name:"ShoppingCart"}),iconPosition:"left",size:"small",onClick:m},v)))})),v=r(2154),m=r(5346),b=r(9854),y=r(1664),O=r.n(y),w=r(2322),j=["product","index","bordered","variant","aspectRatio","ratingValue","buttonLabel","onButtonClick","showDiscountBadge"];function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function P(e){var{product:t,index:r,bordered:n=!1,variant:a="default",aspectRatio:c=1,ratingValue:l,buttonLabel:d="Add",onButtonClick:u,showDiscountBadge:f=!0}=e,p=(0,i.Z)(e,j),{sku:h,isVariantOf:{name:y},image:[k],offers:{lowPrice:P,offers:[{listPrice:_,availability:E}]}}=t,S=x(x({},(0,b.w)({product:t,selectedOffer:0,index:r})),{},{as:O(),passHref:!0,legacyBehavior:!1}),V="https://schema.org/InStock"!==E;return(0,w.jsxs)(o,x(x({outOfStock:V,bordered:n,variant:a,"data-fs-product-card-sku":h},p),{},{children:[(0,w.jsx)(s,{aspectRatio:c,children:(0,w.jsx)(v.E,{src:k.url,alt:k.alternateName,width:360,height:360/c,sizes:"(max-width: 768px) 25vw, 30vw",loading:"lazy"})}),(0,w.jsx)(g,{title:y,price:{value:P,listPrice:_,formatter:m.P},ratingValue:l,outOfStock:V,onButtonClick:u,linkProps:S,showDiscountBadge:f})]}))}var _=(0,a.memo)(P)},8686:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return m}});var n=r(7794),i=r(9913),a=r(2981),o=r.n(a),s=r(3432),c=r(2322);var l=function(e){var{products:t,page:r,pageSize:n}=e;return(0,c.jsx)(i.Z,{aspectRatio:1,loading:0===t.length,children:(0,c.jsx)("ul",{"data-fs-product-grid":!0,className:o().fsProductGrid,children:t.map(((e,t)=>{var{node:i}=e;return(0,c.jsx)("li",{children:(0,c.jsx)(s.Z,{product:i,index:n*r+t+1,bordered:!0,aspectRatio:1})},"".concat(i.id))}))})})},d=r(2784),u=r(7704),f=r(1163),p=r(5184);var h=function(e){var{page:t,pageSize:r,products:i,title:a}=e,o=(0,d.useRef)(!1),{ref:s,inView:l}=(0,u.YD)(),{pages:h}=(0,n.R)(),g=(0,f.useRouter)(),{sendViewItemListEvent:v}=(0,p.m)({products:i,title:a,page:t,pageSize:r});return(0,d.useEffect)((()=>{l&&h.length>1&&((e,t)=>{var r=new URL(window.location.href);r.searchParams.get("page")!==e&&(r.searchParams.set("page",e),t.replace(r,void 0,{shallow:!0,scroll:!1}))})(t.toString(),g),l&&!o.current&&i.length&&(v(),o.current=!0)}),[h.length,l,t,g,v,i.length]),(0,c.jsx)("div",{ref:s})},g=r(7028),v=r(763);var m=function(e){var t,{page:r,title:i,showSponsoredProducts:a=!0}=e,o=null!==(t=(0,v.r)(r))&&void 0!==t?t:[],{itemsPerPage:s}=(0,n.R)(),d=a?o.slice(0,2):void 0,u=Math.ceil(s/2),f=0===r&&d&&d.length>1;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(h,{products:o,page:r,pageSize:s,title:i}),f?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l,{products:o.slice(0,u),page:r,pageSize:u}),(0,c.jsxs)("div",{"data-fs-product-listing-sponsored":!0,children:[(0,c.jsx)("h3",{children:"Sponsored"}),(0,c.jsx)(g.Z,{selectedFacets:[{key:"productClusterIds",value:"141"}],title:""})]}),(0,c.jsx)(l,{products:o.slice(u,s),page:r,pageSize:u})]}):(0,c.jsx)(l,{products:o,page:r,pageSize:s})]})}},7028:function(e,t,r){"use strict";r.d(t,{Z:function(){return E}});var n=r(4730),i=r(2784),a=r(7704),o=r(5184),s=r(9499);var c=(0,i.forwardRef)((function({testId:e="store-tiles",children:t,...r},n){const a=i.Children.count(t);const o=3===a?"expanded-first":2===a?"expanded-first-two":"";return i.createElement("ul",{ref:n,"data-fs-tiles":!0,"data-fs-tiles-variant":o,"data-testid":e,...r},t)})),l=r(2044),d=r.n(l),u=r(2322),f=["children"];function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){(0,s.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g=e=>{var{children:t}=e,r=(0,n.Z)(e,f);return(0,u.jsx)(c,h(h({className:d().fsTiles},r),{},{children:t}))};var v=(0,i.forwardRef)((function({testId:e="store-tile",children:t,...r},n){return i.createElement("li",{ref:n,"data-fs-tile":!0,"data-testid":e,...r},t)})),m=r(3432);var b=function(e){var{children:t,loading:r=!0}=e;return r?(0,u.jsx)(g,{children:Array.from({length:3},((e,t)=>{return(0,u.jsx)(v,{children:(0,u.jsx)(j,{index:t+1,aspectRatio:(r=3,n=t,3===r&&0===n||2===r&&(0===n||1===n)?5/3:3/4)})},String(t));var r,n}))}):(0,u.jsx)(u.Fragment,{children:t})},y=r(2928),O=r(4106),w=r.n(O);var j=function(e){var{index:t,aspectRatio:r=1}=e;return(0,u.jsxs)("div",{"data-fs-product-tile-skeleton":!0,className:w().fsProductTileSkeleton,"data-fs-product-tile-skeleton-index":t,children:[(0,u.jsx)("div",{"data-fs-product-tile-skeleton-image":!0,"data-fs-product-tile-skeleton-index":t,style:{"--fs-product-tile-skeleton-image-aspect-ratio":r},children:(0,u.jsx)(y.Z,{size:{width:"auto",height:"100%"},loading:!0})}),(0,u.jsxs)("div",{"data-fs-product-tile-skeleton-content":!0,"data-fs-product-tile-skeleton-index":t,children:[(0,u.jsxs)("div",{"data-fs-product-tile-skeleton-heading":!0,children:[(0,u.jsx)("div",{"data-fs-product-tile-skeleton-text":!0,"data-fs-product-tile-skeleton-index":t,children:(0,u.jsx)(y.Z,{size:{width:"70%",height:"1.5rem"}})}),(0,u.jsx)("div",{"data-fs-product-tile-skeleton-price":!0,children:(0,u.jsx)(y.Z,{size:{width:"60%",height:"1.5rem"}})})]}),(0,u.jsx)("div",{"data-fs-product-tile-skeleton-badge":!0,"data-fs-product-tile-skeleton-index":t,children:(0,u.jsx)(y.Z,{size:{width:"6rem",height:"2rem"},border:"pill"})})]})]})},k=r(737),x=r(8879),P=["title"],_=(e,t)=>3===e&&0===t||2===e&&(0===t||1===t)?5/3:3/4,E=e=>{var t,{title:r}=e,s=(0,n.Z)(e,P),c=(0,i.useRef)(!1),{ref:l,inView:d}=(0,a.YD)(),f=(0,k.kN)(s),p=null!==(t=null===f||void 0===f?void 0:f.edges)&&void 0!==t?t:[],{sendViewItemListEvent:h}=(0,o.m)({products:p,title:r,page:0,pageSize:0});return(0,i.useEffect)((()=>{d&&!c.current&&p.length&&(h(),c.current=!0)}),[d,p.length,h]),0===(null===f||void 0===f?void 0:f.edges.length)?null:(0,u.jsxs)(x.Z,{className:"layout__section layout__content",ref:l,children:[(0,u.jsx)("h2",{className:"text__title-section",children:r}),(0,u.jsx)("div",{children:(0,u.jsx)(b,{loading:!f,children:(0,u.jsx)(g,{children:p.map(((e,t)=>(0,u.jsx)(v,{children:(0,u.jsx)(m.Z,{"data-testid":"tile-card",product:e.node,index:t+1,variant:"wide",aspectRatio:_(p.length,t)})},e.node.id)))})})})]})}},2154:function(e,t,r){"use strict";r.d(t,{E:function(){return w}});var n=r(9499),i=r(4730),a=r(2784),o=r(1608),s=r.n(o),c=r(7183),l="https://".concat(r.n(c)().api.storeId,".vtexassets.com");var d=(e,t)=>{var r,n,i=[l,"unsafe"],a=[];t.trim&&i.push("trim"),t.manualCrop&&i.push((e=>{var{left:t,top:r,right:n,bottom:i}=e;return"".concat(t,"x").concat(r,":").concat(n,"x").concat(i)})(t.manualCrop)),t.fitIn&&i.push("fit-in"),a.push(null!==(r=t.horizontalAlign)&&void 0!==r?r:"center"),a.push(null!==(n=t.verticalAlign)&&void 0!==n?n:"middle"),t.smart&&a.push("smart");var{filters:o}=t;return o&&a.push(function(e){var t=["filters"];return Object.keys(e).forEach((r=>{var n,i=e[r];n=Array.isArray(i)?i.join(","):!0===i?"":String(i),t.push("".concat(r,"(").concat(n,")"))})),t.join(":")}(o)),a.push(encodeURIComponent(e)),(e,r)=>{var n="";return t.flipHorizontal&&(n+="-"),n+="".concat(e,"x"),t.flipVertical&&(n+="-"),n+="".concat(r),[...i,n,...a].join("/")}},u=["src","width","height","options"];function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var p=[1,2,3],h=p[p.length-1],g=e=>{var{src:t,width:r,height:o,options:s={}}=e,c=(0,i.Z)(e,u),{srcSet:l,src:g}=(0,a.useMemo)((()=>{var e=d(t,s),n=p.map((t=>{var n=r*t;return"".concat(e(n,o*t)," ").concat(n,"w")}));return{src:e(r*h,o*h),srcSet:n.join(", ")}}),[o,s,t,r]);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({src:g,srcSet:l,width:"".concat(r,"px"),height:"".concat(o,"px")},c)},v=r(2322),m=["src","width","height","quality"];function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function O(e){var{src:t,width:r,height:n,quality:a}=e,o=(0,i.Z)(e,m),{src:c,alt:l}=g(y({src:String(t),width:Number(r),height:Number(n),options:a?{filters:{quality:a}}:void 0},o));return(0,v.jsx)(s(),y({"data-fs-image":!0,unoptimized:!0,src:c,width:r,height:n,alt:l},o))}O.displayName="Image";var w=(0,a.memo)(O)},5184:function(e,t,r){"use strict";r.d(t,{m:function(){return o}});var n=r(8460),i=r(2784),a=r(5914),o=e=>{var{products:t,title:r,page:o,pageSize:s}=e,{currency:{code:c}}=(0,a.kP)();return{sendViewItemListEvent:(0,i.useCallback)((()=>{(0,n._)({name:"view_item_list",params:{item_list_name:r,item_list_id:r,items:t.map(((e,t)=>{var{node:r}=e;return{item_id:r.isVariantOf.productGroupID,item_name:r.isVariantOf.name,item_brand:r.brand.name,item_variant:r.sku,price:r.offers.offers[0].price,index:o*s+t+1,discount:r.offers.offers[0].listPrice-r.offers.offers[0].price,currency:c,item_variant_name:r.name,product_reference_id:r.gtin}}))}})}),[c,t,r,o,s])}}},9854:function(e,t,r){"use strict";r.d(t,{w:function(){return o}});var n=r(8460),i=r(2784),a=r(5914),o=e=>{var{index:t,product:r,selectedOffer:o}=e,{slug:s}=r,{currency:{code:c}}=(0,a.kP)(),l=(0,i.useCallback)((()=>{(0,n._)({name:"select_item",params:{items:[{item_id:r.isVariantOf.productGroupID,item_name:r.isVariantOf.name,item_brand:r.brand.name,item_variant:r.sku,index:t,price:r.offers.offers[o].price,discount:r.offers.offers[o].listPrice-r.offers.offers[o].price,currency:c,item_variant_name:r.name,product_reference_id:r.gtin}]}}),(0,n._)({name:"search_select_item",params:{url:window.location.href,items:[{item_id:r.isVariantOf.productGroupID,item_variant:r.sku,index:t}]}})}),[c,r,t,o]);return{href:"/".concat(s,"/p"),onClick:l,"data-testid":"product-link"}}},4106:function(e){e.exports={"fs-product-tile-skeleton":"product-tile-skeleton_fs-product-tile-skeleton___HloN",fsProductTileSkeleton:"product-tile-skeleton_fs-product-tile-skeleton___HloN"}},2044:function(e){e.exports={"fs-tiles":"tiles_fs-tiles__N15Au",fsTiles:"tiles_fs-tiles__N15Au"}}}]);
|