@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
@@ -0,0 +1,48 @@
1
+ import {
2
+ Navbar as UINavbar,
3
+ NavbarLinks as UINavbarLinks,
4
+ NavbarLinksList as UINavbarLinksList,
5
+ NavbarSlider as UINavbarSlider,
6
+ NavbarSliderHeader as UINavbarSliderHeader,
7
+ NavbarSliderContent as UINavbarSliderContent,
8
+ NavbarSliderFooter as UINavbarSliderFooter,
9
+ NavbarHeader as UINavbarHeader,
10
+ NavbarRow as UINavbarRow,
11
+ NavbarButtons as UINavbarButtons,
12
+ IconButton as UIIconButton,
13
+ } from '@faststore/ui'
14
+
15
+ import NavbarCustomizations from 'src/customizations/components/overrides/Navbar'
16
+
17
+ const navbarComponentsCustomization = {}
18
+
19
+ const navbarPropsCustomization = {} as any
20
+
21
+ Object.entries(NavbarCustomizations.components).forEach(([key, value]) => {
22
+ if (value.Component) {
23
+ navbarComponentsCustomization[key] = value.Component
24
+ }
25
+ })
26
+
27
+ Object.entries(NavbarCustomizations.components).forEach(([key, value]) => {
28
+ if (value.props) {
29
+ navbarPropsCustomization[key] = value.props
30
+ }
31
+ })
32
+
33
+ const Components = {
34
+ Navbar: UINavbar,
35
+ NavbarLinks: UINavbarLinks,
36
+ NavbarLinksList: UINavbarLinksList,
37
+ NavbarSlider: UINavbarSlider,
38
+ NavbarSliderHeader: UINavbarSliderHeader,
39
+ NavbarSliderContent: UINavbarSliderContent,
40
+ NavbarSliderFooter: UINavbarSliderFooter,
41
+ NavbarHeader: UINavbarHeader,
42
+ NavbarRow: UINavbarRow,
43
+ NavbarButtons: UINavbarButtons,
44
+ IconButton: UIIconButton,
45
+ ...navbarComponentsCustomization,
46
+ }
47
+
48
+ export { Components, navbarPropsCustomization as Props }
@@ -1,11 +1,20 @@
1
- import { Price, DiscountBadge } from '@faststore/ui'
1
+ import {
2
+ ProductTitle as UIProductTitle,
3
+ DiscountBadge as UIDiscountBadge,
4
+ BuyButton as UIBuyButton,
5
+ SkuSelector as UISkuSelector,
6
+ ShippingSimulation as UIShippingSimulation,
7
+ } from '@faststore/ui'
2
8
 
3
9
  import ProductDetailsCustomizations from 'src/customizations/components/overrides/ProductDetails'
4
10
 
5
11
  const Components = {
6
- Price,
7
- DiscountBadge,
8
- ...ProductDetailsCustomizations.components
12
+ ProductTitle: UIProductTitle,
13
+ DiscountBadge: UIDiscountBadge,
14
+ BuyButton: UIBuyButton,
15
+ SkuSelector: UISkuSelector,
16
+ ShippingSimulation: UIShippingSimulation,
17
+ ...ProductDetailsCustomizations.components,
9
18
  }
10
19
 
11
20
  export { Components }
@@ -4,11 +4,7 @@ import { gql } from '@faststore/graphql-utils'
4
4
  import { sendAnalyticsEvent } from '@faststore/sdk'
5
5
  import type { CurrencyCode, ViewItemEvent } from '@faststore/sdk'
6
6
  import type { ProductDetailsFragment_ProductFragment } from '@generated/graphql'
7
- import {
8
- Link as UILink,
9
- ProductTitle as UIProductTitle,
10
- DiscountBadge as UIDiscountBadge,
11
- } from '@faststore/ui'
7
+ import { Link as UILink } from '@faststore/ui'
12
8
 
13
9
  import { useSession } from 'src/sdk/session'
14
10
  import { useProduct } from 'src/sdk/product/useProduct'
@@ -24,6 +20,10 @@ import { ProductDetailsSettings } from 'src/components/ui/ProductDetails'
24
20
 
25
21
  import styles from './section.module.scss'
26
22
 
23
+ import { Components } from 'src/components/sections/ProductDetails/Overrides'
24
+
25
+ const { ProductTitle, DiscountBadge } = Components
26
+
27
27
  interface ProductDetailsContextProps {
28
28
  context: ProductDetailsFragment_ProductFragment
29
29
  }
@@ -147,11 +147,11 @@ function ProductDetails({
147
147
  <section data-fs-product-details>
148
148
  <section data-fs-product-details-body>
149
149
  <header data-fs-product-details-title data-fs-product-details-section>
150
- <UIProductTitle
150
+ <ProductTitle
151
151
  title={<h1>{name}</h1>}
152
152
  label={
153
153
  showDiscountBadge && (
154
- <UIDiscountBadge
154
+ <DiscountBadge
155
155
  listPrice={listPrice}
156
156
  spotPrice={lowPrice}
157
157
  size={discountBadgeSize}
@@ -0,0 +1,34 @@
1
+ import { ProductShelf as UIProductShelf } from '@faststore/ui'
2
+ import ProductCard from 'src/components/product/ProductCard'
3
+ import Carousel from 'src/components/ui/Carousel'
4
+
5
+ import ProductShelfCustomizations from 'src/customizations/components/overrides/ProductShelf'
6
+
7
+ const productShelfComponentsCustomization = {}
8
+
9
+ const productShelfPropsCustomization = {} as any
10
+
11
+ Object.entries(ProductShelfCustomizations.components).forEach(
12
+ ([key, value]) => {
13
+ if (value.Component) {
14
+ productShelfComponentsCustomization[key] = value.Component
15
+ }
16
+ }
17
+ )
18
+
19
+ Object.entries(ProductShelfCustomizations.components).forEach(
20
+ ([key, value]) => {
21
+ if (value.props) {
22
+ productShelfPropsCustomization[key] = value.props
23
+ }
24
+ }
25
+ )
26
+
27
+ const Components = {
28
+ ProductShelf: UIProductShelf,
29
+ __experimentalCarousel: Carousel,
30
+ __experimentalProductCard: ProductCard,
31
+ ...productShelfComponentsCustomization,
32
+ }
33
+
34
+ export { Components, productShelfPropsCustomization as Props }
@@ -1,20 +1,22 @@
1
1
  import type { BreadcrumbProps as UIBreadcrumbProps } from '@faststore/ui'
2
- import { Icon, Breadcrumb as UIBreadcrumb } from '@faststore/ui'
3
2
  import { memo } from 'react'
4
3
 
5
4
  import Link from 'src/components/ui/Link'
6
5
 
6
+ import { Components, Props } from 'src/components/sections/Breadcrumb/Overrides'
7
+ const { Breadcrumb: BreadcrumbWrapper, Icon } = Components
8
+
7
9
  export interface BreadcrumbProps extends UIBreadcrumbProps {
8
10
  icon: string
9
11
  alt: string
10
12
  }
11
13
 
12
14
  const Breadcrumb = ({
13
- icon = 'Home',
15
+ icon = Props['Icon'].name ?? 'Home',
14
16
  alt = 'Go to homepage',
15
17
  ...otherProps
16
18
  }: BreadcrumbProps) => (
17
- <UIBreadcrumb
19
+ <BreadcrumbWrapper
18
20
  homeLink={
19
21
  <Link
20
22
  data-fs-breadcrumb-link
@@ -23,7 +25,13 @@ const Breadcrumb = ({
23
25
  href="/"
24
26
  prefetch={false}
25
27
  >
26
- <Icon name={icon} width={18} height={18} weight="bold" />
28
+ <Icon
29
+ width={18}
30
+ height={18}
31
+ weight="bold"
32
+ {...Props['Icon']}
33
+ name={icon}
34
+ />
27
35
  </Link>
28
36
  }
29
37
  renderLink={({ itemProps: { item: link, name } }) => (
@@ -31,8 +39,9 @@ const Breadcrumb = ({
31
39
  {name}
32
40
  </Link>
33
41
  )}
42
+ {...Props['Breadcrumb']}
34
43
  {...otherProps}
35
- ></UIBreadcrumb>
44
+ />
36
45
  )
37
46
 
38
47
  export default memo(Breadcrumb)
@@ -2,7 +2,7 @@ import type { Dispatch, SetStateAction } from 'react'
2
2
 
3
3
  import {
4
4
  Icon as UIIcon,
5
- BuyButton as UIBuyButton,
5
+ Price as UIPrice,
6
6
  QuantitySelector as UIQuantitySelector,
7
7
  } from '@faststore/ui'
8
8
 
@@ -14,8 +14,9 @@ import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
14
14
  import Selectors from 'src/components/ui/SkuSelector'
15
15
  import AddToCartLoadingSkeleton from './AddToCartLoadingSkeleton'
16
16
 
17
- import { Components } from '../../sections/ProductDetails/Overrides'
18
- const { Price } = Components
17
+ import { Components } from 'src/components/sections/ProductDetails/Overrides'
18
+
19
+ const { BuyButton } = Components
19
20
 
20
21
  interface ProductDetailsSettingsProps {
21
22
  product: ProductDetailsFragment_ProductFragment
@@ -76,7 +77,7 @@ function ProductDetailsSettings({
76
77
  <>
77
78
  <section data-fs-product-details-values>
78
79
  <div data-fs-product-details-prices>
79
- <Price
80
+ <UIPrice
80
81
  value={listPrice}
81
82
  formatter={useFormattedPrice}
82
83
  testId="list-price"
@@ -84,7 +85,7 @@ function ProductDetailsSettings({
84
85
  variant="listing"
85
86
  SRText="Original price:"
86
87
  />
87
- <Price
88
+ <UIPrice
88
89
  value={lowPrice}
89
90
  formatter={useFormattedPrice}
90
91
  testId="price"
@@ -112,15 +113,15 @@ function ProductDetailsSettings({
112
113
  isValidating ? (
113
114
  <AddToCartLoadingSkeleton />
114
115
  ) : (
115
- <UIBuyButton
116
+ <BuyButton
116
117
  disabled={buyDisabled}
117
118
  icon={
118
119
  <UIIcon aria-label={buyButtonIconAlt} name={buyButtonIconName} />
119
120
  }
120
121
  {...buyProps}
121
122
  >
122
- {buyButtonTitle}
123
- </UIBuyButton>
123
+ {buyButtonTitle || 'Add to Cart'}
124
+ </BuyButton>
124
125
  )
125
126
  }
126
127
  </>
@@ -1,17 +1,20 @@
1
1
  import { useEffect, useId, useRef } from 'react'
2
2
 
3
- import { ProductShelf as UIProductShelf } from '@faststore/ui'
4
-
5
3
  import ProductShelfSkeleton from 'src/components/skeletons/ProductShelfSkeleton'
6
4
  import { useViewItemListEvent } from 'src/sdk/analytics/hooks/useViewItemListEvent'
7
5
  import { useProductsQuery } from 'src/sdk/product/useProductsQuery'
8
6
  import { textToKebabCase } from 'src/utils/utilities'
9
7
 
10
- import Carousel from '../../ui/Carousel'
11
-
12
- import { Components } from 'src/components/ui/ProductShelf/Overrides'
8
+ import {
9
+ Components,
10
+ Props,
11
+ } from 'src/components/sections/ProductShelf/Overrides'
13
12
 
14
- const { ProductCard } = Components
13
+ const {
14
+ ProductShelf: ProductShelfWrapper,
15
+ __experimentalCarousel: Carousel,
16
+ __experimentalProductCard: ProductCard,
17
+ } = Components
15
18
 
16
19
  type Sort =
17
20
  | 'discount_desc'
@@ -34,8 +37,8 @@ export type ProductShelfProps = {
34
37
  value: string
35
38
  }[]
36
39
  productCardConfiguration?: {
37
- showDiscountBadge: boolean
38
- bordered: boolean
40
+ showDiscountBadge?: boolean
41
+ bordered?: boolean
39
42
  }
40
43
  inView: boolean
41
44
  }
@@ -43,7 +46,10 @@ export type ProductShelfProps = {
43
46
  function ProductShelf({
44
47
  title,
45
48
  inView,
46
- productCardConfiguration,
49
+ productCardConfiguration: {
50
+ bordered = Props['__experimentalProductCard'].bordered,
51
+ showDiscountBadge = Props['__experimentalProductCard'].showDiscountBadge,
52
+ } = {},
47
53
  ...variables
48
54
  }: ProductShelfProps) {
49
55
  const titleId = textToKebabCase(title)
@@ -79,25 +85,28 @@ function ProductShelf({
79
85
  aspectRatio={aspectRatio}
80
86
  loading={products === undefined}
81
87
  >
82
- <UIProductShelf>
83
- <Carousel id={titleId || id}>
88
+ <ProductShelfWrapper {...Props['ProductShelfWrapper']}>
89
+ <Carousel id={titleId || id} {...Props['__experimentalCarousel']}>
84
90
  {productEdges.map((product, idx) => (
85
91
  <ProductCard
86
- bordered={productCardConfiguration?.bordered}
87
- showDiscountBadge={productCardConfiguration?.showDiscountBadge}
88
- key={`${product.node.id}`}
89
- product={product.node}
90
- index={idx + 1}
91
92
  aspectRatio={aspectRatio}
92
93
  imgProps={{
93
94
  width: 216,
94
95
  height: 216,
95
96
  sizes: '(max-width: 768px) 42vw, 30vw',
96
97
  }}
98
+ {...Props['__experimentalProductCard']}
99
+ bordered={bordered}
100
+ showDiscountBadge={showDiscountBadge}
101
+ // Dynamic props, shouldn't be overridable
102
+ // This decision can be reviewed later if needed
103
+ key={`${product.node.id}`}
104
+ product={product.node}
105
+ index={idx + 1}
97
106
  />
98
107
  ))}
99
108
  </Carousel>
100
- </UIProductShelf>
109
+ </ProductShelfWrapper>
101
110
  </ProductShelfSkeleton>
102
111
  </>
103
112
  )
@@ -1,7 +1,4 @@
1
- import {
2
- ShippingSimulation as UIShippingSimulation,
3
- ShippingSimulationProps as UIShippingSimulationProps,
4
- } from '@faststore/ui'
1
+ import { ShippingSimulationProps as UIShippingSimulationProps } from '@faststore/ui'
5
2
 
6
3
  import { getShippingSimulation } from 'src/sdk/shipping'
7
4
  import { ShippingSla } from '@generated/graphql'
@@ -9,6 +6,10 @@ import { useSession } from 'src/sdk/session'
9
6
  import { IShippingItem } from '@faststore/api'
10
7
  import { useShippingSimulation } from './useShippingSimulation'
11
8
 
9
+ import { Components } from 'src/components/sections/ProductDetails/Overrides'
10
+
11
+ const { ShippingSimulation: ShippingSimulationWrapper } = Components
12
+
12
13
  type ShippingSimulationOptionalProps =
13
14
  | 'title'
14
15
  | 'formatter'
@@ -76,7 +77,7 @@ export default function ShippingSimulation({
76
77
  const { location, options } = shippingSimulation
77
78
 
78
79
  return (
79
- <UIShippingSimulation
80
+ <ShippingSimulationWrapper
80
81
  formatter={formatter}
81
82
  onInput={handleOnInput}
82
83
  onSubmit={handleSubmit}
@@ -1,9 +1,13 @@
1
1
  import { HTMLAttributes } from 'react'
2
2
 
3
- import { SkuSelectorProps, SkuSelector as UISkuSelector } from '@faststore/ui'
3
+ import { SkuSelectorProps } from '@faststore/ui'
4
4
  import NextLink from 'next/link'
5
5
  import { Image } from '../Image'
6
6
 
7
+ import { Components } from 'src/components/sections/ProductDetails/Overrides'
8
+
9
+ const { SkuSelector } = Components
10
+
7
11
  export type SkuVariantsByName = Record<
8
12
  string,
9
13
  Array<{ alt: string; label: string; value: string; src?: string }>
@@ -40,7 +44,7 @@ function Selectors({
40
44
  <section {...otherProps}>
41
45
  {availableVariations &&
42
46
  Object.keys(availableVariations).map((skuVariant) => (
43
- <UISkuSelector
47
+ <SkuSelector
44
48
  key={skuVariant}
45
49
  skuPropertyName={skuVariant}
46
50
  availableVariations={availableVariations}
@@ -0,0 +1,9 @@
1
+ import { ProductTitle as UIProductTitle } from '@faststore/ui'
2
+
3
+ export interface CustomComponentProps {
4
+ name: string
5
+ }
6
+
7
+ export default function ProductTitle({ name = 'Component' }) {
8
+ return <UIProductTitle title={<h1>Overriding {name}</h1>} />
9
+ }
@@ -0,0 +1,15 @@
1
+ // This is an example of how it can be used on the starter.
2
+
3
+ import { SectionOverride } from 'src/typings/overrides'
4
+
5
+ const SECTION = 'BannerText' as const
6
+
7
+ const overrides: SectionOverride[typeof SECTION] = {
8
+ name: SECTION,
9
+ components: {
10
+ Banner: { props: {} },
11
+ BannerContent: { props: {} },
12
+ },
13
+ }
14
+
15
+ export default overrides
@@ -0,0 +1,15 @@
1
+ // This is an example of how it can be used on the starter.
2
+
3
+ import { SectionOverride } from 'src/typings/overrides'
4
+
5
+ const SECTION = 'Breadcrumb' as const
6
+
7
+ const overrides: SectionOverride[typeof SECTION] = {
8
+ name: SECTION,
9
+ components: {
10
+ Breadcrumb: { props: {} },
11
+ Icon: { props: {} },
12
+ },
13
+ }
14
+
15
+ export default overrides
@@ -0,0 +1,16 @@
1
+ // This is an example of how it can be used on the starter.
2
+
3
+ import { SectionOverride } from 'src/typings/overrides'
4
+
5
+ const SECTION = 'Hero' as const
6
+
7
+ const overrides: SectionOverride[typeof SECTION] = {
8
+ name: SECTION,
9
+ components: {
10
+ Hero: { props: {} },
11
+ HeroImage: { props: {} },
12
+ HeroHeader: { props: {} },
13
+ },
14
+ }
15
+
16
+ export default overrides
@@ -0,0 +1,24 @@
1
+ // This is an example of how it can be used on the starter.
2
+
3
+ import { SectionOverride } from 'src/typings/overrides'
4
+
5
+ const SECTION = 'Navbar' as const
6
+
7
+ const overrides: SectionOverride[typeof SECTION] = {
8
+ name: SECTION,
9
+ components: {
10
+ Navbar: { props: {} },
11
+ NavbarLinks: { props: {} },
12
+ NavbarLinksList: { props: {} },
13
+ NavbarSlider: { props: {} },
14
+ NavbarSliderHeader: { props: {} },
15
+ NavbarSliderContent: { props: {} },
16
+ NavbarSliderFooter: { props: {} },
17
+ NavbarHeader: { props: {} },
18
+ NavbarRow: { props: {} },
19
+ NavbarButtons: { props: {} },
20
+ IconButton: { props: {} },
21
+ },
22
+ }
23
+
24
+ export default overrides
@@ -1,10 +1,12 @@
1
- import { SectionOverride } from "src/typings/overrides";
1
+ // This is an example of how it can be used on the starter.
2
2
 
3
- const SECTION = "ProductDetails" as const;
3
+ import { SectionOverride } from 'src/typings/overrides'
4
+
5
+ const SECTION = 'ProductDetails' as const
4
6
 
5
7
  const overrides: SectionOverride[typeof SECTION] = {
6
8
  name: SECTION,
7
9
  components: {},
8
- };
10
+ }
9
11
 
10
- export default overrides;
12
+ export default overrides
@@ -1,10 +1,16 @@
1
- import { SectionOverride } from "src/typings/overrides";
1
+ // This is an example of how it can be used on the starter.
2
2
 
3
- const SECTION = "ProductShelf" as const;
3
+ import { SectionOverride } from 'src/typings/overrides'
4
+
5
+ const SECTION = 'ProductShelf' as const
4
6
 
5
7
  const overrides: SectionOverride[typeof SECTION] = {
6
8
  name: SECTION,
7
- components: {},
8
- };
9
+ components: {
10
+ ProductShelf: { props: {} },
11
+ __experimentalCarousel: { props: {} },
12
+ __experimentalProductCard: { props: {} },
13
+ },
14
+ }
9
15
 
10
- export default overrides;
16
+ export default overrides
@@ -1,18 +1,55 @@
1
1
  export const SECTIONS = {
2
- ProductDetails: { components: ["Price"] },
3
- ProductShelf: { components: ["ProductCard"] }
4
- } as const;
5
-
6
- // export type ComponentOrProps =
7
- // | { Component: React.ElementType }
8
- // | { props: Record<string, unknown> };
9
-
10
- export type SectionOverride = {
11
- [K in keyof typeof SECTIONS]: {
12
- name: K;
13
- components: {
14
- [ComponentKey in typeof SECTIONS[K]["components"][number]]?: React.ElementType;
15
- };
16
- };
17
- };
18
-
2
+ Hero: {
3
+ components: ['Hero', 'HeroImage', 'HeroHeader'],
4
+ },
5
+ BannerText: {
6
+ components: ['Banner', 'BannerContent'],
7
+ },
8
+ ProductDetails: {
9
+ components: [
10
+ 'ProductTitle',
11
+ 'DiscountBadge',
12
+ 'BuyButton',
13
+ 'SkuSelector',
14
+ 'ShippingSimulation',
15
+ ],
16
+ },
17
+ ProductShelf: {
18
+ components: [
19
+ 'ProductShelf',
20
+ '__experimentalCarousel',
21
+ '__experimentalProductCard',
22
+ ],
23
+ },
24
+ Navbar: {
25
+ components: [
26
+ 'Navbar',
27
+ 'NavbarLinks',
28
+ 'NavbarLinksList',
29
+ 'NavbarSlider',
30
+ 'NavbarSliderHeader',
31
+ 'NavbarSliderContent',
32
+ 'NavbarSliderFooter',
33
+ 'NavbarHeader',
34
+ 'NavbarRow',
35
+ 'NavbarButtons',
36
+ 'IconButton',
37
+ ],
38
+ },
39
+ Breadcrumb: {
40
+ components: ['Breadcrumb', 'Icon'],
41
+ },
42
+ } as const
43
+
44
+ // export type ComponentOrProps =
45
+ // | { Component: React.ElementType }
46
+ // | { props: Record<string, unknown> };
47
+
48
+ export type SectionOverride = {
49
+ [K in keyof typeof SECTIONS]: {
50
+ name: K
51
+ components: {
52
+ [ComponentKey in (typeof SECTIONS)[K]['components'][number]]?: any
53
+ }
54
+ }
55
+ }
package/.next/BUILD_ID DELETED
@@ -1 +0,0 @@
1
- PhpKjbrX2m-wtpeOa39bI