@faststore/core 2.1.33 → 2.1.36

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 (48) hide show
  1. package/.turbo/turbo-build.log +7 -7
  2. package/package.json +3 -3
  3. package/src/components/common/Alert/Alert.tsx +5 -8
  4. package/src/components/navigation/Navbar/Navbar.tsx +22 -22
  5. package/src/components/navigation/NavbarLinks/NavbarLinks.tsx +8 -7
  6. package/src/components/navigation/NavbarSlider/NavbarSlider.tsx +15 -14
  7. package/src/components/product/ProductGrid/ProductGrid.tsx +5 -10
  8. package/src/components/region/RegionBar/RegionBar.tsx +27 -13
  9. package/src/components/search/Filter/Filter.tsx +6 -11
  10. package/src/components/sections/Alert/Alert.tsx +17 -13
  11. package/src/components/sections/Alert/Overrides.tsx +13 -25
  12. package/src/components/sections/BannerText/BannerText.tsx +24 -20
  13. package/src/components/sections/BannerText/Overrides.tsx +11 -23
  14. package/src/components/sections/Breadcrumb/Overrides.tsx +13 -25
  15. package/src/components/sections/EmptyState/EmptyState.tsx +6 -8
  16. package/src/components/sections/EmptyState/Overrides.tsx +12 -24
  17. package/src/components/sections/Hero/Hero.tsx +15 -12
  18. package/src/components/sections/Hero/Overrides.tsx +12 -24
  19. package/src/components/sections/Navbar/Overrides.tsx +43 -31
  20. package/src/components/sections/Newsletter/Overrides.tsx +28 -26
  21. package/src/components/sections/ProductDetails/Overrides.tsx +51 -38
  22. package/src/components/sections/ProductDetails/ProductDetails.tsx +22 -30
  23. package/src/components/sections/ProductGallery/Overrides.tsx +44 -35
  24. package/src/components/sections/ProductShelf/Overrides.tsx +14 -28
  25. package/src/components/sections/RegionBar/Overrides.tsx +12 -24
  26. package/src/components/ui/Breadcrumb/Breadcrumb.tsx +9 -7
  27. package/src/components/ui/ImageGallery/ImageGallery.tsx +13 -19
  28. package/src/components/ui/Newsletter/Newsletter.tsx +23 -24
  29. package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +21 -17
  30. package/src/components/ui/ProductGallery/ProductGallery.tsx +31 -38
  31. package/src/components/ui/ProductShelf/ProductShelf.tsx +11 -16
  32. package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +2 -3
  33. package/src/components/ui/SkuSelector/Selectors.tsx +8 -7
  34. package/src/customizations/components/overrides/Alert.tsx +3 -7
  35. package/src/customizations/components/overrides/BannerText.tsx +3 -7
  36. package/src/customizations/components/overrides/Breadcrumb.tsx +3 -7
  37. package/src/customizations/components/overrides/EmptyState.tsx +3 -6
  38. package/src/customizations/components/overrides/Hero.tsx +3 -8
  39. package/src/customizations/components/overrides/Navbar.tsx +3 -16
  40. package/src/customizations/components/overrides/Newsletter.tsx +3 -11
  41. package/src/customizations/components/overrides/ProductDetails.tsx +3 -18
  42. package/src/customizations/components/overrides/ProductGallery.tsx +3 -16
  43. package/src/customizations/components/overrides/ProductShelf.tsx +3 -8
  44. package/src/customizations/components/overrides/RegionBar.tsx +3 -8
  45. package/src/typings/overrideDefinitionUtils.ts +40 -0
  46. package/src/typings/overrides.ts +267 -0
  47. package/src/utils/overrides.ts +53 -0
  48. package/src/typings/overrides.d.ts +0 -97
@@ -1,27 +1,15 @@
1
1
  import { Breadcrumb as UIBreadcrumb, Icon as UIIcon } from '@faststore/ui'
2
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 }
3
+ import { getSectionOverrides } from 'src/utils/overrides'
4
+ import { override } from 'src/customizations/components/overrides/Breadcrumb'
5
+ import type { BreadcrumbOverrideDefinition } from 'src/typings/overrides'
6
+
7
+ const { Breadcrumb, Icon } = getSectionOverrides(
8
+ {
9
+ Breadcrumb: UIBreadcrumb,
10
+ Icon: UIIcon,
11
+ },
12
+ override as BreadcrumbOverrideDefinition
13
+ )
14
+
15
+ export { Breadcrumb, Icon }
@@ -4,9 +4,7 @@ import type { PropsWithChildren } from 'react'
4
4
  import Section from '../Section'
5
5
  import styles from './section.module.scss'
6
6
 
7
- import { Components, Props } from 'src/components/sections/EmptyState/Overrides'
8
-
9
- const { EmptyState: EmptyStateWrapper } = Components
7
+ import { EmptyState as EmptyStateWrapper } from 'src/components/sections/EmptyState/Overrides'
10
8
 
11
9
  export interface EmptyStateProps {
12
10
  title: string
@@ -14,20 +12,20 @@ export interface EmptyStateProps {
14
12
  }
15
13
 
16
14
  function EmptyState({
17
- title = Props['EmptyState'].title,
18
- titleIcon = Props['EmptyState'].titleIcon,
15
+ title = EmptyStateWrapper.props.title,
16
+ titleIcon = EmptyStateWrapper.props.titleIcon,
19
17
  children,
20
18
  }: PropsWithChildren<EmptyStateProps>) {
21
19
  return (
22
20
  <Section className={`${styles.section} section-empty-state`}>
23
- <EmptyStateWrapper
21
+ <EmptyStateWrapper.Component
24
22
  bkgColor="light"
25
- {...Props['EmptyState']}
23
+ {...EmptyStateWrapper.props}
26
24
  title={title}
27
25
  titleIcon={titleIcon}
28
26
  >
29
27
  {children}
30
- </EmptyStateWrapper>
28
+ </EmptyStateWrapper.Component>
31
29
  </Section>
32
30
  )
33
31
  }
@@ -1,26 +1,14 @@
1
1
  import { EmptyState as UIEmptyState } from '@faststore/ui'
2
2
 
3
- import EmptyStateCustomizations from 'src/customizations/components/overrides/EmptyState'
4
-
5
- const emptyStateComponentsCustomization = {}
6
-
7
- const emptyStatePropsCustomization = {} as any
8
-
9
- Object.entries(EmptyStateCustomizations.components).forEach(([key, value]) => {
10
- if (value.Component) {
11
- emptyStateComponentsCustomization[key] = value.Component
12
- }
13
- })
14
-
15
- Object.entries(EmptyStateCustomizations.components).forEach(([key, value]) => {
16
- if (value.props) {
17
- emptyStatePropsCustomization[key] = value.props
18
- }
19
- })
20
-
21
- const Components = {
22
- EmptyState: UIEmptyState,
23
- ...emptyStateComponentsCustomization,
24
- }
25
-
26
- export { Components, emptyStatePropsCustomization as Props }
3
+ import { getSectionOverrides } from 'src/utils/overrides'
4
+ import { override } from 'src/customizations/components/overrides/EmptyState'
5
+ import type { EmptyStateOverrideDefinition } from 'src/typings/overrides'
6
+
7
+ const { EmptyState } = getSectionOverrides(
8
+ {
9
+ EmptyState: UIEmptyState,
10
+ },
11
+ override as EmptyStateOverrideDefinition
12
+ )
13
+
14
+ export { EmptyState }
@@ -2,9 +2,14 @@ import {
2
2
  HeroProps as UIHeroProps,
3
3
  HeroHeaderProps as UIHeroHeaderProps,
4
4
  } from '@faststore/ui'
5
- import { Components, Props } from './Overrides'
6
5
  import { ReactNode } from 'react'
7
6
  import { Image } from 'src/components/ui/Image'
7
+ import {
8
+ Hero as HeroWrapper,
9
+ HeroImage,
10
+ HeroHeader,
11
+ } from 'src/components/sections/Hero/Overrides'
12
+
8
13
  import Section from '../Section'
9
14
 
10
15
  import styles from './section.module.scss'
@@ -25,25 +30,23 @@ export type HeroProps = {
25
30
  icon?: ReactNode
26
31
  }
27
32
 
28
- const { Hero: HeroWrapper, HeroImage, HeroHeader } = Components
29
-
30
33
  const Hero = ({
31
34
  link,
32
35
  title,
33
36
  subtitle,
34
37
  image,
35
- variant = Props['Hero'].variant ?? 'primary',
36
- colorVariant = Props['Hero'].colorVariant ?? 'main',
38
+ variant = HeroWrapper.props.variant ?? 'primary',
39
+ colorVariant = HeroWrapper.props.colorVariant ?? 'main',
37
40
  icon,
38
41
  }: HeroProps) => {
39
42
  return (
40
43
  <Section className={`${styles.section} section-hero`}>
41
- <HeroWrapper
42
- {...Props['Hero']}
44
+ <HeroWrapper.Component
45
+ {...HeroWrapper.props}
43
46
  variant={variant}
44
47
  colorVariant={colorVariant}
45
48
  >
46
- <HeroImage {...Props['HeroImage']}>
49
+ <HeroImage.Component {...HeroImage.props}>
47
50
  <Image
48
51
  loading="eager"
49
52
  src={image.src}
@@ -52,16 +55,16 @@ const Hero = ({
52
55
  height={240}
53
56
  sizes="(max-width: 360px) 50vw, (max-width: 768px) 90vw, 50vw"
54
57
  />
55
- </HeroImage>
56
- <HeroHeader
58
+ </HeroImage.Component>
59
+ <HeroHeader.Component
57
60
  title={title}
58
61
  subtitle={subtitle}
59
62
  link={link?.url}
60
63
  linkText={link?.text}
61
64
  icon={icon}
62
- {...Props['HeroHeader']}
65
+ {...HeroHeader.props}
63
66
  />
64
- </HeroWrapper>
67
+ </HeroWrapper.Component>
65
68
  </Section>
66
69
  )
67
70
  }
@@ -4,29 +4,17 @@ import {
4
4
  HeroHeader as UIHeroHeader,
5
5
  } from '@faststore/ui'
6
6
 
7
- import HeroCustomizations from 'src/customizations/components/overrides/Hero'
7
+ import { getSectionOverrides } from 'src/utils/overrides'
8
+ import { override } from 'src/customizations/components/overrides/Hero'
9
+ import type { HeroOverrideDefinition } from 'src/typings/overrides'
8
10
 
9
- const heroComponentsCustomization = {}
11
+ const { Hero, HeroImage, HeroHeader } = getSectionOverrides(
12
+ {
13
+ Hero: UIHero,
14
+ HeroImage: UIHeroImage,
15
+ HeroHeader: UIHeroHeader,
16
+ },
17
+ override as HeroOverrideDefinition
18
+ )
10
19
 
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 }
20
+ export { Hero, HeroImage, HeroHeader }
@@ -12,37 +12,49 @@ import {
12
12
  IconButton as UIIconButton,
13
13
  } from '@faststore/ui'
14
14
 
15
- import NavbarCustomizations from 'src/customizations/components/overrides/Navbar'
15
+ import { getSectionOverrides } from 'src/utils/overrides'
16
+ import { override } from 'src/customizations/components/overrides/Navbar'
17
+ import type { NavbarOverrideDefinition } from 'src/typings/overrides'
16
18
 
17
- const navbarComponentsCustomization = {}
19
+ const {
20
+ Navbar,
21
+ NavbarLinks,
22
+ NavbarLinksList,
23
+ NavbarSlider,
24
+ NavbarSliderHeader,
25
+ NavbarSliderContent,
26
+ NavbarSliderFooter,
27
+ NavbarHeader,
28
+ NavbarRow,
29
+ NavbarButtons,
30
+ IconButton,
31
+ } = getSectionOverrides(
32
+ {
33
+ Navbar: UINavbar,
34
+ NavbarLinks: UINavbarLinks,
35
+ NavbarLinksList: UINavbarLinksList,
36
+ NavbarSlider: UINavbarSlider,
37
+ NavbarSliderHeader: UINavbarSliderHeader,
38
+ NavbarSliderContent: UINavbarSliderContent,
39
+ NavbarSliderFooter: UINavbarSliderFooter,
40
+ NavbarHeader: UINavbarHeader,
41
+ NavbarRow: UINavbarRow,
42
+ NavbarButtons: UINavbarButtons,
43
+ IconButton: UIIconButton,
44
+ },
45
+ override as NavbarOverrideDefinition
46
+ )
18
47
 
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,
48
+ export {
49
+ Navbar,
50
+ NavbarLinks,
51
+ NavbarLinksList,
52
+ NavbarSlider,
53
+ NavbarSliderHeader,
54
+ NavbarSliderContent,
55
+ NavbarSliderFooter,
56
+ NavbarHeader,
57
+ NavbarRow,
58
+ NavbarButtons,
59
+ IconButton,
46
60
  }
47
-
48
- export { Components, navbarPropsCustomization as Props }
@@ -4,32 +4,34 @@ import {
4
4
  Icon as UIIcon,
5
5
  } from '@faststore/ui'
6
6
 
7
- import NewsletterCustomizations from 'src/customizations/components/overrides/Newsletter'
7
+ import { getSectionOverrides } from 'src/utils/overrides'
8
+ import { override } from 'src/customizations/components/overrides/Newsletter'
9
+ import type { NewsletterOverrideDefinition } from 'src/typings/overrides'
8
10
 
9
- const newsletterComponentsCustomization = {}
11
+ const {
12
+ ToastIconSuccess,
13
+ ToastIconError,
14
+ HeaderIcon,
15
+ InputFieldName,
16
+ InputFieldEmail,
17
+ Button,
18
+ } = getSectionOverrides(
19
+ {
20
+ ToastIconSuccess: UIIcon,
21
+ ToastIconError: UIIcon,
22
+ HeaderIcon: UIIcon,
23
+ InputFieldName: UIInputField,
24
+ InputFieldEmail: UIInputField,
25
+ Button: UIButton,
26
+ },
27
+ override as NewsletterOverrideDefinition
28
+ )
10
29
 
11
- const newsletterPropsCustomization = {} as any
12
-
13
- Object.entries(NewsletterCustomizations.components).forEach(([key, value]) => {
14
- if (value.Component) {
15
- newsletterComponentsCustomization[key] = value.Component
16
- }
17
- })
18
-
19
- Object.entries(NewsletterCustomizations.components).forEach(([key, value]) => {
20
- if (value.props) {
21
- newsletterPropsCustomization[key] = value.props
22
- }
23
- })
24
-
25
- const Components = {
26
- ToastIconSuccess: UIIcon,
27
- ToastIconError: UIIcon,
28
- HeaderIcon: UIIcon,
29
- InputFieldName: UIInputField,
30
- InputFieldEmail: UIInputField,
31
- Button: UIButton,
32
- ...newsletterComponentsCustomization,
30
+ export {
31
+ ToastIconSuccess,
32
+ ToastIconError,
33
+ HeaderIcon,
34
+ InputFieldName,
35
+ InputFieldEmail,
36
+ Button,
33
37
  }
34
-
35
- export { Components, newsletterPropsCustomization as Props }
@@ -10,47 +10,60 @@ import {
10
10
  ImageZoom as UIImageZoom,
11
11
  ImageGallery as UIImageGallery,
12
12
  } from '@faststore/ui'
13
- import ImageGallery from 'src/components/ui/ImageGallery'
14
- import ShippingSimulation from 'src/components/ui/ShippingSimulation/ShippingSimulation'
15
- import { Image } from 'src/components/ui/Image'
16
-
17
- import ProductDetailsCustomizations from 'src/customizations/components/overrides/ProductDetails'
18
-
19
- const productDetailsComponentsCustomization = {}
20
13
 
21
- const productDetailsPropsCustomization = {} as any
14
+ import LocalImageGallery from 'src/components/ui/ImageGallery'
15
+ import LocalShippingSimulation from 'src/components/ui/ShippingSimulation/ShippingSimulation'
16
+ import { Image } from 'src/components/ui/Image'
22
17
 
23
- Object.entries(ProductDetailsCustomizations.components).forEach(
24
- ([key, value]) => {
25
- if (value.Component) {
26
- productDetailsComponentsCustomization[key] = value.Component
27
- }
28
- }
29
- )
18
+ import { getSectionOverrides } from 'src/utils/overrides'
19
+ import { override } from 'src/customizations/components/overrides/ProductDetails'
20
+ import type { ProductDetailsOverrideDefinition } from 'src/typings/overrides'
30
21
 
31
- Object.entries(ProductDetailsCustomizations.components).forEach(
32
- ([key, value]) => {
33
- if (value.props) {
34
- productDetailsPropsCustomization[key] = value.props
35
- }
36
- }
22
+ const {
23
+ ProductTitle,
24
+ DiscountBadge,
25
+ BuyButton,
26
+ Icon,
27
+ Price,
28
+ QuantitySelector,
29
+ SkuSelector,
30
+ ShippingSimulation,
31
+ ImageGallery,
32
+ ImageZoom,
33
+ __experimentalImageGalleryImage,
34
+ __experimentalImageGallery,
35
+ __experimentalShippingSimulation,
36
+ } = getSectionOverrides(
37
+ {
38
+ ProductTitle: UIProductTitle,
39
+ DiscountBadge: UIDiscountBadge,
40
+ BuyButton: UIBuyButton,
41
+ Icon: UIIcon,
42
+ Price: UIPrice,
43
+ QuantitySelector: UIQuantitySelector,
44
+ SkuSelector: UISkuSelector,
45
+ ShippingSimulation: UIShippingSimulation,
46
+ ImageGallery: UIImageGallery,
47
+ ImageZoom: UIImageZoom,
48
+ __experimentalImageGalleryImage: Image,
49
+ __experimentalImageGallery: LocalImageGallery,
50
+ __experimentalShippingSimulation: LocalShippingSimulation,
51
+ },
52
+ override as ProductDetailsOverrideDefinition
37
53
  )
38
54
 
39
- const Components = {
40
- ProductTitle: UIProductTitle,
41
- DiscountBadge: UIDiscountBadge,
42
- BuyButton: UIBuyButton,
43
- Icon: UIIcon,
44
- Price: UIPrice,
45
- QuantitySelector: UIQuantitySelector,
46
- SkuSelector: UISkuSelector,
47
- ShippingSimulation: UIShippingSimulation,
48
- ImageGallery: UIImageGallery,
49
- ImageZoom: UIImageZoom,
50
- __experimentalImageGalleryImage: Image,
51
- __experimentalImageGallery: ImageGallery,
52
- __experimentalShippingSimulation: ShippingSimulation,
53
- ...productDetailsComponentsCustomization,
55
+ export {
56
+ ProductTitle,
57
+ DiscountBadge,
58
+ BuyButton,
59
+ Icon,
60
+ Price,
61
+ QuantitySelector,
62
+ SkuSelector,
63
+ ShippingSimulation,
64
+ ImageGallery,
65
+ ImageZoom,
66
+ __experimentalImageGalleryImage,
67
+ __experimentalImageGallery,
68
+ __experimentalShippingSimulation,
54
69
  }
55
-
56
- export { Components, productDetailsPropsCustomization as Props }
@@ -18,16 +18,11 @@ import { ProductDetailsSettings } from 'src/components/ui/ProductDetails'
18
18
  import styles from './section.module.scss'
19
19
 
20
20
  import {
21
- Components,
22
- Props,
23
- } from 'src/components/sections/ProductDetails/Overrides'
24
-
25
- const {
26
21
  ProductTitle,
27
22
  DiscountBadge,
28
- __experimentalImageGallery: ImageGallery,
29
- __experimentalShippingSimulation: ShippingSimulation,
30
- } = Components
23
+ __experimentalImageGallery as ImageGallery,
24
+ __experimentalShippingSimulation as ShippingSimulation,
25
+ } from 'src/components/sections/ProductDetails/Overrides'
31
26
 
32
27
  interface ProductDetailsContextProps {
33
28
  context: ProductDetailsFragment_ProductFragment
@@ -70,25 +65,22 @@ function ProductDetails({
70
65
  refNumber: showRefNumber,
71
66
  discountBadge: {
72
67
  showDiscountBadge,
73
- size: discountBadgeSize = Props['DiscountBadge'].size,
68
+ size: discountBadgeSize = DiscountBadge.props.size,
74
69
  },
75
70
  },
76
71
  buyButton: { icon: buyButtonIcon, title: buyButtonTitle },
77
72
  shippingSimulator: {
78
- title: shippingSimulatorTitle = Props['__experimentalShippingSimulation']
79
- .title,
80
- inputLabel: shippingSimulatorInputLabel = Props[
81
- '__experimentalShippingSimulation'
82
- ].inputLabel,
83
- shippingOptionsTableTitle: shippingSimulatorOptionsTableTitle = Props[
84
- '__experimentalShippingSimulation'
85
- ].optionsLabel,
73
+ title: shippingSimulatorTitle = ShippingSimulation.props.title,
74
+ inputLabel: shippingSimulatorInputLabel = ShippingSimulation.props
75
+ .inputLabel,
76
+ shippingOptionsTableTitle:
77
+ shippingSimulatorOptionsTableTitle = ShippingSimulation.props
78
+ .optionsLabel,
86
79
  link: {
87
- to: shippingSimulatorLinkUrl = Props['__experimentalShippingSimulation']
80
+ to: shippingSimulatorLinkUrl = ShippingSimulation.props
88
81
  .idkPostalCodeLinkProps?.href,
89
- text: shippingSimulatorLinkText = Props[
90
- '__experimentalShippingSimulation'
91
- ].idkPostalCodeLinkProps?.children,
82
+ text: shippingSimulatorLinkText = ShippingSimulation.props
83
+ .idkPostalCodeLinkProps?.children,
92
84
  },
93
85
  },
94
86
  productDescription: {
@@ -165,16 +157,16 @@ function ProductDetails({
165
157
  <section data-fs-product-details>
166
158
  <section data-fs-product-details-body data-fs-content="product-details">
167
159
  <header data-fs-product-details-title data-fs-product-details-section>
168
- <ProductTitle
160
+ <ProductTitle.Component
169
161
  // TODO: We should review this prop. There's now way to override the title and use the dynamic name value.
170
162
  // Maybe passing a ProductTitleHeader component as a prop would be better, as it would be overridable.
171
163
  // Maybe now it's worth to make title always a h1 and receive only the name, as it would be easier for users to override.
172
164
  title={<h1>{name}</h1>}
173
- {...Props['ProductTitle']}
165
+ {...ProductTitle.props}
174
166
  label={
175
167
  showDiscountBadge && (
176
- <DiscountBadge
177
- {...Props['DiscountBadge']}
168
+ <DiscountBadge.Component
169
+ {...DiscountBadge.props}
178
170
  size={discountBadgeSize}
179
171
  // Dynamic props shouldn't be overridable
180
172
  // This decision can be reviewed later if needed
@@ -186,9 +178,9 @@ function ProductDetails({
186
178
  refNumber={showRefNumber && productId}
187
179
  />
188
180
  </header>
189
- <ImageGallery
181
+ <ImageGallery.Component
190
182
  data-fs-product-details-gallery
191
- {...Props['__experimentalImageGallery']}
183
+ {...ImageGallery.props}
192
184
  images={productImages}
193
185
  />
194
186
  <section data-fs-product-details-info>
@@ -211,13 +203,13 @@ function ProductDetails({
211
203
  </section>
212
204
 
213
205
  {availability && (
214
- <ShippingSimulation
206
+ <ShippingSimulation.Component
215
207
  data-fs-product-details-section
216
208
  data-fs-product-details-shipping
217
209
  formatter={useFormattedPrice}
218
- {...Props['__experimentalShippingSimulation']}
210
+ {...ShippingSimulation.props}
219
211
  idkPostalCodeLinkProps={{
220
- ...Props['idkPostalCodeLinkProps'],
212
+ ...ShippingSimulation.props.idkPostalCodeLinkProps,
221
213
  href: shippingSimulatorLinkUrl,
222
214
  children: shippingSimulatorLinkText,
223
215
  }}
@@ -5,6 +5,7 @@ import {
5
5
  Skeleton as UISkeleton,
6
6
  Icon as UIIcon,
7
7
  } from '@faststore/ui'
8
+
8
9
  import ProductCard from 'src/components/product/ProductCard'
9
10
  import FilterDesktop from 'src/components/search/Filter/FilterDesktop'
10
11
 
@@ -12,41 +13,49 @@ const FilterSlider = lazy(
12
13
  () => import('src/components/search/Filter/FilterSlider')
13
14
  )
14
15
 
15
- import ProductGalleryCustomizations from 'src/customizations/components/overrides/ProductGallery'
16
-
17
- const productGalleryComponentsCustomization = {}
18
-
19
- const productGalleryPropsCustomization = {} as any
20
-
21
- Object.entries(ProductGalleryCustomizations.components).forEach(
22
- ([key, value]) => {
23
- if (value.Component) {
24
- productGalleryComponentsCustomization[key] = value.Component
25
- }
26
- }
16
+ import { getSectionOverrides } from 'src/utils/overrides'
17
+ import { override } from 'src/customizations/components/overrides/ProductGallery'
18
+ import type { ProductGalleryOverrideDefinition } from 'src/typings/overrides'
19
+
20
+ const {
21
+ MobileFilterButton,
22
+ FilterIcon,
23
+ PrevIcon,
24
+ ResultsCountSkeleton,
25
+ SortSkeleton,
26
+ FilterButtonSkeleton,
27
+ LinkButtonPrev,
28
+ LinkButtonNext,
29
+ __experimentalFilterDesktop,
30
+ __experimentalFilterSlider,
31
+ __experimentalProductCard,
32
+ } = getSectionOverrides(
33
+ {
34
+ MobileFilterButton: UIButton,
35
+ FilterIcon: UIIcon,
36
+ PrevIcon: UIIcon,
37
+ ResultsCountSkeleton: UISkeleton,
38
+ SortSkeleton: UISkeleton,
39
+ FilterButtonSkeleton: UISkeleton,
40
+ LinkButtonPrev: UILinkButton,
41
+ LinkButtonNext: UILinkButton,
42
+ __experimentalFilterDesktop: FilterDesktop,
43
+ __experimentalFilterSlider: FilterSlider,
44
+ __experimentalProductCard: ProductCard,
45
+ },
46
+ override as ProductGalleryOverrideDefinition
27
47
  )
28
48
 
29
- Object.entries(ProductGalleryCustomizations.components).forEach(
30
- ([key, value]) => {
31
- if (value.props) {
32
- productGalleryPropsCustomization[key] = value.props
33
- }
34
- }
35
- )
36
-
37
- const Components = {
38
- Button: UIButton,
39
- FilterIcon: UIIcon,
40
- PrevIcon: UIIcon,
41
- ResultsCountSkeleton: UISkeleton,
42
- SortSkeleton: UISkeleton,
43
- FilterButtonSkeleton: UISkeleton,
44
- LinkButtonPrev: UILinkButton,
45
- LinkButtonNext: UILinkButton,
46
- __experimentalFilterDesktop: FilterDesktop,
47
- __experimentalFilterSlider: FilterSlider,
48
- __experimentalProductCard: ProductCard,
49
- ...productGalleryComponentsCustomization,
49
+ export {
50
+ MobileFilterButton,
51
+ FilterIcon,
52
+ PrevIcon,
53
+ ResultsCountSkeleton,
54
+ SortSkeleton,
55
+ FilterButtonSkeleton,
56
+ LinkButtonPrev,
57
+ LinkButtonNext,
58
+ __experimentalFilterDesktop,
59
+ __experimentalFilterSlider,
60
+ __experimentalProductCard,
50
61
  }
51
-
52
- export { Components, productGalleryPropsCustomization as Props }