@faststore/core 2.1.33 → 2.1.35

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 (195) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/build-manifest.json +129 -0
  3. package/.next/cache/.tsbuildinfo +1 -0
  4. package/.next/cache/config.json +7 -0
  5. package/.next/cache/eslint/.cache_1gneedd +1 -0
  6. package/.next/cache/next-server.js.nft.json +1 -0
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/index.pack +0 -0
  9. package/.next/cache/webpack/server-production/0.pack +0 -0
  10. package/.next/cache/webpack/server-production/index.pack +0 -0
  11. package/.next/export-marker.json +1 -0
  12. package/.next/images-manifest.json +1 -0
  13. package/.next/next-server.js.nft.json +1 -0
  14. package/.next/package.json +1 -0
  15. package/.next/prerender-manifest.json +1 -0
  16. package/.next/react-loadable-manifest.json +44 -0
  17. package/.next/required-server-files.json +1 -0
  18. package/.next/routes-manifest.json +1 -0
  19. package/.next/server/chunks/123.js +58 -0
  20. package/.next/server/chunks/143.js +106 -0
  21. package/.next/server/chunks/183.js +90 -0
  22. package/.next/server/chunks/184.js +61 -0
  23. package/.next/server/chunks/186.js +113 -0
  24. package/.next/server/chunks/247.js +61 -0
  25. package/.next/server/chunks/253.js +509 -0
  26. package/.next/server/chunks/269.js +517 -0
  27. package/.next/server/chunks/287.js +58 -0
  28. package/.next/server/chunks/289.js +239 -0
  29. package/.next/server/chunks/312.js +697 -0
  30. package/.next/server/chunks/350.js +143 -0
  31. package/.next/server/chunks/487.js +9142 -0
  32. package/.next/server/chunks/502.js +626 -0
  33. package/.next/server/chunks/576.js +90 -0
  34. package/.next/server/chunks/597.js +211 -0
  35. package/.next/server/chunks/650.js +9142 -0
  36. package/.next/server/chunks/676.js +32 -0
  37. package/.next/server/chunks/721.js +650 -0
  38. package/.next/server/chunks/74.js +4039 -0
  39. package/.next/server/chunks/81.js +1254 -0
  40. package/.next/server/chunks/825.js +4039 -0
  41. package/.next/server/chunks/854.js +72 -0
  42. package/.next/server/chunks/859.js +959 -0
  43. package/.next/server/chunks/886.js +120 -0
  44. package/.next/server/chunks/907.js +1910 -0
  45. package/.next/server/chunks/98.js +124 -0
  46. package/.next/server/chunks/font-manifest.json +1 -0
  47. package/.next/server/font-manifest.json +1 -0
  48. package/.next/server/middleware-build-manifest.js +1 -0
  49. package/.next/server/middleware-manifest.json +6 -0
  50. package/.next/server/middleware-react-loadable-manifest.js +1 -0
  51. package/.next/server/pages/404.js +386 -0
  52. package/.next/server/pages/404.js.nft.json +1 -0
  53. package/.next/server/pages/500.js +388 -0
  54. package/.next/server/pages/500.js.nft.json +1 -0
  55. package/.next/server/pages/[...slug].js +1005 -0
  56. package/.next/server/pages/[...slug].js.nft.json +1 -0
  57. package/.next/server/pages/[slug]/p.js +2337 -0
  58. package/.next/server/pages/[slug]/p.js.nft.json +1 -0
  59. package/.next/server/pages/_app.js +281 -0
  60. package/.next/server/pages/_app.js.nft.json +1 -0
  61. package/.next/server/pages/_document.js +352 -0
  62. package/.next/server/pages/_document.js.nft.json +1 -0
  63. package/.next/server/pages/_error.js +164 -0
  64. package/.next/server/pages/_error.js.nft.json +1 -0
  65. package/.next/server/pages/account.js +363 -0
  66. package/.next/server/pages/account.js.nft.json +1 -0
  67. package/.next/server/pages/api/graphql.js +365 -0
  68. package/.next/server/pages/api/graphql.js.nft.json +1 -0
  69. package/.next/server/pages/api/preview.js +148 -0
  70. package/.next/server/pages/api/preview.js.nft.json +1 -0
  71. package/.next/server/pages/checkout.js +363 -0
  72. package/.next/server/pages/checkout.js.nft.json +1 -0
  73. package/.next/server/pages/en-US/404.html +81 -0
  74. package/.next/server/pages/en-US/404.json +1 -0
  75. package/.next/server/pages/en-US/500.html +81 -0
  76. package/.next/server/pages/en-US/500.json +1 -0
  77. package/.next/server/pages/en-US/account.html +81 -0
  78. package/.next/server/pages/en-US/account.json +1 -0
  79. package/.next/server/pages/en-US/checkout.html +81 -0
  80. package/.next/server/pages/en-US/checkout.json +1 -0
  81. package/.next/server/pages/en-US/login.html +81 -0
  82. package/.next/server/pages/en-US/login.json +1 -0
  83. package/.next/server/pages/en-US/s.html +81 -0
  84. package/.next/server/pages/en-US/s.json +1 -0
  85. package/.next/server/pages/en-US.html +81 -0
  86. package/.next/server/pages/en-US.json +1 -0
  87. package/.next/server/pages/index.js +439 -0
  88. package/.next/server/pages/index.js.nft.json +1 -0
  89. package/.next/server/pages/login.js +368 -0
  90. package/.next/server/pages/login.js.nft.json +1 -0
  91. package/.next/server/pages/s.js +466 -0
  92. package/.next/server/pages/s.js.nft.json +1 -0
  93. package/.next/server/pages-manifest.json +16 -0
  94. package/.next/server/webpack-api-runtime.js +229 -0
  95. package/.next/server/webpack-runtime.js +229 -0
  96. package/.next/static/chunks/143.dd8a556e6957baa1.js +1 -0
  97. package/.next/static/chunks/209-d1d2eeaeefbc68f7.js +1 -0
  98. package/.next/static/chunks/495.0ecd099878b2a36d.js +1 -0
  99. package/.next/static/chunks/502.b14533723651e5a1.js +1 -0
  100. package/.next/static/chunks/548-6b23e7ad82cd22b9.js +1 -0
  101. package/.next/static/chunks/597.f8d0595b113c70af.js +1 -0
  102. package/.next/static/chunks/64.2f385ef39cd5877d.js +1 -0
  103. package/.next/static/chunks/651.7142f31ce1e052b3.js +1 -0
  104. package/.next/static/chunks/706-1020d118bb59b204.js +1 -0
  105. package/.next/static/chunks/738-a5ff304828f20cbf.js +1 -0
  106. package/.next/static/chunks/741.52f7fb873418346f.js +1 -0
  107. package/.next/static/chunks/791-681afeb766a9098f.js +1 -0
  108. package/.next/static/chunks/98.97381d2021f86cd9.js +1 -0
  109. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +1 -0
  110. package/.next/static/chunks/main-fd466221927468fd.js +1 -0
  111. package/.next/static/chunks/pages/404-14d27e3706f3d2c3.js +1 -0
  112. package/.next/static/chunks/pages/500-250ccf5c9626e451.js +1 -0
  113. package/.next/static/chunks/pages/[...slug]-bcfaf0c5d60b57a0.js +1 -0
  114. package/.next/static/chunks/pages/[slug]/p-c1f2b05344981f12.js +1 -0
  115. package/.next/static/chunks/pages/_app-babcc4d7b80d8f4a.js +1 -0
  116. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +1 -0
  117. package/.next/static/chunks/pages/account-d248acc931146694.js +1 -0
  118. package/.next/static/chunks/pages/checkout-97f6d6f36f041a6f.js +1 -0
  119. package/.next/static/chunks/pages/index-bdbfb082027ed2b7.js +1 -0
  120. package/.next/static/chunks/pages/login-b1bdf30c951bb60d.js +1 -0
  121. package/.next/static/chunks/pages/s-aabfa5c08338974a.js +1 -0
  122. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +1 -0
  123. package/.next/static/chunks/webpack-73cade94715ad9e1.js +1 -0
  124. package/.next/static/css/208b7dd52a0981bd.css +1 -0
  125. package/.next/static/css/41ef280537acec50.css +1 -0
  126. package/.next/static/css/4ad5a6bd11a9f8d8.css +1 -0
  127. package/.next/static/css/5330ae3076254840.css +1 -0
  128. package/.next/static/css/5972921daee792bb.css +1 -0
  129. package/.next/static/css/6e1a7434f061d0ef.css +1 -0
  130. package/.next/static/css/82a475e147f4b2ee.css +1 -0
  131. package/.next/static/css/af5ef0767b748cb3.css +1 -0
  132. package/.next/static/css/cb7d1fcea42fab9c.css +1 -0
  133. package/.next/static/css/d67fbe2a613293c1.css +1 -0
  134. package/.next/static/uXS-aZT8ClbPcIudKFF0d/_buildManifest.js +1 -0
  135. package/.next/static/uXS-aZT8ClbPcIudKFF0d/_ssgManifest.js +1 -0
  136. package/.next/trace +80 -0
  137. package/.turbo/turbo-build.log +7 -7
  138. package/package.json +2 -2
  139. package/public/~partytown/debug/partytown-atomics.js +556 -0
  140. package/public/~partytown/debug/partytown-media.js +374 -0
  141. package/public/~partytown/debug/partytown-sandbox-sw.js +543 -0
  142. package/public/~partytown/debug/partytown-sw.js +59 -0
  143. package/public/~partytown/debug/partytown-ww-atomics.js +1789 -0
  144. package/public/~partytown/debug/partytown-ww-sw.js +1781 -0
  145. package/public/~partytown/debug/partytown.js +72 -0
  146. package/public/~partytown/partytown-atomics.js +2 -0
  147. package/public/~partytown/partytown-media.js +2 -0
  148. package/public/~partytown/partytown-sw.js +2 -0
  149. package/public/~partytown/partytown.js +2 -0
  150. package/src/components/common/Alert/Alert.tsx +5 -8
  151. package/src/components/navigation/Navbar/Navbar.tsx +22 -22
  152. package/src/components/navigation/NavbarLinks/NavbarLinks.tsx +8 -7
  153. package/src/components/navigation/NavbarSlider/NavbarSlider.tsx +15 -14
  154. package/src/components/product/ProductGrid/ProductGrid.tsx +5 -10
  155. package/src/components/region/RegionBar/RegionBar.tsx +27 -13
  156. package/src/components/search/Filter/Filter.tsx +6 -11
  157. package/src/components/sections/Alert/Alert.tsx +17 -13
  158. package/src/components/sections/Alert/Overrides.tsx +13 -25
  159. package/src/components/sections/BannerText/BannerText.tsx +24 -20
  160. package/src/components/sections/BannerText/Overrides.tsx +11 -23
  161. package/src/components/sections/Breadcrumb/Overrides.tsx +13 -25
  162. package/src/components/sections/EmptyState/EmptyState.tsx +6 -8
  163. package/src/components/sections/EmptyState/Overrides.tsx +12 -24
  164. package/src/components/sections/Hero/Hero.tsx +15 -12
  165. package/src/components/sections/Hero/Overrides.tsx +12 -24
  166. package/src/components/sections/Navbar/Overrides.tsx +43 -31
  167. package/src/components/sections/Newsletter/Overrides.tsx +28 -26
  168. package/src/components/sections/ProductDetails/Overrides.tsx +51 -38
  169. package/src/components/sections/ProductDetails/ProductDetails.tsx +22 -30
  170. package/src/components/sections/ProductGallery/Overrides.tsx +44 -35
  171. package/src/components/sections/ProductShelf/Overrides.tsx +14 -28
  172. package/src/components/sections/RegionBar/Overrides.tsx +12 -24
  173. package/src/components/ui/Breadcrumb/Breadcrumb.tsx +9 -7
  174. package/src/components/ui/ImageGallery/ImageGallery.tsx +13 -19
  175. package/src/components/ui/Newsletter/Newsletter.tsx +23 -24
  176. package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +21 -17
  177. package/src/components/ui/ProductGallery/ProductGallery.tsx +31 -38
  178. package/src/components/ui/ProductShelf/ProductShelf.tsx +11 -16
  179. package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +2 -3
  180. package/src/components/ui/SkuSelector/Selectors.tsx +8 -7
  181. package/src/customizations/components/overrides/Alert.tsx +3 -7
  182. package/src/customizations/components/overrides/BannerText.tsx +3 -7
  183. package/src/customizations/components/overrides/Breadcrumb.tsx +3 -7
  184. package/src/customizations/components/overrides/EmptyState.tsx +3 -6
  185. package/src/customizations/components/overrides/Hero.tsx +3 -8
  186. package/src/customizations/components/overrides/Navbar.tsx +3 -16
  187. package/src/customizations/components/overrides/Newsletter.tsx +3 -11
  188. package/src/customizations/components/overrides/ProductDetails.tsx +3 -18
  189. package/src/customizations/components/overrides/ProductGallery.tsx +3 -16
  190. package/src/customizations/components/overrides/ProductShelf.tsx +3 -8
  191. package/src/customizations/components/overrides/RegionBar.tsx +3 -8
  192. package/src/typings/overrideDefinitionUtils.ts +40 -0
  193. package/src/typings/overrides.ts +267 -0
  194. package/src/utils/overrides.ts +53 -0
  195. package/src/typings/overrides.d.ts +0 -97
@@ -6,15 +6,10 @@ import { ProductGalleryProps } from 'src/components/ui/ProductGallery/ProductGal
6
6
  import { useFilter } from './useFilter'
7
7
 
8
8
  import {
9
- Components,
10
- Props,
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
- {...Props['__experimentalFilterDesktop']}
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
- {...Props['__experimentalFilterSlider']}
50
+ <FilterSlider.Component
51
+ {...FilterSlider.props}
57
52
  {...filter}
58
53
  testId={testId}
59
54
  title={filterCmsData?.title}
@@ -1,14 +1,17 @@
1
- import CommonAlert from 'src/components/common/Alert'
2
-
3
- import { Components, Props } from 'src/components/sections/Alert/Overrides'
1
+ import { ReactNode } from 'react'
4
2
 
5
- const { Icon } = Components
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
- text: string
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 = Props['Icon'].name,
22
+ icon = Icon.props.name,
20
23
  content,
21
24
  link: {
22
- text = Props['Alert'].link?.text,
23
- to = Props['Alert'].link?.to,
24
- } = Props['Alert'].link,
25
- dismissible = Props['Alert'].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 {...Props['Icon']} name={icon} />}
32
+ icon={<Icon.Component {...Icon.props} name={icon} />}
33
+ {...AlertWrapper.props}
30
34
  link={{
31
- ...(Props['Alert'].link ?? {}),
35
+ ...(AlertWrapper.props.link ?? {}),
32
36
  children: text,
33
37
  href: to,
34
- target: Props['Alert'].link?.target ?? '_self',
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 AlertCustomizations from 'src/customizations/components/overrides/Alert'
4
-
5
- const alertComponentsCustomization = {}
6
-
7
- const alertPropsCustomization = {} as any
8
-
9
- Object.entries(AlertCustomizations.components).forEach(([key, value]) => {
10
- if (value.Component) {
11
- alertComponentsCustomization[key] = value.Component
12
- }
13
- })
14
-
15
- Object.entries(AlertCustomizations.components).forEach(([key, value]) => {
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 = Props['BannerTextContent'].link,
29
- text: linkText = Props['BannerTextContent'].linkText,
30
+ url: linkUrl = BannerTextContent.props.link,
31
+ text: linkText = BannerTextContent.props.linkText,
30
32
  },
31
- variant = Props['BannerText'].variant ?? 'primary',
32
- colorVariant = Props['BannerText'].colorVariant ?? 'main',
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
- <BannerTextWrapper
37
- {...Props['BannerText']}
38
- variant={variant}
39
- colorVariant={colorVariant}
40
- >
41
- <BannerTextContent
42
- {...Props['BannerTextContent']}
43
- title={title}
44
- caption={caption}
45
- link={linkUrl}
46
- linkText={linkText}
47
- />
48
- </BannerTextWrapper>
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 BannerTextCustomizations from 'src/customizations/components/overrides/BannerText'
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 bannerTextComponentsCustomization = {}
10
+ const { BannerText, BannerTextContent } = getSectionOverrides(
11
+ {
12
+ BannerText: UIBannerText,
13
+ BannerTextContent: UIBannerTextContent,
14
+ },
15
+ override as BannerTextOverrideDefinition
16
+ )
9
17
 
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
- BannerText: UIBannerText,
26
- BannerTextContent: UIBannerTextContent,
27
- ...bannerTextComponentsCustomization,
28
- }
29
-
30
- export { Components, bannerTextPropsCustomization as Props }
18
+ export { BannerText, BannerTextContent }
@@ -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 }