@faststore/core 2.0.141-alpha.0 → 2.0.142-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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +6 -0
- package/cms/faststore/sections.json +42 -1
- package/package.json +4 -4
- package/src/components/cart/CartToggle/CartToggle.tsx +4 -4
- package/src/components/cms/GlobalSections.tsx +3 -3
- package/src/components/navigation/Navbar/Navbar.tsx +120 -64
- package/src/components/navigation/Navbar/index.ts +1 -0
- package/src/components/navigation/NavbarLinks/NavbarLinks.tsx +20 -33
- package/src/components/navigation/NavbarSlider/NavbarSlider.tsx +23 -7
- package/src/components/region/RegionButton/RegionButton.tsx +3 -3
- package/src/components/sections/Alert/index.ts +1 -0
- package/src/components/sections/Footer/Footer.tsx +2 -9
- package/src/components/sections/Navbar/Navbar.tsx +85 -0
- package/src/components/sections/Navbar/index.ts +2 -0
- package/src/components/sections/Section/Section.tsx +10 -4
- package/src/components/ui/Button/ButtonSignIn/ButtonSignIn.tsx +12 -3
- package/src/components/ui/Image/Image.tsx +3 -1
- package/src/components/ui/Image/index.ts +1 -0
- package/src/components/ui/Logo/Logo.tsx +23 -2
- package/src/styles/themes/midnight.scss +0 -1
- package/src/styles/themes/soft-blue.scss +0 -1
- package/.next/BUILD_ID +0 -1
- package/.next/build-manifest.json +0 -132
- package/.next/cache/.tsbuildinfo +0 -1
- package/.next/cache/config.json +0 -7
- package/.next/cache/eslint/.cache_1gneedd +0 -1
- package/.next/cache/next-server.js.nft.json +0 -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/export-marker.json +0 -1
- package/.next/images-manifest.json +0 -1
- package/.next/next-server.js.nft.json +0 -1
- package/.next/package.json +0 -1
- package/.next/prerender-manifest.json +0 -1
- package/.next/react-loadable-manifest.json +0 -48
- package/.next/required-server-files.json +0 -1
- package/.next/routes-manifest.json +0 -1
- package/.next/server/chunks/104.js +0 -703
- package/.next/server/chunks/123.js +0 -58
- package/.next/server/chunks/143.js +0 -106
- package/.next/server/chunks/183.js +0 -80
- package/.next/server/chunks/247.js +0 -61
- package/.next/server/chunks/280.js +0 -324
- package/.next/server/chunks/287.js +0 -58
- package/.next/server/chunks/312.js +0 -670
- package/.next/server/chunks/336.js +0 -821
- package/.next/server/chunks/350.js +0 -142
- package/.next/server/chunks/368.js +0 -253
- package/.next/server/chunks/401.js +0 -7241
- package/.next/server/chunks/431.js +0 -7241
- package/.next/server/chunks/502.js +0 -600
- package/.next/server/chunks/557.js +0 -132
- package/.next/server/chunks/576.js +0 -80
- package/.next/server/chunks/597.js +0 -169
- package/.next/server/chunks/608.js +0 -644
- package/.next/server/chunks/644.js +0 -235
- package/.next/server/chunks/664.js +0 -3401
- package/.next/server/chunks/676.js +0 -32
- package/.next/server/chunks/701.js +0 -87
- package/.next/server/chunks/74.js +0 -2520
- package/.next/server/chunks/746.js +0 -225
- package/.next/server/chunks/82.js +0 -371
- package/.next/server/chunks/854.js +0 -72
- package/.next/server/chunks/859.js +0 -959
- package/.next/server/chunks/874.js +0 -487
- package/.next/server/chunks/886.js +0 -120
- package/.next/server/chunks/907.js +0 -1723
- package/.next/server/chunks/98.js +0 -124
- package/.next/server/chunks/font-manifest.json +0 -1
- package/.next/server/font-manifest.json +0 -1
- package/.next/server/middleware-build-manifest.js +0 -1
- package/.next/server/middleware-manifest.json +0 -6
- package/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/.next/server/pages/404.js +0 -393
- package/.next/server/pages/404.js.nft.json +0 -1
- package/.next/server/pages/500.js +0 -395
- package/.next/server/pages/500.js.nft.json +0 -1
- package/.next/server/pages/[...slug].js +0 -725
- package/.next/server/pages/[...slug].js.nft.json +0 -1
- package/.next/server/pages/[slug]/p.js +0 -2386
- package/.next/server/pages/[slug]/p.js.nft.json +0 -1
- package/.next/server/pages/_app.js +0 -368
- package/.next/server/pages/_app.js.nft.json +0 -1
- package/.next/server/pages/_document.js +0 -304
- package/.next/server/pages/_document.js.nft.json +0 -1
- package/.next/server/pages/_error.js +0 -164
- package/.next/server/pages/_error.js.nft.json +0 -1
- package/.next/server/pages/account.js +0 -370
- package/.next/server/pages/account.js.nft.json +0 -1
- package/.next/server/pages/api/graphql.js +0 -315
- package/.next/server/pages/api/graphql.js.nft.json +0 -1
- package/.next/server/pages/api/preview.js +0 -118
- package/.next/server/pages/api/preview.js.nft.json +0 -1
- package/.next/server/pages/checkout.js +0 -370
- package/.next/server/pages/checkout.js.nft.json +0 -1
- package/.next/server/pages/en-US/404.html +0 -81
- package/.next/server/pages/en-US/404.json +0 -1
- package/.next/server/pages/en-US/500.html +0 -81
- package/.next/server/pages/en-US/500.json +0 -1
- package/.next/server/pages/en-US/account.html +0 -81
- package/.next/server/pages/en-US/account.json +0 -1
- package/.next/server/pages/en-US/checkout.html +0 -81
- package/.next/server/pages/en-US/checkout.json +0 -1
- package/.next/server/pages/en-US/login.html +0 -81
- package/.next/server/pages/en-US/login.json +0 -1
- package/.next/server/pages/en-US/s.html +0 -81
- package/.next/server/pages/en-US/s.json +0 -1
- package/.next/server/pages/en-US.html +0 -81
- package/.next/server/pages/en-US.json +0 -1
- package/.next/server/pages/index.js +0 -966
- package/.next/server/pages/index.js.nft.json +0 -1
- package/.next/server/pages/login.js +0 -375
- package/.next/server/pages/login.js.nft.json +0 -1
- package/.next/server/pages/s.js +0 -457
- package/.next/server/pages/s.js.nft.json +0 -1
- package/.next/server/pages-manifest.json +0 -16
- package/.next/server/webpack-api-runtime.js +0 -229
- package/.next/server/webpack-runtime.js +0 -229
- package/.next/static/aYsUeJebfxFmPYaCwqdKq/_buildManifest.js +0 -1
- package/.next/static/aYsUeJebfxFmPYaCwqdKq/_ssgManifest.js +0 -1
- package/.next/static/chunks/143.dd8a556e6957baa1.js +0 -1
- package/.next/static/chunks/170.c17ce564bb568265.js +0 -1
- package/.next/static/chunks/202-80a2f2380b08e20d.js +0 -1
- package/.next/static/chunks/226.b57e10ad9932f88c.js +0 -1
- package/.next/static/chunks/327-43715af4f3fffaf6.js +0 -1
- package/.next/static/chunks/336.0846f48eccce57e4.js +0 -1
- package/.next/static/chunks/366-4a0572a47e2225d9.js +0 -1
- package/.next/static/chunks/391-47b923ef44945418.js +0 -1
- package/.next/static/chunks/495.8ffebac98e9475dc.js +0 -1
- package/.next/static/chunks/502.7fd4f230c33d8eca.js +0 -1
- package/.next/static/chunks/545-1d3d08edfd2ee4c6.js +0 -1
- package/.next/static/chunks/597.c5cf3fbeae5ceb63.js +0 -1
- package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
- package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
- package/.next/static/chunks/98.97381d2021f86cd9.js +0 -1
- package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
- package/.next/static/chunks/main-fd466221927468fd.js +0 -1
- package/.next/static/chunks/pages/404-eb7e8c41c852c36d.js +0 -1
- package/.next/static/chunks/pages/500-7dc597fd3f74e419.js +0 -1
- package/.next/static/chunks/pages/[...slug]-229b8537827404bc.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-a3a8af1949dc6eca.js +0 -1
- package/.next/static/chunks/pages/_app-3e4e7e579cb0681a.js +0 -1
- package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
- package/.next/static/chunks/pages/account-7f4c51b747b4edd0.js +0 -1
- package/.next/static/chunks/pages/checkout-cb8871ab88a1471f.js +0 -1
- package/.next/static/chunks/pages/index-7587d2684d1f1de4.js +0 -1
- package/.next/static/chunks/pages/login-9490b01a047906c0.js +0 -1
- package/.next/static/chunks/pages/s-9582cfca21ff2718.js +0 -1
- package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
- package/.next/static/chunks/webpack-d73d5e1e07f9bee2.js +0 -1
- package/.next/static/css/13a4da555ff5e3be.css +0 -1
- package/.next/static/css/2257f9a5bf751bf1.css +0 -1
- package/.next/static/css/2e00f7ba49c754b3.css +0 -1
- package/.next/static/css/2e9de35e0cb999e0.css +0 -1
- package/.next/static/css/43b1b3821e21630c.css +0 -1
- package/.next/static/css/48af598df5fe042d.css +0 -1
- package/.next/static/css/587c27bbda64e700.css +0 -1
- package/.next/static/css/7701d01af31e31d1.css +0 -1
- package/.next/static/css/e02cdad8fc000339.css +0 -1
- package/.next/static/css/e434797816e17065.css +0 -1
- package/.next/static/media/brandless-neutral.76ddf63a.png +0 -0
- package/.next/trace +0 -68
- package/public/~partytown/debug/partytown-atomics.js +0 -556
- package/public/~partytown/debug/partytown-media.js +0 -374
- package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
- package/public/~partytown/debug/partytown-sw.js +0 -59
- package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
- package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
- package/public/~partytown/debug/partytown.js +0 -72
- package/public/~partytown/partytown-atomics.js +0 -2
- package/public/~partytown/partytown-media.js +0 -2
- package/public/~partytown/partytown-sw.js +0 -2
- package/public/~partytown/partytown.js +0 -2
- /package/src/components/{navigation → sections}/Navbar/section.module.scss +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -26,7 +26,7 @@ Route (pages) Size First Load JS
|
|
|
26
26
|
┌ ● / 2.97 kB 126 kB
|
|
27
27
|
├ └ css/13a4da555ff5e3be.css 7.19 kB
|
|
28
28
|
├ /_app 0 B 77.9 kB
|
|
29
|
-
├ ● /[...slug] 10 kB
|
|
29
|
+
├ ● /[...slug] 10 kB 133 kB
|
|
30
30
|
├ └ css/2e9de35e0cb999e0.css 7.9 kB
|
|
31
31
|
├ ● /[slug]/p 11.4 kB 134 kB
|
|
32
32
|
├ └ css/7701d01af31e31d1.css 10.9 kB
|
|
@@ -37,13 +37,13 @@ Route (pages) Size First Load JS
|
|
|
37
37
|
├ λ /api/preview 0 B 77.9 kB
|
|
38
38
|
├ ● /checkout 659 B 113 kB
|
|
39
39
|
├ ● /login 1.01 kB 113 kB
|
|
40
|
-
└ ● /s
|
|
40
|
+
└ ● /s 995 B 124 kB
|
|
41
41
|
+ First Load JS shared by all 80.7 kB
|
|
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-
|
|
46
|
-
└ css/
|
|
45
|
+
├ chunks/webpack-3c331de8004e61a7.js 2.27 kB
|
|
46
|
+
└ css/923c4a942e57bc91.css 2.81 kB
|
|
47
47
|
|
|
48
48
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
|
49
49
|
○ (Static) automatically rendered as static HTML (uses no initial props)
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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.142-alpha.0](https://github.com/vtex/faststore/compare/v2.0.141-alpha.0...v2.0.142-alpha.0) (2023-05-16)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- Adjust `Navbar` for CMS ([#1756](https://github.com/vtex/faststore/issues/1756)) ([105a8b2](https://github.com/vtex/faststore/commit/105a8b2f69ffd8438532d7c9eb959ed26a567675))
|
|
11
|
+
|
|
6
12
|
## [2.0.141-alpha.0](https://github.com/vtex/faststore/compare/v2.0.140-alpha.0...v2.0.141-alpha.0) (2023-05-16)
|
|
7
13
|
|
|
8
14
|
### Features
|
|
@@ -149,11 +149,12 @@
|
|
|
149
149
|
"title": "Navbar",
|
|
150
150
|
"type": "object",
|
|
151
151
|
"description": "Navbar configuration",
|
|
152
|
-
"required": ["
|
|
152
|
+
"required": ["logo"],
|
|
153
153
|
"properties": {
|
|
154
154
|
"logo": {
|
|
155
155
|
"title": "Logo",
|
|
156
156
|
"type": "object",
|
|
157
|
+
"required": ["src"],
|
|
157
158
|
"properties": {
|
|
158
159
|
"src": {
|
|
159
160
|
"title": "Image",
|
|
@@ -194,6 +195,11 @@
|
|
|
194
195
|
"title": "Call to Action",
|
|
195
196
|
"type": "string",
|
|
196
197
|
"default": "Sign In"
|
|
198
|
+
},
|
|
199
|
+
"myAccountLabel": {
|
|
200
|
+
"title": "My Account Label",
|
|
201
|
+
"type": "string",
|
|
202
|
+
"default": "My Account"
|
|
197
203
|
}
|
|
198
204
|
}
|
|
199
205
|
},
|
|
@@ -272,6 +278,41 @@
|
|
|
272
278
|
}
|
|
273
279
|
}
|
|
274
280
|
}
|
|
281
|
+
},
|
|
282
|
+
"menu": {
|
|
283
|
+
"type": "object",
|
|
284
|
+
"title": "Menu",
|
|
285
|
+
"properties": {
|
|
286
|
+
"icon": {
|
|
287
|
+
"title": "Icon",
|
|
288
|
+
"type": "object",
|
|
289
|
+
"properties": {
|
|
290
|
+
"icon": {
|
|
291
|
+
"title": "Icon",
|
|
292
|
+
"type": "string",
|
|
293
|
+
"enumNames": ["List"],
|
|
294
|
+
"enum": ["List"],
|
|
295
|
+
"default": "List"
|
|
296
|
+
},
|
|
297
|
+
"alt": {
|
|
298
|
+
"title": "Alternative Label",
|
|
299
|
+
"type": "string",
|
|
300
|
+
"default": "List"
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"home": {
|
|
307
|
+
"title": "Home",
|
|
308
|
+
"type": "object",
|
|
309
|
+
"properties": {
|
|
310
|
+
"label": {
|
|
311
|
+
"title": "Go to Home Label",
|
|
312
|
+
"type": "string",
|
|
313
|
+
"default": "Go to Home"
|
|
314
|
+
}
|
|
315
|
+
}
|
|
275
316
|
}
|
|
276
317
|
}
|
|
277
318
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.142-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.142-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.142-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": "d03c47af5c1e66cec599d8dec1fd211c5ec01afc"
|
|
112
112
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
|
+
Icon as UIIcon,
|
|
2
3
|
Badge as UIBadge,
|
|
3
|
-
Icon,
|
|
4
4
|
IconButton as UIIconButton,
|
|
5
5
|
} from '@faststore/ui'
|
|
6
6
|
|
|
7
7
|
import { useCartToggleButton } from 'src/sdk/cart/useCartToggleButton'
|
|
8
8
|
|
|
9
|
-
function CartToggle() {
|
|
9
|
+
function CartToggle({ alt, icon }: { alt: string; icon: string }) {
|
|
10
10
|
const btnProps = useCartToggleButton()
|
|
11
11
|
const totalItems = btnProps['data-items']
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
14
|
<UIIconButton
|
|
15
15
|
data-fs-cart-toggle
|
|
16
|
-
aria-label={
|
|
17
|
-
icon={<
|
|
16
|
+
aria-label={alt}
|
|
17
|
+
icon={<UIIcon name={icon} width={32} height={32} />}
|
|
18
18
|
{...btnProps}
|
|
19
19
|
>
|
|
20
20
|
<UIBadge counter>{totalItems}</UIBadge>
|
|
@@ -7,11 +7,11 @@ import { PageContentType, getPage } from 'src/server/cms'
|
|
|
7
7
|
|
|
8
8
|
import RegionBar from 'src/components/common/RegionBar'
|
|
9
9
|
import Toast from 'src/components/common/Toast'
|
|
10
|
-
import Navbar from 'src/components/navigation/Navbar'
|
|
11
10
|
import RenderSections from './RenderSections'
|
|
12
11
|
|
|
12
|
+
import Alert from 'src/components/sections/Alert'
|
|
13
|
+
import Navbar from 'src/components/sections/Navbar'
|
|
13
14
|
import Footer from 'src/components/sections/Footer'
|
|
14
|
-
import Alert from 'src/components/sections/Alert/Alert'
|
|
15
15
|
|
|
16
16
|
export const GLOBAL_SECTIONS_CONTENT_TYPE = 'globalSections'
|
|
17
17
|
|
|
@@ -23,6 +23,7 @@ export type GlobalSectionsData = {
|
|
|
23
23
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
24
24
|
Alert,
|
|
25
25
|
Footer,
|
|
26
|
+
Navbar,
|
|
26
27
|
...CUSTOM_COMPONENTS,
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -49,7 +50,6 @@ function GlobalSections({
|
|
|
49
50
|
return (
|
|
50
51
|
<>
|
|
51
52
|
<RenderSections sections={firstSections} components={COMPONENTS} />
|
|
52
|
-
<Navbar />
|
|
53
53
|
|
|
54
54
|
<Toast />
|
|
55
55
|
|
|
@@ -1,30 +1,80 @@
|
|
|
1
1
|
import { Suspense, useRef, useState } from 'react'
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
+
useUI,
|
|
5
|
+
useScrollDirection,
|
|
4
6
|
Icon as UIIcon,
|
|
5
|
-
IconButton as UIIconButton,
|
|
6
7
|
Navbar as UINavbar,
|
|
8
|
+
NavbarRow as UINavbarRow,
|
|
9
|
+
IconButton as UIIconButton,
|
|
7
10
|
NavbarButtons as UINavbarButtons,
|
|
8
11
|
NavbarHeader as UINavbarHeader,
|
|
9
|
-
NavbarRow as UINavbarRow,
|
|
10
|
-
useScrollDirection,
|
|
11
|
-
useUI,
|
|
12
12
|
} from '@faststore/ui'
|
|
13
13
|
|
|
14
|
+
import { mark } from 'src/sdk/tests/mark'
|
|
15
|
+
|
|
14
16
|
import CartToggle from 'src/components/cart/CartToggle'
|
|
15
|
-
import type { SearchInputRef } from 'src/components/search/SearchInput'
|
|
16
17
|
import SearchInput from 'src/components/search/SearchInput'
|
|
17
|
-
import {
|
|
18
|
+
import type { SearchInputRef } from 'src/components/search/SearchInput'
|
|
19
|
+
|
|
18
20
|
import Link from 'src/components/ui/Link'
|
|
19
21
|
import Logo from 'src/components/ui/Logo'
|
|
20
|
-
import {
|
|
22
|
+
import { ButtonSignIn, ButtonSignInFallback } from 'src/components/ui/Button'
|
|
21
23
|
|
|
22
24
|
import NavbarLinks from '../NavbarLinks'
|
|
23
25
|
import NavbarSlider from '../NavbarSlider'
|
|
26
|
+
import type { NavbarProps as SectionNavbarProps } from '../../sections/Navbar'
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
export interface NavbarProps {
|
|
29
|
+
/**
|
|
30
|
+
* Logo props.
|
|
31
|
+
*/
|
|
32
|
+
logo: SectionNavbarProps['logo']
|
|
33
|
+
/**
|
|
34
|
+
* Cart props.
|
|
35
|
+
*/
|
|
36
|
+
cart: SectionNavbarProps['cartIcon']
|
|
37
|
+
/**
|
|
38
|
+
* Sign In props.
|
|
39
|
+
*/
|
|
40
|
+
signIn: {
|
|
41
|
+
button: SectionNavbarProps['signInButton']
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Region props.
|
|
45
|
+
*/
|
|
46
|
+
region: {
|
|
47
|
+
icon: string
|
|
48
|
+
label: string
|
|
49
|
+
shouldDisplayRegion: boolean
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Page links.
|
|
53
|
+
*/
|
|
54
|
+
links: SectionNavbarProps['navigation']['pageLinks']
|
|
55
|
+
/**
|
|
56
|
+
* Home props.
|
|
57
|
+
*/
|
|
58
|
+
home: SectionNavbarProps['navigation']['home']
|
|
59
|
+
/**
|
|
60
|
+
* Menu props.
|
|
61
|
+
*/
|
|
62
|
+
menu: SectionNavbarProps['navigation']['menu']
|
|
63
|
+
}
|
|
26
64
|
|
|
27
|
-
function Navbar(
|
|
65
|
+
function Navbar({
|
|
66
|
+
cart,
|
|
67
|
+
logo,
|
|
68
|
+
home,
|
|
69
|
+
links,
|
|
70
|
+
signIn,
|
|
71
|
+
region,
|
|
72
|
+
home: { label: homeLabel },
|
|
73
|
+
signIn: { button: signInButton },
|
|
74
|
+
menu: {
|
|
75
|
+
icon: { icon: menuIcon, alt: menuIconAlt },
|
|
76
|
+
},
|
|
77
|
+
}: NavbarProps) {
|
|
28
78
|
const scrollDirection = useScrollDirection()
|
|
29
79
|
const { openNavbar, navbar: displayNavbar } = useUI()
|
|
30
80
|
const searchMobileRef = useRef<SearchInputRef>(null)
|
|
@@ -36,67 +86,73 @@ function Navbar() {
|
|
|
36
86
|
}
|
|
37
87
|
|
|
38
88
|
return (
|
|
39
|
-
<
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
)}
|
|
89
|
+
<UINavbar scrollDirection={scrollDirection}>
|
|
90
|
+
<UINavbarHeader>
|
|
91
|
+
<UINavbarRow className="layout__content">
|
|
92
|
+
{!searchExpanded && (
|
|
93
|
+
<>
|
|
94
|
+
<UIIconButton
|
|
95
|
+
data-fs-navbar-button-menu
|
|
96
|
+
onClick={openNavbar}
|
|
97
|
+
aria-label={menuIconAlt}
|
|
98
|
+
icon={<UIIcon name={menuIcon} width={32} height={32} />}
|
|
99
|
+
/>
|
|
100
|
+
<Link
|
|
101
|
+
href="/"
|
|
102
|
+
data-fs-navbar-logo
|
|
103
|
+
prefetch={false}
|
|
104
|
+
title={homeLabel}
|
|
105
|
+
aria-label={homeLabel}
|
|
106
|
+
>
|
|
107
|
+
<Logo {...logo} />
|
|
108
|
+
</Link>
|
|
109
|
+
</>
|
|
110
|
+
)}
|
|
62
111
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
/>
|
|
76
|
-
)}
|
|
77
|
-
|
|
78
|
-
<SearchInput
|
|
79
|
-
placeholder=""
|
|
80
|
-
ref={searchMobileRef}
|
|
81
|
-
testId="store-input-mobile"
|
|
82
|
-
buttonTestId="store-input-mobile-button"
|
|
83
|
-
onSearchClick={handlerExpandSearch}
|
|
112
|
+
<SearchInput />
|
|
113
|
+
|
|
114
|
+
<UINavbarButtons searchExpanded={searchExpanded}>
|
|
115
|
+
{searchExpanded && (
|
|
116
|
+
<UIIconButton
|
|
117
|
+
data-fs-button-collapse
|
|
118
|
+
aria-label="Collapse search bar"
|
|
119
|
+
icon={<UIIcon name="CaretLeft" width={32} height={32} />}
|
|
120
|
+
onClick={() => {
|
|
121
|
+
setSearchExpanded(false)
|
|
122
|
+
searchMobileRef.current?.resetSearchInput()
|
|
123
|
+
}}
|
|
84
124
|
/>
|
|
125
|
+
)}
|
|
126
|
+
|
|
127
|
+
<SearchInput
|
|
128
|
+
placeholder=""
|
|
129
|
+
ref={searchMobileRef}
|
|
130
|
+
testId="store-input-mobile"
|
|
131
|
+
buttonTestId="store-input-mobile-button"
|
|
132
|
+
onSearchClick={handlerExpandSearch}
|
|
133
|
+
/>
|
|
85
134
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
135
|
+
<Suspense fallback={<ButtonSignInFallback />}>
|
|
136
|
+
<ButtonSignIn {...signInButton} />
|
|
137
|
+
</Suspense>
|
|
89
138
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
139
|
+
<CartToggle {...cart} />
|
|
140
|
+
</UINavbarButtons>
|
|
141
|
+
</UINavbarRow>
|
|
142
|
+
</UINavbarHeader>
|
|
94
143
|
|
|
95
|
-
|
|
144
|
+
<NavbarLinks links={links} region={region} className="hidden-mobile" />
|
|
96
145
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
146
|
+
{displayNavbar && (
|
|
147
|
+
<NavbarSlider
|
|
148
|
+
home={home}
|
|
149
|
+
logo={logo}
|
|
150
|
+
links={links}
|
|
151
|
+
signIn={signIn}
|
|
152
|
+
region={region}
|
|
153
|
+
/>
|
|
154
|
+
)}
|
|
155
|
+
</UINavbar>
|
|
100
156
|
)
|
|
101
157
|
}
|
|
102
158
|
|
|
@@ -1,57 +1,44 @@
|
|
|
1
1
|
import type { AnchorHTMLAttributes } from 'react'
|
|
2
2
|
|
|
3
|
-
import type { NavbarLinksProps as UINavbarLinksProps } from '@faststore/ui'
|
|
4
3
|
import {
|
|
5
4
|
NavbarLinks as UINavbarLinks,
|
|
6
5
|
NavbarLinksList as UINavbarLinksList,
|
|
7
6
|
NavbarLinksListItem as UINavbarLinksListItem,
|
|
8
7
|
} from '@faststore/ui'
|
|
8
|
+
import type { NavbarLinksProps as UINavbarLinksProps } from '@faststore/ui'
|
|
9
9
|
|
|
10
|
-
import RegionButton from 'src/components/region/RegionButton'
|
|
11
10
|
import Link from 'src/components/ui/Link'
|
|
11
|
+
import RegionButton from 'src/components/region/RegionButton'
|
|
12
|
+
import type { NavbarProps } from 'src/components/navigation/Navbar'
|
|
13
|
+
|
|
12
14
|
import { mark } from 'src/sdk/tests/mark'
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
interface NavbarLinksProps extends UINavbarLinksProps {
|
|
17
|
+
links: NavbarProps['links']
|
|
18
|
+
region: NavbarProps['region']
|
|
15
19
|
/**
|
|
16
20
|
* Callback function when a link is clicked.
|
|
17
21
|
*/
|
|
18
22
|
onClickLink?: AnchorHTMLAttributes<HTMLAnchorElement>['onClick']
|
|
19
23
|
}
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
name: 'Home Appliances',
|
|
28
|
-
href: '/kitchen---home-appliances',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'Computer and Software',
|
|
32
|
-
href: '/computer---software',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: 'Technology',
|
|
36
|
-
href: '/technology',
|
|
37
|
-
},
|
|
38
|
-
]
|
|
39
|
-
|
|
40
|
-
function NavbarLinks({ onClickLink, ...otherProps }: NavbarLinksProps) {
|
|
25
|
+
function NavbarLinks({
|
|
26
|
+
links,
|
|
27
|
+
onClickLink,
|
|
28
|
+
region: { icon: regionIcon, label: regionLabel, shouldDisplayRegion },
|
|
29
|
+
...otherProps
|
|
30
|
+
}: NavbarLinksProps) {
|
|
41
31
|
return (
|
|
42
32
|
<UINavbarLinks {...otherProps}>
|
|
43
33
|
<div className="layout__content">
|
|
44
|
-
|
|
34
|
+
{shouldDisplayRegion && (
|
|
35
|
+
<RegionButton icon={regionIcon} label={regionLabel} />
|
|
36
|
+
)}
|
|
45
37
|
<UINavbarLinksList>
|
|
46
|
-
{
|
|
47
|
-
<UINavbarLinksListItem key={
|
|
48
|
-
<Link
|
|
49
|
-
|
|
50
|
-
href={href}
|
|
51
|
-
prefetch={false}
|
|
52
|
-
onClick={onClickLink}
|
|
53
|
-
>
|
|
54
|
-
{name}
|
|
38
|
+
{links.map(({ url, text }) => (
|
|
39
|
+
<UINavbarLinksListItem key={text}>
|
|
40
|
+
<Link variant="display" href={url} onClick={onClickLink}>
|
|
41
|
+
{text}
|
|
55
42
|
</Link>
|
|
56
43
|
</UINavbarLinksListItem>
|
|
57
44
|
))}
|
|
@@ -12,11 +12,27 @@ import { ButtonSignIn, ButtonSignInFallback } from 'src/components/ui/Button'
|
|
|
12
12
|
import Link from 'src/components/ui/Link'
|
|
13
13
|
import Logo from 'src/components/ui/Logo'
|
|
14
14
|
import { mark } from 'src/sdk/tests/mark'
|
|
15
|
+
|
|
15
16
|
import NavbarLinks from '../NavbarLinks'
|
|
17
|
+
import type { NavbarProps } from '../Navbar'
|
|
18
|
+
|
|
19
|
+
import styles from '../../sections/Navbar/section.module.scss'
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
interface NavbarSliderProps {
|
|
22
|
+
logo: NavbarProps['logo']
|
|
23
|
+
home: NavbarProps['home']
|
|
24
|
+
links: NavbarProps['links']
|
|
25
|
+
region: NavbarProps['region']
|
|
26
|
+
signIn: NavbarProps['signIn']
|
|
27
|
+
}
|
|
18
28
|
|
|
19
|
-
function NavbarSlider(
|
|
29
|
+
function NavbarSlider({
|
|
30
|
+
logo,
|
|
31
|
+
links,
|
|
32
|
+
region,
|
|
33
|
+
home: { label: homeLabel },
|
|
34
|
+
signIn: { button: signInButton },
|
|
35
|
+
}: NavbarSliderProps) {
|
|
20
36
|
const { closeNavbar } = useUI()
|
|
21
37
|
const { fade, fadeOut } = useFadeEffect()
|
|
22
38
|
|
|
@@ -33,19 +49,19 @@ function NavbarSlider() {
|
|
|
33
49
|
<Link
|
|
34
50
|
href="/"
|
|
35
51
|
onClick={fadeOut}
|
|
36
|
-
|
|
37
|
-
|
|
52
|
+
title={homeLabel}
|
|
53
|
+
aria-label={homeLabel}
|
|
38
54
|
data-fs-navbar-slider-logo
|
|
39
55
|
>
|
|
40
|
-
<Logo />
|
|
56
|
+
<Logo {...logo} />
|
|
41
57
|
</Link>
|
|
42
58
|
</UINavbarSliderHeader>
|
|
43
59
|
<UINavbarSliderContent>
|
|
44
|
-
<NavbarLinks onClickLink={fadeOut} />
|
|
60
|
+
<NavbarLinks onClickLink={fadeOut} links={links} region={region} />
|
|
45
61
|
</UINavbarSliderContent>
|
|
46
62
|
<UINavbarSliderFooter>
|
|
47
63
|
<Suspense fallback={<ButtonSignInFallback />}>
|
|
48
|
-
<ButtonSignIn />
|
|
64
|
+
<ButtonSignIn {...signInButton} />
|
|
49
65
|
</Suspense>
|
|
50
66
|
</UINavbarSliderFooter>
|
|
51
67
|
</UINavbarSlider>
|
|
@@ -3,7 +3,7 @@ import { Button as UIButton } from '@faststore/ui'
|
|
|
3
3
|
import { Icon, useUI } from '@faststore/ui'
|
|
4
4
|
import { useSession } from 'src/sdk/session'
|
|
5
5
|
|
|
6
|
-
function RegionButton() {
|
|
6
|
+
function RegionButton({ icon, label }: { icon: string; label: string }) {
|
|
7
7
|
const { openModal } = useUI()
|
|
8
8
|
const { postalCode } = useSession()
|
|
9
9
|
|
|
@@ -11,11 +11,11 @@ function RegionButton() {
|
|
|
11
11
|
<UIButton
|
|
12
12
|
variant="tertiary"
|
|
13
13
|
size="small"
|
|
14
|
-
icon={<Icon name=
|
|
14
|
+
icon={<Icon name={icon} width={18} height={18} weight="bold" />}
|
|
15
15
|
iconPosition="left"
|
|
16
16
|
onClick={openModal}
|
|
17
17
|
>
|
|
18
|
-
{postalCode ??
|
|
18
|
+
{postalCode ?? label}
|
|
19
19
|
</UIButton>
|
|
20
20
|
)
|
|
21
21
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Alert'
|
|
@@ -11,7 +11,7 @@ import UIFooter, {
|
|
|
11
11
|
} from '../../common/Footer'
|
|
12
12
|
import type { FooterLinksProps, FooterSocialProps } from '../../common/Footer'
|
|
13
13
|
|
|
14
|
-
import
|
|
14
|
+
import Logo from 'src/components/ui/Logo'
|
|
15
15
|
import UIIncentives from '../../ui/Incentives'
|
|
16
16
|
import type { Incentive } from '../../ui/Incentives'
|
|
17
17
|
|
|
@@ -61,14 +61,7 @@ const Footer = ({
|
|
|
61
61
|
/>
|
|
62
62
|
</UIFooterNavigation>
|
|
63
63
|
<UIFooterInfo>
|
|
64
|
-
<
|
|
65
|
-
data-fs-footer-logo
|
|
66
|
-
loading="lazy"
|
|
67
|
-
src={logoSrc}
|
|
68
|
-
alt={logoAlt}
|
|
69
|
-
width={112}
|
|
70
|
-
height={119}
|
|
71
|
-
/>
|
|
64
|
+
<Logo alt={logoAlt} src={logoSrc} />
|
|
72
65
|
{showPaymentMethods && (
|
|
73
66
|
<UIPaymentMethods
|
|
74
67
|
flagList={paymentMethods}
|