@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
package/.turbo/turbo-build.log
CHANGED
|
@@ -21,25 +21,25 @@ info - Generating static pages (7/7)
|
|
|
21
21
|
info - Finalizing page optimization...
|
|
22
22
|
|
|
23
23
|
Route (pages) Size First Load JS
|
|
24
|
-
┌ ● / 3.
|
|
24
|
+
┌ ● / 3.16 kB 197 kB
|
|
25
25
|
├ /_app 0 B 77.9 kB
|
|
26
|
-
├ ● /[...slug] 4.
|
|
26
|
+
├ ● /[...slug] 4.06 kB 208 kB
|
|
27
27
|
├ └ css/d67fbe2a613293c1.css 1.84 kB
|
|
28
|
-
├ ● /[slug]/p
|
|
28
|
+
├ ● /[slug]/p 10.9 kB 205 kB
|
|
29
29
|
├ └ css/5972921daee792bb.css 11.3 kB
|
|
30
|
-
├ ○ /404 1.
|
|
31
|
-
├ ● /500 1.
|
|
30
|
+
├ ○ /404 1.19 kB 114 kB
|
|
31
|
+
├ ● /500 1.21 kB 114 kB
|
|
32
32
|
├ ● /account 670 B 113 kB
|
|
33
33
|
├ λ /api/graphql 0 B 77.9 kB
|
|
34
34
|
├ λ /api/preview 0 B 77.9 kB
|
|
35
35
|
├ ● /checkout 657 B 113 kB
|
|
36
|
-
├ ● /login 1.
|
|
36
|
+
├ ● /login 1.08 kB 113 kB
|
|
37
37
|
└ ● /s 4.55 kB 127 kB
|
|
38
38
|
+ First Load JS shared by all 80.7 kB
|
|
39
39
|
├ chunks/framework-dfd14d7ce6600b03.js 45.3 kB
|
|
40
40
|
├ chunks/main-fd466221927468fd.js 23.9 kB
|
|
41
41
|
├ chunks/pages/_app-babcc4d7b80d8f4a.js 6.38 kB
|
|
42
|
-
├ chunks/webpack-
|
|
42
|
+
├ chunks/webpack-73cade94715ad9e1.js 2.3 kB
|
|
43
43
|
└ css/208b7dd52a0981bd.css 2.8 kB
|
|
44
44
|
|
|
45
45
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.36",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"browserslist": "supports es6-module and not dead",
|
|
6
6
|
"scripts": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@envelop/graphql-jit": "^1.1.1",
|
|
30
30
|
"@envelop/parser-cache": "^2.2.0",
|
|
31
31
|
"@envelop/validation-cache": "^2.2.0",
|
|
32
|
-
"@faststore/api": "^2.1.
|
|
32
|
+
"@faststore/api": "^2.1.36",
|
|
33
33
|
"@faststore/components": "^2.1.33",
|
|
34
34
|
"@faststore/graphql-utils": "^2.1.33",
|
|
35
35
|
"@faststore/sdk": "^2.1.33",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"msw": {
|
|
111
111
|
"workerDirectory": "public"
|
|
112
112
|
},
|
|
113
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "2bb75febbcbdc8c114d3f0912db8502840851440"
|
|
114
114
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import type { PropsWithChildren, ReactNode } from 'react'
|
|
2
2
|
import { useCallback, useState } from 'react'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { AlertProps as UIAlertProps } from '@faststore/ui'
|
|
5
5
|
import { mark } from 'src/sdk/tests/mark'
|
|
6
6
|
|
|
7
7
|
import Section from 'src/components/sections/Section/Section'
|
|
8
8
|
import styles from './section.module.scss'
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
const { Alert: AlertWrapper } = Components
|
|
10
|
+
import { Alert as AlertWrapper } from 'src/components/sections/Alert/Overrides'
|
|
13
11
|
|
|
14
12
|
export interface AlertProps extends UIAlertProps {
|
|
15
13
|
/**
|
|
@@ -38,15 +36,14 @@ function Alert({
|
|
|
38
36
|
|
|
39
37
|
return (
|
|
40
38
|
<Section className={`${styles.section} section-alert`}>
|
|
41
|
-
<AlertWrapper
|
|
42
|
-
{...
|
|
39
|
+
<AlertWrapper.Component
|
|
40
|
+
{...otherProps}
|
|
43
41
|
// Dynamic props, shouldn't be overridable
|
|
44
42
|
// This decision can be reviewed later if needed
|
|
45
43
|
onClose={onAlertClose}
|
|
46
|
-
{...otherProps}
|
|
47
44
|
>
|
|
48
45
|
{content ?? children}
|
|
49
|
-
</AlertWrapper>
|
|
46
|
+
</AlertWrapper.Component>
|
|
50
47
|
</Section>
|
|
51
48
|
)
|
|
52
49
|
}
|
|
@@ -15,15 +15,13 @@ import { ButtonSignIn } from 'src/components/ui/Button'
|
|
|
15
15
|
|
|
16
16
|
import type { NavbarProps as SectionNavbarProps } from '../../sections/Navbar'
|
|
17
17
|
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
const {
|
|
21
|
-
Navbar: NavbarWrapper,
|
|
18
|
+
import {
|
|
19
|
+
Navbar as NavbarWrapper,
|
|
22
20
|
NavbarHeader,
|
|
23
21
|
NavbarRow,
|
|
24
22
|
NavbarButtons,
|
|
25
23
|
IconButton,
|
|
26
|
-
}
|
|
24
|
+
} from 'src/components/sections/Navbar/Overrides'
|
|
27
25
|
|
|
28
26
|
export interface NavbarProps {
|
|
29
27
|
/**
|
|
@@ -77,10 +75,7 @@ function Navbar({
|
|
|
77
75
|
home: { label: homeLabel },
|
|
78
76
|
signIn: { button: signInButton },
|
|
79
77
|
menu: {
|
|
80
|
-
icon: {
|
|
81
|
-
icon: menuIcon,
|
|
82
|
-
alt: menuIconAlt = Props['IconButton']['aria-label'],
|
|
83
|
-
},
|
|
78
|
+
icon: { icon: menuIcon, alt: menuIconAlt = IconButton.props['aria-label'] },
|
|
84
79
|
},
|
|
85
80
|
}: NavbarProps) {
|
|
86
81
|
const scrollDirection = useScrollDirection()
|
|
@@ -99,16 +94,19 @@ function Navbar({
|
|
|
99
94
|
}, [])
|
|
100
95
|
|
|
101
96
|
return (
|
|
102
|
-
<NavbarWrapper
|
|
103
|
-
|
|
104
|
-
|
|
97
|
+
<NavbarWrapper.Component
|
|
98
|
+
scrollDirection={scrollDirection}
|
|
99
|
+
{...NavbarWrapper.props}
|
|
100
|
+
>
|
|
101
|
+
<NavbarHeader.Component {...NavbarHeader.props}>
|
|
102
|
+
<NavbarRow.Component {...NavbarRow.props}>
|
|
105
103
|
{!searchExpanded && (
|
|
106
104
|
<>
|
|
107
|
-
<IconButton
|
|
105
|
+
<IconButton.Component
|
|
108
106
|
data-fs-navbar-button-menu
|
|
109
107
|
onClick={openNavbar}
|
|
110
108
|
icon={<UIIcon name={menuIcon} width={32} height={32} />}
|
|
111
|
-
{...
|
|
109
|
+
{...IconButton.props}
|
|
112
110
|
aria-label={menuIconAlt}
|
|
113
111
|
/>
|
|
114
112
|
<Link
|
|
@@ -125,17 +123,19 @@ function Navbar({
|
|
|
125
123
|
|
|
126
124
|
<SearchInput sort={searchInput?.sort} />
|
|
127
125
|
|
|
128
|
-
<NavbarButtons
|
|
126
|
+
<NavbarButtons.Component
|
|
129
127
|
searchExpanded={searchExpanded}
|
|
130
|
-
{...
|
|
128
|
+
{...NavbarButtons.props}
|
|
131
129
|
>
|
|
132
130
|
{searchExpanded && (
|
|
133
|
-
<IconButton
|
|
131
|
+
<IconButton.Component
|
|
134
132
|
data-fs-button-collapse
|
|
135
133
|
aria-label="Collapse search bar"
|
|
136
134
|
icon={<UIIcon name="CaretLeft" width={32} height={32} />}
|
|
135
|
+
{...IconButton.props}
|
|
136
|
+
// Dynamic props, shouldn't be overridable
|
|
137
|
+
// This decision can be reviewed later if needed
|
|
137
138
|
onClick={handleCollapseSearch}
|
|
138
|
-
{...Props['IconButton']}
|
|
139
139
|
/>
|
|
140
140
|
)}
|
|
141
141
|
|
|
@@ -153,9 +153,9 @@ function Navbar({
|
|
|
153
153
|
<ButtonSignIn {...signInButton} />
|
|
154
154
|
|
|
155
155
|
<CartToggle {...cart} />
|
|
156
|
-
</NavbarButtons>
|
|
157
|
-
</NavbarRow>
|
|
158
|
-
</NavbarHeader>
|
|
156
|
+
</NavbarButtons.Component>
|
|
157
|
+
</NavbarRow.Component>
|
|
158
|
+
</NavbarHeader.Component>
|
|
159
159
|
|
|
160
160
|
<NavbarLinks links={links} region={region} className="hidden-mobile" />
|
|
161
161
|
|
|
@@ -168,7 +168,7 @@ function Navbar({
|
|
|
168
168
|
region={region}
|
|
169
169
|
/>
|
|
170
170
|
)}
|
|
171
|
-
</NavbarWrapper>
|
|
171
|
+
</NavbarWrapper.Component>
|
|
172
172
|
)
|
|
173
173
|
}
|
|
174
174
|
|
|
@@ -9,9 +9,10 @@ import type { NavbarProps } from 'src/components/navigation/Navbar'
|
|
|
9
9
|
|
|
10
10
|
import { mark } from 'src/sdk/tests/mark'
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
import {
|
|
13
|
+
NavbarLinks as NavbarLinksWrapper,
|
|
14
|
+
NavbarLinksList,
|
|
15
|
+
} from 'src/components/sections/Navbar/Overrides'
|
|
15
16
|
|
|
16
17
|
interface NavbarLinksProps extends UINavbarLinksProps {
|
|
17
18
|
links: NavbarProps['links']
|
|
@@ -29,12 +30,12 @@ function NavbarLinks({
|
|
|
29
30
|
...otherProps
|
|
30
31
|
}: NavbarLinksProps) {
|
|
31
32
|
return (
|
|
32
|
-
<NavbarLinksWrapper {...otherProps} {...
|
|
33
|
+
<NavbarLinksWrapper.Component {...otherProps} {...NavbarLinksWrapper.props}>
|
|
33
34
|
<div data-fs-navbar-links-wrapper data-fs-content="navbar">
|
|
34
35
|
{shouldDisplayRegion && (
|
|
35
36
|
<RegionButton icon={regionIcon} label={regionLabel} />
|
|
36
37
|
)}
|
|
37
|
-
<NavbarLinksList {...
|
|
38
|
+
<NavbarLinksList.Component {...NavbarLinksList.props}>
|
|
38
39
|
{links.map(({ url, text }) => (
|
|
39
40
|
<UINavbarLinksListItem key={text}>
|
|
40
41
|
<Link variant="display" href={url} onClick={onClickLink}>
|
|
@@ -42,9 +43,9 @@ function NavbarLinks({
|
|
|
42
43
|
</Link>
|
|
43
44
|
</UINavbarLinksListItem>
|
|
44
45
|
))}
|
|
45
|
-
</NavbarLinksList>
|
|
46
|
+
</NavbarLinksList.Component>
|
|
46
47
|
</div>
|
|
47
|
-
</NavbarLinksWrapper>
|
|
48
|
+
</NavbarLinksWrapper.Component>
|
|
48
49
|
)
|
|
49
50
|
}
|
|
50
51
|
|
|
@@ -11,14 +11,12 @@ import type { NavbarProps } from '../Navbar'
|
|
|
11
11
|
|
|
12
12
|
import styles from '../../sections/Navbar/section.module.scss'
|
|
13
13
|
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
const {
|
|
17
|
-
NavbarSlider: NavbarSliderWrapper,
|
|
14
|
+
import {
|
|
15
|
+
NavbarSlider as NavbarSliderWrapper,
|
|
18
16
|
NavbarSliderHeader,
|
|
19
17
|
NavbarSliderContent,
|
|
20
18
|
NavbarSliderFooter,
|
|
21
|
-
}
|
|
19
|
+
} from 'src/components/sections/Navbar/Overrides'
|
|
22
20
|
|
|
23
21
|
interface NavbarSliderProps {
|
|
24
22
|
logo: NavbarProps['logo']
|
|
@@ -39,16 +37,19 @@ function NavbarSlider({
|
|
|
39
37
|
const { fade, fadeOut } = useFadeEffect()
|
|
40
38
|
|
|
41
39
|
return (
|
|
42
|
-
<NavbarSliderWrapper
|
|
40
|
+
<NavbarSliderWrapper.Component
|
|
43
41
|
fade={fade}
|
|
44
42
|
onDismiss={fadeOut}
|
|
45
43
|
overlayProps={{
|
|
46
44
|
className: `section ${styles.section} section-navbar-slider`,
|
|
47
45
|
}}
|
|
48
46
|
onTransitionEnd={() => fade === 'out' && closeNavbar()}
|
|
49
|
-
{...
|
|
47
|
+
{...NavbarSliderWrapper.props}
|
|
50
48
|
>
|
|
51
|
-
<NavbarSliderHeader
|
|
49
|
+
<NavbarSliderHeader.Component
|
|
50
|
+
onClose={fadeOut}
|
|
51
|
+
{...NavbarSliderWrapper.props}
|
|
52
|
+
>
|
|
52
53
|
<Link
|
|
53
54
|
href="/"
|
|
54
55
|
onClick={fadeOut}
|
|
@@ -58,16 +59,16 @@ function NavbarSlider({
|
|
|
58
59
|
>
|
|
59
60
|
<Logo {...logo} />
|
|
60
61
|
</Link>
|
|
61
|
-
</NavbarSliderHeader>
|
|
62
|
-
<NavbarSliderContent {...
|
|
62
|
+
</NavbarSliderHeader.Component>
|
|
63
|
+
<NavbarSliderContent.Component {...NavbarSliderContent.props}>
|
|
63
64
|
<NavbarLinks onClickLink={fadeOut} links={links} region={region} />
|
|
64
|
-
</NavbarSliderContent>
|
|
65
|
-
<NavbarSliderFooter {...
|
|
65
|
+
</NavbarSliderContent.Component>
|
|
66
|
+
<NavbarSliderFooter.Component {...NavbarSliderFooter.props}>
|
|
66
67
|
<Suspense fallback={<ButtonSignInFallback />}>
|
|
67
68
|
<ButtonSignIn {...signInButton} />
|
|
68
69
|
</Suspense>
|
|
69
|
-
</NavbarSliderFooter>
|
|
70
|
-
</NavbarSliderWrapper>
|
|
70
|
+
</NavbarSliderFooter.Component>
|
|
71
|
+
</NavbarSliderWrapper.Component>
|
|
71
72
|
)
|
|
72
73
|
}
|
|
73
74
|
|
|
@@ -7,12 +7,7 @@ import ProductGridSkeleton from 'src/components/skeletons/ProductGridSkeleton'
|
|
|
7
7
|
|
|
8
8
|
import { ProductCardProps } from '../ProductCard'
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
Components,
|
|
12
|
-
Props,
|
|
13
|
-
} from 'src/components/sections/ProductGallery/Overrides'
|
|
14
|
-
|
|
15
|
-
const { __experimentalProductCard: ProductCard } = Components
|
|
10
|
+
import { __experimentalProductCard as ProductCard } from 'src/components/sections/ProductGallery/Overrides'
|
|
16
11
|
|
|
17
12
|
interface Props {
|
|
18
13
|
/**
|
|
@@ -35,8 +30,8 @@ function ProductGrid({
|
|
|
35
30
|
page,
|
|
36
31
|
pageSize,
|
|
37
32
|
productCard: {
|
|
38
|
-
showDiscountBadge =
|
|
39
|
-
bordered =
|
|
33
|
+
showDiscountBadge = ProductCard.props.showDiscountBadge,
|
|
34
|
+
bordered = ProductCard.props.bordered,
|
|
40
35
|
} = {},
|
|
41
36
|
}: Props) {
|
|
42
37
|
const aspectRatio = 1
|
|
@@ -49,14 +44,14 @@ function ProductGrid({
|
|
|
49
44
|
<UIProductGrid>
|
|
50
45
|
{products.map(({ node: product }, idx) => (
|
|
51
46
|
<UIProductGridItem key={`${product.id}`}>
|
|
52
|
-
<ProductCard
|
|
47
|
+
<ProductCard.Component
|
|
53
48
|
aspectRatio={aspectRatio}
|
|
54
49
|
imgProps={{
|
|
55
50
|
width: 150,
|
|
56
51
|
height: 150,
|
|
57
52
|
sizes: '30vw',
|
|
58
53
|
}}
|
|
59
|
-
{...
|
|
54
|
+
{...ProductCard.props}
|
|
60
55
|
bordered={showDiscountBadge}
|
|
61
56
|
showDiscountBadge={bordered}
|
|
62
57
|
product={product}
|
|
@@ -3,9 +3,11 @@ import type { RegionBarProps as UIRegionBarProps } from '@faststore/ui'
|
|
|
3
3
|
import { useUI } from '@faststore/ui'
|
|
4
4
|
import { useSession } from 'src/sdk/session'
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import {
|
|
7
|
+
RegionBar as RegionBarWrapper,
|
|
8
|
+
LocationIcon,
|
|
9
|
+
ButtonIcon,
|
|
10
|
+
} from 'src/components/sections/RegionBar/Overrides'
|
|
9
11
|
|
|
10
12
|
export interface RegionBarProps {
|
|
11
13
|
/**
|
|
@@ -34,25 +36,37 @@ export interface RegionBarProps {
|
|
|
34
36
|
|
|
35
37
|
function RegionBar({
|
|
36
38
|
icon: {
|
|
37
|
-
icon: locationIcon =
|
|
38
|
-
alt: locationIconAlt =
|
|
39
|
+
icon: locationIcon = LocationIcon.props.name,
|
|
40
|
+
alt: locationIconAlt = LocationIcon.props['aria-label'],
|
|
39
41
|
},
|
|
40
42
|
buttonIcon: {
|
|
41
|
-
icon: buttonIcon =
|
|
42
|
-
alt: buttonIconAlt =
|
|
43
|
+
icon: buttonIcon = ButtonIcon.props.name,
|
|
44
|
+
alt: buttonIconAlt = ButtonIcon.props['aria-label'],
|
|
43
45
|
},
|
|
44
|
-
label =
|
|
45
|
-
editLabel =
|
|
46
|
+
label = RegionBarWrapper.props.label,
|
|
47
|
+
editLabel = RegionBarWrapper.props.editLabel,
|
|
46
48
|
...otherProps
|
|
47
49
|
}: RegionBarProps) {
|
|
48
50
|
const { openModal } = useUI()
|
|
49
51
|
const { postalCode } = useSession()
|
|
50
52
|
|
|
51
53
|
return (
|
|
52
|
-
<RegionBarWrapper
|
|
53
|
-
icon={
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
<RegionBarWrapper.Component
|
|
55
|
+
icon={
|
|
56
|
+
<LocationIcon.Component
|
|
57
|
+
{...LocationIcon.props}
|
|
58
|
+
name={locationIcon}
|
|
59
|
+
aria-label={locationIconAlt}
|
|
60
|
+
/>
|
|
61
|
+
}
|
|
62
|
+
buttonIcon={
|
|
63
|
+
<ButtonIcon.Component
|
|
64
|
+
{...ButtonIcon.props}
|
|
65
|
+
name={buttonIcon}
|
|
66
|
+
aria-label={buttonIconAlt}
|
|
67
|
+
/>
|
|
68
|
+
}
|
|
69
|
+
{...RegionBarWrapper.props}
|
|
56
70
|
label={label}
|
|
57
71
|
editLabel={editLabel}
|
|
58
72
|
// Dynamic props shouldn't be overridable
|
|
@@ -6,15 +6,10 @@ import { ProductGalleryProps } from 'src/components/ui/ProductGallery/ProductGal
|
|
|
6
6
|
import { useFilter } from './useFilter'
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
__experimentalFilterDesktop as FilterDesktop,
|
|
10
|
+
__experimentalFilterSlider as FilterSlider,
|
|
11
11
|
} from 'src/components/sections/ProductGallery/Overrides'
|
|
12
12
|
|
|
13
|
-
const {
|
|
14
|
-
__experimentalFilterDesktop: FilterDesktop,
|
|
15
|
-
__experimentalFilterSlider: FilterSlider,
|
|
16
|
-
} = Components
|
|
17
|
-
|
|
18
13
|
interface Props {
|
|
19
14
|
/**
|
|
20
15
|
* CMS defined data to be used in filter component.
|
|
@@ -42,8 +37,8 @@ function Filter({
|
|
|
42
37
|
return (
|
|
43
38
|
<>
|
|
44
39
|
<div className="hidden-mobile">
|
|
45
|
-
<FilterDesktop
|
|
46
|
-
{...
|
|
40
|
+
<FilterDesktop.Component
|
|
41
|
+
{...FilterDesktop.props}
|
|
47
42
|
{...filter}
|
|
48
43
|
testId={testId}
|
|
49
44
|
title={filterCmsData?.title}
|
|
@@ -52,8 +47,8 @@ function Filter({
|
|
|
52
47
|
|
|
53
48
|
{displayFilter && (
|
|
54
49
|
<Suspense fallback={null}>
|
|
55
|
-
<FilterSlider
|
|
56
|
-
{...
|
|
50
|
+
<FilterSlider.Component
|
|
51
|
+
{...FilterSlider.props}
|
|
57
52
|
{...filter}
|
|
58
53
|
testId={testId}
|
|
59
54
|
title={filterCmsData?.title}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { Components, Props } from 'src/components/sections/Alert/Overrides'
|
|
1
|
+
import { ReactNode } from 'react'
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
import CommonAlert from 'src/components/common/Alert'
|
|
4
|
+
import {
|
|
5
|
+
Alert as AlertWrapper,
|
|
6
|
+
Icon,
|
|
7
|
+
} from 'src/components/sections/Alert/Overrides'
|
|
6
8
|
|
|
7
9
|
export interface AlertProps {
|
|
8
10
|
icon: string
|
|
9
11
|
content: string
|
|
10
12
|
link: {
|
|
11
|
-
|
|
13
|
+
// It is only ReactNode when overridden as such
|
|
14
|
+
text: string | ReactNode
|
|
12
15
|
to: string
|
|
13
16
|
}
|
|
14
17
|
dismissible: boolean
|
|
@@ -16,22 +19,23 @@ export interface AlertProps {
|
|
|
16
19
|
|
|
17
20
|
// TODO: Change actionPath and actionLabel with Link
|
|
18
21
|
function Alert({
|
|
19
|
-
icon =
|
|
22
|
+
icon = Icon.props.name,
|
|
20
23
|
content,
|
|
21
24
|
link: {
|
|
22
|
-
text =
|
|
23
|
-
to =
|
|
24
|
-
}
|
|
25
|
-
dismissible =
|
|
25
|
+
text = AlertWrapper.props.link?.children,
|
|
26
|
+
to = AlertWrapper.props.link?.href,
|
|
27
|
+
},
|
|
28
|
+
dismissible = AlertWrapper.props.dismissible,
|
|
26
29
|
}: AlertProps) {
|
|
27
30
|
return (
|
|
28
31
|
<CommonAlert
|
|
29
|
-
icon={<Icon {...
|
|
32
|
+
icon={<Icon.Component {...Icon.props} name={icon} />}
|
|
33
|
+
{...AlertWrapper.props}
|
|
30
34
|
link={{
|
|
31
|
-
...(
|
|
35
|
+
...(AlertWrapper.props.link ?? {}),
|
|
32
36
|
children: text,
|
|
33
37
|
href: to,
|
|
34
|
-
target:
|
|
38
|
+
target: AlertWrapper.props.link?.target ?? '_self',
|
|
35
39
|
}}
|
|
36
40
|
dismissible={dismissible}
|
|
37
41
|
>
|
|
@@ -1,27 +1,15 @@
|
|
|
1
1
|
import { Alert as UIAlert, 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
|
-
alertPropsCustomization[key] = value.props
|
|
18
|
-
}
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
const Components = {
|
|
22
|
-
Alert: UIAlert,
|
|
23
|
-
Icon: UIIcon,
|
|
24
|
-
...alertComponentsCustomization,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export { Components, alertPropsCustomization as Props }
|
|
3
|
+
import { getSectionOverrides } from 'src/utils/overrides'
|
|
4
|
+
import { override } from 'src/customizations/components/overrides/Alert'
|
|
5
|
+
import type { AlertOverrideDefinition } from 'src/typings/overrides'
|
|
6
|
+
|
|
7
|
+
const { Alert, Icon } = getSectionOverrides(
|
|
8
|
+
{
|
|
9
|
+
Alert: UIAlert,
|
|
10
|
+
Icon: UIIcon,
|
|
11
|
+
},
|
|
12
|
+
override as AlertOverrideDefinition
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
export { Alert, Icon }
|
|
@@ -2,9 +2,13 @@ import {
|
|
|
2
2
|
BannerTextProps as UIBannerTextProps,
|
|
3
3
|
BannerTextContentProps as UIBannerTextContentProps,
|
|
4
4
|
} from '@faststore/ui'
|
|
5
|
-
import { Components, Props } from './Overrides'
|
|
6
5
|
|
|
6
|
+
import {
|
|
7
|
+
BannerText as BannerTextWrapper,
|
|
8
|
+
BannerTextContent,
|
|
9
|
+
} from 'src/components/sections/BannerText/Overrides'
|
|
7
10
|
import Section from '../Section'
|
|
11
|
+
|
|
8
12
|
import styles from './section.module.scss'
|
|
9
13
|
|
|
10
14
|
export interface BannerTextProps {
|
|
@@ -18,34 +22,34 @@ export interface BannerTextProps {
|
|
|
18
22
|
variant?: UIBannerTextProps['variant']
|
|
19
23
|
}
|
|
20
24
|
|
|
21
|
-
const { BannerText: BannerTextWrapper, BannerTextContent } = Components
|
|
22
|
-
|
|
23
25
|
// TODO: Change actionPath and actionLabel with Link
|
|
24
26
|
function BannerText({
|
|
25
27
|
title,
|
|
26
28
|
caption,
|
|
27
29
|
link: {
|
|
28
|
-
url: linkUrl =
|
|
29
|
-
text: linkText =
|
|
30
|
+
url: linkUrl = BannerTextContent.props.link,
|
|
31
|
+
text: linkText = BannerTextContent.props.linkText,
|
|
30
32
|
},
|
|
31
|
-
variant =
|
|
32
|
-
colorVariant =
|
|
33
|
+
variant = BannerTextWrapper.props.variant ?? 'primary',
|
|
34
|
+
colorVariant = BannerTextWrapper.props.colorVariant ?? 'main',
|
|
33
35
|
}: BannerTextProps) {
|
|
34
36
|
return (
|
|
35
37
|
<Section className={`${styles.section} section-banner layout__section`}>
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
<div className="layout__content">
|
|
39
|
+
<BannerTextWrapper.Component
|
|
40
|
+
{...BannerTextWrapper.props}
|
|
41
|
+
variant={variant}
|
|
42
|
+
colorVariant={colorVariant}
|
|
43
|
+
>
|
|
44
|
+
<BannerTextContent.Component
|
|
45
|
+
{...BannerTextContent.props}
|
|
46
|
+
title={title}
|
|
47
|
+
caption={caption}
|
|
48
|
+
link={linkUrl}
|
|
49
|
+
linkText={linkText}
|
|
50
|
+
/>
|
|
51
|
+
</BannerTextWrapper.Component>
|
|
52
|
+
</div>
|
|
49
53
|
</Section>
|
|
50
54
|
)
|
|
51
55
|
}
|
|
@@ -3,28 +3,16 @@ import {
|
|
|
3
3
|
BannerTextContent as UIBannerTextContent,
|
|
4
4
|
} from '@faststore/ui'
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import { getSectionOverrides } from 'src/utils/overrides'
|
|
7
|
+
import { override } from 'src/customizations/components/overrides/BannerText'
|
|
8
|
+
import type { BannerTextOverrideDefinition } from 'src/typings/overrides'
|
|
7
9
|
|
|
8
|
-
const
|
|
10
|
+
const { BannerText, BannerTextContent } = getSectionOverrides(
|
|
11
|
+
{
|
|
12
|
+
BannerText: UIBannerText,
|
|
13
|
+
BannerTextContent: UIBannerTextContent,
|
|
14
|
+
},
|
|
15
|
+
override as BannerTextOverrideDefinition
|
|
16
|
+
)
|
|
9
17
|
|
|
10
|
-
|
|
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
|
-
BannerText: UIBannerText,
|
|
26
|
-
BannerTextContent: UIBannerTextContent,
|
|
27
|
-
...bannerTextComponentsCustomization,
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { Components, bannerTextPropsCustomization as Props }
|
|
18
|
+
export { BannerText, BannerTextContent }
|