@faststore/core 0.3.6 → 0.3.7
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/.storybook/preview.js +0 -4
- package/CHANGELOG.md +2 -0
- package/README.md +13 -11
- package/cypress/integration/analytics.test.js +1 -1
- package/cypress/integration/search.test.js +1 -1
- package/package.json +17 -16
- package/src/components/cart/CartItem/CartItem.tsx +4 -4
- package/src/components/cart/CartSidebar/CartSidebar.stories.mdx +3 -3
- package/src/components/cart/CartSidebar/CartSidebar.tsx +14 -11
- package/src/components/cart/CartToggle/CartToggle.tsx +6 -4
- package/src/components/cart/EmptyCart/EmptyCart.tsx +4 -3
- package/src/components/common/Footer/Footer.tsx +9 -5
- package/src/components/common/Footer/FooterLinks.tsx +1 -1
- package/src/components/common/Navbar/Navbar.tsx +4 -6
- package/src/components/common/Navbar/NavbarSlider.tsx +3 -5
- package/src/components/common/Navbar/navbar.module.scss +1 -1
- package/src/components/product/OutOfStock/OutOfStock.tsx +5 -5
- package/src/components/product/ProductCard/ProductCard.stories.mdx +14 -14
- package/src/components/product/ProductCard/ProductCard.tsx +10 -9
- package/src/components/regionalization/Regionalization.stories.mdx +2 -6
- package/src/components/regionalization/RegionalizationBar/RegionalizationBar.tsx +3 -3
- package/src/components/regionalization/RegionalizationButton/RegionalizationButton.tsx +4 -3
- package/src/components/regionalization/RegionalizationInput/RegionalizationInput.tsx +2 -2
- package/src/components/regionalization/RegionalizationModal/RegionalizationModalContent.tsx +3 -2
- package/src/components/search/Filter/Facets.tsx +9 -6
- package/src/components/search/Filter/FilterSlider.tsx +6 -6
- package/src/components/search/SearchHistory/SearchHistory.tsx +4 -5
- package/src/components/search/SearchInput/search-input.module.scss +1 -14
- package/src/components/search/SearchTop/SearchTop.tsx +4 -5
- package/src/components/search/Sort/Sort.tsx +2 -3
- package/src/components/sections/BannerText/banner-text.module.scss +6 -6
- package/src/components/sections/Incentives/Incentives.tsx +1 -1
- package/src/components/sections/Newsletter/Newsletter.tsx +10 -8
- package/src/components/sections/Newsletter/newsletter.module.scss +1 -1
- package/src/components/sections/ProducDetailsContent/ProductDetailsContent.tsx +1 -1
- package/src/components/sections/ProducDetailsContent/product-details-content.module.scss +0 -9
- package/src/components/sections/ProductDetails/ProductDetails.tsx +11 -5
- package/src/components/sections/ProductDetails/product-details.module.scss +1 -1
- package/src/components/sections/ProductGallery/ProductGallery.tsx +4 -3
- package/src/components/sections/ScrollToTopButton/ScrollToTopButton.tsx +5 -4
- package/src/components/ui/Alert/Alert.tsx +7 -4
- package/src/components/ui/Button/Button.stories.mdx +3 -44
- package/src/components/ui/Button/ButtonLink/ButtonLink.tsx +2 -1
- package/src/components/ui/Button/button.module.scss +0 -381
- package/src/components/ui/Button/index.ts +0 -3
- package/src/components/ui/Gift/Gift.tsx +2 -2
- package/src/components/ui/ImageGallery/ImageGallerySelector.tsx +5 -5
- package/src/components/ui/ImageGallery/image-gallery-selector.module.scss +6 -0
- package/src/components/ui/Link/Link.tsx +19 -34
- package/src/components/ui/PriceRange/PriceRange.tsx +6 -4
- package/src/components/ui/PriceRange/price-range.module.scss +1 -1
- package/src/components/ui/ProductTitle/ProductTitle.stories.mdx +13 -15
- package/src/components/ui/QuantitySelector/quantity-selector.module.scss +21 -26
- package/src/components/ui/ShippingSimulation/ShippingSimulation.stories.mdx +1 -1
- package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +8 -3
- package/src/components/ui/SlideOver/SlideOver.stories.mdx +3 -3
- package/src/pages/_app.tsx +3 -4
- package/src/styles/global/components.scss +0 -3
- package/src/styles/global/storybook-components.scss +3 -3
- package/src/styles/global/utilities.scss +12 -5
- package/src/components/ui/Badge/Badge.stories.mdx +0 -465
- package/src/components/ui/Badge/Badge.tsx +0 -76
- package/src/components/ui/Badge/DiscountBadge.stories.mdx +0 -191
- package/src/components/ui/Badge/DiscountBadge.tsx +0 -57
- package/src/components/ui/Badge/badge.module.scss +0 -252
- package/src/components/ui/Badge/index.ts +0 -4
- package/src/components/ui/Button/Button.tsx +0 -85
- package/src/components/ui/Button/ButtonBuy/ButtonBuy.tsx +0 -24
- package/src/components/ui/Button/ButtonBuy/index.ts +0 -1
- package/src/components/ui/Checkbox/Checkbox.stories.mdx +0 -268
- package/src/components/ui/Checkbox/Checkbox.tsx +0 -20
- package/src/components/ui/Checkbox/checkbox.module.scss +0 -157
- package/src/components/ui/Checkbox/index.ts +0 -2
- package/src/components/ui/InputText/InputText.stories.mdx +0 -311
- package/src/components/ui/InputText/InputText.tsx +0 -128
- package/src/components/ui/InputText/index.ts +0 -2
- package/src/components/ui/InputText/input-text.module.scss +0 -168
- package/src/components/ui/Link/link.module.scss +0 -98
- package/src/components/ui/Radio/Radio.stories.mdx +0 -237
- package/src/components/ui/Radio/Radio.tsx +0 -36
- package/src/components/ui/Radio/index.ts +0 -2
- package/src/components/ui/Radio/radio.module.scss +0 -122
- package/src/components/ui/Select/Select.stories.mdx +0 -168
- package/src/components/ui/Select/Select.tsx +0 -70
- package/src/components/ui/Select/index.ts +0 -2
- package/src/components/ui/Select/select.module.scss +0 -85
- package/src/components/ui/SlideOver/overlay.scss +0 -14
- package/src/styles/global/resets.scss +0 -48
- package/src/styles/global/tokens.scss +0 -276
- package/src/styles/global/typography.scss +0 -66
|
@@ -3,13 +3,14 @@ import {
|
|
|
3
3
|
ProductCardActions as UIProductCardActions,
|
|
4
4
|
ProductCardContent as UIProductCardContent,
|
|
5
5
|
ProductCardImage as UIProductCardImage,
|
|
6
|
+
Badge as UIBadge,
|
|
7
|
+
DiscountBadge as UIDiscountBadge,
|
|
6
8
|
} from '@faststore/ui'
|
|
7
9
|
import { gql } from '@faststore/graphql-utils'
|
|
8
10
|
import { memo } from 'react'
|
|
9
11
|
import type { ReactNode } from 'react'
|
|
10
12
|
|
|
11
13
|
import Link from 'src/components/ui/Link'
|
|
12
|
-
import { Badge, DiscountBadge } from 'src/components/ui/Badge'
|
|
13
14
|
import { Image } from 'src/components/ui/Image'
|
|
14
15
|
import Price from 'src/components/ui/Price'
|
|
15
16
|
import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
|
|
@@ -35,9 +36,9 @@ export interface ProductCardProps {
|
|
|
35
36
|
*/
|
|
36
37
|
aspectRatio?: number
|
|
37
38
|
/**
|
|
38
|
-
* Enables a
|
|
39
|
+
* Enables a BuyButton to the component.
|
|
39
40
|
*/
|
|
40
|
-
|
|
41
|
+
BuyButton?: ReactNode
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
function ProductCard({
|
|
@@ -46,7 +47,7 @@ function ProductCard({
|
|
|
46
47
|
variant = 'default',
|
|
47
48
|
bordered = false,
|
|
48
49
|
aspectRatio = 1,
|
|
49
|
-
|
|
50
|
+
BuyButton,
|
|
50
51
|
...otherProps
|
|
51
52
|
}: ProductCardProps) {
|
|
52
53
|
const {
|
|
@@ -67,7 +68,7 @@ function ProductCard({
|
|
|
67
68
|
data-fs-product-card
|
|
68
69
|
data-fs-product-card-variant={variant}
|
|
69
70
|
data-fs-product-card-bordered={bordered}
|
|
70
|
-
data-fs-product-card-actionable={!!
|
|
71
|
+
data-fs-product-card-actionable={!!BuyButton}
|
|
71
72
|
data-fs-product-card-sku={sku}
|
|
72
73
|
className={styles.fsProductCard}
|
|
73
74
|
{...otherProps}
|
|
@@ -113,13 +114,13 @@ function ProductCard({
|
|
|
113
114
|
</div>
|
|
114
115
|
|
|
115
116
|
{outOfStock ? (
|
|
116
|
-
<
|
|
117
|
+
<UIBadge>Out of stock</UIBadge>
|
|
117
118
|
) : (
|
|
118
|
-
<
|
|
119
|
+
<UIDiscountBadge listPrice={listPrice} spotPrice={spotPrice} />
|
|
119
120
|
)}
|
|
120
|
-
{!!
|
|
121
|
+
{!!BuyButton && (
|
|
121
122
|
<UIProductCardActions data-fs-product-card-actions>
|
|
122
|
-
{
|
|
123
|
+
{BuyButton}
|
|
123
124
|
</UIProductCardActions>
|
|
124
125
|
)}
|
|
125
126
|
</UIProductCardContent>
|
|
@@ -21,9 +21,7 @@ export const TemplateRegionalizationModal = () => {
|
|
|
21
21
|
export const TemplateButtonWithProvider = () => {
|
|
22
22
|
return (
|
|
23
23
|
<UIProvider>
|
|
24
|
-
<div
|
|
25
|
-
style={{ display: 'flex', alignItems: 'center', columnGap: '20px' }}
|
|
26
|
-
>
|
|
24
|
+
<div style={{ display: 'flex', alignItems: 'center', columnGap: '20px' }}>
|
|
27
25
|
<p style={{ whiteSpace: 'nowrap' }}>Try me:</p>
|
|
28
26
|
<RegionalizationButton />
|
|
29
27
|
<TemplateRegionalizationModal />
|
|
@@ -114,9 +112,7 @@ With the Regionalization feature enabled, if a customer enters their Postal Code
|
|
|
114
112
|
<article className="sbdocs-list-text">
|
|
115
113
|
<h3>RegionalizationInput</h3>
|
|
116
114
|
<p>
|
|
117
|
-
An actionable
|
|
118
|
-
<a href="../?path=/docs/atoms-inputtext--actionable">InputText</a>{' '}
|
|
119
|
-
able to check the Postal Code authenticity.
|
|
115
|
+
An actionable InputText able to check the Postal Code authenticity.
|
|
120
116
|
</p>
|
|
121
117
|
</article>
|
|
122
118
|
</li>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react'
|
|
2
|
+
import { Button as UIButton } from '@faststore/ui'
|
|
2
3
|
|
|
3
|
-
import Button from 'src/components/ui/Button'
|
|
4
4
|
import Icon from 'src/components/ui/Icon'
|
|
5
5
|
import { useSession } from 'src/sdk/session'
|
|
6
6
|
import { useUI } from 'src/sdk/ui/Provider'
|
|
@@ -21,7 +21,7 @@ function RegionBar({ classes, ...otherProps }: Props) {
|
|
|
21
21
|
className={`${classes} ${styles.fsRegionalizationBar}`}
|
|
22
22
|
{...otherProps}
|
|
23
23
|
>
|
|
24
|
-
<
|
|
24
|
+
<UIButton onClick={openModal}>
|
|
25
25
|
<Icon name="MapPin" width={24} height={24} />
|
|
26
26
|
{postalCode ? (
|
|
27
27
|
<>
|
|
@@ -32,7 +32,7 @@ function RegionBar({ classes, ...otherProps }: Props) {
|
|
|
32
32
|
<span data-fs-regionalization-bar-message>Set your location</span>
|
|
33
33
|
)}
|
|
34
34
|
<Icon name="CaretRight" width={24} height={24} />
|
|
35
|
-
</
|
|
35
|
+
</UIButton>
|
|
36
36
|
</div>
|
|
37
37
|
)
|
|
38
38
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import Button from '
|
|
1
|
+
import { Button as UIButton } from '@faststore/ui'
|
|
2
|
+
|
|
2
3
|
import Icon from 'src/components/ui/Icon'
|
|
3
4
|
import { useSession } from 'src/sdk/session'
|
|
4
5
|
import { useUI } from 'src/sdk/ui/Provider'
|
|
@@ -8,7 +9,7 @@ function RegionButton() {
|
|
|
8
9
|
const { postalCode } = useSession()
|
|
9
10
|
|
|
10
11
|
return (
|
|
11
|
-
<
|
|
12
|
+
<UIButton
|
|
12
13
|
data-fs-regionalization-button
|
|
13
14
|
variant="tertiary"
|
|
14
15
|
size="small"
|
|
@@ -17,7 +18,7 @@ function RegionButton() {
|
|
|
17
18
|
onClick={openModal}
|
|
18
19
|
>
|
|
19
20
|
<span>{postalCode ?? 'Set your location'}</span>
|
|
20
|
-
</
|
|
21
|
+
</UIButton>
|
|
21
22
|
)
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRef, useState } from 'react'
|
|
2
|
+
import { InputField as UIInputField } from '@faststore/ui'
|
|
2
3
|
|
|
3
|
-
import InputText from 'src/components/ui/InputText'
|
|
4
4
|
import { sessionStore, useSession, validateSession } from 'src/sdk/session'
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
@@ -40,7 +40,7 @@ function RegionInput({ closeModal }: Props) {
|
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
42
|
<div className="regionalization-input">
|
|
43
|
-
<
|
|
43
|
+
<UIInputField
|
|
44
44
|
inputRef={inputRef}
|
|
45
45
|
id="postal-code-input"
|
|
46
46
|
error={errorMessage}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { IconButton as UIIconButton } from '@faststore/ui'
|
|
2
|
+
|
|
1
3
|
import RegionalizationInput from 'src/components/regionalization/RegionalizationInput'
|
|
2
|
-
import Button from 'src/components/ui/Button'
|
|
3
4
|
import Icon from 'src/components/ui/Icon'
|
|
4
5
|
import Link from 'src/components/ui/Link'
|
|
5
6
|
|
|
@@ -19,7 +20,7 @@ function RegionalizationModalContent({
|
|
|
19
20
|
>
|
|
20
21
|
<header data-fs-regionalization-modal-header>
|
|
21
22
|
{onClose && (
|
|
22
|
-
<
|
|
23
|
+
<UIIconButton
|
|
23
24
|
onClick={() => onClose?.()}
|
|
24
25
|
data-fs-regionalization-modal-button
|
|
25
26
|
aria-label="Close Regionalization Modal"
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Checkbox as UICheckbox,
|
|
3
|
+
Label as UILabel,
|
|
4
|
+
List as UIList,
|
|
5
|
+
Badge as UIBadge,
|
|
6
|
+
} from '@faststore/ui'
|
|
2
7
|
|
|
3
8
|
import type {
|
|
4
9
|
Filter_FacetsFragment,
|
|
5
10
|
IStoreSelectedFacet,
|
|
6
11
|
} from '@generated/graphql'
|
|
7
12
|
import Accordion, { AccordionItem } from 'src/components/ui/Accordion'
|
|
8
|
-
import { Badge } from 'src/components/ui/Badge'
|
|
9
|
-
import Checkbox from 'src/components/ui/Checkbox'
|
|
10
13
|
import PriceRange from 'src/components/ui/PriceRange'
|
|
11
14
|
|
|
12
15
|
import styles from './facets.module.scss'
|
|
@@ -81,7 +84,7 @@ function Facets({
|
|
|
81
84
|
|
|
82
85
|
return (
|
|
83
86
|
<li key={id} data-fs-facets-list-item>
|
|
84
|
-
<
|
|
87
|
+
<UICheckbox
|
|
85
88
|
id={id}
|
|
86
89
|
checked={item.selected}
|
|
87
90
|
onChange={() =>
|
|
@@ -101,9 +104,9 @@ function Facets({
|
|
|
101
104
|
data-fs-facets-list-item-label
|
|
102
105
|
>
|
|
103
106
|
{item.label}{' '}
|
|
104
|
-
<
|
|
107
|
+
<UIBadge data-fs-facets-list-item-badge>
|
|
105
108
|
{item.quantity}
|
|
106
|
-
</
|
|
109
|
+
</UIBadge>
|
|
107
110
|
</UILabel>
|
|
108
111
|
</li>
|
|
109
112
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useSearch } from '@faststore/sdk'
|
|
2
|
+
import { Button as UIButton, IconButton as UIIconButton } from '@faststore/ui'
|
|
2
3
|
|
|
3
4
|
import type { Filter_FacetsFragment } from '@generated/graphql'
|
|
4
|
-
import Button from 'src/components/ui/Button'
|
|
5
5
|
import Icon from 'src/components/ui/Icon'
|
|
6
6
|
import SlideOver from 'src/components/ui/SlideOver'
|
|
7
7
|
import { useUI } from 'src/sdk/ui/Provider'
|
|
@@ -48,7 +48,7 @@ function FilterSlider({
|
|
|
48
48
|
<div data-fs-filter-slider-content>
|
|
49
49
|
<header data-fs-filter-slider-header>
|
|
50
50
|
<h2 className="text__lead">Filters</h2>
|
|
51
|
-
<
|
|
51
|
+
<UIIconButton
|
|
52
52
|
data-fs-filter-slider-header-icon
|
|
53
53
|
aria-label="Close Filters"
|
|
54
54
|
icon={<Icon name="X" width={32} height={32} />}
|
|
@@ -77,14 +77,14 @@ function FilterSlider({
|
|
|
77
77
|
/>
|
|
78
78
|
</div>
|
|
79
79
|
<footer data-fs-filter-slider-footer>
|
|
80
|
-
<
|
|
80
|
+
<UIButton
|
|
81
81
|
data-fs-filter-slider-footer-button-clear
|
|
82
82
|
variant="secondary"
|
|
83
83
|
onClick={() => dispatch({ type: 'selectFacets', payload: [] })}
|
|
84
84
|
>
|
|
85
85
|
Clear All
|
|
86
|
-
</
|
|
87
|
-
<
|
|
86
|
+
</UIButton>
|
|
87
|
+
<UIButton
|
|
88
88
|
data-fs-filter-slider-footer-button-apply
|
|
89
89
|
variant="primary"
|
|
90
90
|
data-testid="filter-slider-button-apply"
|
|
@@ -100,7 +100,7 @@ function FilterSlider({
|
|
|
100
100
|
}}
|
|
101
101
|
>
|
|
102
102
|
Apply
|
|
103
|
-
</
|
|
103
|
+
</UIButton>
|
|
104
104
|
</footer>
|
|
105
105
|
</SlideOver>
|
|
106
106
|
)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { List as UIList } from '@faststore/ui'
|
|
1
|
+
import { List as UIList, Button as UIButton } from '@faststore/ui'
|
|
2
2
|
|
|
3
|
-
import Button from 'src/components/ui/Button'
|
|
4
3
|
import Icon from 'src/components/ui/Icon'
|
|
5
4
|
import Link from 'src/components/ui/Link'
|
|
6
5
|
import useSearchHistory from 'src/sdk/search/useSearchHistory'
|
|
@@ -20,11 +19,11 @@ const SearchHistory = () => {
|
|
|
20
19
|
<section data-fs-search-section className={styles.fsSearch}>
|
|
21
20
|
<div data-fs-search-header>
|
|
22
21
|
<p data-fs-search-title>History</p>
|
|
23
|
-
<
|
|
22
|
+
<UIButton variant="tertiary" onClick={clearSearchHistory}>
|
|
24
23
|
Clear History
|
|
25
|
-
</
|
|
24
|
+
</UIButton>
|
|
26
25
|
</div>
|
|
27
|
-
<UIList
|
|
26
|
+
<UIList as="ol">
|
|
28
27
|
{searchHistory.map((item) => (
|
|
29
28
|
<li key={item.term} data-fs-search-item>
|
|
30
29
|
<Link
|
|
@@ -8,16 +8,10 @@
|
|
|
8
8
|
// Default properties
|
|
9
9
|
--fs-search-input-padding : var(--fs-spacing-1) var(--fs-spacing-7) var(--fs-spacing-1) var(--fs-spacing-2);
|
|
10
10
|
--fs-search-input-bkg-color : var(--fs-color-body-bkg);
|
|
11
|
-
--fs-search-input-box-shadow : 0 0 0 var(--fs-border-width) var(--fs-border-color-active);
|
|
12
11
|
|
|
13
12
|
--fs-search-input-height-mobile : var(--fs-control-tap-size);
|
|
14
13
|
--fs-search-input-height-desktop : var(--fs-spacing-6);
|
|
15
14
|
|
|
16
|
-
--fs-search-input-border-width : var(--fs-border-width);
|
|
17
|
-
--fs-search-input-border-radius : var(--fs-border-radius);
|
|
18
|
-
--fs-search-input-border-color : var(--fs-border-color);
|
|
19
|
-
--fs-search-input-border-color-hover : var(--fs-border-color-active);
|
|
20
|
-
|
|
21
15
|
--fs-search-input-transition-timing : var(--fs-transition-timing);
|
|
22
16
|
--fs-search-input-transition-function : ease;
|
|
23
17
|
|
|
@@ -67,18 +61,11 @@
|
|
|
67
61
|
@include media(">=notebook") { height: var(--fs-search-input-height-desktop); }
|
|
68
62
|
|
|
69
63
|
[data-fs-search-input] {
|
|
70
|
-
|
|
64
|
+
height: auto;
|
|
71
65
|
padding: var(--fs-search-input-padding);
|
|
72
66
|
background-color: var(--fs-search-input-bkg-color);
|
|
73
|
-
border: var(--fs-search-input-border-width) solid var(--fs-search-input-border-color);
|
|
74
|
-
border-radius: var(--fs-search-input-border-radius);
|
|
75
67
|
transition: box-shadow var(--fs-search-input-transition-timing) var(--fs-search-input-transition-timing), border var(--fs-search-input-transition-timing) var(--fs-search-input-transition-function);
|
|
76
68
|
|
|
77
|
-
&:hover {
|
|
78
|
-
border-color: var(--fs-search-input-border-color-hover);
|
|
79
|
-
box-shadow: var(--fs-search-input-box-shadow);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
69
|
@include input-focus-ring;
|
|
83
70
|
|
|
84
71
|
[data-fs-search-input-dropdown-visible="true"] & {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { List as UIList } from '@faststore/ui'
|
|
1
|
+
import { List as UIList, Badge as UIBadge } from '@faststore/ui'
|
|
2
2
|
import { forwardRef } from 'react'
|
|
3
3
|
import type { HTMLAttributes } from 'react'
|
|
4
4
|
|
|
5
|
-
import { Badge } from 'src/components/ui/Badge'
|
|
6
5
|
import Link from 'src/components/ui/Link'
|
|
7
6
|
import useSearchInput, { formatSearchPath } from 'src/sdk/search/useSearchInput'
|
|
8
7
|
import useTopSearch from 'src/sdk/search/useTopSearch'
|
|
@@ -47,7 +46,7 @@ const SearchTop = forwardRef<HTMLDivElement, SearchTopProps>(function SearchTop(
|
|
|
47
46
|
<div data-fs-search-header>
|
|
48
47
|
<p data-fs-search-title>Top Search</p>
|
|
49
48
|
</div>
|
|
50
|
-
<UIList
|
|
49
|
+
<UIList as="ol">
|
|
51
50
|
{terms.map((term, index) => (
|
|
52
51
|
<li key={term.value} data-fs-search-item>
|
|
53
52
|
<Link
|
|
@@ -61,9 +60,9 @@ const SearchTop = forwardRef<HTMLDivElement, SearchTopProps>(function SearchTop(
|
|
|
61
60
|
)
|
|
62
61
|
}
|
|
63
62
|
>
|
|
64
|
-
<
|
|
63
|
+
<UIBadge data-fs-search-badge variant="info">
|
|
65
64
|
{index + 1}
|
|
66
|
-
</
|
|
65
|
+
</UIBadge>
|
|
67
66
|
{term.value}
|
|
68
67
|
</Link>
|
|
69
68
|
</li>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useSearch } from '@faststore/sdk'
|
|
2
|
-
|
|
3
|
-
import Select from 'src/components/ui/Select'
|
|
2
|
+
import { SelectField } from '@faststore/ui'
|
|
4
3
|
|
|
5
4
|
const OptionsMap = {
|
|
6
5
|
price_desc: 'Price, descending',
|
|
@@ -19,7 +18,7 @@ function Sort() {
|
|
|
19
18
|
const { state, setState } = useSearch()
|
|
20
19
|
|
|
21
20
|
return (
|
|
22
|
-
<
|
|
21
|
+
<SelectField
|
|
23
22
|
id="sort-select"
|
|
24
23
|
className="sort / text__title-mini-alt"
|
|
25
24
|
label="Sort by"
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
--fs-banner-padding-mobile : var(--fs-spacing-6) 5%;
|
|
10
10
|
--fs-banner-padding-desktop : var(--fs-spacing-9) 15%;
|
|
11
11
|
|
|
12
|
-
// Link
|
|
13
|
-
--fs-banner-link-min-width
|
|
14
|
-
--fs-banner-link-margin-top
|
|
12
|
+
// Button Link
|
|
13
|
+
--fs-banner-button-link-min-width : 11.25rem;
|
|
14
|
+
--fs-banner-button-link-margin-top : var(--fs-spacing-6);
|
|
15
15
|
|
|
16
16
|
// Title
|
|
17
17
|
--fs-banner-title-size : var(--fs-text-size-lead);
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
height: 100%;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
[data-fs-banner-text-link] [data-fs-link] {
|
|
63
|
-
min-width: var(--fs-banner-link-min-width);
|
|
64
|
-
margin-top: var(--fs-banner-link-margin-top);
|
|
62
|
+
[data-fs-banner-text-link] [data-fs-button-link] {
|
|
63
|
+
min-width: var(--fs-banner-button-link-min-width);
|
|
64
|
+
margin-top: var(--fs-banner-button-link-margin-top);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
// --------------------------------------------------------
|
|
@@ -35,7 +35,7 @@ function Incentives({
|
|
|
35
35
|
data-fs-incentives-variant={variant}
|
|
36
36
|
className={styles.fsIncentives}
|
|
37
37
|
>
|
|
38
|
-
<UIList
|
|
38
|
+
<UIList className="layout__content">
|
|
39
39
|
{incentives.map((incentive, index) => (
|
|
40
40
|
<li key={String(index)}>
|
|
41
41
|
<UIIncentive>
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, FormEvent, ReactNode } from 'react'
|
|
2
2
|
import { forwardRef, useRef } from 'react'
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Form,
|
|
5
|
+
Button as UIButton,
|
|
6
|
+
InputField as UIInputField,
|
|
7
|
+
} from '@faststore/ui'
|
|
4
8
|
|
|
5
9
|
import { useUI } from 'src/sdk/ui/Provider'
|
|
6
10
|
import Icon from 'src/components/ui/Icon'
|
|
7
|
-
import Button from 'src/components/ui/Button'
|
|
8
11
|
import Link from 'src/components/ui/Link'
|
|
9
|
-
import InputText from 'src/components/ui/InputText'
|
|
10
12
|
import { useNewsletter } from 'src/sdk/newsletter/useNewsletter'
|
|
11
13
|
|
|
12
14
|
import Section from '../Section'
|
|
@@ -96,7 +98,7 @@ const Newsletter = forwardRef<HTMLFormElement, NewsletterProps>(
|
|
|
96
98
|
<div data-fs-newsletter-controls>
|
|
97
99
|
{lite ? (
|
|
98
100
|
<>
|
|
99
|
-
<
|
|
101
|
+
<UIInputField
|
|
100
102
|
inputRef={emailInputRef}
|
|
101
103
|
id="newsletter-email"
|
|
102
104
|
label="Your Email"
|
|
@@ -117,13 +119,13 @@ const Newsletter = forwardRef<HTMLFormElement, NewsletterProps>(
|
|
|
117
119
|
</>
|
|
118
120
|
) : (
|
|
119
121
|
<>
|
|
120
|
-
<
|
|
122
|
+
<UIInputField
|
|
121
123
|
inputRef={nameInputRef}
|
|
122
124
|
id="newsletter-name"
|
|
123
125
|
label="Your Name"
|
|
124
126
|
required
|
|
125
127
|
/>
|
|
126
|
-
<
|
|
128
|
+
<UIInputField
|
|
127
129
|
inputRef={emailInputRef}
|
|
128
130
|
id="newsletter-email"
|
|
129
131
|
label="Your Email"
|
|
@@ -136,9 +138,9 @@ const Newsletter = forwardRef<HTMLFormElement, NewsletterProps>(
|
|
|
136
138
|
Privacy Policy.
|
|
137
139
|
</Link>
|
|
138
140
|
</span>
|
|
139
|
-
<
|
|
141
|
+
<UIButton variant="secondary" inverse type="submit">
|
|
140
142
|
{loading ? 'Loading...' : 'Subscribe'}
|
|
141
|
-
</
|
|
143
|
+
</UIButton>
|
|
142
144
|
</>
|
|
143
145
|
)}
|
|
144
146
|
</div>
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
.fs-product-details-content {
|
|
2
|
-
// -----------------------------
|
|
3
|
-
// List
|
|
4
|
-
// -----------------------------
|
|
5
|
-
|
|
6
|
-
[data-fs-product-details-highlights] [data-fs-list="unordered"] {
|
|
7
|
-
list-style: initial;
|
|
8
|
-
list-style-position: inside;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
2
|
// -----------------------------
|
|
12
3
|
// Table
|
|
13
4
|
// -----------------------------
|
|
@@ -2,12 +2,14 @@ import { gql } from '@faststore/graphql-utils'
|
|
|
2
2
|
import type { CurrencyCode, ViewItemEvent } from '@faststore/sdk'
|
|
3
3
|
import { sendAnalyticsEvent } from '@faststore/sdk'
|
|
4
4
|
import { useEffect, useState } from 'react'
|
|
5
|
+
import {
|
|
6
|
+
BuyButton as UIBuyButton,
|
|
7
|
+
DiscountBadge as UIDiscountBadge,
|
|
8
|
+
} from '@faststore/ui'
|
|
5
9
|
|
|
6
10
|
import type { ProductDetailsFragment_ProductFragment } from '@generated/graphql'
|
|
7
11
|
import OutOfStock from 'src/components/product/OutOfStock'
|
|
8
|
-
import { DiscountBadge } from 'src/components/ui/Badge'
|
|
9
12
|
import Breadcrumb from 'src/components/ui/Breadcrumb'
|
|
10
|
-
import { ButtonBuy } from 'src/components/ui/Button'
|
|
11
13
|
import { ImageGallery } from 'src/components/ui/ImageGallery'
|
|
12
14
|
import Price from 'src/components/ui/Price'
|
|
13
15
|
import ProductTitle from 'src/components/ui/ProductTitle'
|
|
@@ -123,7 +125,11 @@ function ProductDetails({ context: staleProduct }: Props) {
|
|
|
123
125
|
<ProductTitle
|
|
124
126
|
title={<h1>{name}</h1>}
|
|
125
127
|
label={
|
|
126
|
-
<
|
|
128
|
+
<UIDiscountBadge
|
|
129
|
+
listPrice={listPrice}
|
|
130
|
+
spotPrice={lowPrice}
|
|
131
|
+
size="big"
|
|
132
|
+
/>
|
|
127
133
|
}
|
|
128
134
|
refNumber={productId}
|
|
129
135
|
/>
|
|
@@ -178,9 +184,9 @@ function ProductDetails({ context: staleProduct }: Props) {
|
|
|
178
184
|
{isValidating ? (
|
|
179
185
|
<AddToCartLoadingSkeleton />
|
|
180
186
|
) : (
|
|
181
|
-
<
|
|
187
|
+
<UIBuyButton disabled={buyDisabled} {...buyProps}>
|
|
182
188
|
Add to Cart
|
|
183
|
-
</
|
|
189
|
+
</UIBuyButton>
|
|
184
190
|
)}
|
|
185
191
|
{!availability && (
|
|
186
192
|
<OutOfStock
|
|
@@ -2,13 +2,14 @@ import { useSearch } from '@faststore/sdk'
|
|
|
2
2
|
import { NextSeo } from 'next-seo'
|
|
3
3
|
import { lazy, Suspense } from 'react'
|
|
4
4
|
import type { MouseEvent } from 'react'
|
|
5
|
+
import { Button as UIButton } from '@faststore/ui'
|
|
5
6
|
|
|
6
7
|
import Filter from 'src/components/search/Filter'
|
|
7
8
|
import Sort from 'src/components/search/Sort'
|
|
8
9
|
import FilterSkeleton from 'src/components/skeletons/FilterSkeleton'
|
|
9
10
|
import ProductGridSkeleton from 'src/components/skeletons/ProductGridSkeleton'
|
|
10
11
|
import Skeleton from 'src/components/skeletons/Skeleton'
|
|
11
|
-
import
|
|
12
|
+
import { ButtonLink } from 'src/components/ui/Button'
|
|
12
13
|
import Icon from 'src/components/ui/Icon'
|
|
13
14
|
import { mark } from 'src/sdk/tests/mark'
|
|
14
15
|
import { useUI } from 'src/sdk/ui/Provider'
|
|
@@ -100,7 +101,7 @@ function ProductGallery({ title, searchTerm }: Props) {
|
|
|
100
101
|
loading={facets?.length === 0}
|
|
101
102
|
data-fs-product-listing-filter-button-skeleton
|
|
102
103
|
>
|
|
103
|
-
<
|
|
104
|
+
<UIButton
|
|
104
105
|
variant="tertiary"
|
|
105
106
|
data-testid="open-filter-button"
|
|
106
107
|
icon={<Icon name="FadersHorizontal" width={16} height={16} />}
|
|
@@ -109,7 +110,7 @@ function ProductGallery({ title, searchTerm }: Props) {
|
|
|
109
110
|
onClick={openFilter}
|
|
110
111
|
>
|
|
111
112
|
Filters
|
|
112
|
-
</
|
|
113
|
+
</UIButton>
|
|
113
114
|
</Skeleton>
|
|
114
115
|
</div>
|
|
115
116
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { Button as UIButton } from '@faststore/ui'
|
|
2
|
+
import type { ButtonProps } from '@faststore/ui'
|
|
3
|
+
|
|
1
4
|
import Icon from 'src/components/ui/Icon'
|
|
2
5
|
|
|
3
|
-
import Button from '../../ui/Button'
|
|
4
6
|
import Section from '../Section'
|
|
5
|
-
import type { ButtonProps } from '../../ui/Button'
|
|
6
7
|
import styles from './scroll-to-top-button.module.scss'
|
|
7
8
|
|
|
8
9
|
interface ScrollToTopButtonProps {
|
|
@@ -30,14 +31,14 @@ function ScrollToTopButton({
|
|
|
30
31
|
}: ScrollToTopButtonProps) {
|
|
31
32
|
return (
|
|
32
33
|
<Section className={styles.fsScrollToTopButton}>
|
|
33
|
-
<
|
|
34
|
+
<UIButton
|
|
34
35
|
variant="secondary"
|
|
35
36
|
icon={icon}
|
|
36
37
|
iconPosition={iconPosition}
|
|
37
38
|
onClick={() => window.scrollTo(0, 0)}
|
|
38
39
|
>
|
|
39
40
|
{text}
|
|
40
|
-
</
|
|
41
|
+
</UIButton>
|
|
41
42
|
</Section>
|
|
42
43
|
)
|
|
43
44
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Alert as UIAlert,
|
|
3
|
+
Icon as UIIcon,
|
|
4
|
+
Button as UIButton,
|
|
5
|
+
} from '@faststore/ui'
|
|
2
6
|
import { useCallback } from 'react'
|
|
3
7
|
import type { ReactNode, MouseEvent } from 'react'
|
|
4
8
|
import type { AlertProps } from '@faststore/ui'
|
|
5
9
|
|
|
6
10
|
import Link from 'src/components/ui/Link'
|
|
7
|
-
import Button from 'src/components/ui/Button'
|
|
8
11
|
import Icon from 'src/components/ui/Icon'
|
|
9
12
|
|
|
10
13
|
import styles from './alert.module.scss'
|
|
@@ -65,11 +68,11 @@ function Alert({
|
|
|
65
68
|
)}
|
|
66
69
|
|
|
67
70
|
{dismissible && (
|
|
68
|
-
<
|
|
71
|
+
<UIButton data-fs-alert-button aria-label="Close" onClick={handleClose}>
|
|
69
72
|
<span>
|
|
70
73
|
<Icon name="X" width={18} height={18} weight="bold" />
|
|
71
74
|
</span>
|
|
72
|
-
</
|
|
75
|
+
</UIButton>
|
|
73
76
|
)}
|
|
74
77
|
</UIAlert>
|
|
75
78
|
)
|