@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
|
|
2
2
|
|
|
3
|
-
import { DiscountBadge } from '
|
|
3
|
+
import { DiscountBadge } from '@faststore/ui'
|
|
4
4
|
import ProductTitle from '.'
|
|
5
5
|
import { TokenTable, TokenRow } from 'src/../.storybook/components'
|
|
6
6
|
|
|
@@ -25,22 +25,23 @@ import { TokenTable, TokenRow } from 'src/../.storybook/components'
|
|
|
25
25
|
label: {
|
|
26
26
|
control: { type: 'radio' },
|
|
27
27
|
options: [
|
|
28
|
-
'<DiscountBadge listPrice={100} spotPrice={90} big />',
|
|
29
|
-
'<DiscountBadge listPrice={100} spotPrice={70} big />',
|
|
30
|
-
'<DiscountBadge listPrice={100} spotPrice={10} big />',
|
|
28
|
+
'<DiscountBadge listPrice={100} spotPrice={90} size="big" />',
|
|
29
|
+
'<DiscountBadge listPrice={100} spotPrice={70} size="big" />',
|
|
30
|
+
'<DiscountBadge listPrice={100} spotPrice={10} size="big" />',
|
|
31
31
|
],
|
|
32
32
|
mapping: {
|
|
33
|
-
'<DiscountBadge listPrice={100} spotPrice={90} big />': (
|
|
34
|
-
<DiscountBadge listPrice={100} spotPrice={90} big />
|
|
33
|
+
'<DiscountBadge listPrice={100} spotPrice={90} size="big" />': (
|
|
34
|
+
<DiscountBadge listPrice={100} spotPrice={90} size="big" />
|
|
35
35
|
),
|
|
36
|
-
'<DiscountBadge listPrice={100} spotPrice={70} big />': (
|
|
37
|
-
<DiscountBadge listPrice={100} spotPrice={70} big />
|
|
36
|
+
'<DiscountBadge listPrice={100} spotPrice={70} size="big" />': (
|
|
37
|
+
<DiscountBadge listPrice={100} spotPrice={70} size="big" />
|
|
38
38
|
),
|
|
39
|
-
'<DiscountBadge listPrice={100} spotPrice={10} big />': (
|
|
40
|
-
<DiscountBadge listPrice={100} spotPrice={10} big />
|
|
39
|
+
'<DiscountBadge listPrice={100} spotPrice={10} size="big" />': (
|
|
40
|
+
<DiscountBadge listPrice={100} spotPrice={10} size="big" />
|
|
41
41
|
),
|
|
42
42
|
},
|
|
43
|
-
defaultValue:
|
|
43
|
+
defaultValue:
|
|
44
|
+
'<DiscountBadge listPrice={100} spotPrice={90} size="big" />',
|
|
44
45
|
},
|
|
45
46
|
refNumber: {
|
|
46
47
|
defaultValue: '99995945',
|
|
@@ -100,8 +101,5 @@ The product title that is commonly used on Product Details Page (PDP).
|
|
|
100
101
|
token="--fs-product-title-addendum-size"
|
|
101
102
|
value="var(--fs-text-size-1)"
|
|
102
103
|
/>
|
|
103
|
-
<TokenRow
|
|
104
|
-
token="--fs-product-title-addendum-line-height"
|
|
105
|
-
value="1.7"
|
|
106
|
-
/>
|
|
104
|
+
<TokenRow token="--fs-product-title-addendum-line-height" value="1.7" />
|
|
107
105
|
</TokenTable>
|
|
@@ -35,10 +35,6 @@
|
|
|
35
35
|
--fs-qty-selector-button-bkg-color-focus : var(--fs-qty-selector-button-bkg-color-hover);
|
|
36
36
|
--fs-qty-selector-button-border-radius : var(--fs-qty-selector-border-radius);
|
|
37
37
|
|
|
38
|
-
--fs-qty-selector-transition-function : var(--fs-transition-function);
|
|
39
|
-
--fs-qty-selector-transition-property : var(--fs-transition-property);
|
|
40
|
-
--fs-qty-selector-transition-timing : var(--fs-transition-timing);
|
|
41
|
-
|
|
42
38
|
// Disabled properties
|
|
43
39
|
--fs-qty-selector-disabled-bkg-color : var(--fs-color-disabled-bkg);
|
|
44
40
|
--fs-qty-selector-disabled-text-color : var(--fs-color-disabled-text);
|
|
@@ -73,31 +69,13 @@
|
|
|
73
69
|
font-size: var(--fs-qty-selector-text-size);
|
|
74
70
|
color: var(--fs-qty-selector-text-color);
|
|
75
71
|
text-align: center;
|
|
76
|
-
background-color: var(--fs-qty-selector-bkg-color);
|
|
77
|
-
border: var(--fs-qty-selector-border-width) solid var(--fs-qty-selector-border-color);
|
|
78
|
-
border-radius: var(--fs-qty-selector-border-radius);
|
|
79
|
-
transition:
|
|
80
|
-
var(--fs-qty-selector-transition-property)
|
|
81
|
-
var(--fs-qty-selector-transition-timing)
|
|
82
|
-
var(--fs-qty-selector-transition-function);
|
|
83
|
-
|
|
84
|
-
@include input-focus-ring;
|
|
85
72
|
}
|
|
86
73
|
|
|
87
74
|
[data-quantity-selector-button] {
|
|
88
75
|
position: absolute;
|
|
89
|
-
min-width: var(--fs-control-tap-size);
|
|
90
|
-
height: 100%;
|
|
91
|
-
min-height: var(--fs-control-tap-size);
|
|
92
|
-
padding: var(--fs-spacing-1);
|
|
93
76
|
background-color: var(--fs-qty-selector-button-bkg-color);
|
|
94
|
-
border: 0;
|
|
95
|
-
border-radius: var(--fs-qty-selector-button-border-radius);
|
|
96
77
|
|
|
97
78
|
[data-fs-icon] {
|
|
98
|
-
display: flex;
|
|
99
|
-
align-items: center;
|
|
100
|
-
justify-content: center;
|
|
101
79
|
width: 100%;
|
|
102
80
|
height: 100%;
|
|
103
81
|
border-radius: var(--fs-qty-selector-button-border-radius);
|
|
@@ -108,6 +86,10 @@
|
|
|
108
86
|
var(--fs-qty-selector-transition-function);
|
|
109
87
|
}
|
|
110
88
|
|
|
89
|
+
&[data-fs-icon-button] {
|
|
90
|
+
padding: var(--fs-spacing-1);
|
|
91
|
+
}
|
|
92
|
+
|
|
111
93
|
&:first-of-type { left: 0; }
|
|
112
94
|
|
|
113
95
|
&:last-of-type { right: 0; }
|
|
@@ -119,14 +101,31 @@
|
|
|
119
101
|
|
|
120
102
|
&:disabled {
|
|
121
103
|
cursor: not-allowed;
|
|
104
|
+
background-color: var(--fs-qty-selector-button-bkg-color);
|
|
105
|
+
|
|
106
|
+
&:hover, &:focus-visible {
|
|
107
|
+
background-color: var(--fs-qty-selector-button-bkg-color);
|
|
108
|
+
}
|
|
122
109
|
|
|
123
110
|
[data-fs-icon] {
|
|
124
111
|
color: var(--fs-qty-selector-disabled-icon-color);
|
|
125
112
|
}
|
|
126
113
|
}
|
|
127
114
|
|
|
115
|
+
&:hover:not(:disabled) {
|
|
116
|
+
background-color: transparent;
|
|
117
|
+
box-shadow: none;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&:focus:not(:disabled) {
|
|
121
|
+
background-color: transparent;
|
|
122
|
+
box-shadow: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
128
125
|
&:focus-visible {
|
|
126
|
+
background-color: var(--fs-qty-selector-button-bkg-color);
|
|
129
127
|
outline: none;
|
|
128
|
+
box-shadow: none;
|
|
130
129
|
|
|
131
130
|
[data-fs-icon] {
|
|
132
131
|
@include focus-ring;
|
|
@@ -151,10 +150,6 @@
|
|
|
151
150
|
// --------------------------------------------------------
|
|
152
151
|
|
|
153
152
|
&[data-fs-quantity-selector="disabled"] {
|
|
154
|
-
[data-quantity-selector-input] {
|
|
155
|
-
background-color: var(--fs-qty-selector-disabled-bkg-color);
|
|
156
|
-
border-color: var(--fs-qty-selector-disabled-border-color);
|
|
157
|
-
}
|
|
158
153
|
[data-quantity-selector-button]:hover [data-fs-icon] { background-color: transparent; }
|
|
159
154
|
}
|
|
160
155
|
}
|
|
@@ -32,7 +32,7 @@ This feature lets customers set the `PostalCode` and see the shipping options in
|
|
|
32
32
|
|
|
33
33
|
## Overview
|
|
34
34
|
|
|
35
|
-
The `ShippingSimulation` component uses [FastStore UI Table](https://www.faststore.dev/reference/ui/molecules/Table), and [
|
|
35
|
+
The `ShippingSimulation` component uses [FastStore UI Table](https://www.faststore.dev/reference/ui/molecules/Table), and [InputField](https://www.faststore.dev/reference/ui/molecules/InputField) as base.
|
|
36
36
|
|
|
37
37
|
### Steps
|
|
38
38
|
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import type { IShippingItem } from '@faststore/api'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Table,
|
|
4
|
+
TableBody,
|
|
5
|
+
TableCell,
|
|
6
|
+
TableRow,
|
|
7
|
+
InputField as UIInputField,
|
|
8
|
+
} from '@faststore/ui'
|
|
3
9
|
import type { HTMLAttributes } from 'react'
|
|
4
10
|
|
|
5
11
|
import Price from 'src/components/ui/Price'
|
|
6
12
|
import { usePriceFormatter } from 'src/sdk/product/useFormattedPrice'
|
|
7
13
|
|
|
8
14
|
import Icon from '../Icon'
|
|
9
|
-
import InputText from '../InputText'
|
|
10
15
|
import Link from '../Link'
|
|
11
16
|
import styles from './shipping-simulation.module.scss'
|
|
12
17
|
import { useShippingSimulation } from './useShippingSimulation'
|
|
@@ -56,7 +61,7 @@ function ShippingSimulation({
|
|
|
56
61
|
Shipping
|
|
57
62
|
</h2>
|
|
58
63
|
|
|
59
|
-
<
|
|
64
|
+
<UIInputField
|
|
60
65
|
actionable
|
|
61
66
|
error={errorMessage}
|
|
62
67
|
id="shipping-postal-code"
|
|
@@ -19,7 +19,7 @@ import storeConfig from 'store.config'
|
|
|
19
19
|
import { validateSession } from 'src/sdk/session'
|
|
20
20
|
import { useFilter } from 'src/components/search/Filter/useFilter'
|
|
21
21
|
|
|
22
|
-
import Button,
|
|
22
|
+
import { Button, BuyButton } from '@faststore/ui'
|
|
23
23
|
import { FilterSlider } from 'src/components/search/Filter'
|
|
24
24
|
|
|
25
25
|
import SlideOver from '.'
|
|
@@ -127,12 +127,12 @@ export const TemplateCartSidebar = () => {
|
|
|
127
127
|
return (
|
|
128
128
|
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
129
129
|
<CartToggle />
|
|
130
|
-
<
|
|
130
|
+
<BuyButton
|
|
131
131
|
style={{ marginLeft: '12px' }}
|
|
132
132
|
onClick={() => addItem(cartItem)}
|
|
133
133
|
>
|
|
134
134
|
Add item to Cart
|
|
135
|
-
</
|
|
135
|
+
</BuyButton>
|
|
136
136
|
{displayCart && <CartSidebar />}
|
|
137
137
|
</div>
|
|
138
138
|
)
|
package/src/pages/_app.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import '
|
|
3
|
-
|
|
4
|
-
import '../styles/global/layout.scss'
|
|
1
|
+
// FastStore UI's base styles
|
|
2
|
+
import '@faststore/ui/src/styles/global.scss'
|
|
3
|
+
|
|
5
4
|
import '../styles/global/components.scss'
|
|
6
5
|
|
|
7
6
|
import '../customizations/themes/index.scss'
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
// ----------------------------------------------------------
|
|
2
|
-
// GLOBAL STYLES
|
|
3
|
-
// Utilities
|
|
4
|
-
// ----------------------------------------------------------
|
|
5
|
-
|
|
6
1
|
/* SQ-DISABLE */
|
|
7
2
|
@use "sass:math";
|
|
8
3
|
|
|
9
4
|
/* SQ-ENABLE */
|
|
5
|
+
/* stylelint-disable-next-line no-invalid-position-at-import-rule */
|
|
6
|
+
@import "~include-media/dist/include-media";
|
|
7
|
+
|
|
8
|
+
// Include Media Overwrites //////////////////////////
|
|
9
|
+
|
|
10
|
+
$breakpoints: (
|
|
11
|
+
"phone": 320px,
|
|
12
|
+
"phonemid": 375px,
|
|
13
|
+
"tablet": 768px,
|
|
14
|
+
"notebook": 1280px,
|
|
15
|
+
"desktop": 1440px,
|
|
16
|
+
);
|
|
10
17
|
|
|
11
18
|
// Px to rem.
|
|
12
19
|
$base: 16px !default;
|