@faststore/core 2.0.173-alpha.0 → 2.0.175-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/.turbo/turbo-build.log +9 -9
  2. package/CHANGELOG.md +6 -0
  3. package/package.json +4 -4
  4. package/src/components/navigation/Navbar/Navbar.tsx +37 -29
  5. package/src/components/navigation/NavbarLinks/NavbarLinks.tsx +9 -9
  6. package/src/components/navigation/NavbarSlider/NavbarSlider.tsx +23 -18
  7. package/src/components/sections/Alert/Alert.tsx +0 -1
  8. package/src/components/sections/BannerNewsletter/BannerNewsletter.tsx +13 -9
  9. package/src/components/sections/BannerNewsletter/section.module.scss +1 -1
  10. package/src/components/sections/BannerText/BannerText.tsx +31 -20
  11. package/src/components/sections/BannerText/Overrides.tsx +30 -0
  12. package/src/components/sections/BannerText/section.module.scss +1 -1
  13. package/src/components/sections/Breadcrumb/Overrides.tsx +27 -0
  14. package/src/components/sections/Hero/Hero.tsx +19 -13
  15. package/src/components/sections/Hero/Overrides.tsx +32 -0
  16. package/src/components/sections/Navbar/Navbar.tsx +6 -6
  17. package/src/components/sections/Navbar/Overrides.tsx +48 -0
  18. package/src/components/sections/ProductDetails/Overrides.tsx +13 -4
  19. package/src/components/sections/ProductDetails/ProductDetails.tsx +7 -7
  20. package/src/components/sections/ProductShelf/Overrides.tsx +34 -0
  21. package/src/components/ui/Breadcrumb/Breadcrumb.tsx +14 -5
  22. package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +9 -8
  23. package/src/components/ui/ProductShelf/ProductShelf.tsx +26 -17
  24. package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +6 -5
  25. package/src/components/ui/SkuSelector/Selectors.tsx +6 -2
  26. package/src/customizations/components/CustomComponent.tsx +9 -0
  27. package/src/customizations/components/overrides/BannerText.tsx +15 -0
  28. package/src/customizations/components/overrides/Breadcrumb.tsx +15 -0
  29. package/src/customizations/components/overrides/Hero.tsx +16 -0
  30. package/src/customizations/components/overrides/Navbar.tsx +24 -0
  31. package/src/customizations/components/overrides/ProductDetails.tsx +6 -4
  32. package/src/customizations/components/overrides/ProductShelf.tsx +11 -5
  33. package/src/typings/overrides.d.ts +54 -17
  34. package/.next/BUILD_ID +0 -1
  35. package/.next/build-manifest.json +0 -123
  36. package/.next/cache/.tsbuildinfo +0 -1
  37. package/.next/cache/config.json +0 -7
  38. package/.next/cache/eslint/.cache_1gneedd +0 -1
  39. package/.next/cache/next-server.js.nft.json +0 -1
  40. package/.next/cache/webpack/client-production/0.pack +0 -0
  41. package/.next/cache/webpack/client-production/index.pack +0 -0
  42. package/.next/cache/webpack/server-production/0.pack +0 -0
  43. package/.next/cache/webpack/server-production/index.pack +0 -0
  44. package/.next/export-marker.json +0 -1
  45. package/.next/images-manifest.json +0 -1
  46. package/.next/next-server.js.nft.json +0 -1
  47. package/.next/package.json +0 -1
  48. package/.next/prerender-manifest.json +0 -1
  49. package/.next/react-loadable-manifest.json +0 -44
  50. package/.next/required-server-files.json +0 -1
  51. package/.next/routes-manifest.json +0 -1
  52. package/.next/server/chunks/123.js +0 -58
  53. package/.next/server/chunks/143.js +0 -106
  54. package/.next/server/chunks/183.js +0 -90
  55. package/.next/server/chunks/205.js +0 -692
  56. package/.next/server/chunks/247.js +0 -61
  57. package/.next/server/chunks/280.js +0 -324
  58. package/.next/server/chunks/287.js +0 -58
  59. package/.next/server/chunks/289.js +0 -229
  60. package/.next/server/chunks/312.js +0 -697
  61. package/.next/server/chunks/350.js +0 -143
  62. package/.next/server/chunks/368.js +0 -253
  63. package/.next/server/chunks/487.js +0 -9142
  64. package/.next/server/chunks/502.js +0 -626
  65. package/.next/server/chunks/576.js +0 -90
  66. package/.next/server/chunks/597.js +0 -211
  67. package/.next/server/chunks/650.js +0 -9142
  68. package/.next/server/chunks/676.js +0 -32
  69. package/.next/server/chunks/701.js +0 -87
  70. package/.next/server/chunks/74.js +0 -3819
  71. package/.next/server/chunks/82.js +0 -371
  72. package/.next/server/chunks/825.js +0 -4039
  73. package/.next/server/chunks/854.js +0 -72
  74. package/.next/server/chunks/859.js +0 -959
  75. package/.next/server/chunks/874.js +0 -487
  76. package/.next/server/chunks/886.js +0 -120
  77. package/.next/server/chunks/907.js +0 -1803
  78. package/.next/server/chunks/970.js +0 -200
  79. package/.next/server/chunks/98.js +0 -124
  80. package/.next/server/chunks/font-manifest.json +0 -1
  81. package/.next/server/font-manifest.json +0 -1
  82. package/.next/server/middleware-build-manifest.js +0 -1
  83. package/.next/server/middleware-manifest.json +0 -6
  84. package/.next/server/middleware-react-loadable-manifest.js +0 -1
  85. package/.next/server/pages/404.js +0 -393
  86. package/.next/server/pages/404.js.nft.json +0 -1
  87. package/.next/server/pages/500.js +0 -395
  88. package/.next/server/pages/500.js.nft.json +0 -1
  89. package/.next/server/pages/[...slug].js +0 -786
  90. package/.next/server/pages/[...slug].js.nft.json +0 -1
  91. package/.next/server/pages/[slug]/p.js +0 -2532
  92. package/.next/server/pages/[slug]/p.js.nft.json +0 -1
  93. package/.next/server/pages/_app.js +0 -281
  94. package/.next/server/pages/_app.js.nft.json +0 -1
  95. package/.next/server/pages/_document.js +0 -340
  96. package/.next/server/pages/_document.js.nft.json +0 -1
  97. package/.next/server/pages/_error.js +0 -164
  98. package/.next/server/pages/_error.js.nft.json +0 -1
  99. package/.next/server/pages/account.js +0 -370
  100. package/.next/server/pages/account.js.nft.json +0 -1
  101. package/.next/server/pages/api/graphql.js +0 -365
  102. package/.next/server/pages/api/graphql.js.nft.json +0 -1
  103. package/.next/server/pages/api/preview.js +0 -119
  104. package/.next/server/pages/api/preview.js.nft.json +0 -1
  105. package/.next/server/pages/checkout.js +0 -370
  106. package/.next/server/pages/checkout.js.nft.json +0 -1
  107. package/.next/server/pages/en-US/404.html +0 -81
  108. package/.next/server/pages/en-US/404.json +0 -1
  109. package/.next/server/pages/en-US/500.html +0 -81
  110. package/.next/server/pages/en-US/500.json +0 -1
  111. package/.next/server/pages/en-US/account.html +0 -81
  112. package/.next/server/pages/en-US/account.json +0 -1
  113. package/.next/server/pages/en-US/checkout.html +0 -81
  114. package/.next/server/pages/en-US/checkout.json +0 -1
  115. package/.next/server/pages/en-US/login.html +0 -81
  116. package/.next/server/pages/en-US/login.json +0 -1
  117. package/.next/server/pages/en-US/s.html +0 -81
  118. package/.next/server/pages/en-US/s.json +0 -1
  119. package/.next/server/pages/en-US.html +0 -81
  120. package/.next/server/pages/en-US.json +0 -1
  121. package/.next/server/pages/index.js +0 -966
  122. package/.next/server/pages/index.js.nft.json +0 -1
  123. package/.next/server/pages/login.js +0 -375
  124. package/.next/server/pages/login.js.nft.json +0 -1
  125. package/.next/server/pages/s.js +0 -473
  126. package/.next/server/pages/s.js.nft.json +0 -1
  127. package/.next/server/pages-manifest.json +0 -16
  128. package/.next/server/webpack-api-runtime.js +0 -229
  129. package/.next/server/webpack-runtime.js +0 -229
  130. package/.next/static/PhpKjbrX2m-wtpeOa39bI/_buildManifest.js +0 -1
  131. package/.next/static/PhpKjbrX2m-wtpeOa39bI/_ssgManifest.js +0 -1
  132. package/.next/static/chunks/0-82274e07cb857231.js +0 -1
  133. package/.next/static/chunks/143.dd8a556e6957baa1.js +0 -1
  134. package/.next/static/chunks/240-8e66b2892f9d8c40.js +0 -1
  135. package/.next/static/chunks/460-08f41a79ff49f7be.js +0 -1
  136. package/.next/static/chunks/495.0ecd099878b2a36d.js +0 -1
  137. package/.next/static/chunks/502.ec90d1859d393d34.js +0 -1
  138. package/.next/static/chunks/597.f8d0595b113c70af.js +0 -1
  139. package/.next/static/chunks/64.ebbe1d2b40f980c7.js +0 -1
  140. package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
  141. package/.next/static/chunks/671-b9052a742f78868a.js +0 -1
  142. package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
  143. package/.next/static/chunks/98.97381d2021f86cd9.js +0 -1
  144. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
  145. package/.next/static/chunks/main-fd466221927468fd.js +0 -1
  146. package/.next/static/chunks/pages/404-1d46047d84c70397.js +0 -1
  147. package/.next/static/chunks/pages/500-e0780a8c9c2b95b9.js +0 -1
  148. package/.next/static/chunks/pages/[...slug]-790467346ef6ea71.js +0 -1
  149. package/.next/static/chunks/pages/[slug]/p-cacfd98badcab1cc.js +0 -1
  150. package/.next/static/chunks/pages/_app-79d333aa6001a806.js +0 -1
  151. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
  152. package/.next/static/chunks/pages/account-e2c5451023a787be.js +0 -1
  153. package/.next/static/chunks/pages/checkout-4f9386de28fa9bab.js +0 -1
  154. package/.next/static/chunks/pages/index-eed785c65060e408.js +0 -1
  155. package/.next/static/chunks/pages/login-2e426ab5bd8af906.js +0 -1
  156. package/.next/static/chunks/pages/s-8dbc6ab055ffb6b3.js +0 -1
  157. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
  158. package/.next/static/chunks/webpack-d62f6560695a4b1b.js +0 -1
  159. package/.next/static/css/13a4da555ff5e3be.css +0 -1
  160. package/.next/static/css/23a9d5dfc051ec6e.css +0 -1
  161. package/.next/static/css/287f5ba239375052.css +0 -1
  162. package/.next/static/css/2e00f7ba49c754b3.css +0 -1
  163. package/.next/static/css/6e41f1b6078c14c1.css +0 -1
  164. package/.next/static/css/7d822a137c54a781.css +0 -1
  165. package/.next/static/css/c6f97f692b2efad9.css +0 -1
  166. package/.next/static/css/d4a0d9df8c6df555.css +0 -1
  167. package/.next/static/css/e02cdad8fc000339.css +0 -1
  168. package/.next/static/css/e2dad288b79896b9.css +0 -1
  169. package/.next/trace +0 -71
  170. package/public/~partytown/debug/partytown-atomics.js +0 -556
  171. package/public/~partytown/debug/partytown-media.js +0 -374
  172. package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
  173. package/public/~partytown/debug/partytown-sw.js +0 -59
  174. package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
  175. package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
  176. package/public/~partytown/debug/partytown.js +0 -72
  177. package/public/~partytown/partytown-atomics.js +0 -2
  178. package/public/~partytown/partytown-media.js +0 -2
  179. package/public/~partytown/partytown-sw.js +0 -2
  180. package/public/~partytown/partytown.js +0 -2
  181. package/src/components/ui/BannerText/BannerText.tsx +0 -69
  182. package/src/components/ui/BannerText/index.ts +0 -2
  183. package/src/components/ui/ProductShelf/Overrides.tsx +0 -10
@@ -21,27 +21,27 @@ info - Generating static pages (7/7)
21
21
  info - Finalizing page optimization...
22
22
 
23
23
  Route (pages) Size First Load JS
24
- ┌ ● / 3.1 kB 125 kB
25
- ├ └ css/13a4da555ff5e3be.css 7.19 kB
24
+ ┌ ● / 3.47 kB 126 kB
25
+ ├ └ css/c7fc1f563fa33060.css 7.18 kB
26
26
  ├ /_app 0 B 77.8 kB
27
- ├ ● /[...slug] 10.1 kB 133 kB
27
+ ├ ● /[...slug] 10.4 kB 134 kB
28
28
  ├ └ css/6e41f1b6078c14c1.css 7.9 kB
29
- ├ ● /[slug]/p 11.7 kB 134 kB
30
- ├ └ css/c6f97f692b2efad9.css 11 kB
29
+ ├ ● /[slug]/p 11.9 kB 135 kB
30
+ ├ └ css/8988ac07eb0af0ca.css 11 kB
31
31
  ├ ○ /404 1.09 kB 113 kB
32
32
  ├ ● /500 1.11 kB 113 kB
33
- ├ ● /account 669 B 112 kB
33
+ ├ ● /account 668 B 113 kB
34
34
  ├ λ /api/graphql 0 B 77.8 kB
35
35
  ├ λ /api/preview 0 B 77.8 kB
36
- ├ ● /checkout 657 B 112 kB
36
+ ├ ● /checkout 658 B 113 kB
37
37
  ├ ● /login 1.01 kB 113 kB
38
38
  └ ● /s 1.11 kB 124 kB
39
39
  + First Load JS shared by all 80.6 kB
40
40
  ├ chunks/framework-dfd14d7ce6600b03.js 45.3 kB
41
41
  ├ chunks/main-fd466221927468fd.js 23.9 kB
42
42
  ├ chunks/pages/_app-79d333aa6001a806.js 6.38 kB
43
- ├ chunks/webpack-d62f6560695a4b1b.js 2.21 kB
44
- └ css/e2dad288b79896b9.css 2.78 kB
43
+ ├ chunks/webpack-9ba6546d294eb768.js 2.21 kB
44
+ └ css/104f0f3ce3be32c6.css 2.79 kB
45
45
 
46
46
  λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
47
47
  ○ (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.175-alpha.0](https://github.com/vtex/faststore/compare/v2.0.174-alpha.0...v2.0.175-alpha.0) (2023-06-02)
7
+
8
+ ### Features
9
+
10
+ - Allows some section's component to be overridable ([#1768](https://github.com/vtex/faststore/issues/1768)) ([e19cba2](https://github.com/vtex/faststore/commit/e19cba222351510ffc91ba130ed61e857e9e6bb5))
11
+
6
12
  ## 2.0.173-alpha.0 (2023-06-01)
7
13
 
8
14
  ### Chores
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "2.0.173-alpha.0",
3
+ "version": "2.0.175-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.173-alpha.0",
33
- "@faststore/components": "^2.0.173-alpha.0",
33
+ "@faststore/components": "^2.0.175-alpha.0",
34
34
  "@faststore/graphql-utils": "^2.0.3-alpha.0",
35
35
  "@faststore/sdk": "^2.0.173-alpha.0",
36
- "@faststore/ui": "^2.0.173-alpha.0",
36
+ "@faststore/ui": "^2.0.175-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": "0f3272fc1c6c0b1c21933b8a06401baded4c3c57"
111
+ "gitHead": "49cd929bd62bf068a51337335d97142703f1c813"
112
112
  }
@@ -1,29 +1,29 @@
1
- import { Suspense, useRef, useState } from 'react'
2
-
3
- import {
4
- Icon as UIIcon,
5
- IconButton as UIIconButton,
6
- Navbar as UINavbar,
7
- NavbarButtons as UINavbarButtons,
8
- NavbarHeader as UINavbarHeader,
9
- NavbarRow as UINavbarRow,
10
- useScrollDirection,
11
- useUI,
12
- } from '@faststore/ui'
1
+ import { useRef, useState } from 'react'
2
+
3
+ import { useUI, useScrollDirection, Icon as UIIcon } from '@faststore/ui'
13
4
 
14
5
  import { mark } from 'src/sdk/tests/mark'
15
6
 
16
- import CartToggle from 'src/components/cart/CartToggle'
17
7
  import type { SearchInputRef } from 'src/components/search/SearchInput'
18
8
  import SearchInput from 'src/components/search/SearchInput'
19
-
20
- import Link from 'src/components/ui/Link'
9
+ import NavbarLinks from 'src/components/navigation/NavbarLinks'
10
+ import NavbarSlider from 'src/components/navigation/NavbarSlider'
11
+ import CartToggle from 'src/components/cart/CartToggle'
21
12
  import Logo from 'src/components/ui/Logo'
13
+ import Link from 'src/components/ui/Link'
22
14
  import { ButtonSignIn } from 'src/components/ui/Button'
23
15
 
24
16
  import type { NavbarProps as SectionNavbarProps } from '../../sections/Navbar'
25
- import NavbarLinks from '../NavbarLinks'
26
- import NavbarSlider from '../NavbarSlider'
17
+
18
+ import { Components, Props } from 'src/components/sections/Navbar/Overrides'
19
+
20
+ const {
21
+ Navbar: NavbarWrapper,
22
+ NavbarHeader,
23
+ NavbarRow,
24
+ NavbarButtons,
25
+ IconButton,
26
+ } = Components
27
27
 
28
28
  export interface NavbarProps {
29
29
  /**
@@ -77,7 +77,10 @@ function Navbar({
77
77
  home: { label: homeLabel },
78
78
  signIn: { button: signInButton },
79
79
  menu: {
80
- icon: { icon: menuIcon, alt: menuIconAlt },
80
+ icon: {
81
+ icon: menuIcon,
82
+ alt: menuIconAlt = Props['IconButton']['aria-label'],
83
+ },
81
84
  },
82
85
  }: NavbarProps) {
83
86
  const scrollDirection = useScrollDirection()
@@ -91,16 +94,17 @@ function Navbar({
91
94
  }
92
95
 
93
96
  return (
94
- <UINavbar scrollDirection={scrollDirection}>
95
- <UINavbarHeader>
96
- <UINavbarRow className="layout__content">
97
+ <NavbarWrapper scrollDirection={scrollDirection} {...Props['Navbar']}>
98
+ <NavbarHeader {...Props['NavbarHeader']}>
99
+ <NavbarRow className="layout__content" {...Props['NavbarRow']}>
97
100
  {!searchExpanded && (
98
101
  <>
99
- <UIIconButton
102
+ <IconButton
100
103
  data-fs-navbar-button-menu
101
104
  onClick={openNavbar}
102
- aria-label={menuIconAlt}
103
105
  icon={<UIIcon name={menuIcon} width={32} height={32} />}
106
+ {...Props['IconButton']}
107
+ aria-label={menuIconAlt}
104
108
  />
105
109
  <Link
106
110
  href="/"
@@ -116,9 +120,12 @@ function Navbar({
116
120
 
117
121
  <SearchInput sort={searchInput?.sort} />
118
122
 
119
- <UINavbarButtons searchExpanded={searchExpanded}>
123
+ <NavbarButtons
124
+ searchExpanded={searchExpanded}
125
+ {...Props['NavbarButtons']}
126
+ >
120
127
  {searchExpanded && (
121
- <UIIconButton
128
+ <IconButton
122
129
  data-fs-button-collapse
123
130
  aria-label="Collapse search bar"
124
131
  icon={<UIIcon name="CaretLeft" width={32} height={32} />}
@@ -126,6 +133,7 @@ function Navbar({
126
133
  setSearchExpanded(false)
127
134
  searchMobileRef.current?.resetSearchInput()
128
135
  }}
136
+ {...Props['IconButton']}
129
137
  />
130
138
  )}
131
139
 
@@ -143,9 +151,9 @@ function Navbar({
143
151
  <ButtonSignIn {...signInButton} />
144
152
 
145
153
  <CartToggle {...cart} />
146
- </UINavbarButtons>
147
- </UINavbarRow>
148
- </UINavbarHeader>
154
+ </NavbarButtons>
155
+ </NavbarRow>
156
+ </NavbarHeader>
149
157
 
150
158
  <NavbarLinks links={links} region={region} className="hidden-mobile" />
151
159
 
@@ -158,7 +166,7 @@ function Navbar({
158
166
  region={region}
159
167
  />
160
168
  )}
161
- </UINavbar>
169
+ </NavbarWrapper>
162
170
  )
163
171
  }
164
172
 
@@ -1,10 +1,6 @@
1
1
  import type { AnchorHTMLAttributes } from 'react'
2
2
 
3
- import {
4
- NavbarLinks as UINavbarLinks,
5
- NavbarLinksList as UINavbarLinksList,
6
- NavbarLinksListItem as UINavbarLinksListItem,
7
- } from '@faststore/ui'
3
+ import { NavbarLinksListItem as UINavbarLinksListItem } from '@faststore/ui'
8
4
  import type { NavbarLinksProps as UINavbarLinksProps } from '@faststore/ui'
9
5
 
10
6
  import Link from 'src/components/ui/Link'
@@ -13,6 +9,10 @@ import type { NavbarProps } from 'src/components/navigation/Navbar'
13
9
 
14
10
  import { mark } from 'src/sdk/tests/mark'
15
11
 
12
+ import { Components, Props } from 'src/components/sections/Navbar/Overrides'
13
+
14
+ const { NavbarLinks: NavbarLinksWrapper, NavbarLinksList } = Components
15
+
16
16
  interface NavbarLinksProps extends UINavbarLinksProps {
17
17
  links: NavbarProps['links']
18
18
  region: NavbarProps['region']
@@ -29,12 +29,12 @@ function NavbarLinks({
29
29
  ...otherProps
30
30
  }: NavbarLinksProps) {
31
31
  return (
32
- <UINavbarLinks {...otherProps}>
32
+ <NavbarLinksWrapper {...otherProps} {...Props['NavbarLinks']}>
33
33
  <div className="layout__content">
34
34
  {shouldDisplayRegion && (
35
35
  <RegionButton icon={regionIcon} label={regionLabel} />
36
36
  )}
37
- <UINavbarLinksList>
37
+ <NavbarLinksList {...Props['NavbarLinksList']}>
38
38
  {links.map(({ url, text }) => (
39
39
  <UINavbarLinksListItem key={text}>
40
40
  <Link variant="display" href={url} onClick={onClickLink}>
@@ -42,9 +42,9 @@ function NavbarLinks({
42
42
  </Link>
43
43
  </UINavbarLinksListItem>
44
44
  ))}
45
- </UINavbarLinksList>
45
+ </NavbarLinksList>
46
46
  </div>
47
- </UINavbarLinks>
47
+ </NavbarLinksWrapper>
48
48
  )
49
49
  }
50
50
 
@@ -1,23 +1,25 @@
1
- import {
2
- NavbarSlider as UINavbarSlider,
3
- NavbarSliderContent as UINavbarSliderContent,
4
- NavbarSliderFooter as UINavbarSliderFooter,
5
- NavbarSliderHeader as UINavbarSliderHeader,
6
- useFadeEffect,
7
- useUI,
8
- } from '@faststore/ui'
1
+ import { useFadeEffect, useUI } from '@faststore/ui'
9
2
  import { Suspense } from 'react'
10
3
 
11
4
  import { ButtonSignIn, ButtonSignInFallback } from 'src/components/ui/Button'
12
5
  import Link from 'src/components/ui/Link'
6
+ import NavbarLinks from 'src/components/navigation/NavbarLinks'
13
7
  import Logo from 'src/components/ui/Logo'
14
8
  import { mark } from 'src/sdk/tests/mark'
15
9
 
16
- import NavbarLinks from '../NavbarLinks'
17
10
  import type { NavbarProps } from '../Navbar'
18
11
 
19
12
  import styles from '../../sections/Navbar/section.module.scss'
20
13
 
14
+ import { Components, Props } from 'src/components/sections/Navbar/Overrides'
15
+
16
+ const {
17
+ NavbarSlider: NavbarSliderWrapper,
18
+ NavbarSliderHeader,
19
+ NavbarSliderContent,
20
+ NavbarSliderFooter,
21
+ } = Components
22
+
21
23
  interface NavbarSliderProps {
22
24
  logo: NavbarProps['logo']
23
25
  home: NavbarProps['home']
@@ -37,15 +39,16 @@ function NavbarSlider({
37
39
  const { fade, fadeOut } = useFadeEffect()
38
40
 
39
41
  return (
40
- <UINavbarSlider
42
+ <NavbarSliderWrapper
41
43
  fade={fade}
42
44
  onDismiss={fadeOut}
43
45
  overlayProps={{
44
46
  className: `section ${styles.section} section-navbar-slider`,
45
47
  }}
46
48
  onTransitionEnd={() => fade === 'out' && closeNavbar()}
49
+ {...Props['NavbarSlider']}
47
50
  >
48
- <UINavbarSliderHeader onClose={fadeOut}>
51
+ <NavbarSliderHeader onClose={fadeOut} {...Props['NavbarSliderHeader']}>
49
52
  <Link
50
53
  href="/"
51
54
  onClick={fadeOut}
@@ -55,14 +58,16 @@ function NavbarSlider({
55
58
  >
56
59
  <Logo {...logo} />
57
60
  </Link>
58
- </UINavbarSliderHeader>
59
- <UINavbarSliderContent>
61
+ </NavbarSliderHeader>
62
+ <NavbarSliderContent {...Props['NavbarSliderContent']}>
60
63
  <NavbarLinks onClickLink={fadeOut} links={links} region={region} />
61
- </UINavbarSliderContent>
62
- <UINavbarSliderFooter>
63
- <ButtonSignIn {...signInButton} />
64
- </UINavbarSliderFooter>
65
- </UINavbarSlider>
64
+ </NavbarSliderContent>
65
+ <NavbarSliderFooter {...Props['NavbarSliderFooter']}>
66
+ <Suspense fallback={<ButtonSignInFallback />}>
67
+ <ButtonSignIn {...signInButton} />
68
+ </Suspense>
69
+ </NavbarSliderFooter>
70
+ </NavbarSliderWrapper>
66
71
  )
67
72
  }
68
73
 
@@ -1,5 +1,4 @@
1
1
  import { Icon as UIIcon } from '@faststore/ui'
2
- import Section from '../Section'
3
2
  import UIAlert from 'src/components/common/Alert'
4
3
 
5
4
  export interface AlertProps {
@@ -1,4 +1,7 @@
1
- import BannerText from 'src/components/ui/BannerText'
1
+ import {
2
+ Banner as UIBanner,
3
+ BannerContent as UIBannerContent,
4
+ } from '@faststore/ui'
2
5
  import Newsletter from '../Newsletter'
3
6
  import Section from '../Section'
4
7
  import styles from './section.module.scss'
@@ -9,14 +12,15 @@ function BannerNewsletter() {
9
12
  className={`${styles.section} section-banner-newsletter layout__content`}
10
13
  >
11
14
  <div data-fs-banner-newsletter>
12
- <BannerText
13
- title="Get to Know Our Next Release"
14
- caption="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam elit nisi, vehicula in turpis sit amet, posuere aliquam nisl. "
15
- actionLabel="Shop Now"
16
- actionPath="/"
17
- variant="secondary"
18
- colorVariant="light"
19
- />
15
+ <UIBanner variant="secondary" colorVariant="light">
16
+ <UIBannerContent
17
+ title="Get to Know Our Next Release"
18
+ caption="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam elit nisi, vehicula in turpis sit amet, posuere aliquam nisl. "
19
+ link="/"
20
+ linkText="Shop Now"
21
+ />
22
+ </UIBanner>
23
+
20
24
  <Newsletter
21
25
  title="Get News and Special Offers!"
22
26
  description="Receive our news and promotions in advance. Enjoy and get 10% off your first purchase. For more information click here."
@@ -1,6 +1,6 @@
1
1
  .section {
2
2
  @import "@faststore/ui/src/components/atoms/Button/styles.scss";
3
3
  @import "@faststore/ui/src/components/molecules/LinkButton/styles.scss";
4
- @import "@faststore/ui/src/components/molecules/Banner/styles.scss";
4
+ @import "@faststore/ui/src/components/organisms/Banner/styles.scss";
5
5
  @import "@faststore/ui/src/components/organisms/BannerNewsletter/styles.scss";
6
6
  }
@@ -1,39 +1,50 @@
1
- import UIBannerText, {
2
- BannerTextProps as UIBannerTextProps,
3
- } from 'src/components/ui/BannerText'
4
- import Section from '../Section'
1
+ import {
2
+ BannerProps as UIBannerProps,
3
+ BannerContentProps as UIBannerContentProps,
4
+ } from '@faststore/ui'
5
+ import { Components, Props } from './Overrides'
5
6
 
7
+ import Section from '../Section'
6
8
  import styles from './section.module.scss'
7
9
 
8
10
  export interface BannerTextProps {
9
- title: string
10
- caption: string
11
+ title: UIBannerContentProps['title']
12
+ caption: UIBannerContentProps['caption']
11
13
  link?: {
12
- text: string
13
- url: string
14
+ text?: string
15
+ url?: string
14
16
  }
15
- colorVariant?: UIBannerTextProps['colorVariant']
16
- variant?: UIBannerTextProps['variant']
17
+ colorVariant?: UIBannerProps['colorVariant']
18
+ variant?: UIBannerProps['variant']
17
19
  }
18
20
 
21
+ const { Banner, BannerContent } = Components
22
+
19
23
  // TODO: Change actionPath and actionLabel with Link
20
24
  function BannerText({
21
25
  title,
22
26
  caption,
23
27
  link,
24
- variant,
25
- colorVariant = 'main',
28
+ variant = Props['BannerText'].variant ?? 'primary',
29
+ colorVariant = Props['BannerText'].colorVariant ?? 'main',
26
30
  }: BannerTextProps) {
27
31
  return (
28
32
  <Section className={`${styles.section} section-banner layout__section`}>
29
- <UIBannerText
30
- variant={variant}
31
- title={title}
32
- caption={caption}
33
- actionPath={link?.url}
34
- actionLabel={link?.text}
35
- colorVariant={colorVariant}
36
- />
33
+ <div className="layout__content">
34
+ <Banner
35
+ variant={variant}
36
+ colorVariant={colorVariant}
37
+ {...Props['Banner']}
38
+ >
39
+ <BannerContent
40
+ title={title}
41
+ caption={caption}
42
+ link={link?.url}
43
+ linkText={link?.text}
44
+ {...Props['BannerContent']}
45
+ />
46
+ </Banner>
47
+ </div>
37
48
  </Section>
38
49
  )
39
50
  }
@@ -0,0 +1,30 @@
1
+ import {
2
+ Banner as UIBanner,
3
+ BannerContent as UIBannerContent,
4
+ } from '@faststore/ui'
5
+
6
+ import BannerTextCustomizations from 'src/customizations/components/overrides/BannerText'
7
+
8
+ const bannerTextComponentsCustomization = {}
9
+
10
+ const bannerTextPropsCustomization = {} as any
11
+
12
+ Object.entries(BannerTextCustomizations.components).forEach(([key, value]) => {
13
+ if (value.Component) {
14
+ bannerTextComponentsCustomization[key] = value.Component
15
+ }
16
+ })
17
+
18
+ Object.entries(BannerTextCustomizations.components).forEach(([key, value]) => {
19
+ if (value.props) {
20
+ bannerTextPropsCustomization[key] = value.props
21
+ }
22
+ })
23
+
24
+ const Components = {
25
+ Banner: UIBanner,
26
+ BannerContent: UIBannerContent,
27
+ ...bannerTextComponentsCustomization,
28
+ }
29
+
30
+ export { Components, bannerTextPropsCustomization as Props }
@@ -1,5 +1,5 @@
1
1
  .section {
2
2
  @import "@faststore/ui/src/components/atoms/Button/styles";
3
3
  @import "@faststore/ui/src/components/molecules/LinkButton/styles";
4
- @import "@faststore/ui/src/components/molecules/Banner/styles";
4
+ @import "@faststore/ui/src/components/organisms/Banner/styles";
5
5
  }
@@ -0,0 +1,27 @@
1
+ import { Breadcrumb as UIBreadcrumb, Icon as UIIcon } from '@faststore/ui'
2
+
3
+ import BreadcrumbCustomizations from 'src/customizations/components/overrides/Breadcrumb'
4
+
5
+ const breadcrumbComponentsCustomization = {}
6
+
7
+ const breadcrumbPropsCustomization = {} as any
8
+
9
+ Object.entries(BreadcrumbCustomizations.components).forEach(([key, value]) => {
10
+ if (value.Component) {
11
+ breadcrumbComponentsCustomization[key] = value.Component
12
+ }
13
+ })
14
+
15
+ Object.entries(BreadcrumbCustomizations.components).forEach(([key, value]) => {
16
+ if (value.props) {
17
+ breadcrumbPropsCustomization[key] = value.props
18
+ }
19
+ })
20
+
21
+ const Components = {
22
+ Breadcrumb: UIBreadcrumb,
23
+ Icon: UIIcon,
24
+ ...breadcrumbComponentsCustomization,
25
+ }
26
+
27
+ export { Components, breadcrumbPropsCustomization as Props }
@@ -1,9 +1,8 @@
1
- import type { HeroProps as UIHeroProps } from '@faststore/ui'
2
1
  import {
3
- Hero as UIHero,
4
- HeroHeader as UIHeroHeader,
5
- HeroImage as UIHeroImage,
2
+ HeroProps as UIHeroProps,
3
+ HeroHeaderProps as UIHeroHeaderProps,
6
4
  } from '@faststore/ui'
5
+ import { Components, Props } from './Overrides'
7
6
  import { ReactNode } from 'react'
8
7
  import { Image } from 'src/components/ui/Image'
9
8
  import Section from '../Section'
@@ -11,8 +10,8 @@ import Section from '../Section'
11
10
  import styles from './section.module.scss'
12
11
 
13
12
  export type HeroProps = {
14
- title: string
15
- subtitle: string
13
+ title: UIHeroHeaderProps['title']
14
+ subtitle: UIHeroHeaderProps['subtitle']
16
15
  link?: {
17
16
  text: string
18
17
  url: string
@@ -26,19 +25,25 @@ export type HeroProps = {
26
25
  icon?: ReactNode
27
26
  }
28
27
 
28
+ const { Hero: HeroWrapper, HeroImage, HeroHeader } = Components
29
+
29
30
  const Hero = ({
30
31
  link,
31
32
  title,
32
33
  subtitle,
33
34
  image,
34
- variant = 'primary',
35
- colorVariant = 'main',
35
+ variant = Props['Hero'].variant ?? 'primary',
36
+ colorVariant = Props['Hero'].colorVariant ?? 'main',
36
37
  icon,
37
38
  }: HeroProps) => {
38
39
  return (
39
40
  <Section className={`${styles.section} section-hero`}>
40
- <UIHero colorVariant={colorVariant} variant={variant}>
41
- <UIHeroImage data-fs-hero-image>
41
+ <HeroWrapper
42
+ {...Props['Hero']}
43
+ variant={variant}
44
+ colorVariant={colorVariant}
45
+ >
46
+ <HeroImage {...Props['HeroImage']}>
42
47
  <Image
43
48
  loading="eager"
44
49
  src={image.src}
@@ -47,15 +52,16 @@ const Hero = ({
47
52
  height={240}
48
53
  sizes="(max-width: 360px) 50vw, (max-width: 768px) 90vw, 50vw"
49
54
  />
50
- </UIHeroImage>
51
- <UIHeroHeader
55
+ </HeroImage>
56
+ <HeroHeader
52
57
  title={title}
53
58
  subtitle={subtitle}
54
59
  link={link?.url}
55
60
  linkText={link?.text}
56
61
  icon={icon}
62
+ {...Props['HeroHeader']}
57
63
  />
58
- </UIHero>
64
+ </HeroWrapper>
59
65
  </Section>
60
66
  )
61
67
  }
@@ -0,0 +1,32 @@
1
+ import {
2
+ Hero as UIHero,
3
+ HeroImage as UIHeroImage,
4
+ HeroHeader as UIHeroHeader,
5
+ } from '@faststore/ui'
6
+
7
+ import HeroCustomizations from 'src/customizations/components/overrides/Hero'
8
+
9
+ const heroComponentsCustomization = {}
10
+
11
+ const heroPropsCustomization = {} as any
12
+
13
+ Object.entries(HeroCustomizations.components).forEach(([key, value]) => {
14
+ if (value.Component) {
15
+ heroComponentsCustomization[key] = value.Component
16
+ }
17
+ })
18
+
19
+ Object.entries(HeroCustomizations.components).forEach(([key, value]) => {
20
+ if (value.props) {
21
+ heroPropsCustomization[key] = value.props
22
+ }
23
+ })
24
+
25
+ const Components = {
26
+ Hero: UIHero,
27
+ HeroImage: UIHeroImage,
28
+ HeroHeader: UIHeroHeader,
29
+ ...heroComponentsCustomization,
30
+ }
31
+
32
+ export { Components, heroPropsCustomization as Props }
@@ -1,9 +1,9 @@
1
- import UINavbar from '../../navigation/Navbar'
2
-
3
1
  import Section from '../Section'
4
2
 
5
3
  import styles from './section.module.scss'
6
4
 
5
+ import Navbar from 'src/components/navigation/Navbar'
6
+
7
7
  type PageLinks = {
8
8
  url: string
9
9
  text: string
@@ -51,7 +51,7 @@ export interface NavbarProps {
51
51
  }
52
52
  }
53
53
 
54
- function Navbar({
54
+ function NavbarSection({
55
55
  logo,
56
56
  searchInput,
57
57
  cartIcon,
@@ -68,8 +68,8 @@ function Navbar({
68
68
  },
69
69
  }: NavbarProps) {
70
70
  return (
71
- <Section className={`${styles.section} section-navbar`}>
72
- <UINavbar
71
+ <Section as="header" className={`${styles.section} section-navbar`}>
72
+ <Navbar
73
73
  home={home}
74
74
  menu={menu}
75
75
  logo={logo}
@@ -87,4 +87,4 @@ function Navbar({
87
87
  )
88
88
  }
89
89
 
90
- export default Navbar
90
+ export default NavbarSection