@faststore/core 2.0.121-alpha.0 → 2.0.122-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.
- package/.next/BUILD_ID +1 -0
- package/.next/build-manifest.json +120 -0
- package/.next/cache/.tsbuildinfo +1 -0
- package/.next/cache/config.json +7 -0
- package/.next/cache/eslint/.cache_1gneedd +1 -0
- package/.next/cache/next-server.js.nft.json +1 -0
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/export-marker.json +1 -0
- package/.next/images-manifest.json +1 -0
- package/.next/next-server.js.nft.json +1 -0
- package/.next/package.json +1 -0
- package/.next/prerender-manifest.json +1 -0
- package/.next/react-loadable-manifest.json +52 -0
- package/.next/required-server-files.json +1 -0
- package/.next/routes-manifest.json +1 -0
- package/.next/server/chunks/104.js +255 -0
- package/.next/server/chunks/120.js +435 -0
- package/.next/server/chunks/123.js +58 -0
- package/.next/server/chunks/143.js +106 -0
- package/.next/server/chunks/154.js +206 -0
- package/.next/server/chunks/183.js +80 -0
- package/.next/server/chunks/247.js +61 -0
- package/.next/server/chunks/254.js +159 -0
- package/.next/server/chunks/256.js +1787 -0
- package/.next/server/chunks/280.js +322 -0
- package/.next/server/chunks/287.js +58 -0
- package/.next/server/chunks/312.js +674 -0
- package/.next/server/chunks/336.js +820 -0
- package/.next/server/chunks/350.js +142 -0
- package/.next/server/chunks/398.js +132 -0
- package/.next/server/chunks/401.js +7241 -0
- package/.next/server/chunks/431.js +7241 -0
- package/.next/server/chunks/502.js +603 -0
- package/.next/server/chunks/554.js +264 -0
- package/.next/server/chunks/557.js +135 -0
- package/.next/server/chunks/576.js +80 -0
- package/.next/server/chunks/597.js +169 -0
- package/.next/server/chunks/608.js +515 -0
- package/.next/server/chunks/664.js +3401 -0
- package/.next/server/chunks/676.js +32 -0
- package/.next/server/chunks/74.js +2606 -0
- package/.next/server/chunks/746.js +249 -0
- package/.next/server/chunks/82.js +371 -0
- package/.next/server/chunks/854.js +72 -0
- package/.next/server/chunks/859.js +959 -0
- package/.next/server/chunks/872.js +358 -0
- package/.next/server/chunks/886.js +120 -0
- package/.next/server/chunks/98.js +124 -0
- package/.next/server/chunks/font-manifest.json +1 -0
- package/.next/server/font-manifest.json +1 -0
- package/.next/server/middleware-build-manifest.js +1 -0
- package/.next/server/middleware-manifest.json +6 -0
- package/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/.next/server/pages/404.js +414 -0
- package/.next/server/pages/404.js.nft.json +1 -0
- package/.next/server/pages/500.js +384 -0
- package/.next/server/pages/500.js.nft.json +1 -0
- package/.next/server/pages/[...slug].js +700 -0
- package/.next/server/pages/[...slug].js.nft.json +1 -0
- package/.next/server/pages/[slug]/p.js +2338 -0
- package/.next/server/pages/[slug]/p.js.nft.json +1 -0
- package/.next/server/pages/_app.js +368 -0
- package/.next/server/pages/_app.js.nft.json +1 -0
- package/.next/server/pages/_document.js +304 -0
- package/.next/server/pages/_document.js.nft.json +1 -0
- package/.next/server/pages/_error.js +164 -0
- package/.next/server/pages/_error.js.nft.json +1 -0
- package/.next/server/pages/account.js +370 -0
- package/.next/server/pages/account.js.nft.json +1 -0
- package/.next/server/pages/api/graphql.js +315 -0
- package/.next/server/pages/api/graphql.js.nft.json +1 -0
- package/.next/server/pages/api/preview.js +118 -0
- package/.next/server/pages/api/preview.js.nft.json +1 -0
- package/.next/server/pages/checkout.js +370 -0
- package/.next/server/pages/checkout.js.nft.json +1 -0
- package/.next/server/pages/en-US/404.html +81 -0
- package/.next/server/pages/en-US/404.json +1 -0
- package/.next/server/pages/en-US/500.html +81 -0
- package/.next/server/pages/en-US/500.json +1 -0
- package/.next/server/pages/en-US/account.html +81 -0
- package/.next/server/pages/en-US/account.json +1 -0
- package/.next/server/pages/en-US/checkout.html +81 -0
- package/.next/server/pages/en-US/checkout.json +1 -0
- package/.next/server/pages/en-US/login.html +81 -0
- package/.next/server/pages/en-US/login.json +1 -0
- package/.next/server/pages/en-US/s.html +81 -0
- package/.next/server/pages/en-US/s.json +1 -0
- package/.next/server/pages/en-US.html +81 -0
- package/.next/server/pages/en-US.json +1 -0
- package/.next/server/pages/index.js +580 -0
- package/.next/server/pages/index.js.nft.json +1 -0
- package/.next/server/pages/login.js +396 -0
- package/.next/server/pages/login.js.nft.json +1 -0
- package/.next/server/pages/s.js +438 -0
- package/.next/server/pages/s.js.nft.json +1 -0
- package/.next/server/pages-manifest.json +16 -0
- package/.next/server/webpack-api-runtime.js +229 -0
- package/.next/server/webpack-runtime.js +229 -0
- package/.next/static/chunks/143.dd8a556e6957baa1.js +1 -0
- package/.next/static/chunks/170.b45293edb4f089c8.js +1 -0
- package/.next/static/chunks/226.b57e10ad9932f88c.js +1 -0
- package/.next/static/chunks/336.84e96cd7aa2412bc.js +1 -0
- package/.next/static/chunks/419-274b5b8beee8c7b2.js +1 -0
- package/.next/static/chunks/495.e6b60941cc3e82e4.js +1 -0
- package/.next/static/chunks/54.1d3e6cb43b5b1626.js +1 -0
- package/.next/static/chunks/597.d0da2018cc312352.js +1 -0
- package/.next/static/chunks/608.59e69b83f35d9c44.js +1 -0
- package/.next/static/chunks/651.7142f31ce1e052b3.js +1 -0
- package/.next/static/chunks/706-abfba2e18f084aed.js +1 -0
- package/.next/static/chunks/741.52f7fb873418346f.js +1 -0
- package/.next/static/chunks/832-99f4667bdaf092f8.js +1 -0
- package/.next/static/chunks/861-d1a326525092ab9c.js +1 -0
- package/.next/static/chunks/98.97381d2021f86cd9.js +1 -0
- package/.next/static/chunks/framework-dfd14d7ce6600b03.js +1 -0
- package/.next/static/chunks/main-9746772201fe3ac1.js +1 -0
- package/.next/static/chunks/pages/404-ac22e12eb22b9c50.js +1 -0
- package/.next/static/chunks/pages/500-7b708e8b89389d0e.js +1 -0
- package/.next/static/chunks/pages/[...slug]-3aaeeabdb9564d0f.js +1 -0
- package/.next/static/chunks/pages/[slug]/p-b269ba68926617dd.js +1 -0
- package/.next/static/chunks/pages/_app-b601536188b9a919.js +1 -0
- package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +1 -0
- package/.next/static/chunks/pages/account-04a0a6c07709c50e.js +1 -0
- package/.next/static/chunks/pages/checkout-2ed6b828bb6ed7e6.js +1 -0
- package/.next/static/chunks/pages/index-c2b6dfd205dc6cc2.js +1 -0
- package/.next/static/chunks/pages/login-3bb40d77e6ee120a.js +1 -0
- package/.next/static/chunks/pages/s-8fec20c40a2bd7da.js +1 -0
- package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +1 -0
- package/.next/static/chunks/webpack-426a37879992164d.js +1 -0
- package/.next/static/css/025f924b9633ecd3.css +1 -0
- package/.next/static/css/2253644409b99b98.css +1 -0
- package/.next/static/css/364c439adafef5c8.css +1 -0
- package/.next/static/css/4b7b7b64ae6afe67.css +1 -0
- package/.next/static/css/4e0fc649e912b30f.css +1 -0
- package/.next/static/css/501cb58eaa378545.css +1 -0
- package/.next/static/css/587c27bbda64e700.css +1 -0
- package/.next/static/css/5f1b35b69b2ba1f7.css +1 -0
- package/.next/static/css/7a8417de90d11c60.css +1 -0
- package/.next/static/css/7df2581c69fe96b4.css +1 -0
- package/.next/static/media/brandless-neutral.76ddf63a.png +0 -0
- package/.next/static/z81uKE37lBbYBn8W-39Mb/_buildManifest.js +1 -0
- package/.next/static/z81uKE37lBbYBn8W-39Mb/_ssgManifest.js +1 -0
- package/.next/trace +65 -0
- package/.turbo/turbo-build.log +15 -16
- package/CHANGELOG.md +6 -0
- package/package.json +4 -4
- package/public/~partytown/debug/partytown-atomics.js +556 -0
- package/public/~partytown/debug/partytown-media.js +374 -0
- package/public/~partytown/debug/partytown-sandbox-sw.js +543 -0
- package/public/~partytown/debug/partytown-sw.js +59 -0
- package/public/~partytown/debug/partytown-ww-atomics.js +1789 -0
- package/public/~partytown/debug/partytown-ww-sw.js +1781 -0
- package/public/~partytown/debug/partytown.js +72 -0
- package/public/~partytown/partytown-atomics.js +2 -0
- package/public/~partytown/partytown-media.js +2 -0
- package/public/~partytown/partytown-sw.js +2 -0
- package/public/~partytown/partytown.js +2 -0
- package/src/components/cart/CartSidebar/CartSidebar.tsx +6 -2
- package/src/components/cart/CartSidebar/section.module.scss +21 -0
- package/src/components/cms/GlobalSections.tsx +6 -6
- package/src/components/common/Alert/Alert.tsx +8 -3
- package/src/components/common/Alert/section.module.scss +9 -0
- package/src/components/common/Footer/Footer.tsx +87 -89
- package/src/components/common/Footer/FooterLinks.tsx +4 -6
- package/src/components/common/Footer/section.module.scss +12 -0
- package/src/components/common/RegionBar/RegionBar.tsx +17 -0
- package/src/components/common/RegionBar/index.ts +1 -0
- package/src/components/common/RegionBar/section.module.scss +8 -0
- package/src/components/navigation/Navbar/Navbar.tsx +62 -61
- package/src/components/navigation/Navbar/section.module.scss +26 -0
- package/src/components/navigation/NavbarLinks/NavbarLinks.tsx +0 -1
- package/src/components/navigation/NavbarSlider/NavbarSlider.tsx +11 -7
- package/src/components/navigation/NavbarSlider/section.module.scss +26 -0
- package/src/components/product/ProductGrid/ProductGrid.tsx +2 -4
- package/src/components/region/RegionModal/RegionModal.tsx +6 -1
- package/src/components/region/RegionModal/section.module.scss +13 -0
- package/src/components/search/Filter/Filter.tsx +6 -3
- package/src/components/search/Filter/FilterSlider.tsx +5 -0
- package/src/components/search/Filter/section.module.scss +22 -0
- package/src/components/sections/BannerNewsletter/BannerNewsletter.tsx +5 -3
- package/src/components/sections/BannerNewsletter/section.module.scss +8 -0
- package/src/components/sections/BannerText/BannerText.tsx +4 -2
- package/src/components/sections/BannerText/section.module.scss +8 -0
- package/src/components/sections/Breadcrumb/Breadcrumb.tsx +4 -2
- package/src/components/sections/Breadcrumb/section.module.scss +9 -0
- package/src/components/sections/Hero/Hero.tsx +5 -9
- package/src/components/sections/Hero/section.module.scss +9 -0
- package/src/components/sections/{Incentives → IncentivesHeader}/IncentivesHeader.tsx +3 -2
- package/src/components/sections/IncentivesHeader/index.ts +1 -0
- package/src/components/sections/IncentivesHeader/section.module.scss +8 -0
- package/src/components/sections/Newsletter/Newsletter.tsx +68 -69
- package/src/components/sections/Newsletter/section.module.scss +11 -0
- package/src/components/sections/ProducDetailsContent/ProductDetailsContent.tsx +2 -4
- package/src/components/sections/ProductDetails/ProductDetails.tsx +44 -43
- package/src/components/sections/ProductDetails/section.module.scss +27 -0
- package/src/components/sections/ProductGallery/ProductGallery.tsx +121 -119
- package/src/components/sections/ProductGallery/section.module.scss +28 -0
- package/src/components/sections/ProductShelf/ProductShelf.tsx +8 -4
- package/src/components/sections/ProductShelf/section.module.scss +17 -0
- package/src/components/sections/ProductTiles/ProductTiles.tsx +9 -4
- package/src/components/sections/ProductTiles/section.module.scss +17 -0
- package/src/components/sections/ScrollToTopButton/ScrollToTopButton.tsx +3 -3
- package/src/components/sections/ScrollToTopButton/section.module.scss +11 -0
- package/src/components/skeletons/FilterSkeleton/FilterSkeleton.tsx +1 -2
- package/src/components/skeletons/ProductCardSkeleton/ProductCardSkeleton.tsx +0 -3
- package/src/components/skeletons/ProductShelfSkeleton/ProductShelfSkeleton.tsx +2 -2
- package/src/components/skeletons/ProductTilesSkeleton/ProductTileSkeleton/ProductTileSkeleton.tsx +0 -3
- package/src/components/ui/BannerText/BannerText.tsx +0 -3
- package/src/components/ui/Button/ButtonSignIn/ButtonSignIn.tsx +1 -2
- package/src/components/{sections → ui}/Incentives/Incentives.tsx +0 -3
- package/src/components/ui/Incentives/incentivesMock.ts +27 -0
- package/src/components/ui/Logo/Logo.tsx +1 -10
- package/src/components/ui/Tiles/Tiles.tsx +1 -6
- package/src/pages/[slug]/p.tsx +1 -1
- package/src/pages/_app.tsx +2 -2
- package/src/pages/index.tsx +2 -2
- package/src/styles/global/components.scss +8 -0
- package/src/styles/themes/midnight.scss +1 -1
- package/src/components/common/Footer/Footer.stories.mdx +0 -158
- package/src/components/common/Footer/footer.module.scss +0 -220
- package/src/components/sections/BannerNewsletter/banner-newsletter.module.scss +0 -23
- package/src/components/sections/Incentives/Incentives.stories.mdx +0 -159
- package/src/components/sections/Incentives/IncentivesFooter.tsx +0 -8
- package/src/components/sections/Incentives/incentives.module.scss +0 -122
- package/src/components/sections/Incentives/incentivesMock.ts +0 -55
- package/src/components/sections/Newsletter/Newsletter.stories.mdx +0 -139
- package/src/components/sections/Newsletter/newsletter.module.scss +0 -135
- package/src/components/sections/ProductDetails/product-details.module.scss +0 -185
- package/src/components/sections/ProductGallery/product-gallery.module.scss +0 -184
- package/src/components/sections/ScrollToTopButton/scroll-to-top-button.module.scss +0 -12
- package/src/components/skeletons/FilterSkeleton/FilterSkeleton.stories.mdx +0 -97
- package/src/components/skeletons/FilterSkeleton/filter-skeleton.module.scss +0 -51
- package/src/components/skeletons/ProductCardSkeleton/ProductCardSkeleton.stories.mdx +0 -113
- package/src/components/skeletons/ProductCardSkeleton/product-card-skeleton.module.scss +0 -58
- package/src/components/skeletons/ProductTilesSkeleton/ProductTileSkeleton/product-tile-skeleton.module.scss +0 -81
- package/src/components/ui/BannerText/BannerText.stories.mdx +0 -270
- package/src/components/ui/BannerText/banner-text.module.scss +0 -127
- package/src/components/ui/Button/Button.stories.mdx +0 -643
- package/src/components/ui/Button/button.module.scss +0 -11
- package/src/components/ui/Carousel/Carousel.stories.mdx +0 -201
- package/src/components/ui/Carousel/carousel.module.scss +0 -147
- package/src/components/ui/Logo/logo.module.scss +0 -12
- package/src/components/ui/Tiles/Tiles.stories.mdx +0 -151
- package/src/components/ui/Tiles/tiles.module.scss +0 -58
- /package/src/components/{sections → ui}/Incentives/index.ts +0 -0
|
@@ -7,7 +7,7 @@ import Link from 'src/components/ui/Link'
|
|
|
7
7
|
import { useNewsletter } from 'src/sdk/newsletter/useNewsletter'
|
|
8
8
|
|
|
9
9
|
import Section from '../Section'
|
|
10
|
-
import styles from './
|
|
10
|
+
import styles from './section.module.scss'
|
|
11
11
|
|
|
12
12
|
export interface NewsletterProps
|
|
13
13
|
extends Omit<ComponentPropsWithRef<'form'>, 'title' | 'onSubmit'> {
|
|
@@ -71,75 +71,74 @@ const Newsletter = forwardRef<HTMLFormElement, NewsletterProps>(
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
return (
|
|
74
|
-
<Section
|
|
75
|
-
data-fs-newsletter={card ? 'card' : ''}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
{
|
|
89
|
-
</
|
|
90
|
-
{description && <span> {description}</span>}
|
|
91
|
-
</header>
|
|
74
|
+
<Section className={`${styles.section} section-newsletter`}>
|
|
75
|
+
<div data-fs-newsletter={card ? 'card' : ''}>
|
|
76
|
+
<form
|
|
77
|
+
data-fs-newsletter-form
|
|
78
|
+
ref={ref}
|
|
79
|
+
onSubmit={handleSubmit}
|
|
80
|
+
{...otherProps}
|
|
81
|
+
className="layout__content"
|
|
82
|
+
>
|
|
83
|
+
<header data-fs-newsletter-header>
|
|
84
|
+
<h3>
|
|
85
|
+
<Icon name="Envelop" width={32} height={32} />
|
|
86
|
+
{title}
|
|
87
|
+
</h3>
|
|
88
|
+
{description && <span> {description}</span>}
|
|
89
|
+
</header>
|
|
92
90
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
91
|
+
<div data-fs-newsletter-controls>
|
|
92
|
+
{lite ? (
|
|
93
|
+
<>
|
|
94
|
+
<UIInputField
|
|
95
|
+
inputRef={emailInputRef}
|
|
96
|
+
id="newsletter-email"
|
|
97
|
+
label="Your Email"
|
|
98
|
+
type="email"
|
|
99
|
+
required
|
|
100
|
+
actionable
|
|
101
|
+
onSubmit={() => undefined}
|
|
102
|
+
onClear={() => undefined}
|
|
103
|
+
buttonActionText="Subscribe"
|
|
104
|
+
displayClearButton={false}
|
|
105
|
+
/>
|
|
106
|
+
<span data-fs-newsletter-addendum>
|
|
107
|
+
By subscribing to our newsletter you agree to to our{' '}
|
|
108
|
+
<Link href="/" inverse variant="inline">
|
|
109
|
+
Privacy Policy.
|
|
110
|
+
</Link>
|
|
111
|
+
</span>
|
|
112
|
+
</>
|
|
113
|
+
) : (
|
|
114
|
+
<>
|
|
115
|
+
<UIInputField
|
|
116
|
+
inputRef={nameInputRef}
|
|
117
|
+
id="newsletter-name"
|
|
118
|
+
label="Your Name"
|
|
119
|
+
required
|
|
120
|
+
/>
|
|
121
|
+
<UIInputField
|
|
122
|
+
inputRef={emailInputRef}
|
|
123
|
+
id="newsletter-email"
|
|
124
|
+
label="Your Email"
|
|
125
|
+
type="email"
|
|
126
|
+
required
|
|
127
|
+
/>
|
|
128
|
+
<span data-fs-newsletter-addendum>
|
|
129
|
+
By subscribing to our newsletter you agree to to our{' '}
|
|
130
|
+
<Link href="/" inverse variant="inline">
|
|
131
|
+
Privacy Policy.
|
|
132
|
+
</Link>
|
|
133
|
+
</span>
|
|
134
|
+
<UIButton variant="secondary" inverse type="submit">
|
|
135
|
+
{loading ? 'Loading...' : 'Subscribe'}
|
|
136
|
+
</UIButton>
|
|
137
|
+
</>
|
|
138
|
+
)}
|
|
139
|
+
</div>
|
|
140
|
+
</form>
|
|
141
|
+
</div>
|
|
143
142
|
</Section>
|
|
144
143
|
)
|
|
145
144
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* stylelint-disable no-invalid-position-at-import-rule */
|
|
2
|
+
@import "@faststore/ui/src/styles/base/utilities.scss";
|
|
3
|
+
|
|
4
|
+
.section {
|
|
5
|
+
@import "@faststore/ui/src/components/atoms/Button/styles.scss";
|
|
6
|
+
@import "@faststore/ui/src/components/atoms/Icon/styles.scss";
|
|
7
|
+
@import "@faststore/ui/src/components/atoms/Input/styles.scss";
|
|
8
|
+
@import "@faststore/ui/src/components/atoms/Link/styles.scss";
|
|
9
|
+
@import "@faststore/ui/src/components/molecules/InputField/styles.scss";
|
|
10
|
+
@import "@faststore/ui/src/components/organisms/Newsletter/styles.scss";
|
|
11
|
+
}
|
|
@@ -12,8 +12,6 @@ import {
|
|
|
12
12
|
} from '@faststore/ui'
|
|
13
13
|
import { useState } from 'react'
|
|
14
14
|
|
|
15
|
-
import Section from '../Section'
|
|
16
|
-
|
|
17
15
|
interface ArticleLabels {
|
|
18
16
|
/**
|
|
19
17
|
* Label for the "description" article.
|
|
@@ -100,7 +98,7 @@ function ProductDetailsContent({
|
|
|
100
98
|
const labels = { ...DEFAULT_LABELS, ...propLabels }
|
|
101
99
|
|
|
102
100
|
return (
|
|
103
|
-
<
|
|
101
|
+
<section data-fs-product-details-content>
|
|
104
102
|
<UIAccordion
|
|
105
103
|
indices={indices}
|
|
106
104
|
onChange={onChange}
|
|
@@ -275,7 +273,7 @@ function ProductDetailsContent({
|
|
|
275
273
|
</UIAccordionPanel>
|
|
276
274
|
</UIAccordionItem>
|
|
277
275
|
</UIAccordion>
|
|
278
|
-
</
|
|
276
|
+
</section>
|
|
279
277
|
)
|
|
280
278
|
}
|
|
281
279
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { gql } from '@faststore/graphql-utils'
|
|
2
2
|
import type { CurrencyCode, ViewItemEvent } from '@faststore/sdk'
|
|
3
3
|
import { sendAnalyticsEvent } from '@faststore/sdk'
|
|
4
|
-
import { useEffect, useState } from 'react'
|
|
5
4
|
import {
|
|
6
5
|
BuyButton as UIBuyButton,
|
|
7
6
|
DiscountBadge as UIDiscountBadge,
|
|
8
|
-
QuantitySelector as UIQuantitySelector,
|
|
9
|
-
ProductTitle as UIProductTitle,
|
|
10
7
|
Price as UIPrice,
|
|
8
|
+
ProductTitle as UIProductTitle,
|
|
9
|
+
QuantitySelector as UIQuantitySelector,
|
|
11
10
|
} from '@faststore/ui'
|
|
11
|
+
import { useEffect, useState } from 'react'
|
|
12
12
|
|
|
13
13
|
import type { ProductDetailsFragment_ProductFragment } from '@generated/graphql'
|
|
14
14
|
import OutOfStock from 'src/components/product/OutOfStock'
|
|
@@ -24,7 +24,7 @@ import { useSession } from 'src/sdk/session'
|
|
|
24
24
|
|
|
25
25
|
import ProductDetailsContent from '../ProducDetailsContent'
|
|
26
26
|
import Section from '../Section'
|
|
27
|
-
import styles from './
|
|
27
|
+
import styles from './section.module.scss'
|
|
28
28
|
|
|
29
29
|
interface Props {
|
|
30
30
|
context: ProductDetailsFragment_ProductFragment
|
|
@@ -166,49 +166,50 @@ function ProductDetails({ context: staleProduct }: Props) {
|
|
|
166
166
|
|
|
167
167
|
return (
|
|
168
168
|
<Section
|
|
169
|
-
className={`${styles.
|
|
169
|
+
className={`${styles.section} section-product-details layout__content layout__section`}
|
|
170
170
|
>
|
|
171
|
-
<
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
171
|
+
<section data-fs-product-details>
|
|
172
|
+
<Breadcrumb breadcrumbList={breadcrumbs.itemListElement} />
|
|
173
|
+
<section data-fs-product-details-body>
|
|
174
|
+
<header data-fs-product-details-title data-fs-product-details-section>
|
|
175
|
+
<UIProductTitle
|
|
176
|
+
title={<h1>{name}</h1>}
|
|
177
|
+
label={
|
|
178
|
+
<UIDiscountBadge
|
|
179
|
+
listPrice={listPrice}
|
|
180
|
+
spotPrice={lowPrice}
|
|
181
|
+
size="big"
|
|
182
|
+
/>
|
|
183
|
+
}
|
|
184
|
+
refNumber={productId}
|
|
185
|
+
/>
|
|
186
|
+
</header>
|
|
187
|
+
<ImageGallery
|
|
188
|
+
data-fs-product-details-gallery
|
|
189
|
+
images={productImages}
|
|
185
190
|
/>
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
<section data-fs-product-details-info>
|
|
191
|
-
<section
|
|
192
|
-
data-fs-product-details-settings
|
|
193
|
-
data-fs-product-details-section
|
|
194
|
-
>
|
|
195
|
-
{availability ? <ProductDetailsSection /> : <OutOfStock />}
|
|
196
|
-
</section>
|
|
197
|
-
{availability && (
|
|
198
|
-
<ShippingSimulation
|
|
191
|
+
<section data-fs-product-details-info>
|
|
192
|
+
<section
|
|
193
|
+
data-fs-product-details-settings
|
|
199
194
|
data-fs-product-details-section
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
195
|
+
>
|
|
196
|
+
{availability ? <ProductDetailsSection /> : <OutOfStock />}
|
|
197
|
+
</section>
|
|
198
|
+
{availability && (
|
|
199
|
+
<ShippingSimulation
|
|
200
|
+
data-fs-product-details-section
|
|
201
|
+
data-fs-product-details-shipping
|
|
202
|
+
productShippingInfo={{
|
|
203
|
+
id,
|
|
204
|
+
quantity: addQuantity,
|
|
205
|
+
seller: seller.identifier,
|
|
206
|
+
}}
|
|
207
|
+
formatter={useFormattedPrice}
|
|
208
|
+
/>
|
|
209
|
+
)}
|
|
210
|
+
</section>
|
|
211
|
+
<ProductDetailsContent />
|
|
209
212
|
</section>
|
|
210
|
-
|
|
211
|
-
<ProductDetailsContent />
|
|
212
213
|
</section>
|
|
213
214
|
</Section>
|
|
214
215
|
)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* stylelint-disable no-invalid-position-at-import-rule */
|
|
2
|
+
@import "@faststore/ui/src/styles/base/utilities.scss";
|
|
3
|
+
|
|
4
|
+
.section {
|
|
5
|
+
margin-top: 0;
|
|
6
|
+
|
|
7
|
+
@import "@faststore/ui/src/components/atoms/Icon/styles.scss";
|
|
8
|
+
@import "@faststore/ui/src/components/atoms/Link/styles.scss";
|
|
9
|
+
@import "@faststore/ui/src/components/atoms/List/styles.scss";
|
|
10
|
+
@import "@faststore/ui/src/components/atoms/Badge/styles.scss";
|
|
11
|
+
@import "@faststore/ui/src/components/atoms/Button/styles.scss";
|
|
12
|
+
@import "@faststore/ui/src/components/atoms/Input/styles.scss";
|
|
13
|
+
@import "@faststore/ui/src/components/molecules/Accordion/styles.scss";
|
|
14
|
+
@import "@faststore/ui/src/components/molecules/Breadcrumb/styles.scss";
|
|
15
|
+
@import "@faststore/ui/src/components/molecules/BuyButton/styles.scss";
|
|
16
|
+
@import "@faststore/ui/src/components/molecules/DiscountBadge/styles.scss";
|
|
17
|
+
@import "@faststore/ui/src/components/molecules/Dropdown/styles.scss";
|
|
18
|
+
@import "@faststore/ui/src/components/molecules/InputField/styles.scss";
|
|
19
|
+
@import "@faststore/ui/src/components/molecules/LinkButton/styles.scss";
|
|
20
|
+
@import "@faststore/ui/src/components/molecules/ProductTitle/styles.scss";
|
|
21
|
+
@import "@faststore/ui/src/components/molecules/QuantitySelector/styles.scss";
|
|
22
|
+
@import "@faststore/ui/src/components/molecules/SkuSelector/styles.scss";
|
|
23
|
+
@import "@faststore/ui/src/components/molecules/Table/styles.scss";
|
|
24
|
+
@import "@faststore/ui/src/components/organisms/ShippingSimulation/styles.scss";
|
|
25
|
+
@import "@faststore/ui/src/components/organisms/ImageGallery/styles.scss";
|
|
26
|
+
@import "@faststore/ui/src/components/organisms/ProductDetails/styles.scss";
|
|
27
|
+
}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from '@faststore/ui'
|
|
7
7
|
import { NextSeo } from 'next-seo'
|
|
8
8
|
import type { MouseEvent } from 'react'
|
|
9
|
-
import {
|
|
9
|
+
import { Suspense, lazy } from 'react'
|
|
10
10
|
|
|
11
11
|
import { Icon, useUI } from '@faststore/ui'
|
|
12
12
|
import Filter from 'src/components/search/Filter'
|
|
@@ -17,7 +17,7 @@ import { mark } from 'src/sdk/tests/mark'
|
|
|
17
17
|
|
|
18
18
|
import Section from '../Section'
|
|
19
19
|
import EmptyGallery from './EmptyGallery'
|
|
20
|
-
import styles from './
|
|
20
|
+
import styles from './section.module.scss'
|
|
21
21
|
import { useDelayedFacets } from './useDelayedFacets'
|
|
22
22
|
import { useDelayedPagination } from './useDelayedPagination'
|
|
23
23
|
import { useGalleryQuery } from './useGalleryQuery'
|
|
@@ -46,137 +46,139 @@ function ProductGallery({ title, searchTerm }: Props) {
|
|
|
46
46
|
if (data && totalCount === 0) {
|
|
47
47
|
return (
|
|
48
48
|
<Section
|
|
49
|
-
|
|
50
|
-
className={`${styles.fsProductListing} layout__content`}
|
|
51
|
-
data-fs-product-listing
|
|
49
|
+
className={`${styles.section} section-product-gallery layout__content`}
|
|
52
50
|
>
|
|
53
|
-
<
|
|
51
|
+
<section data-testid="product-gallery" data-fs-product-listing>
|
|
52
|
+
<EmptyGallery />
|
|
53
|
+
</section>
|
|
54
54
|
</Section>
|
|
55
55
|
)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
59
|
<Section
|
|
60
|
-
|
|
61
|
-
className={`${styles.fsProductListing} layout__content-full`}
|
|
62
|
-
data-fs-product-listing
|
|
60
|
+
className={`${styles.section} section-product-gallery layout__content-full`}
|
|
63
61
|
>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
</header>
|
|
70
|
-
)}
|
|
71
|
-
<div data-fs-product-listing-content-grid className="layout__content">
|
|
72
|
-
<div data-fs-product-listing-filters>
|
|
73
|
-
<FilterSkeleton loading={facets?.length === 0}>
|
|
74
|
-
<Filter facets={facets} />
|
|
75
|
-
</FilterSkeleton>
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
<div data-fs-product-listing-results-count data-count={totalCount}>
|
|
79
|
-
<UISkeleton
|
|
80
|
-
data-fs-product-listing-results-count-skeleton
|
|
81
|
-
loading={!data}
|
|
82
|
-
size={{ width: '100%', height: '1.5rem' }}
|
|
83
|
-
>
|
|
84
|
-
<h2 data-testid="total-product-count">{totalCount} Results</h2>
|
|
85
|
-
</UISkeleton>
|
|
86
|
-
</div>
|
|
87
|
-
|
|
88
|
-
<div data-fs-product-listing-sort>
|
|
89
|
-
<UISkeleton
|
|
90
|
-
data-fs-product-listing-sort-skeleton
|
|
91
|
-
loading={facets?.length === 0}
|
|
92
|
-
size={{ width: 'auto', height: '1.5rem' }}
|
|
93
|
-
>
|
|
94
|
-
<Sort />
|
|
95
|
-
</UISkeleton>
|
|
96
|
-
|
|
97
|
-
<UISkeleton
|
|
98
|
-
data-fs-product-listing-filter-button-skeleton
|
|
99
|
-
loading={facets?.length === 0}
|
|
100
|
-
size={{ width: '6rem', height: '1.5rem' }}
|
|
62
|
+
<section data-testid="product-gallery" data-fs-product-listing>
|
|
63
|
+
{searchTerm && (
|
|
64
|
+
<header
|
|
65
|
+
data-fs-product-listing-search-term
|
|
66
|
+
className="layout__content"
|
|
101
67
|
>
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
68
|
+
<h1>
|
|
69
|
+
Showing results for: <span>{searchTerm}</span>
|
|
70
|
+
</h1>
|
|
71
|
+
</header>
|
|
72
|
+
)}
|
|
73
|
+
<div data-fs-product-listing-content-grid className="layout__content">
|
|
74
|
+
<div data-fs-product-listing-filters>
|
|
75
|
+
<FilterSkeleton loading={facets?.length === 0}>
|
|
76
|
+
<Filter facets={facets} />
|
|
77
|
+
</FilterSkeleton>
|
|
78
|
+
</div>
|
|
79
|
+
<div data-fs-product-listing-results-count data-count={totalCount}>
|
|
80
|
+
<UISkeleton
|
|
81
|
+
data-fs-product-listing-results-count-skeleton
|
|
82
|
+
loading={!data}
|
|
83
|
+
size={{ width: '100%', height: '1.5rem' }}
|
|
109
84
|
>
|
|
110
|
-
|
|
111
|
-
</
|
|
112
|
-
</
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
variant="secondary"
|
|
85
|
+
<h2 data-testid="total-product-count">{totalCount} Results</h2>
|
|
86
|
+
</UISkeleton>
|
|
87
|
+
</div>
|
|
88
|
+
<div data-fs-product-listing-sort>
|
|
89
|
+
<UISkeleton
|
|
90
|
+
data-fs-product-listing-sort-skeleton
|
|
91
|
+
loading={facets?.length === 0}
|
|
92
|
+
size={{ width: 'auto', height: '1.5rem' }}
|
|
93
|
+
>
|
|
94
|
+
<Sort />
|
|
95
|
+
</UISkeleton>
|
|
96
|
+
<UISkeleton
|
|
97
|
+
data-fs-product-listing-filter-button-skeleton
|
|
98
|
+
loading={facets?.length === 0}
|
|
99
|
+
size={{ width: '6rem', height: '1.5rem' }}
|
|
100
|
+
>
|
|
101
|
+
<UIButton
|
|
102
|
+
variant="tertiary"
|
|
103
|
+
data-testid="open-filter-button"
|
|
104
|
+
icon={<Icon name="FadersHorizontal" width={16} height={16} />}
|
|
131
105
|
iconPosition="left"
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
106
|
+
aria-label="Open Filters"
|
|
107
|
+
onClick={openFilter}
|
|
135
108
|
>
|
|
136
|
-
|
|
137
|
-
</
|
|
138
|
-
</
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
key={`gallery-page-${page}`}
|
|
147
|
-
showSponsoredProducts={false}
|
|
148
|
-
page={page}
|
|
149
|
-
title={title}
|
|
109
|
+
Filters
|
|
110
|
+
</UIButton>
|
|
111
|
+
</UISkeleton>
|
|
112
|
+
</div>
|
|
113
|
+
<div data-fs-product-listing-results>
|
|
114
|
+
{/* Add link to previous page. This helps on SEO */}
|
|
115
|
+
{prev !== false && (
|
|
116
|
+
<div data-fs-product-listing-pagination="top">
|
|
117
|
+
<NextSeo
|
|
118
|
+
additionalLinkTags={[{ rel: 'prev', href: prev.link }]}
|
|
150
119
|
/>
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
120
|
+
<UILinkButton
|
|
121
|
+
onClick={(e: MouseEvent<HTMLElement>) => {
|
|
122
|
+
e.currentTarget.blur()
|
|
123
|
+
e.preventDefault()
|
|
124
|
+
addPrevPage()
|
|
125
|
+
}}
|
|
126
|
+
href={prev.link}
|
|
127
|
+
rel="prev"
|
|
128
|
+
variant="secondary"
|
|
129
|
+
iconPosition="left"
|
|
130
|
+
icon={
|
|
131
|
+
<Icon
|
|
132
|
+
name="ArrowLeft"
|
|
133
|
+
width={16}
|
|
134
|
+
height={16}
|
|
135
|
+
weight="bold"
|
|
136
|
+
/>
|
|
137
|
+
}
|
|
138
|
+
>
|
|
139
|
+
Previous Page
|
|
140
|
+
</UILinkButton>
|
|
141
|
+
</div>
|
|
142
|
+
)}
|
|
143
|
+
{/* Render ALL products */}
|
|
144
|
+
{data ? (
|
|
145
|
+
<Suspense fallback={GalleryPageSkeleton}>
|
|
146
|
+
{pages.map((page) => (
|
|
147
|
+
<GalleryPage
|
|
148
|
+
key={`gallery-page-${page}`}
|
|
149
|
+
showSponsoredProducts={false}
|
|
150
|
+
page={page}
|
|
151
|
+
title={title}
|
|
152
|
+
/>
|
|
153
|
+
))}
|
|
154
|
+
</Suspense>
|
|
155
|
+
) : (
|
|
156
|
+
GalleryPageSkeleton
|
|
157
|
+
)}
|
|
158
|
+
{/* Add link to next page. This helps on SEO */}
|
|
159
|
+
{next !== false && (
|
|
160
|
+
<div data-fs-product-listing-pagination="bottom">
|
|
161
|
+
<NextSeo
|
|
162
|
+
additionalLinkTags={[{ rel: 'next', href: next.link }]}
|
|
163
|
+
/>
|
|
164
|
+
<UILinkButton
|
|
165
|
+
testId="show-more"
|
|
166
|
+
onClick={(e: MouseEvent<HTMLElement>) => {
|
|
167
|
+
e.currentTarget.blur()
|
|
168
|
+
e.preventDefault()
|
|
169
|
+
addNextPage()
|
|
170
|
+
}}
|
|
171
|
+
href={next.link}
|
|
172
|
+
rel="next"
|
|
173
|
+
variant="secondary"
|
|
174
|
+
>
|
|
175
|
+
Load more products
|
|
176
|
+
</UILinkButton>
|
|
177
|
+
</div>
|
|
178
|
+
)}
|
|
179
|
+
</div>
|
|
178
180
|
</div>
|
|
179
|
-
</
|
|
181
|
+
</section>
|
|
180
182
|
</Section>
|
|
181
183
|
)
|
|
182
184
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* stylelint-disable no-invalid-position-at-import-rule */
|
|
2
|
+
@import "@faststore/ui/src/styles/base/utilities.scss";
|
|
3
|
+
|
|
4
|
+
.section {
|
|
5
|
+
@import "@faststore/ui/src/components/atoms/Badge/styles.scss";
|
|
6
|
+
@import "@faststore/ui/src/components/atoms/Button/styles.scss";
|
|
7
|
+
@import "@faststore/ui/src/components/atoms/Checkbox/styles.scss";
|
|
8
|
+
@import "@faststore/ui/src/components/atoms/Icon/styles.scss";
|
|
9
|
+
@import "@faststore/ui/src/components/atoms/Input/styles.scss";
|
|
10
|
+
@import "@faststore/ui/src/components/atoms/Link/styles.scss";
|
|
11
|
+
@import "@faststore/ui/src/components/atoms/List/styles.scss";
|
|
12
|
+
@import "@faststore/ui/src/components/atoms/Price/styles.scss";
|
|
13
|
+
@import "@faststore/ui/src/components/atoms/Select/styles.scss";
|
|
14
|
+
@import "@faststore/ui/src/components/atoms/Skeleton/styles";
|
|
15
|
+
@import "@faststore/ui/src/components/atoms/Slider/styles.scss";
|
|
16
|
+
@import "@faststore/ui/src/components/molecules/Accordion/styles.scss";
|
|
17
|
+
@import "@faststore/ui/src/components/molecules/DiscountBadge/styles.scss";
|
|
18
|
+
@import "@faststore/ui/src/components/molecules/InputField/styles.scss";
|
|
19
|
+
@import "@faststore/ui/src/components/molecules/ProductCard/styles.scss";
|
|
20
|
+
@import "@faststore/ui/src/components/molecules/ProductCardSkeleton/styles";
|
|
21
|
+
@import "@faststore/ui/src/components/molecules/SelectField/styles.scss";
|
|
22
|
+
@import "@faststore/ui/src/components/organisms/EmptyState/styles.scss";
|
|
23
|
+
@import "@faststore/ui/src/components/organisms/Filter/styles.scss";
|
|
24
|
+
@import "@faststore/ui/src/components/organisms/FilterSkeleton/styles.scss";
|
|
25
|
+
@import "@faststore/ui/src/components/organisms/PriceRange/styles.scss";
|
|
26
|
+
@import "@faststore/ui/src/components/organisms/ProductGrid/styles.scss";
|
|
27
|
+
@import "@faststore/ui/src/components/organisms/ProductGallery/styles.scss";
|
|
28
|
+
}
|