@faststore/core 2.0.172-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 (39) hide show
  1. package/.turbo/turbo-build.log +9 -9
  2. package/CHANGELOG.md +12 -0
  3. package/cypress/integration/a11y.test.js +3 -3
  4. package/cypress/integration/analytics.test.js +1 -1
  5. package/cypress/integration/performance.test.js +5 -5
  6. package/package.json +6 -6
  7. package/src/components/navigation/Navbar/Navbar.tsx +37 -29
  8. package/src/components/navigation/NavbarLinks/NavbarLinks.tsx +9 -9
  9. package/src/components/navigation/NavbarSlider/NavbarSlider.tsx +23 -18
  10. package/src/components/sections/Alert/Alert.tsx +0 -1
  11. package/src/components/sections/BannerNewsletter/BannerNewsletter.tsx +13 -9
  12. package/src/components/sections/BannerNewsletter/section.module.scss +1 -1
  13. package/src/components/sections/BannerText/BannerText.tsx +31 -20
  14. package/src/components/sections/BannerText/Overrides.tsx +30 -0
  15. package/src/components/sections/BannerText/section.module.scss +1 -1
  16. package/src/components/sections/Breadcrumb/Overrides.tsx +27 -0
  17. package/src/components/sections/Hero/Hero.tsx +19 -13
  18. package/src/components/sections/Hero/Overrides.tsx +32 -0
  19. package/src/components/sections/Navbar/Navbar.tsx +6 -6
  20. package/src/components/sections/Navbar/Overrides.tsx +48 -0
  21. package/src/components/sections/ProductDetails/Overrides.tsx +13 -4
  22. package/src/components/sections/ProductDetails/ProductDetails.tsx +7 -7
  23. package/src/components/sections/ProductShelf/Overrides.tsx +34 -0
  24. package/src/components/ui/Breadcrumb/Breadcrumb.tsx +14 -5
  25. package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +9 -8
  26. package/src/components/ui/ProductShelf/ProductShelf.tsx +26 -17
  27. package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +6 -5
  28. package/src/components/ui/SkuSelector/Selectors.tsx +6 -2
  29. package/src/customizations/components/CustomComponent.tsx +9 -0
  30. package/src/customizations/components/overrides/BannerText.tsx +15 -0
  31. package/src/customizations/components/overrides/Breadcrumb.tsx +15 -0
  32. package/src/customizations/components/overrides/Hero.tsx +16 -0
  33. package/src/customizations/components/overrides/Navbar.tsx +24 -0
  34. package/src/customizations/components/overrides/ProductDetails.tsx +6 -4
  35. package/src/customizations/components/overrides/ProductShelf.tsx +11 -5
  36. package/src/typings/overrides.d.ts +54 -17
  37. package/src/components/ui/BannerText/BannerText.tsx +0 -69
  38. package/src/components/ui/BannerText/index.ts +0 -2
  39. package/src/components/ui/ProductShelf/Overrides.tsx +0 -10
@@ -21,27 +21,27 @@ info - Generating static pages (7/7)
21
21
  info - Finalizing page optimization...
22
22
 
23
23
  Route (pages) Size First Load JS
24
- ┌ ● / 3.1 kB 125 kB
25
- ├ └ css/13a4da555ff5e3be.css 7.19 kB
24
+ ┌ ● / 3.47 kB 126 kB
25
+ ├ └ css/c7fc1f563fa33060.css 7.18 kB
26
26
  ├ /_app 0 B 77.8 kB
27
- ├ ● /[...slug] 10.1 kB 133 kB
27
+ ├ ● /[...slug] 10.4 kB 134 kB
28
28
  ├ └ css/6e41f1b6078c14c1.css 7.9 kB
29
- ├ ● /[slug]/p 11.7 kB 134 kB
30
- ├ └ css/c6f97f692b2efad9.css 11 kB
29
+ ├ ● /[slug]/p 11.9 kB 135 kB
30
+ ├ └ css/8988ac07eb0af0ca.css 11 kB
31
31
  ├ ○ /404 1.09 kB 113 kB
32
32
  ├ ● /500 1.11 kB 113 kB
33
- ├ ● /account 669 B 112 kB
33
+ ├ ● /account 668 B 113 kB
34
34
  ├ λ /api/graphql 0 B 77.8 kB
35
35
  ├ λ /api/preview 0 B 77.8 kB
36
- ├ ● /checkout 657 B 112 kB
36
+ ├ ● /checkout 658 B 113 kB
37
37
  ├ ● /login 1.01 kB 113 kB
38
38
  └ ● /s 1.11 kB 124 kB
39
39
  + First Load JS shared by all 80.6 kB
40
40
  ├ chunks/framework-dfd14d7ce6600b03.js 45.3 kB
41
41
  ├ chunks/main-fd466221927468fd.js 23.9 kB
42
42
  ├ chunks/pages/_app-79d333aa6001a806.js 6.38 kB
43
- ├ chunks/webpack-d62f6560695a4b1b.js 2.21 kB
44
- └ css/e2dad288b79896b9.css 2.78 kB
43
+ ├ chunks/webpack-9ba6546d294eb768.js 2.21 kB
44
+ └ css/104f0f3ce3be32c6.css 2.79 kB
45
45
 
46
46
  λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
47
47
  ○ (Static) automatically rendered as static HTML (uses no initial props)
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.175-alpha.0](https://github.com/vtex/faststore/compare/v2.0.174-alpha.0...v2.0.175-alpha.0) (2023-06-02)
7
+
8
+ ### Features
9
+
10
+ - Allows some section's component to be overridable ([#1768](https://github.com/vtex/faststore/issues/1768)) ([e19cba2](https://github.com/vtex/faststore/commit/e19cba222351510ffc91ba130ed61e857e9e6bb5))
11
+
12
+ ## 2.0.173-alpha.0 (2023-06-01)
13
+
14
+ ### Chores
15
+
16
+ - temp skip flaky tests ([#1808](https://github.com/vtex/faststore/issues/1808)) ([734b000](https://github.com/vtex/faststore/commit/734b000ec7c8bff756e514cd9acbc77ecf0e9b62))
17
+
6
18
  ## [2.0.172-alpha.0](https://github.com/vtex/faststore/compare/v2.0.171-alpha.0...v2.0.172-alpha.0) (2023-05-31)
7
19
 
8
20
  ### Features
@@ -13,7 +13,7 @@ describe('Accessibility tests', () => {
13
13
  cy.clearIDB()
14
14
  })
15
15
 
16
- it('checks a11y for collection page', () => {
16
+ it.skip('checks a11y for collection page', () => {
17
17
  cy.visit(pages.collection)
18
18
  cy.waitForHydration()
19
19
 
@@ -30,7 +30,7 @@ describe('Accessibility tests', () => {
30
30
  })
31
31
  })
32
32
 
33
- it('checks a11y for product page', () => {
33
+ it.skip('checks a11y for product page', () => {
34
34
  cy.visit(pages.pdp)
35
35
  cy.waitForHydration()
36
36
 
@@ -47,7 +47,7 @@ describe('Accessibility tests', () => {
47
47
  })
48
48
  })
49
49
 
50
- it('checks a11y for home page', () => {
50
+ it.skip('checks a11y for home page', () => {
51
51
  cy.visit(pages.home)
52
52
  cy.waitForHydration()
53
53
 
@@ -389,7 +389,7 @@ describe('view_cart event', () => {
389
389
  })
390
390
  })
391
391
 
392
- it('is fired when the minicart is opened (with items)', () => {
392
+ it.skip('is fired when the minicart is opened (with items)', () => {
393
393
  cy.visit(pages.pdp, options)
394
394
  cy.waitForHydration()
395
395
 
@@ -25,7 +25,7 @@ describe('React rendering performance', () => {
25
25
  cy.clearIDB()
26
26
  })
27
27
 
28
- it('Renders Navbar component once', () => {
28
+ it.skip('Renders Navbar component once', () => {
29
29
  const mark = 'Navbar'
30
30
 
31
31
  for (const path of paths) {
@@ -33,7 +33,7 @@ describe('React rendering performance', () => {
33
33
  }
34
34
  })
35
35
 
36
- it('Renders Footer component once', () => {
36
+ it.skip('Renders Footer component once', () => {
37
37
  const mark = 'Footer'
38
38
 
39
39
  for (const path of paths) {
@@ -41,7 +41,7 @@ describe('React rendering performance', () => {
41
41
  }
42
42
  })
43
43
 
44
- it('Renders Alert component once', () => {
44
+ it.skip('Renders Alert component once', () => {
45
45
  const mark = 'Alert'
46
46
 
47
47
  for (const path of paths) {
@@ -49,7 +49,7 @@ describe('React rendering performance', () => {
49
49
  }
50
50
  })
51
51
 
52
- it('Renders Page component once', () => {
52
+ it.skip('Renders Page component once', () => {
53
53
  const mark = 'Page'
54
54
 
55
55
  for (const path of paths) {
@@ -57,7 +57,7 @@ describe('React rendering performance', () => {
57
57
  }
58
58
  })
59
59
 
60
- it('Renders ProductGallery component once on PLP', () => {
60
+ it.skip('Renders ProductGallery component once on PLP', () => {
61
61
  const mark = 'ProductGallery'
62
62
 
63
63
  testMark(pages.collection, mark)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "2.0.172-alpha.0",
3
+ "version": "2.0.175-alpha.0",
4
4
  "license": "MIT",
5
5
  "browserslist": "supports es6-module and not dead",
6
6
  "scripts": {
@@ -29,11 +29,11 @@
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.0.165-alpha.0",
33
- "@faststore/components": "^2.0.168-alpha.0",
32
+ "@faststore/api": "^2.0.173-alpha.0",
33
+ "@faststore/components": "^2.0.175-alpha.0",
34
34
  "@faststore/graphql-utils": "^2.0.3-alpha.0",
35
- "@faststore/sdk": "^2.0.162-alpha.0",
36
- "@faststore/ui": "^2.0.169-alpha.0",
35
+ "@faststore/sdk": "^2.0.173-alpha.0",
36
+ "@faststore/ui": "^2.0.175-alpha.0",
37
37
  "@types/react": "^18.0.14",
38
38
  "@vtex/client-cms": "^0.2.12",
39
39
  "autoprefixer": "^10.4.0",
@@ -108,5 +108,5 @@
108
108
  "msw": {
109
109
  "workerDirectory": "public"
110
110
  },
111
- "gitHead": "4154be1b6bc5024ac1684563f7b8c436a75ac605"
111
+ "gitHead": "49cd929bd62bf068a51337335d97142703f1c813"
112
112
  }
@@ -1,29 +1,29 @@
1
- import { Suspense, useRef, useState } from 'react'
2
-
3
- import {
4
- Icon as UIIcon,
5
- IconButton as UIIconButton,
6
- Navbar as UINavbar,
7
- NavbarButtons as UINavbarButtons,
8
- NavbarHeader as UINavbarHeader,
9
- NavbarRow as UINavbarRow,
10
- useScrollDirection,
11
- useUI,
12
- } from '@faststore/ui'
1
+ import { useRef, useState } from 'react'
2
+
3
+ import { useUI, useScrollDirection, Icon as UIIcon } from '@faststore/ui'
13
4
 
14
5
  import { mark } from 'src/sdk/tests/mark'
15
6
 
16
- import CartToggle from 'src/components/cart/CartToggle'
17
7
  import type { SearchInputRef } from 'src/components/search/SearchInput'
18
8
  import SearchInput from 'src/components/search/SearchInput'
19
-
20
- import Link from 'src/components/ui/Link'
9
+ import NavbarLinks from 'src/components/navigation/NavbarLinks'
10
+ import NavbarSlider from 'src/components/navigation/NavbarSlider'
11
+ import CartToggle from 'src/components/cart/CartToggle'
21
12
  import Logo from 'src/components/ui/Logo'
13
+ import Link from 'src/components/ui/Link'
22
14
  import { ButtonSignIn } from 'src/components/ui/Button'
23
15
 
24
16
  import type { NavbarProps as SectionNavbarProps } from '../../sections/Navbar'
25
- import NavbarLinks from '../NavbarLinks'
26
- import NavbarSlider from '../NavbarSlider'
17
+
18
+ import { Components, Props } from 'src/components/sections/Navbar/Overrides'
19
+
20
+ const {
21
+ Navbar: NavbarWrapper,
22
+ NavbarHeader,
23
+ NavbarRow,
24
+ NavbarButtons,
25
+ IconButton,
26
+ } = Components
27
27
 
28
28
  export interface NavbarProps {
29
29
  /**
@@ -77,7 +77,10 @@ function Navbar({
77
77
  home: { label: homeLabel },
78
78
  signIn: { button: signInButton },
79
79
  menu: {
80
- icon: { icon: menuIcon, alt: menuIconAlt },
80
+ icon: {
81
+ icon: menuIcon,
82
+ alt: menuIconAlt = Props['IconButton']['aria-label'],
83
+ },
81
84
  },
82
85
  }: NavbarProps) {
83
86
  const scrollDirection = useScrollDirection()
@@ -91,16 +94,17 @@ function Navbar({
91
94
  }
92
95
 
93
96
  return (
94
- <UINavbar scrollDirection={scrollDirection}>
95
- <UINavbarHeader>
96
- <UINavbarRow className="layout__content">
97
+ <NavbarWrapper scrollDirection={scrollDirection} {...Props['Navbar']}>
98
+ <NavbarHeader {...Props['NavbarHeader']}>
99
+ <NavbarRow className="layout__content" {...Props['NavbarRow']}>
97
100
  {!searchExpanded && (
98
101
  <>
99
- <UIIconButton
102
+ <IconButton
100
103
  data-fs-navbar-button-menu
101
104
  onClick={openNavbar}
102
- aria-label={menuIconAlt}
103
105
  icon={<UIIcon name={menuIcon} width={32} height={32} />}
106
+ {...Props['IconButton']}
107
+ aria-label={menuIconAlt}
104
108
  />
105
109
  <Link
106
110
  href="/"
@@ -116,9 +120,12 @@ function Navbar({
116
120
 
117
121
  <SearchInput sort={searchInput?.sort} />
118
122
 
119
- <UINavbarButtons searchExpanded={searchExpanded}>
123
+ <NavbarButtons
124
+ searchExpanded={searchExpanded}
125
+ {...Props['NavbarButtons']}
126
+ >
120
127
  {searchExpanded && (
121
- <UIIconButton
128
+ <IconButton
122
129
  data-fs-button-collapse
123
130
  aria-label="Collapse search bar"
124
131
  icon={<UIIcon name="CaretLeft" width={32} height={32} />}
@@ -126,6 +133,7 @@ function Navbar({
126
133
  setSearchExpanded(false)
127
134
  searchMobileRef.current?.resetSearchInput()
128
135
  }}
136
+ {...Props['IconButton']}
129
137
  />
130
138
  )}
131
139
 
@@ -143,9 +151,9 @@ function Navbar({
143
151
  <ButtonSignIn {...signInButton} />
144
152
 
145
153
  <CartToggle {...cart} />
146
- </UINavbarButtons>
147
- </UINavbarRow>
148
- </UINavbarHeader>
154
+ </NavbarButtons>
155
+ </NavbarRow>
156
+ </NavbarHeader>
149
157
 
150
158
  <NavbarLinks links={links} region={region} className="hidden-mobile" />
151
159
 
@@ -158,7 +166,7 @@ function Navbar({
158
166
  region={region}
159
167
  />
160
168
  )}
161
- </UINavbar>
169
+ </NavbarWrapper>
162
170
  )
163
171
  }
164
172
 
@@ -1,10 +1,6 @@
1
1
  import type { AnchorHTMLAttributes } from 'react'
2
2
 
3
- import {
4
- NavbarLinks as UINavbarLinks,
5
- NavbarLinksList as UINavbarLinksList,
6
- NavbarLinksListItem as UINavbarLinksListItem,
7
- } from '@faststore/ui'
3
+ import { NavbarLinksListItem as UINavbarLinksListItem } from '@faststore/ui'
8
4
  import type { NavbarLinksProps as UINavbarLinksProps } from '@faststore/ui'
9
5
 
10
6
  import Link from 'src/components/ui/Link'
@@ -13,6 +9,10 @@ import type { NavbarProps } from 'src/components/navigation/Navbar'
13
9
 
14
10
  import { mark } from 'src/sdk/tests/mark'
15
11
 
12
+ import { Components, Props } from 'src/components/sections/Navbar/Overrides'
13
+
14
+ const { NavbarLinks: NavbarLinksWrapper, NavbarLinksList } = Components
15
+
16
16
  interface NavbarLinksProps extends UINavbarLinksProps {
17
17
  links: NavbarProps['links']
18
18
  region: NavbarProps['region']
@@ -29,12 +29,12 @@ function NavbarLinks({
29
29
  ...otherProps
30
30
  }: NavbarLinksProps) {
31
31
  return (
32
- <UINavbarLinks {...otherProps}>
32
+ <NavbarLinksWrapper {...otherProps} {...Props['NavbarLinks']}>
33
33
  <div className="layout__content">
34
34
  {shouldDisplayRegion && (
35
35
  <RegionButton icon={regionIcon} label={regionLabel} />
36
36
  )}
37
- <UINavbarLinksList>
37
+ <NavbarLinksList {...Props['NavbarLinksList']}>
38
38
  {links.map(({ url, text }) => (
39
39
  <UINavbarLinksListItem key={text}>
40
40
  <Link variant="display" href={url} onClick={onClickLink}>
@@ -42,9 +42,9 @@ function NavbarLinks({
42
42
  </Link>
43
43
  </UINavbarLinksListItem>
44
44
  ))}
45
- </UINavbarLinksList>
45
+ </NavbarLinksList>
46
46
  </div>
47
- </UINavbarLinks>
47
+ </NavbarLinksWrapper>
48
48
  )
49
49
  }
50
50
 
@@ -1,23 +1,25 @@
1
- import {
2
- NavbarSlider as UINavbarSlider,
3
- NavbarSliderContent as UINavbarSliderContent,
4
- NavbarSliderFooter as UINavbarSliderFooter,
5
- NavbarSliderHeader as UINavbarSliderHeader,
6
- useFadeEffect,
7
- useUI,
8
- } from '@faststore/ui'
1
+ import { useFadeEffect, useUI } from '@faststore/ui'
9
2
  import { Suspense } from 'react'
10
3
 
11
4
  import { ButtonSignIn, ButtonSignInFallback } from 'src/components/ui/Button'
12
5
  import Link from 'src/components/ui/Link'
6
+ import NavbarLinks from 'src/components/navigation/NavbarLinks'
13
7
  import Logo from 'src/components/ui/Logo'
14
8
  import { mark } from 'src/sdk/tests/mark'
15
9
 
16
- import NavbarLinks from '../NavbarLinks'
17
10
  import type { NavbarProps } from '../Navbar'
18
11
 
19
12
  import styles from '../../sections/Navbar/section.module.scss'
20
13
 
14
+ import { Components, Props } from 'src/components/sections/Navbar/Overrides'
15
+
16
+ const {
17
+ NavbarSlider: NavbarSliderWrapper,
18
+ NavbarSliderHeader,
19
+ NavbarSliderContent,
20
+ NavbarSliderFooter,
21
+ } = Components
22
+
21
23
  interface NavbarSliderProps {
22
24
  logo: NavbarProps['logo']
23
25
  home: NavbarProps['home']
@@ -37,15 +39,16 @@ function NavbarSlider({
37
39
  const { fade, fadeOut } = useFadeEffect()
38
40
 
39
41
  return (
40
- <UINavbarSlider
42
+ <NavbarSliderWrapper
41
43
  fade={fade}
42
44
  onDismiss={fadeOut}
43
45
  overlayProps={{
44
46
  className: `section ${styles.section} section-navbar-slider`,
45
47
  }}
46
48
  onTransitionEnd={() => fade === 'out' && closeNavbar()}
49
+ {...Props['NavbarSlider']}
47
50
  >
48
- <UINavbarSliderHeader onClose={fadeOut}>
51
+ <NavbarSliderHeader onClose={fadeOut} {...Props['NavbarSliderHeader']}>
49
52
  <Link
50
53
  href="/"
51
54
  onClick={fadeOut}
@@ -55,14 +58,16 @@ function NavbarSlider({
55
58
  >
56
59
  <Logo {...logo} />
57
60
  </Link>
58
- </UINavbarSliderHeader>
59
- <UINavbarSliderContent>
61
+ </NavbarSliderHeader>
62
+ <NavbarSliderContent {...Props['NavbarSliderContent']}>
60
63
  <NavbarLinks onClickLink={fadeOut} links={links} region={region} />
61
- </UINavbarSliderContent>
62
- <UINavbarSliderFooter>
63
- <ButtonSignIn {...signInButton} />
64
- </UINavbarSliderFooter>
65
- </UINavbarSlider>
64
+ </NavbarSliderContent>
65
+ <NavbarSliderFooter {...Props['NavbarSliderFooter']}>
66
+ <Suspense fallback={<ButtonSignInFallback />}>
67
+ <ButtonSignIn {...signInButton} />
68
+ </Suspense>
69
+ </NavbarSliderFooter>
70
+ </NavbarSliderWrapper>
66
71
  )
67
72
  }
68
73
 
@@ -1,5 +1,4 @@
1
1
  import { Icon as UIIcon } from '@faststore/ui'
2
- import Section from '../Section'
3
2
  import UIAlert from 'src/components/common/Alert'
4
3
 
5
4
  export interface AlertProps {
@@ -1,4 +1,7 @@
1
- import BannerText from 'src/components/ui/BannerText'
1
+ import {
2
+ Banner as UIBanner,
3
+ BannerContent as UIBannerContent,
4
+ } from '@faststore/ui'
2
5
  import Newsletter from '../Newsletter'
3
6
  import Section from '../Section'
4
7
  import styles from './section.module.scss'
@@ -9,14 +12,15 @@ function BannerNewsletter() {
9
12
  className={`${styles.section} section-banner-newsletter layout__content`}
10
13
  >
11
14
  <div data-fs-banner-newsletter>
12
- <BannerText
13
- title="Get to Know Our Next Release"
14
- caption="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam elit nisi, vehicula in turpis sit amet, posuere aliquam nisl. "
15
- actionLabel="Shop Now"
16
- actionPath="/"
17
- variant="secondary"
18
- colorVariant="light"
19
- />
15
+ <UIBanner variant="secondary" colorVariant="light">
16
+ <UIBannerContent
17
+ title="Get to Know Our Next Release"
18
+ caption="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam elit nisi, vehicula in turpis sit amet, posuere aliquam nisl. "
19
+ link="/"
20
+ linkText="Shop Now"
21
+ />
22
+ </UIBanner>
23
+
20
24
  <Newsletter
21
25
  title="Get News and Special Offers!"
22
26
  description="Receive our news and promotions in advance. Enjoy and get 10% off your first purchase. For more information click here."
@@ -1,6 +1,6 @@
1
1
  .section {
2
2
  @import "@faststore/ui/src/components/atoms/Button/styles.scss";
3
3
  @import "@faststore/ui/src/components/molecules/LinkButton/styles.scss";
4
- @import "@faststore/ui/src/components/molecules/Banner/styles.scss";
4
+ @import "@faststore/ui/src/components/organisms/Banner/styles.scss";
5
5
  @import "@faststore/ui/src/components/organisms/BannerNewsletter/styles.scss";
6
6
  }
@@ -1,39 +1,50 @@
1
- import UIBannerText, {
2
- BannerTextProps as UIBannerTextProps,
3
- } from 'src/components/ui/BannerText'
4
- import Section from '../Section'
1
+ import {
2
+ BannerProps as UIBannerProps,
3
+ BannerContentProps as UIBannerContentProps,
4
+ } from '@faststore/ui'
5
+ import { Components, Props } from './Overrides'
5
6
 
7
+ import Section from '../Section'
6
8
  import styles from './section.module.scss'
7
9
 
8
10
  export interface BannerTextProps {
9
- title: string
10
- caption: string
11
+ title: UIBannerContentProps['title']
12
+ caption: UIBannerContentProps['caption']
11
13
  link?: {
12
- text: string
13
- url: string
14
+ text?: string
15
+ url?: string
14
16
  }
15
- colorVariant?: UIBannerTextProps['colorVariant']
16
- variant?: UIBannerTextProps['variant']
17
+ colorVariant?: UIBannerProps['colorVariant']
18
+ variant?: UIBannerProps['variant']
17
19
  }
18
20
 
21
+ const { Banner, BannerContent } = Components
22
+
19
23
  // TODO: Change actionPath and actionLabel with Link
20
24
  function BannerText({
21
25
  title,
22
26
  caption,
23
27
  link,
24
- variant,
25
- colorVariant = 'main',
28
+ variant = Props['BannerText'].variant ?? 'primary',
29
+ colorVariant = Props['BannerText'].colorVariant ?? 'main',
26
30
  }: BannerTextProps) {
27
31
  return (
28
32
  <Section className={`${styles.section} section-banner layout__section`}>
29
- <UIBannerText
30
- variant={variant}
31
- title={title}
32
- caption={caption}
33
- actionPath={link?.url}
34
- actionLabel={link?.text}
35
- colorVariant={colorVariant}
36
- />
33
+ <div className="layout__content">
34
+ <Banner
35
+ variant={variant}
36
+ colorVariant={colorVariant}
37
+ {...Props['Banner']}
38
+ >
39
+ <BannerContent
40
+ title={title}
41
+ caption={caption}
42
+ link={link?.url}
43
+ linkText={link?.text}
44
+ {...Props['BannerContent']}
45
+ />
46
+ </Banner>
47
+ </div>
37
48
  </Section>
38
49
  )
39
50
  }
@@ -0,0 +1,30 @@
1
+ import {
2
+ Banner as UIBanner,
3
+ BannerContent as UIBannerContent,
4
+ } from '@faststore/ui'
5
+
6
+ import BannerTextCustomizations from 'src/customizations/components/overrides/BannerText'
7
+
8
+ const bannerTextComponentsCustomization = {}
9
+
10
+ const bannerTextPropsCustomization = {} as any
11
+
12
+ Object.entries(BannerTextCustomizations.components).forEach(([key, value]) => {
13
+ if (value.Component) {
14
+ bannerTextComponentsCustomization[key] = value.Component
15
+ }
16
+ })
17
+
18
+ Object.entries(BannerTextCustomizations.components).forEach(([key, value]) => {
19
+ if (value.props) {
20
+ bannerTextPropsCustomization[key] = value.props
21
+ }
22
+ })
23
+
24
+ const Components = {
25
+ Banner: UIBanner,
26
+ BannerContent: UIBannerContent,
27
+ ...bannerTextComponentsCustomization,
28
+ }
29
+
30
+ export { Components, bannerTextPropsCustomization as Props }
@@ -1,5 +1,5 @@
1
1
  .section {
2
2
  @import "@faststore/ui/src/components/atoms/Button/styles";
3
3
  @import "@faststore/ui/src/components/molecules/LinkButton/styles";
4
- @import "@faststore/ui/src/components/molecules/Banner/styles";
4
+ @import "@faststore/ui/src/components/organisms/Banner/styles";
5
5
  }
@@ -0,0 +1,27 @@
1
+ import { Breadcrumb as UIBreadcrumb, Icon as UIIcon } from '@faststore/ui'
2
+
3
+ import BreadcrumbCustomizations from 'src/customizations/components/overrides/Breadcrumb'
4
+
5
+ const breadcrumbComponentsCustomization = {}
6
+
7
+ const breadcrumbPropsCustomization = {} as any
8
+
9
+ Object.entries(BreadcrumbCustomizations.components).forEach(([key, value]) => {
10
+ if (value.Component) {
11
+ breadcrumbComponentsCustomization[key] = value.Component
12
+ }
13
+ })
14
+
15
+ Object.entries(BreadcrumbCustomizations.components).forEach(([key, value]) => {
16
+ if (value.props) {
17
+ breadcrumbPropsCustomization[key] = value.props
18
+ }
19
+ })
20
+
21
+ const Components = {
22
+ Breadcrumb: UIBreadcrumb,
23
+ Icon: UIIcon,
24
+ ...breadcrumbComponentsCustomization,
25
+ }
26
+
27
+ export { Components, breadcrumbPropsCustomization as Props }