@shopgate/engage 7.32.0-beta.7 → 7.32.0-beta.9
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/account/components/Profile/Profile.provider.d.ts +1 -1
- package/account/components/Profile/ProfileAddressBook.d.ts.map +1 -1
- package/account/components/Profile/ProfileAddressBook.js +13 -22
- package/account/components/Profile/ProfileAddressCard.d.ts.map +1 -1
- package/account/components/Profile/ProfileAddressCard.js +8 -18
- package/account/components/Profile/ProfileForm.d.ts.map +1 -1
- package/account/components/Profile/ProfileForm.js +15 -42
- package/account/components/ProfileContact/ProfileContact.js +13 -21
- package/admin-preview/components/FrontendSettingsPreviewBridge/FrontendSettingsPreviewBridge.d.ts.map +1 -1
- package/admin-preview/components/FrontendSettingsPreviewBridge/FrontendSettingsPreviewBridge.js +41 -7
- package/admin-preview/components/FrontendSettingsPreviewBridge/types.d.ts +7 -0
- package/admin-preview/components/FrontendSettingsPreviewBridge/types.d.ts.map +1 -1
- package/admin-preview/initialization/_internal/initialFrontendSettings.d.ts +32 -0
- package/admin-preview/initialization/_internal/initialFrontendSettings.d.ts.map +1 -0
- package/admin-preview/initialization/_internal/initialFrontendSettings.js +43 -0
- package/admin-preview/initialization/awaitInitialFrontendSettings.d.ts +22 -0
- package/admin-preview/initialization/awaitInitialFrontendSettings.d.ts.map +1 -0
- package/admin-preview/initialization/awaitInitialFrontendSettings.js +84 -0
- package/back-in-stock/components/BackInStockButton/index.js +5 -5
- package/cart/components/CartItem/CartItemProductLayout.js +1 -0
- package/cart/components/CartItem/CartItemProductLayoutWideRemoveItem.js +7 -14
- package/cart/components/CartItem/CartItemQuantityPicker.js +1 -0
- package/cart/components/CartItems/CartItemCardReservationLabelChangeStore.js +6 -24
- package/cart/components/CartSummaryWide/CartSummaryWide.js +2 -2
- package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.js +9 -23
- package/cart/components/PaymentBar/PaymentBarCheckoutButton.js +8 -30
- package/cart/components/PaymentBar/testUtils/mockFactories.js +4 -11
- package/category/components/CategoryImage/index.js +13 -2
- package/checkout/components/AddressBook/AddressList.js +14 -23
- package/checkout/components/Checkout/CheckoutActions.js +4 -3
- package/checkout/components/Checkout/CheckoutAddress.js +8 -0
- package/checkout/components/Checkout/CheckoutSection.js +6 -2
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmation.js +6 -7
- package/checkout/components/ResponsiveBackButton/ResponsiveBackButton.js +7 -17
- package/components/Badge/spec.js +6 -29
- package/components/Card/Card.js +1 -1
- package/components/ChipLayout/index.js +2 -4
- package/components/NavigationHandler/connector.js +1 -1
- package/components/NavigationHandler/index.d.ts +2 -2
- package/components/NavigationHandler/spec.js +10 -1
- package/components/Paper/Paper.d.ts +1 -2
- package/components/Paper/Paper.d.ts.map +1 -1
- package/components/Paper/spec.js +5 -22
- package/components/Tabs/components/Tab.d.ts.map +1 -1
- package/components/Tabs/components/Tab.js +14 -16
- package/components/Typography/Typography.d.ts +1 -1
- package/components/v2/Button/Button.d.ts +24 -13
- package/components/v2/Button/Button.d.ts.map +1 -1
- package/components/v2/Button/Button.js +139 -41
- package/components/v2/ButtonBase/ButtonBase.d.ts +50 -10
- package/components/v2/ButtonBase/ButtonBase.d.ts.map +1 -1
- package/components/v2/ButtonBase/ButtonBase.js +192 -17
- package/components/v2/ButtonBase/hooks.d.ts +0 -1
- package/components/v2/ButtonBase/hooks.d.ts.map +1 -1
- package/components/v2/ButtonBase/hooks.js +36 -12
- package/components/v2/ButtonGroup/ButtonGroup.d.ts +11 -5
- package/components/v2/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/components/v2/ButtonGroup/ButtonGroup.js +49 -26
- package/components/v2/CircularProgress/CircularProgress.d.ts.map +1 -1
- package/components/v2/CircularProgress/CircularProgress.js +10 -5
- package/core/hooks/useNavigation.d.ts +10 -2
- package/core/hooks/useNavigation.d.ts.map +1 -1
- package/core/hooks/useNavigation.js +1 -2
- package/core/initialization/index.d.ts.map +1 -1
- package/core/initialization/index.js +24 -5
- package/core/router/conductor.d.ts +9 -0
- package/core/router/helpers.d.ts +28 -15
- package/core/router/helpers.d.ts.map +1 -1
- package/core/router/helpers.js +8 -8
- package/development/components/DevelopmentSettings/DevelopmentSettings.js +3 -3
- package/favorites/components/FavoriteButtonWide/FavoriteButtonWide.js +7 -17
- package/favorites/components/List/List.d.ts.map +1 -1
- package/favorites/components/List/List.js +0 -1
- package/favorites/components/List/ListContent.js +4 -5
- package/favorites/components/Lists/Lists.js +4 -5
- package/filter/components/FilterPageContent/components/ApplyButton/index.js +8 -10
- package/filter/components/FilterPageContent/components/ResetButton/index.js +8 -6
- package/locations/components/ChangeLocationButton/ChangeLocationButton.js +10 -14
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotDialog.js +4 -8
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcher.js +1 -1
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherBar.js +8 -13
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherDefault.js +10 -10
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherBar.js +8 -14
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherDefault.js +9 -10
- package/locations/components/ReserveForm/ReserveForm.js +6 -7
- package/locations/components/StoreDetails/components/GetDirectionsButton.js +2 -4
- package/locations/components/StoreDetails/components/StoreDetails.js +5 -10
- package/locations/components/StoreDetails/components/StoresNearbyListItem.js +13 -21
- package/locations/components/StoreFinder/StoreFinderSelectLocationButton.js +5 -11
- package/locations/components/StoreFinder/StoreFinderStoreInfoButton.js +5 -11
- package/locations/components/StoreList/StoreListSearch.js +1 -0
- package/locations/components/StoreList/StoreSelectLocationButton.js +5 -11
- package/login/components/ForgotPassword/ForgotPassword.js +11 -23
- package/orders/components/OrderDetails/OrderDetailsAuthenticate.js +5 -7
- package/package.json +7 -7
- package/page/components/NotFound.d.ts.map +1 -1
- package/page/components/NotFound.js +7 -6
- package/page/components/ResponsiveWidgetImage/ResponsiveWidgetImage.d.ts +1 -1
- package/page/components/ResponsiveWidgetImage/ResponsiveWidgetImage.js +2 -2
- package/page/components/WidgetVideo/WidgetVideo.d.ts +1 -1
- package/page/components/WidgetVideo/WidgetVideo.d.ts.map +1 -1
- package/page/helpers/index.d.ts +5 -2
- package/page/helpers/index.d.ts.map +1 -1
- package/page/helpers/index.js +8 -5
- package/page/widgets/Button/Button.js +2 -3
- package/page/widgets/NestedCategoryFilter/NestedCategoryFilter.js +8 -8
- package/page/widgets/ProductList/ProductList.js +18 -14
- package/page/widgets/Video/hooks.d.ts +2 -2
- package/product/components/ProductCard/index.js +7 -1
- package/product/components/ProductGrid/components/Item/components/ItemDetails/index.js +6 -1
- package/product/components/ProductGrid/components/Item/components/ItemImage/index.js +1 -11
- package/product/components/ProductGrid/components/Item/index.js +3 -2
- package/product/components/ProductGrid/components/Layout/index.js +2 -1
- package/product/components/ProductGridPrice/index.js +0 -1
- package/product/components/ProductImage/ProductImage.d.ts.map +1 -1
- package/product/components/ProductImage/ProductImage.js +7 -2
- package/product/components/ProductImage/ProductImagePlaceholder.js +3 -3
- package/product/components/ProductSlider/index.js +1 -1
- package/product/components/UnitQuantityPicker/UnitQuantityPicker.d.ts.map +1 -1
- package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +15 -33
- package/push-opt-in/components/PushOptInModal/index.js +4 -4
- package/registration/components/Registration/RegistrationFormActions.js +4 -4
- package/reviews/components/Reviews/components/AllReviewsLink/index.js +6 -6
- package/reviews/components/Reviews/components/Header/components/WriteReviewLink/index.js +4 -3
- package/reviews/components/Reviews/components/Header/components/WriteReviewLink/spec.js +28 -22
- package/reviews/components/Reviews/spec.js +5 -6
- package/settings/reducers/appSettings.d.ts.map +1 -1
- package/settings/reducers/appSettings.js +18 -2
- package/settings/selectors/appSettings.d.ts +37 -2
- package/settings/selectors/appSettings.d.ts.map +1 -1
- package/settings/selectors/appSettings.js +30 -1
- package/settings/types/appSettings.d.ts +42 -2
- package/settings/types/appSettings.d.ts.map +1 -1
- package/settings/types/appSettings.js +124 -1
- package/styles/helpers/index.d.ts +1 -0
- package/styles/helpers/index.js +1 -0
- package/styles/helpers/loadFontCss.d.ts +22 -0
- package/styles/helpers/loadFontCss.d.ts.map +1 -0
- package/styles/helpers/loadFontCss.js +138 -0
- package/styles/helpers/loadThemeCss.d.ts.map +1 -1
- package/styles/helpers/loadThemeCss.js +11 -0
- package/styles/index.d.ts +1 -1
- package/styles/index.d.ts.map +1 -1
- package/styles/theme/createDefaultThemeOptions/index.d.ts.map +1 -1
- package/styles/theme/createDefaultThemeOptions/index.js +94 -3
- package/styles/theme/createTheme/createComponents.types.d.ts +25 -0
- package/styles/theme/createTheme/createComponents.types.d.ts.map +1 -1
- package/styles/theme/createTheme/createComponents.types.js +28 -3
- package/styles/theme/createTheme/createShape.d.ts +2 -3
- package/styles/theme/createTheme/createShape.d.ts.map +1 -1
- package/styles/theme/createTheme/createShape.js +1 -2
- package/styles/theme/createTheme/createThemeFromColorScheme.d.ts +3 -1
- package/styles/theme/createTheme/createThemeFromColorScheme.d.ts.map +1 -1
- package/styles/theme/createTheme/createThemeFromColorScheme.js +4 -2
- package/styles/theme/createTheme/createTypography.d.ts +2 -1
- package/styles/theme/createTheme/createTypography.js +58 -18
- package/styles/theme/createTheme/index.d.ts +2 -2
- package/styles/theme/createTheme/index.d.ts.map +1 -1
- package/styles/theme/createTheme/index.js +2 -2
- package/styles/theme/createTheme/types.d.ts +9 -2
- package/styles/theme/createTheme/types.d.ts.map +1 -1
- package/styles/theme/createTheme/types.js +6 -0
- package/styles/theme/hooks/useColorScheme.d.ts +2 -2
- package/styles/theme/hooks/useColorScheme.d.ts.map +1 -1
- package/styles/theme/hooks/useColorScheme.js +1 -1
- package/styles/theme/hooks/useMediaQuery.d.ts +7 -0
- package/styles/theme/hooks/useMediaQuery.d.ts.map +1 -1
- package/styles/theme/hooks/useMediaQuery.js +5 -5
- package/styles/theme/hooks/useTheme.js +1 -1
- package/styles/theme/index.d.ts +3 -1
- package/styles/theme/index.d.ts.map +1 -1
- package/styles/theme/providers/ColorSchemeContext.d.ts +30 -9
- package/styles/theme/providers/ColorSchemeContext.d.ts.map +1 -1
- package/styles/theme/providers/ColorSchemeContext.js +8 -0
- package/styles/theme/providers/ThemeContext.d.ts +3 -0
- package/styles/theme/providers/ThemeContext.d.ts.map +1 -0
- package/styles/theme/providers/ThemeContext.js +2 -0
- package/styles/theme/providers/ThemeProvider.d.ts +2 -2
- package/styles/theme/providers/ThemeProvider.d.ts.map +1 -1
- package/styles/theme/providers/ThemeProvider.js +58 -16
- package/styles/theme/utils/color.d.ts +12 -12
- package/styles/theme/utils/color.d.ts.map +1 -1
- package/tracking/components/CookieConsentModal/index.js +3 -4
- package/tracking/components/PrivacySettings/index.js +3 -3
- package/cart/components/PaymentBar/PaymentBarReserveButton.connector.js +0 -6
- package/cart/components/PaymentBar/PaymentBarReserveButton.js +0 -71
- package/locations/components/StoreFinder/StoreFinderGetDirectionsButton.connector.js +0 -16
- package/locations/components/StoreFinder/StoreFinderGetDirectionsButton.js +0 -52
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { I18n } from '@shopgate/engage/components';
|
|
3
|
+
import { Button } from '@shopgate/engage/components/v2';
|
|
3
4
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
4
5
|
import { useCartItemProduct } from "./CartItem.hooks";
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
const useStyles = makeStyles()(theme => ({
|
|
7
8
|
button: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
padding: `${theme.spacing(2, 0)} !important`,
|
|
11
|
-
' *': {
|
|
12
|
-
padding: '0 !important'
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
ripple: {
|
|
16
|
-
padding: 0
|
|
9
|
+
marginTop: theme.spacing(2),
|
|
10
|
+
textTransform: 'none'
|
|
17
11
|
}
|
|
18
12
|
}));
|
|
19
13
|
|
|
@@ -27,12 +21,11 @@ const CartItemProductLayoutWideRemoveItem = () => {
|
|
|
27
21
|
const {
|
|
28
22
|
handleRemove
|
|
29
23
|
} = useCartItemProduct();
|
|
30
|
-
return /*#__PURE__*/_jsx(
|
|
24
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
25
|
+
variant: "text",
|
|
26
|
+
color: "primary",
|
|
31
27
|
onClick: handleRemove,
|
|
32
28
|
className: classes.button,
|
|
33
|
-
rippleClassName: classes.ripple,
|
|
34
|
-
type: "secondary",
|
|
35
|
-
flat: true,
|
|
36
29
|
children: /*#__PURE__*/_jsx(I18n.Text, {
|
|
37
30
|
string: "cart.remove_item"
|
|
38
31
|
})
|
|
@@ -8,6 +8,7 @@ const useStyles = makeStyles()(theme => ({
|
|
|
8
8
|
inputStyle: {
|
|
9
9
|
border: 'none',
|
|
10
10
|
background: theme.palette.background.emphasized,
|
|
11
|
+
color: theme.contrastColor(theme.palette.background.emphasized),
|
|
11
12
|
display: 'block',
|
|
12
13
|
fontSize: theme.typography.caption.fontSize,
|
|
13
14
|
textAlign: 'center',
|
|
@@ -1,29 +1,13 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { I18n } from '@shopgate/engage/components';
|
|
3
|
+
import { Button } from '@shopgate/engage/components/v2';
|
|
4
4
|
import { useCartItem } from "../CartItem";
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const useStyles = makeStyles()(theme => ({
|
|
7
|
-
button: {
|
|
8
|
-
fontSize: `${theme.typography.body2.fontSize} !important`,
|
|
9
|
-
letterSpacing: '0.05em',
|
|
10
|
-
padding: '0px !important',
|
|
11
|
-
' *': {
|
|
12
|
-
padding: '0px !important'
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
ripple: {
|
|
16
|
-
padding: 0
|
|
17
|
-
}
|
|
18
|
-
}));
|
|
19
5
|
|
|
20
6
|
/**
|
|
21
7
|
* @returns {JSX}
|
|
22
8
|
*/
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
10
|
const CartItemCardReservationLabelChangeStore = () => {
|
|
24
|
-
const {
|
|
25
|
-
classes
|
|
26
|
-
} = useStyles();
|
|
27
11
|
const {
|
|
28
12
|
invokeFulfillmentAction,
|
|
29
13
|
cartItem
|
|
@@ -39,12 +23,10 @@ const CartItemCardReservationLabelChangeStore = () => {
|
|
|
39
23
|
} = cartItem;
|
|
40
24
|
invokeFulfillmentAction('changeLocation', method);
|
|
41
25
|
}, [cartItem, invokeFulfillmentAction]);
|
|
42
|
-
return /*#__PURE__*/_jsx(
|
|
26
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
27
|
+
variant: "link",
|
|
28
|
+
color: "primary",
|
|
43
29
|
onClick: handleChangeLocationClick,
|
|
44
|
-
className: classes.button,
|
|
45
|
-
rippleClassName: classes.ripple,
|
|
46
|
-
type: "secondary",
|
|
47
|
-
flat: true,
|
|
48
30
|
children: /*#__PURE__*/_jsx(I18n.Text, {
|
|
49
31
|
string: "locations.change_location"
|
|
50
32
|
})
|
|
@@ -25,12 +25,12 @@ const useStyles = makeStyles()(theme => ({
|
|
|
25
25
|
padding: theme.spacing(2)
|
|
26
26
|
},
|
|
27
27
|
total: {
|
|
28
|
-
fontSize: theme.typography.
|
|
28
|
+
fontSize: theme.typography.body2.fontSize,
|
|
29
29
|
padding: theme.spacing(1, 0),
|
|
30
30
|
color: theme.palette.text.primary
|
|
31
31
|
},
|
|
32
32
|
grandTotal: {
|
|
33
|
-
fontSize:
|
|
33
|
+
fontSize: theme.typography.h4.fontSize,
|
|
34
34
|
fontWeight: theme.typography.fontWeightMedium,
|
|
35
35
|
borderTop: `1px solid ${theme.components.border.medium}`,
|
|
36
36
|
padding: theme.spacing(1, 0),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useContext, useMemo } from 'react';
|
|
2
|
-
import { SurroundPortals, I18n
|
|
2
|
+
import { SurroundPortals, I18n } from '@shopgate/engage/components';
|
|
3
3
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
4
4
|
import { CART_CHECKOUT_BUTTON } from '@shopgate/pwa-common-commerce/cart/constants/Portals';
|
|
5
|
-
import
|
|
5
|
+
import { Button } from '@shopgate/engage/components/v2';
|
|
6
6
|
import { CHECKOUT_PATH } from '@shopgate/pwa-common/constants/RoutePaths';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { CartContext } from "../../cart.context";
|
|
@@ -14,15 +14,7 @@ const useStyles = makeStyles()(theme => ({
|
|
|
14
14
|
flexDirection: 'column'
|
|
15
15
|
},
|
|
16
16
|
button: {
|
|
17
|
-
width: '100%',
|
|
18
|
-
background: theme.components.ctaButton.background,
|
|
19
|
-
color: `${theme.contrastColor(theme.components.ctaButton.background)}!important`,
|
|
20
|
-
borderRadius: 4,
|
|
21
17
|
margin: theme.spacing(2, 0)
|
|
22
|
-
},
|
|
23
|
-
disabledButton: {
|
|
24
|
-
background: theme.palette.action.disabledBackground,
|
|
25
|
-
color: `${theme.contrastColor(theme.palette.action.disabledBackground)}!important`
|
|
26
18
|
}
|
|
27
19
|
}));
|
|
28
20
|
|
|
@@ -35,16 +27,12 @@ const CartSummaryWideCheckoutButton = ({
|
|
|
35
27
|
isOrderable
|
|
36
28
|
}) => {
|
|
37
29
|
const {
|
|
38
|
-
classes
|
|
39
|
-
cx
|
|
30
|
+
classes
|
|
40
31
|
} = useStyles();
|
|
41
32
|
const {
|
|
42
33
|
isLoading
|
|
43
34
|
} = useContext(CartContext);
|
|
44
35
|
const isActive = useMemo(() => isOrderable && !isLoading, [isLoading, isOrderable]);
|
|
45
|
-
const buttonClassName = cx(classes.button, {
|
|
46
|
-
[classes.disabledButton]: !isActive
|
|
47
|
-
});
|
|
48
36
|
return /*#__PURE__*/_jsx("div", {
|
|
49
37
|
className: classes.container,
|
|
50
38
|
children: /*#__PURE__*/_jsx(SurroundPortals, {
|
|
@@ -52,16 +40,14 @@ const CartSummaryWideCheckoutButton = ({
|
|
|
52
40
|
portalProps: {
|
|
53
41
|
isActive
|
|
54
42
|
},
|
|
55
|
-
children: /*#__PURE__*/_jsx(
|
|
43
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
56
44
|
href: CHECKOUT_PATH,
|
|
45
|
+
color: "cta",
|
|
46
|
+
fullWidth: true,
|
|
57
47
|
disabled: !isActive,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
className: buttonClassName,
|
|
62
|
-
children: /*#__PURE__*/_jsx(I18n.Text, {
|
|
63
|
-
string: "cart.checkout"
|
|
64
|
-
})
|
|
48
|
+
className: classes.button,
|
|
49
|
+
children: /*#__PURE__*/_jsx(I18n.Text, {
|
|
50
|
+
string: "cart.checkout"
|
|
65
51
|
})
|
|
66
52
|
})
|
|
67
53
|
})
|
|
@@ -1,37 +1,21 @@
|
|
|
1
1
|
import React, { useContext, useMemo } from 'react';
|
|
2
|
-
import { I18n,
|
|
3
|
-
import { makeStyles } from '@shopgate/engage/styles';
|
|
2
|
+
import { I18n, SurroundPortals } from '@shopgate/engage/components';
|
|
4
3
|
import { CART_CHECKOUT_BUTTON } from '@shopgate/pwa-common-commerce/cart/constants/Portals';
|
|
5
|
-
import
|
|
4
|
+
import { Button } from '@shopgate/engage/components/v2';
|
|
6
5
|
import { CHECKOUT_PATH } from '@shopgate/pwa-common/constants/RoutePaths';
|
|
7
6
|
import PropTypes from 'prop-types';
|
|
8
7
|
import { CartContext } from "../../cart.context";
|
|
9
8
|
import connect from "./PaymentBarCheckoutButton.connector";
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
const useStyles = makeStyles()(theme => ({
|
|
12
|
-
button: {
|
|
13
|
-
width: '100%',
|
|
14
|
-
background: theme.components.ctaButton.background,
|
|
15
|
-
color: `${theme.contrastColor(theme.components.ctaButton.background)}!important`
|
|
16
|
-
},
|
|
17
|
-
disabledButton: {
|
|
18
|
-
width: '100%',
|
|
19
|
-
background: theme.palette.action.disabledBackground,
|
|
20
|
-
color: `${theme.contrastColor(theme.palette.action.disabledBackground)}!important`
|
|
21
|
-
}
|
|
22
|
-
}));
|
|
23
9
|
|
|
24
10
|
/**
|
|
25
11
|
* Renders the cart payment bar checkout button.
|
|
26
12
|
* @param {boolean} isOrderable Whether the cart is orderable.
|
|
27
13
|
* @return {JSX.Element}
|
|
28
14
|
*/
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
16
|
const PaymentBarCheckoutButton = ({
|
|
30
17
|
isOrderable
|
|
31
18
|
}) => {
|
|
32
|
-
const {
|
|
33
|
-
classes
|
|
34
|
-
} = useStyles();
|
|
35
19
|
const {
|
|
36
20
|
isLoading
|
|
37
21
|
} = useContext(CartContext);
|
|
@@ -41,19 +25,13 @@ const PaymentBarCheckoutButton = ({
|
|
|
41
25
|
portalProps: {
|
|
42
26
|
isActive
|
|
43
27
|
},
|
|
44
|
-
children: /*#__PURE__*/_jsx(
|
|
28
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
45
29
|
href: CHECKOUT_PATH,
|
|
30
|
+
color: "cta",
|
|
31
|
+
fullWidth: true,
|
|
46
32
|
disabled: !isActive,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"aria-disabled": !isActive,
|
|
50
|
-
children: /*#__PURE__*/_jsx(RippleButton, {
|
|
51
|
-
disabled: !isActive,
|
|
52
|
-
type: "regular",
|
|
53
|
-
className: isActive ? classes.button : classes.disabledButton,
|
|
54
|
-
children: /*#__PURE__*/_jsx(I18n.Text, {
|
|
55
|
-
string: "cart.checkout"
|
|
56
|
-
})
|
|
33
|
+
children: /*#__PURE__*/_jsx(I18n.Text, {
|
|
34
|
+
string: "cart.checkout"
|
|
57
35
|
})
|
|
58
36
|
})
|
|
59
37
|
});
|
|
@@ -38,27 +38,20 @@ const createCartTotalLineMock = () => {
|
|
|
38
38
|
};
|
|
39
39
|
return CartTotalLine;
|
|
40
40
|
};
|
|
41
|
-
const
|
|
41
|
+
const createButtonMock = () => function Button(props) {
|
|
42
42
|
return /*#__PURE__*/_jsx("button", {
|
|
43
43
|
type: "button",
|
|
44
44
|
className: props.className,
|
|
45
45
|
disabled: props.disabled,
|
|
46
|
+
"data-color": props.color,
|
|
47
|
+
"data-href": props.href,
|
|
46
48
|
children: props.children
|
|
47
49
|
});
|
|
48
50
|
};
|
|
49
|
-
const createStylesMock = () => ({
|
|
50
|
-
makeStyles: () => () => () => ({
|
|
51
|
-
classes: {
|
|
52
|
-
button: 'button',
|
|
53
|
-
disabledButton: 'disabledButton'
|
|
54
|
-
}
|
|
55
|
-
})
|
|
56
|
-
});
|
|
57
51
|
module.exports = {
|
|
58
52
|
createSurroundPortalsMock,
|
|
59
53
|
createCartTotalLineMock,
|
|
60
|
-
|
|
61
|
-
createStylesMock
|
|
54
|
+
createButtonMock
|
|
62
55
|
};
|
|
63
56
|
|
|
64
57
|
/* eslint-enable react/prop-types, require-jsdoc */
|
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Image } from '@shopgate/engage/components';
|
|
4
|
+
import { makeStyles } from '@shopgate/engage/styles';
|
|
4
5
|
import connect from "./connector";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const useStyles = makeStyles()(theme => ({
|
|
8
|
+
root: {
|
|
9
|
+
borderRadius: theme.shape.borderRadius,
|
|
10
|
+
overflow: 'hidden'
|
|
11
|
+
}
|
|
12
|
+
}));
|
|
5
13
|
|
|
6
14
|
/**
|
|
7
15
|
* The CategoryImage component
|
|
8
16
|
* @param {Object} props The component props.
|
|
9
17
|
* @returns {JSX.Element}
|
|
10
18
|
*/
|
|
11
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
19
|
const CategoryImage = ({
|
|
13
20
|
className,
|
|
14
21
|
src,
|
|
15
22
|
placeholderSrc
|
|
16
23
|
}) => {
|
|
24
|
+
const {
|
|
25
|
+
classes,
|
|
26
|
+
cx
|
|
27
|
+
} = useStyles();
|
|
17
28
|
if (!src && !placeholderSrc) {
|
|
18
29
|
return null;
|
|
19
30
|
}
|
|
20
31
|
return /*#__PURE__*/_jsx(Image, {
|
|
21
|
-
className: className,
|
|
32
|
+
className: cx(classes.root, className),
|
|
22
33
|
src: src
|
|
23
34
|
// Unwrapped, so the fallback renders into the container the outer Image already provides
|
|
24
35
|
// rather than nesting a second aspect ratio box inside it.
|
|
@@ -6,7 +6,8 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { getCheckoutBillingAddress, getCheckoutShippingAddress } from '@shopgate/engage/checkout/selectors/order';
|
|
7
7
|
import { i18n, historyPush } from '@shopgate/engage/core';
|
|
8
8
|
import { makeStyles, responsiveMediaQuery } from '@shopgate/engage/styles';
|
|
9
|
-
import {
|
|
9
|
+
import { ResponsiveContainer, Typography } from '@shopgate/engage/components';
|
|
10
|
+
import { Button } from '@shopgate/engage/components/v2';
|
|
10
11
|
import { ResponsiveBackButton } from "../ResponsiveBackButton";
|
|
11
12
|
import AddressCard from "../../../account/components/Profile/ProfileAddressCard";
|
|
12
13
|
import { useProfileContext } from "../../../account/components/Profile/Profile.provider";
|
|
@@ -30,12 +31,11 @@ const mapStateToProps = state => ({
|
|
|
30
31
|
const mapDispatchToProps = dispatch => ({
|
|
31
32
|
push: props => dispatch(historyPush(props))
|
|
32
33
|
});
|
|
33
|
-
const useStyles = makeStyles()(
|
|
34
|
+
const useStyles = makeStyles()(() => ({
|
|
34
35
|
container: {
|
|
35
36
|
display: 'flex',
|
|
36
37
|
flexDirection: 'row',
|
|
37
38
|
flexWrap: 'wrap',
|
|
38
|
-
margin: -4,
|
|
39
39
|
padding: 16
|
|
40
40
|
},
|
|
41
41
|
headline: {
|
|
@@ -43,25 +43,16 @@ const useStyles = makeStyles()(theme => ({
|
|
|
43
43
|
margin: 0
|
|
44
44
|
},
|
|
45
45
|
button: {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
[responsiveMediaQuery('<md', {
|
|
55
|
-
webOnly: false
|
|
56
|
-
})]: {
|
|
57
|
-
width: '100%',
|
|
58
|
-
marginRight: 0
|
|
59
|
-
}
|
|
46
|
+
marginTop: 8,
|
|
47
|
+
marginRight: 16,
|
|
48
|
+
textTransform: 'none',
|
|
49
|
+
[responsiveMediaQuery('<md', {
|
|
50
|
+
webOnly: false
|
|
51
|
+
})]: {
|
|
52
|
+
width: '100%',
|
|
53
|
+
marginRight: 0
|
|
60
54
|
}
|
|
61
55
|
},
|
|
62
|
-
ripple: {
|
|
63
|
-
padding: '8px 16px'
|
|
64
|
-
},
|
|
65
56
|
actions: {
|
|
66
57
|
display: 'flex',
|
|
67
58
|
justifyContent: 'flex-end',
|
|
@@ -131,10 +122,10 @@ const AddressList = ({
|
|
|
131
122
|
}, contact.id))
|
|
132
123
|
}), /*#__PURE__*/_jsx("div", {
|
|
133
124
|
className: classes.actions,
|
|
134
|
-
children: /*#__PURE__*/_jsx(
|
|
125
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
126
|
+
color: "primary",
|
|
127
|
+
size: "small",
|
|
135
128
|
className: classes.button,
|
|
136
|
-
rippleClassName: classes.ripple,
|
|
137
|
-
type: "primary",
|
|
138
129
|
onClick: () => push({
|
|
139
130
|
pathname: `${CHECKOUT_ADDRESS_BOOK_CONTACT_PATTERN}`.replace(':type', type)
|
|
140
131
|
}),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { i18n } from '@shopgate/engage/core/helpers';
|
|
3
|
-
import {
|
|
3
|
+
import { SurroundPortals } from '@shopgate/engage/components';
|
|
4
|
+
import { Button } from '@shopgate/engage/components/v2';
|
|
4
5
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
5
6
|
import { useCheckoutContext } from "../../hooks/common";
|
|
6
7
|
import { SupplementalContent } from "../SupplementalContent";
|
|
@@ -30,8 +31,8 @@ const Actions = () => {
|
|
|
30
31
|
paymentButton: PaymentButton,
|
|
31
32
|
isButtonLocked
|
|
32
33
|
} = useCheckoutContext();
|
|
33
|
-
const originalButton = /*#__PURE__*/_jsx(
|
|
34
|
-
|
|
34
|
+
const originalButton = /*#__PURE__*/_jsx(Button, {
|
|
35
|
+
color: "primary",
|
|
35
36
|
onClick: handleSubmitOrder,
|
|
36
37
|
disabled: isButtonLocked,
|
|
37
38
|
children: i18n.text('checkout.submit_order')
|
|
@@ -95,29 +95,37 @@ const CheckoutAddress = ({
|
|
|
95
95
|
children: address ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
96
96
|
children: [/*#__PURE__*/_jsx(Typography, {
|
|
97
97
|
component: "span",
|
|
98
|
+
variant: "body2",
|
|
98
99
|
children: address.middleName?.length ? `${address.firstName} ${address.middleName} ${address.lastName}` : `${address.firstName} ${address.lastName}`
|
|
99
100
|
}), type === ADDRESS_TYPE_BILLING && isGuestCheckout && orderReserveOnly && /*#__PURE__*/_jsxs(_Fragment, {
|
|
100
101
|
children: [/*#__PURE__*/_jsx(Typography, {
|
|
101
102
|
component: "span",
|
|
103
|
+
variant: "body2",
|
|
102
104
|
children: address.emailAddress
|
|
103
105
|
}), /*#__PURE__*/_jsx(Typography, {
|
|
104
106
|
component: "span",
|
|
107
|
+
variant: "body2",
|
|
105
108
|
children: address.mobile
|
|
106
109
|
})]
|
|
107
110
|
}), /*#__PURE__*/_jsx(Typography, {
|
|
108
111
|
component: "span",
|
|
112
|
+
variant: "body2",
|
|
109
113
|
children: address.address1
|
|
110
114
|
}), address.address2?.length ? /*#__PURE__*/_jsx(Typography, {
|
|
111
115
|
component: "span",
|
|
116
|
+
variant: "body2",
|
|
112
117
|
children: address.address2
|
|
113
118
|
}) : null, address.address3?.length ? /*#__PURE__*/_jsx(Typography, {
|
|
114
119
|
component: "span",
|
|
120
|
+
variant: "body2",
|
|
115
121
|
children: address.address3
|
|
116
122
|
}) : null, address.address4?.length ? /*#__PURE__*/_jsx(Typography, {
|
|
117
123
|
component: "span",
|
|
124
|
+
variant: "body2",
|
|
118
125
|
children: address.address4
|
|
119
126
|
}) : null, address.postalCode || address.region || address.city || address.country ? /*#__PURE__*/_jsx(Typography, {
|
|
120
127
|
component: "span",
|
|
128
|
+
variant: "body2",
|
|
121
129
|
children: i18n.text(`checkout.${type}.address`, {
|
|
122
130
|
postalCode: address.postalCode || '',
|
|
123
131
|
region: iso3166?.[address.country]?.divisions?.[address.region] || address.region || '',
|
|
@@ -14,7 +14,7 @@ const useStyles = makeStyles()(theme => ({
|
|
|
14
14
|
card: {
|
|
15
15
|
display: 'flex',
|
|
16
16
|
flexDirection: 'row',
|
|
17
|
-
fontSize: theme.typography.
|
|
17
|
+
fontSize: theme.typography.body2.fontSize,
|
|
18
18
|
width: '100%',
|
|
19
19
|
overflow: 'inherit !important',
|
|
20
20
|
marginBottom: theme.spacing(2),
|
|
@@ -43,7 +43,9 @@ const useStyles = makeStyles()(theme => ({
|
|
|
43
43
|
' tr:last-of-type td': {
|
|
44
44
|
paddingTop: 8,
|
|
45
45
|
borderTop: `1px solid ${theme.components.border.medium}`,
|
|
46
|
-
|
|
46
|
+
'& span': {
|
|
47
|
+
fontWeight: `${theme.typography.fontWeightBold} !important`
|
|
48
|
+
}
|
|
47
49
|
}
|
|
48
50
|
},
|
|
49
51
|
actionsContainer: {
|
|
@@ -116,6 +118,7 @@ const CheckoutSection = ({
|
|
|
116
118
|
children: [/*#__PURE__*/_jsxs("td", {
|
|
117
119
|
children: [/*#__PURE__*/_jsx(Typography, {
|
|
118
120
|
component: "span",
|
|
121
|
+
variant: "body2",
|
|
119
122
|
className: cx({
|
|
120
123
|
[classes.labelWithInfoIcon]: !!info
|
|
121
124
|
}),
|
|
@@ -126,6 +129,7 @@ const CheckoutSection = ({
|
|
|
126
129
|
}), /*#__PURE__*/_jsx("td", {
|
|
127
130
|
children: typeof text === 'string' ? /*#__PURE__*/_jsx(Typography, {
|
|
128
131
|
component: "span",
|
|
132
|
+
variant: "body2",
|
|
129
133
|
children: text
|
|
130
134
|
}) : text
|
|
131
135
|
})]
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useMemo, useEffect, useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { ResponsiveContainer,
|
|
3
|
+
import { ResponsiveContainer, Typography } from '@shopgate/engage/components';
|
|
4
|
+
import { Button } from '@shopgate/engage/components/v2';
|
|
4
5
|
import { makeStyles, responsiveMediaQuery } from '@shopgate/engage/styles';
|
|
5
6
|
import { CartItems } from '@shopgate/engage/cart';
|
|
6
7
|
import { useRoute } from '@shopgate/engage/core';
|
|
@@ -72,9 +73,8 @@ const useStyles = makeStyles()(theme => ({
|
|
|
72
73
|
border: 0
|
|
73
74
|
},
|
|
74
75
|
button: {
|
|
75
|
-
flex: '0 0 auto
|
|
76
|
-
|
|
77
|
-
minWidth: '50% !important',
|
|
76
|
+
flex: '0 0 auto',
|
|
77
|
+
minWidth: '50%',
|
|
78
78
|
[responsiveMediaQuery('<md')]: {
|
|
79
79
|
width: '100%'
|
|
80
80
|
}
|
|
@@ -218,9 +218,8 @@ const CheckoutConfirmation = ({
|
|
|
218
218
|
})]
|
|
219
219
|
}), /*#__PURE__*/_jsx("div", {
|
|
220
220
|
className: classes.buttonWrapper,
|
|
221
|
-
children: /*#__PURE__*/_jsx(
|
|
222
|
-
|
|
223
|
-
disabled: false,
|
|
221
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
222
|
+
color: "primary",
|
|
224
223
|
className: classes.button,
|
|
225
224
|
onClick: onContinueShopping,
|
|
226
225
|
children: i18n.text('checkout.success.continue')
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
3
|
+
import { I18n, ArrowIcon } from '@shopgate/engage/components';
|
|
4
|
+
import { Button } from '@shopgate/engage/components/v2';
|
|
4
5
|
import { useNavigation } from '@shopgate/engage/core';
|
|
5
6
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
6
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -9,21 +10,11 @@ const useStyles = makeStyles()(theme => ({
|
|
|
9
10
|
display: 'flex',
|
|
10
11
|
padding: theme.spacing(4, 2, 2, 2)
|
|
11
12
|
},
|
|
12
|
-
button: {
|
|
13
|
-
fontSize: `${theme.typography.body2.fontSize} !important`,
|
|
14
|
-
padding: '0 !important',
|
|
15
|
-
' > div ': {
|
|
16
|
-
padding: 0,
|
|
17
|
-
display: 'flex'
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
13
|
buttonIcon: {
|
|
21
14
|
display: 'inline-block',
|
|
22
|
-
fontSize:
|
|
15
|
+
fontSize: theme.components.icon.medium,
|
|
23
16
|
alignSelf: 'center',
|
|
24
|
-
marginRight: theme.spacing(0.5)
|
|
25
|
-
marginLeft: -3,
|
|
26
|
-
marginTop: -2
|
|
17
|
+
marginRight: theme.spacing(0.5)
|
|
27
18
|
}
|
|
28
19
|
}));
|
|
29
20
|
|
|
@@ -50,10 +41,9 @@ const ResponsiveBackButton = ({
|
|
|
50
41
|
}, [onClick, pop]);
|
|
51
42
|
return /*#__PURE__*/_jsx("div", {
|
|
52
43
|
className: classes.container,
|
|
53
|
-
children: /*#__PURE__*/_jsxs(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
type: "secondary",
|
|
44
|
+
children: /*#__PURE__*/_jsxs(Button, {
|
|
45
|
+
variant: "link",
|
|
46
|
+
color: "primary",
|
|
57
47
|
onClick: handleClick,
|
|
58
48
|
children: [/*#__PURE__*/_jsx(ArrowIcon, {
|
|
59
49
|
className: classes.buttonIcon
|
package/components/Badge/spec.js
CHANGED
|
@@ -2,46 +2,23 @@ import React from 'react';
|
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
3
|
// Loaded at runtime by utils/unit-tests/envSetup.js; imported here for the matcher types.
|
|
4
4
|
import '@testing-library/jest-dom';
|
|
5
|
-
import { ThemeProvider, createTheme } from '@shopgate/engage/styles';
|
|
6
5
|
import Badge from "./Badge";
|
|
7
|
-
|
|
8
|
-
// ThemeProvider resolves the active breakpoint via matchMedia, which jsdom doesn't implement.
|
|
9
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
Object.defineProperty(window, 'matchMedia', {
|
|
11
|
-
writable: true,
|
|
12
|
-
value: query => ({
|
|
13
|
-
matches: false,
|
|
14
|
-
media: query,
|
|
15
|
-
addEventListener: jest.fn(),
|
|
16
|
-
removeEventListener: jest.fn()
|
|
17
|
-
})
|
|
18
|
-
});
|
|
19
|
-
const theme = createTheme();
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Renders the subject within a theme context.
|
|
23
|
-
* @param ui The element to render.
|
|
24
|
-
* @returns The render result.
|
|
25
|
-
*/
|
|
26
|
-
const renderWithTheme = ui => render(/*#__PURE__*/_jsx(ThemeProvider, {
|
|
27
|
-
theme: theme,
|
|
28
|
-
children: ui
|
|
29
|
-
}));
|
|
30
7
|
describe('<Badge />', () => {
|
|
31
8
|
it('should render the count', () => {
|
|
32
|
-
|
|
9
|
+
render(/*#__PURE__*/_jsx(Badge, {
|
|
33
10
|
count: 3
|
|
34
11
|
}));
|
|
35
12
|
expect(screen.getByText('3')).toBeInTheDocument();
|
|
36
13
|
});
|
|
37
14
|
it('should render nothing when the count is zero', () => {
|
|
38
|
-
|
|
15
|
+
render(/*#__PURE__*/_jsx(Badge, {
|
|
39
16
|
count: 0
|
|
40
17
|
}));
|
|
41
18
|
expect(screen.queryByText('0')).not.toBeInTheDocument();
|
|
42
19
|
});
|
|
43
20
|
it('should cap the count at max', () => {
|
|
44
|
-
|
|
21
|
+
render(/*#__PURE__*/_jsx(Badge, {
|
|
45
22
|
count: 6,
|
|
46
23
|
max: 5
|
|
47
24
|
}));
|
|
@@ -49,14 +26,14 @@ describe('<Badge />', () => {
|
|
|
49
26
|
expect(screen.queryByText('6')).not.toBeInTheDocument();
|
|
50
27
|
});
|
|
51
28
|
it('should render the exact count when it equals max', () => {
|
|
52
|
-
|
|
29
|
+
render(/*#__PURE__*/_jsx(Badge, {
|
|
53
30
|
count: 5,
|
|
54
31
|
max: 5
|
|
55
32
|
}));
|
|
56
33
|
expect(screen.getByText('5')).toBeInTheDocument();
|
|
57
34
|
});
|
|
58
35
|
it('should render an empty bubble when showCount is false', () => {
|
|
59
|
-
|
|
36
|
+
render(/*#__PURE__*/_jsx(Badge, {
|
|
60
37
|
count: 7,
|
|
61
38
|
showCount: false
|
|
62
39
|
}));
|
|
@@ -64,7 +41,7 @@ describe('<Badge />', () => {
|
|
|
64
41
|
expect(document.querySelector('.theme__badge')).toBeInTheDocument();
|
|
65
42
|
});
|
|
66
43
|
it('should apply the shared badge class so themes can target it', () => {
|
|
67
|
-
|
|
44
|
+
render(/*#__PURE__*/_jsx(Badge, {
|
|
68
45
|
count: 1,
|
|
69
46
|
className: "custom-position"
|
|
70
47
|
}));
|
package/components/Card/Card.js
CHANGED
|
@@ -44,7 +44,7 @@ const Card = /*#__PURE__*/forwardRef(({
|
|
|
44
44
|
variant: paperVariant,
|
|
45
45
|
elevation: isPlain ? 0 : elevation ?? appearance.elevation,
|
|
46
46
|
square: square || isPlain,
|
|
47
|
-
borderRadius: theme.
|
|
47
|
+
borderRadius: theme.components.cards.borderRadius,
|
|
48
48
|
background: isPlain ? 'transparent' : theme.components.cards.backgroundColor,
|
|
49
49
|
border: theme.components.cards.border,
|
|
50
50
|
shadowColor: theme.components.cards.shadowColor,
|