@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.
- package/.turbo/turbo-build.log +7 -7
- package/package.json +3 -3
- package/src/components/common/Alert/Alert.tsx +5 -8
- package/src/components/navigation/Navbar/Navbar.tsx +22 -22
- package/src/components/navigation/NavbarLinks/NavbarLinks.tsx +8 -7
- package/src/components/navigation/NavbarSlider/NavbarSlider.tsx +15 -14
- package/src/components/product/ProductGrid/ProductGrid.tsx +5 -10
- package/src/components/region/RegionBar/RegionBar.tsx +27 -13
- package/src/components/search/Filter/Filter.tsx +6 -11
- package/src/components/sections/Alert/Alert.tsx +17 -13
- package/src/components/sections/Alert/Overrides.tsx +13 -25
- package/src/components/sections/BannerText/BannerText.tsx +24 -20
- package/src/components/sections/BannerText/Overrides.tsx +11 -23
- package/src/components/sections/Breadcrumb/Overrides.tsx +13 -25
- package/src/components/sections/EmptyState/EmptyState.tsx +6 -8
- package/src/components/sections/EmptyState/Overrides.tsx +12 -24
- package/src/components/sections/Hero/Hero.tsx +15 -12
- package/src/components/sections/Hero/Overrides.tsx +12 -24
- package/src/components/sections/Navbar/Overrides.tsx +43 -31
- package/src/components/sections/Newsletter/Overrides.tsx +28 -26
- package/src/components/sections/ProductDetails/Overrides.tsx +51 -38
- package/src/components/sections/ProductDetails/ProductDetails.tsx +22 -30
- package/src/components/sections/ProductGallery/Overrides.tsx +44 -35
- package/src/components/sections/ProductShelf/Overrides.tsx +14 -28
- package/src/components/sections/RegionBar/Overrides.tsx +12 -24
- package/src/components/ui/Breadcrumb/Breadcrumb.tsx +9 -7
- package/src/components/ui/ImageGallery/ImageGallery.tsx +13 -19
- package/src/components/ui/Newsletter/Newsletter.tsx +23 -24
- package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +21 -17
- package/src/components/ui/ProductGallery/ProductGallery.tsx +31 -38
- package/src/components/ui/ProductShelf/ProductShelf.tsx +11 -16
- package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +2 -3
- package/src/components/ui/SkuSelector/Selectors.tsx +8 -7
- package/src/customizations/components/overrides/Alert.tsx +3 -7
- package/src/customizations/components/overrides/BannerText.tsx +3 -7
- package/src/customizations/components/overrides/Breadcrumb.tsx +3 -7
- package/src/customizations/components/overrides/EmptyState.tsx +3 -6
- package/src/customizations/components/overrides/Hero.tsx +3 -8
- package/src/customizations/components/overrides/Navbar.tsx +3 -16
- package/src/customizations/components/overrides/Newsletter.tsx +3 -11
- package/src/customizations/components/overrides/ProductDetails.tsx +3 -18
- package/src/customizations/components/overrides/ProductGallery.tsx +3 -16
- package/src/customizations/components/overrides/ProductShelf.tsx +3 -8
- package/src/customizations/components/overrides/RegionBar.tsx +3 -8
- package/src/typings/overrideDefinitionUtils.ts +40 -0
- package/src/typings/overrides.ts +267 -0
- package/src/utils/overrides.ts +53 -0
- 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
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 {
|
|
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 =
|
|
18
|
-
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
|
-
{...
|
|
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
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 =
|
|
36
|
-
colorVariant =
|
|
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
|
-
{...
|
|
44
|
+
<HeroWrapper.Component
|
|
45
|
+
{...HeroWrapper.props}
|
|
43
46
|
variant={variant}
|
|
44
47
|
colorVariant={colorVariant}
|
|
45
48
|
>
|
|
46
|
-
<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
|
-
{...
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
40
|
-
ProductTitle
|
|
41
|
-
DiscountBadge
|
|
42
|
-
BuyButton
|
|
43
|
-
Icon
|
|
44
|
-
Price
|
|
45
|
-
QuantitySelector
|
|
46
|
-
SkuSelector
|
|
47
|
-
ShippingSimulation
|
|
48
|
-
ImageGallery
|
|
49
|
-
ImageZoom
|
|
50
|
-
__experimentalImageGalleryImage
|
|
51
|
-
__experimentalImageGallery
|
|
52
|
-
__experimentalShippingSimulation
|
|
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
|
|
29
|
-
__experimentalShippingSimulation
|
|
30
|
-
}
|
|
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 =
|
|
68
|
+
size: discountBadgeSize = DiscountBadge.props.size,
|
|
74
69
|
},
|
|
75
70
|
},
|
|
76
71
|
buyButton: { icon: buyButtonIcon, title: buyButtonTitle },
|
|
77
72
|
shippingSimulator: {
|
|
78
|
-
title: shippingSimulatorTitle =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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 =
|
|
80
|
+
to: shippingSimulatorLinkUrl = ShippingSimulation.props
|
|
88
81
|
.idkPostalCodeLinkProps?.href,
|
|
89
|
-
text: shippingSimulatorLinkText =
|
|
90
|
-
|
|
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
|
-
{...
|
|
165
|
+
{...ProductTitle.props}
|
|
174
166
|
label={
|
|
175
167
|
showDiscountBadge && (
|
|
176
|
-
<DiscountBadge
|
|
177
|
-
{...
|
|
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
|
-
{...
|
|
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
|
-
{...
|
|
210
|
+
{...ShippingSimulation.props}
|
|
219
211
|
idkPostalCodeLinkProps={{
|
|
220
|
-
...
|
|
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
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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 }
|