@shopgate/pwa-ui-shared 7.31.4-beta.1 → 7.32.0-beta.2
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/ActionButton/spec.js +25 -28
- package/AddToCartButton/index.js +14 -14
- package/Availability/index.js +11 -28
- package/Availability/spec.js +11 -11
- package/Button/index.js +6 -9
- package/ButtonLink/spec.js +11 -7
- package/Card/index.js +5 -8
- package/CardList/components/Item/index.js +1 -2
- package/CartTotalLine/index.js +8 -12
- package/Checkbox/index.js +3 -4
- package/Chip/index.js +9 -10
- package/ContextMenu/components/Item/index.js +18 -28
- package/ContextMenu/index.js +3 -4
- package/Dialog/components/HtmlContentDialog/spec.js +7 -1
- package/DiscountBadge/index.js +35 -32
- package/DiscountBadge/spec.js +5 -5
- package/FavoritesButton/connector.js +1 -1
- package/FavoritesButton/index.js +26 -23
- package/Form/Checkbox/index.js +1 -1
- package/Form/InfoField/spec.js +3 -3
- package/Form/Password/index.js +3 -7
- package/Form/RadioGroup/components/Item/index.js +1 -3
- package/Form/Select/index.js +4 -5
- package/Form/Select/spec.js +3 -3
- package/Form/SelectContextChoices/index.js +8 -8
- package/Form/SelectContextChoices/spec.js +3 -3
- package/Form/TextField/index.js +3 -5
- package/FormElement/components/ErrorText/index.js +7 -8
- package/FormElement/components/Label/index.js +2 -2
- package/FormElement/components/Placeholder/index.js +3 -3
- package/FormElement/components/Underline/index.js +9 -17
- package/Glow/index.js +1 -2
- package/Glow/spec.js +3 -3
- package/IndicatorCircle/index.js +3 -4
- package/LoadingIndicator/index.js +3 -3
- package/Manufacturer/index.js +2 -2
- package/NoResults/components/Icon/index.js +3 -4
- package/NoResults/index.js +5 -5
- package/Placeholder/index.js +2 -2
- package/PlaceholderLabel/index.js +2 -3
- package/Price/index.js +4 -3
- package/PriceInfo/index.js +3 -4
- package/PriceStriked/index.js +3 -4
- package/ProgressBar/index.js +7 -12
- package/RadioButton/index.js +3 -4
- package/RatingStars/index.js +4 -5
- package/Ripple/components/RippleAnimation/index.js +1 -2
- package/Ripple/index.js +1 -2
- package/ScannerOverlay/components/CameraOverlay/index.js +1 -2
- package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/index.js +4 -4
- package/ScannerOverlay/components/ScannerBar/index.js +4 -5
- package/Sheet/components/Header/components/SearchBar/index.js +6 -7
- package/Sheet/components/Header/index.js +18 -15
- package/Sheet/components/Header/spec.js +3 -1
- package/Sheet/index.js +6 -7
- package/TaxDisclaimer/index.js +11 -10
- package/TaxDisclaimer/spec.js +2 -1
- package/TextField/components/ErrorText/index.js +7 -7
- package/TextField/components/FormElement/index.js +3 -3
- package/TextField/components/Hint/index.js +3 -4
- package/TextField/components/Label/index.js +2 -2
- package/TextField/components/Underline/index.js +9 -17
- package/icons/AccountBoxIcon.d.ts +1 -1
- package/icons/AccountBoxIcon.d.ts.map +1 -1
- package/icons/AddMoreIcon.d.ts +1 -1
- package/icons/AddMoreIcon.d.ts.map +1 -1
- package/icons/ArrowDropIcon.d.ts +1 -1
- package/icons/ArrowDropIcon.d.ts.map +1 -1
- package/icons/ArrowIcon.d.ts +1 -1
- package/icons/ArrowIcon.d.ts.map +1 -1
- package/icons/BarcodeScannerIcon.d.ts +1 -1
- package/icons/BarcodeScannerIcon.d.ts.map +1 -1
- package/icons/BoxIcon.d.ts +1 -1
- package/icons/BoxIcon.d.ts.map +1 -1
- package/icons/BrowseIcon.d.ts +2 -1
- package/icons/BrowseIcon.d.ts.map +1 -1
- package/icons/BurgerIcon.d.ts +1 -1
- package/icons/BurgerIcon.d.ts.map +1 -1
- package/icons/CalendarIcon.d.ts +2 -1
- package/icons/CalendarIcon.d.ts.map +1 -1
- package/icons/CartCouponIcon.d.ts +2 -1
- package/icons/CartCouponIcon.d.ts.map +1 -1
- package/icons/CartIcon.d.ts +2 -1
- package/icons/CartIcon.d.ts.map +1 -1
- package/icons/CartPlusIcon.d.ts +2 -1
- package/icons/CartPlusIcon.d.ts.map +1 -1
- package/icons/CheckIcon.d.ts +2 -1
- package/icons/CheckIcon.d.ts.map +1 -1
- package/icons/CheckedIcon.d.ts +1 -1
- package/icons/CheckedIcon.d.ts.map +1 -1
- package/icons/ChevronIcon.d.ts +2 -1
- package/icons/ChevronIcon.d.ts.map +1 -1
- package/icons/CreditCardIcon.d.ts +2 -1
- package/icons/CreditCardIcon.d.ts.map +1 -1
- package/icons/CrossIcon.d.ts +2 -1
- package/icons/CrossIcon.d.ts.map +1 -1
- package/icons/DescriptionIcon.d.ts +2 -1
- package/icons/DescriptionIcon.d.ts.map +1 -1
- package/icons/FilterIcon.d.ts +2 -1
- package/icons/FilterIcon.d.ts.map +1 -1
- package/icons/FlashDisabledIcon.d.ts +2 -1
- package/icons/FlashDisabledIcon.d.ts.map +1 -1
- package/icons/FlashEnabledIcon.d.ts +2 -1
- package/icons/FlashEnabledIcon.d.ts.map +1 -1
- package/icons/GridIcon.d.ts +2 -1
- package/icons/GridIcon.d.ts.map +1 -1
- package/icons/HeartIcon.d.ts +2 -1
- package/icons/HeartIcon.d.ts.map +1 -1
- package/icons/HeartOutlineIcon.d.ts +2 -1
- package/icons/HeartOutlineIcon.d.ts.map +1 -1
- package/icons/HeartPlusIcon.d.ts +2 -1
- package/icons/HeartPlusIcon.d.ts.map +1 -1
- package/icons/HeartPlusOutlineIcon.d.ts +2 -1
- package/icons/HeartPlusOutlineIcon.d.ts.map +1 -1
- package/icons/HomeIcon.d.ts +2 -1
- package/icons/HomeIcon.d.ts.map +1 -1
- package/icons/InfoIcon.d.ts +2 -1
- package/icons/InfoIcon.d.ts.map +1 -1
- package/icons/InfoOutlineIcon.d.ts +2 -1
- package/icons/InfoOutlineIcon.d.ts.map +1 -1
- package/icons/ListIcon.d.ts +2 -1
- package/icons/ListIcon.d.ts.map +1 -1
- package/icons/LocalShippingIcon.d.ts +2 -1
- package/icons/LocalShippingIcon.d.ts.map +1 -1
- package/icons/LocationIcon.d.ts +2 -1
- package/icons/LocationIcon.d.ts.map +1 -1
- package/icons/LocatorIcon.d.ts +2 -1
- package/icons/LocatorIcon.d.ts.map +1 -1
- package/icons/LockIcon.d.ts +2 -1
- package/icons/LockIcon.d.ts.map +1 -1
- package/icons/LogoutIcon.d.ts +2 -1
- package/icons/LogoutIcon.d.ts.map +1 -1
- package/icons/MagnifierIcon.d.ts +2 -1
- package/icons/MagnifierIcon.d.ts.map +1 -1
- package/icons/MapMarkerIcon.d.ts +2 -1
- package/icons/MapMarkerIcon.d.ts.map +1 -1
- package/icons/MoreIcon.d.ts +2 -1
- package/icons/MoreIcon.d.ts.map +1 -1
- package/icons/MoreVertIcon.d.ts +2 -1
- package/icons/MoreVertIcon.d.ts.map +1 -1
- package/icons/NotificationIcon.d.ts +2 -1
- package/icons/NotificationIcon.d.ts.map +1 -1
- package/icons/PersonIcon.d.ts +2 -1
- package/icons/PersonIcon.d.ts.map +1 -1
- package/icons/PhoneIcon.d.ts +2 -1
- package/icons/PhoneIcon.d.ts.map +1 -1
- package/icons/PlaceholderIcon.d.ts +2 -1
- package/icons/PlaceholderIcon.d.ts.map +1 -1
- package/icons/RadioCheckedIcon.d.ts +2 -1
- package/icons/RadioCheckedIcon.d.ts.map +1 -1
- package/icons/RadioUncheckedIcon.d.ts +2 -1
- package/icons/RadioUncheckedIcon.d.ts.map +1 -1
- package/icons/SecurityIcon.d.ts +2 -1
- package/icons/SecurityIcon.d.ts.map +1 -1
- package/icons/ShippingMethodIcon.d.ts +2 -1
- package/icons/ShippingMethodIcon.d.ts.map +1 -1
- package/icons/ShoppingCartIcon.d.ts +2 -1
- package/icons/ShoppingCartIcon.d.ts.map +1 -1
- package/icons/SortIcon.d.ts +2 -1
- package/icons/SortIcon.d.ts.map +1 -1
- package/icons/StarHalfIcon.d.ts +2 -1
- package/icons/StarHalfIcon.d.ts.map +1 -1
- package/icons/StarIcon.d.ts +2 -1
- package/icons/StarIcon.d.ts.map +1 -1
- package/icons/StarOutlineIcon.d.ts +2 -1
- package/icons/StarOutlineIcon.d.ts.map +1 -1
- package/icons/StopIcon.d.ts +2 -1
- package/icons/StopIcon.d.ts.map +1 -1
- package/icons/TickIcon.d.ts +2 -1
- package/icons/TickIcon.d.ts.map +1 -1
- package/icons/TimeIcon.d.ts +2 -1
- package/icons/TimeIcon.d.ts.map +1 -1
- package/icons/TrashIcon.d.ts +1 -1
- package/icons/TrashIcon.d.ts.map +1 -1
- package/icons/TrashOutlineIcon.d.ts +2 -1
- package/icons/TrashOutlineIcon.d.ts.map +1 -1
- package/icons/UncheckedIcon.d.ts +2 -1
- package/icons/UncheckedIcon.d.ts.map +1 -1
- package/icons/ViewListIcon.d.ts +2 -1
- package/icons/ViewListIcon.d.ts.map +1 -1
- package/icons/VisibilityIcon.d.ts +2 -1
- package/icons/VisibilityIcon.d.ts.map +1 -1
- package/icons/VisibilityOffIcon.d.ts +2 -1
- package/icons/VisibilityOffIcon.d.ts.map +1 -1
- package/icons/WarningIcon.d.ts +2 -1
- package/icons/WarningIcon.d.ts.map +1 -1
- package/package.json +5 -5
package/NoResults/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { I18n } from '@shopgate/engage/components';
|
|
3
|
+
import { I18n, Typography } from '@shopgate/engage/components';
|
|
4
4
|
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
5
|
import { svgToDataUrl } from '@shopgate/engage/core';
|
|
6
6
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
@@ -25,11 +25,9 @@ const useStyles = makeStyles()(theme => ({
|
|
|
25
25
|
},
|
|
26
26
|
icon: {
|
|
27
27
|
width: 216,
|
|
28
|
-
color:
|
|
28
|
+
color: theme.palette.primary.main
|
|
29
29
|
},
|
|
30
30
|
headline: {
|
|
31
|
-
fontSize: '1.25rem',
|
|
32
|
-
fontWeight: 500,
|
|
33
31
|
marginTop: 30
|
|
34
32
|
},
|
|
35
33
|
text: {
|
|
@@ -61,7 +59,9 @@ const NoResults = props => {
|
|
|
61
59
|
}), /*#__PURE__*/_jsxs("div", {
|
|
62
60
|
role: "alert",
|
|
63
61
|
"aria-atomic": "true",
|
|
64
|
-
children: [/*#__PURE__*/_jsx(
|
|
62
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
63
|
+
variant: "h3",
|
|
64
|
+
component: "div",
|
|
65
65
|
className: classes.headline,
|
|
66
66
|
children: /*#__PURE__*/_jsx(I18n.Text, {
|
|
67
67
|
string: props.headlineText,
|
package/Placeholder/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import React, { memo } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
const useStyles = makeStyles()(
|
|
5
|
+
const useStyles = makeStyles()(theme => ({
|
|
6
6
|
root: {
|
|
7
|
-
background:
|
|
7
|
+
background: theme.palette.background.emphasized,
|
|
8
8
|
position: 'relative'
|
|
9
9
|
}
|
|
10
10
|
}));
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
4
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const useStyles = makeStyles()(
|
|
5
|
+
const useStyles = makeStyles()(theme => ({
|
|
7
6
|
label: {
|
|
8
|
-
background:
|
|
7
|
+
background: theme.palette.common.black,
|
|
9
8
|
opacity: 0.1,
|
|
10
9
|
width: '100%',
|
|
11
10
|
height: 16,
|
package/Price/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "core-js/modules/es.string.replace.js";
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { I18n } from '@shopgate/engage/components';
|
|
4
|
+
import { I18n, Typography } from '@shopgate/engage/components';
|
|
5
5
|
import { i18n } from '@shopgate/engage/core/helpers';
|
|
6
6
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
7
7
|
import showTaxDisclaimer from '@shopgate/pwa-common-commerce/market/helpers/showTaxDisclaimer';
|
|
@@ -15,7 +15,6 @@ const useStyles = makeStyles()({
|
|
|
15
15
|
},
|
|
16
16
|
disclaimer: {
|
|
17
17
|
color: 'initial',
|
|
18
|
-
fontSize: 14,
|
|
19
18
|
position: 'absolute',
|
|
20
19
|
right: -10,
|
|
21
20
|
top: 0
|
|
@@ -106,7 +105,9 @@ const Price = props => {
|
|
|
106
105
|
price: ariaPrice
|
|
107
106
|
}),
|
|
108
107
|
children: priceContent
|
|
109
|
-
}), props.taxDisclaimer && showDisclaimer ? /*#__PURE__*/_jsxs(
|
|
108
|
+
}), props.taxDisclaimer && showDisclaimer ? /*#__PURE__*/_jsxs(Typography, {
|
|
109
|
+
variant: "body2",
|
|
110
|
+
component: "div",
|
|
110
111
|
className: classes.disclaimer,
|
|
111
112
|
children: [/*#__PURE__*/_jsx("span", {
|
|
112
113
|
"aria-hidden": true,
|
package/PriceInfo/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
4
3
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
5
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const useStyles = makeStyles()({
|
|
5
|
+
const useStyles = makeStyles()(theme => ({
|
|
7
6
|
root: {
|
|
8
|
-
color:
|
|
7
|
+
color: theme.palette.grey.medium
|
|
9
8
|
}
|
|
10
|
-
});
|
|
9
|
+
}));
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* The price info component
|
package/PriceStriked/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { I18n } from '@shopgate/engage/components';
|
|
4
4
|
import { i18n } from '@shopgate/engage/core/helpers';
|
|
5
5
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
6
|
-
import { themeColors } from '@shopgate/pwa-common/helpers/config';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* Calculates the angle for the strike-through line
|
|
@@ -23,10 +22,10 @@ const calcAngle = element => {
|
|
|
23
22
|
document.body.removeChild(cloned);
|
|
24
23
|
return Math.round(90 - Math.atan(width / height) * (180 / Math.PI));
|
|
25
24
|
};
|
|
26
|
-
const useStyles = makeStyles()({
|
|
25
|
+
const useStyles = makeStyles()(theme => ({
|
|
27
26
|
root: {
|
|
28
27
|
whiteSpace: 'nowrap',
|
|
29
|
-
color:
|
|
28
|
+
color: theme.palette.grey.dark,
|
|
30
29
|
'& span': {
|
|
31
30
|
position: 'relative',
|
|
32
31
|
'&::before': {
|
|
@@ -47,7 +46,7 @@ const useStyles = makeStyles()({
|
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
|
-
});
|
|
49
|
+
}));
|
|
51
50
|
|
|
52
51
|
/**
|
|
53
52
|
* The price striked component
|
package/ProgressBar/index.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React, { useEffect, useState, memo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import Color from 'color';
|
|
4
3
|
import Transition from 'react-transition-group/Transition';
|
|
5
4
|
import UIEvents from '@shopgate/pwa-core/emitters/ui';
|
|
6
|
-
import {
|
|
7
|
-
import { getCSSCustomProp, makeStyles, keyframes } from '@shopgate/engage/styles';
|
|
5
|
+
import { makeStyles, keyframes, useTheme } from '@shopgate/engage/styles';
|
|
8
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
7
|
const duration = 150;
|
|
10
8
|
const transitionStyles = {
|
|
@@ -21,9 +19,6 @@ const transitionStyles = {
|
|
|
21
19
|
transform: 'scale(1, 0)'
|
|
22
20
|
}
|
|
23
21
|
};
|
|
24
|
-
const {
|
|
25
|
-
colors
|
|
26
|
-
} = themeConfig;
|
|
27
22
|
const progressBarHeight = 4;
|
|
28
23
|
const indeterminateLong = keyframes({
|
|
29
24
|
'0%': {
|
|
@@ -53,12 +48,12 @@ const indeterminateShort = keyframes({
|
|
|
53
48
|
right: '-8%'
|
|
54
49
|
}
|
|
55
50
|
});
|
|
56
|
-
const useStyles = makeStyles()({
|
|
51
|
+
const useStyles = makeStyles()(theme => ({
|
|
57
52
|
innerElement: {
|
|
58
53
|
':before': {
|
|
59
54
|
content: '""',
|
|
60
55
|
position: 'absolute',
|
|
61
|
-
background:
|
|
56
|
+
background: theme.palette.secondary.main,
|
|
62
57
|
top: 0,
|
|
63
58
|
left: 0,
|
|
64
59
|
bottom: 0,
|
|
@@ -67,7 +62,7 @@ const useStyles = makeStyles()({
|
|
|
67
62
|
':after': {
|
|
68
63
|
content: '""',
|
|
69
64
|
position: 'absolute',
|
|
70
|
-
background:
|
|
65
|
+
background: theme.palette.secondary.main,
|
|
71
66
|
top: 0,
|
|
72
67
|
left: 0,
|
|
73
68
|
bottom: 0,
|
|
@@ -83,7 +78,7 @@ const useStyles = makeStyles()({
|
|
|
83
78
|
animationDelay: '1.15s'
|
|
84
79
|
}
|
|
85
80
|
}
|
|
86
|
-
});
|
|
81
|
+
}));
|
|
87
82
|
|
|
88
83
|
/**
|
|
89
84
|
* A component for visualizing any kind of progress.
|
|
@@ -96,6 +91,7 @@ const ProgressBar = /*#__PURE__*/memo(({
|
|
|
96
91
|
classes,
|
|
97
92
|
cx
|
|
98
93
|
} = useStyles();
|
|
94
|
+
const theme = useTheme();
|
|
99
95
|
const [isAnimating, setIsAnimating] = useState(isVisible);
|
|
100
96
|
const [visible, setVisible] = useState(isVisible);
|
|
101
97
|
useEffect(() => {
|
|
@@ -106,7 +102,6 @@ const ProgressBar = /*#__PURE__*/memo(({
|
|
|
106
102
|
setVisible(false);
|
|
107
103
|
}
|
|
108
104
|
}, [isVisible]);
|
|
109
|
-
const wrapperBackground = Color(getCSSCustomProp('--color-secondary') || colors.accent).fade(0.6);
|
|
110
105
|
return /*#__PURE__*/_jsx(Transition, {
|
|
111
106
|
in: visible,
|
|
112
107
|
timeout: duration,
|
|
@@ -118,7 +113,7 @@ const ProgressBar = /*#__PURE__*/memo(({
|
|
|
118
113
|
style: {
|
|
119
114
|
position: 'absolute',
|
|
120
115
|
bottom: 0,
|
|
121
|
-
background:
|
|
116
|
+
background: theme.alpha(theme.palette.secondary.main, 0.6),
|
|
122
117
|
width: '100%',
|
|
123
118
|
height: progressBarHeight,
|
|
124
119
|
overflow: 'hidden',
|
package/RadioButton/index.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
3
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
4
3
|
import BaseCheckbox from '@shopgate/pwa-common/components/Checkbox';
|
|
5
4
|
import CheckedIcon from "../icons/RadioCheckedIcon";
|
|
6
5
|
import UncheckedIcon from "../icons/RadioUncheckedIcon";
|
|
7
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
const useStyles = makeStyles()(
|
|
7
|
+
const useStyles = makeStyles()(theme => ({
|
|
9
8
|
checkedIcon: {
|
|
10
9
|
width: 24,
|
|
11
10
|
height: 24,
|
|
12
|
-
color:
|
|
11
|
+
color: theme.palette.secondary.main
|
|
13
12
|
},
|
|
14
13
|
uncheckedIcon: {
|
|
15
14
|
width: 24,
|
|
16
15
|
height: 24,
|
|
17
|
-
color:
|
|
16
|
+
color: theme.palette.grey.dark
|
|
18
17
|
}
|
|
19
18
|
}));
|
|
20
19
|
|
package/RatingStars/index.js
CHANGED
|
@@ -2,7 +2,6 @@ import React, { useCallback, useMemo } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import times from 'lodash/times';
|
|
4
4
|
import { i18n } from '@shopgate/engage/core/helpers';
|
|
5
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
6
5
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
7
6
|
import StarIcon from "../icons/StarIcon";
|
|
8
7
|
import StarHalfIcon from "../icons/StarHalfIcon";
|
|
@@ -13,7 +12,7 @@ const ICON_SIZES = {
|
|
|
13
12
|
big: '1.24em',
|
|
14
13
|
large: '2.3em'
|
|
15
14
|
};
|
|
16
|
-
const useStyles = makeStyles()({
|
|
15
|
+
const useStyles = makeStyles()(theme => ({
|
|
17
16
|
container: {
|
|
18
17
|
position: 'relative',
|
|
19
18
|
display: 'inline-block',
|
|
@@ -35,7 +34,7 @@ const useStyles = makeStyles()({
|
|
|
35
34
|
marginRight: '0.23em'
|
|
36
35
|
},
|
|
37
36
|
emptyStars: {
|
|
38
|
-
color:
|
|
37
|
+
color: theme.components.ratingStars.empty,
|
|
39
38
|
display: 'inline-flex',
|
|
40
39
|
alignItems: 'center',
|
|
41
40
|
flexWrap: 'nowrap'
|
|
@@ -44,12 +43,12 @@ const useStyles = makeStyles()({
|
|
|
44
43
|
position: 'absolute',
|
|
45
44
|
left: 0,
|
|
46
45
|
top: 0,
|
|
47
|
-
color:
|
|
46
|
+
color: theme.components.ratingStars.filled,
|
|
48
47
|
display: 'inline-flex',
|
|
49
48
|
alignItems: 'center',
|
|
50
49
|
flexWrap: 'nowrap'
|
|
51
50
|
}
|
|
52
|
-
});
|
|
51
|
+
}));
|
|
53
52
|
const numStars = 5;
|
|
54
53
|
|
|
55
54
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { memo, useRef, useMemo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Transition } from 'react-transition-group';
|
|
4
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
4
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
6
|
const useStyles = makeStyles()(() => ({
|
|
@@ -97,7 +96,7 @@ function RippleAnimation({
|
|
|
97
96
|
});
|
|
98
97
|
}
|
|
99
98
|
RippleAnimation.defaultProps = {
|
|
100
|
-
color:
|
|
99
|
+
color: 'var(--sg-palette-common-black)',
|
|
101
100
|
duration: 300,
|
|
102
101
|
onComplete: () => {},
|
|
103
102
|
size: 48,
|
package/Ripple/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import clamp from 'lodash/clamp';
|
|
4
4
|
import { shift } from '@shopgate/pwa-common/helpers/data';
|
|
5
5
|
import { getOffset } from '@shopgate/pwa-common/helpers/dom';
|
|
6
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
7
6
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
8
7
|
import RippleAnimation from "./components/RippleAnimation";
|
|
9
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -183,7 +182,7 @@ const Ripple = ({
|
|
|
183
182
|
};
|
|
184
183
|
Ripple.defaultProps = {
|
|
185
184
|
className: '',
|
|
186
|
-
color:
|
|
185
|
+
color: 'var(--sg-palette-common-black)',
|
|
187
186
|
disabled: false,
|
|
188
187
|
fill: false,
|
|
189
188
|
onClick: () => {},
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import SurroundPortals from '@shopgate/pwa-common/components/SurroundPortals';
|
|
3
3
|
import { SCANNER_CAMERA } from '@shopgate/pwa-common-commerce/scanner/constants/Portals';
|
|
4
|
-
import { themeColors } from '@shopgate/pwa-common/helpers/config';
|
|
5
4
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
6
|
const edgeHeight = 45;
|
|
@@ -18,7 +17,7 @@ const useStyles = makeStyles()(theme => ({
|
|
|
18
17
|
height: edgeHeight,
|
|
19
18
|
position: 'absolute',
|
|
20
19
|
borderStyle: 'solid',
|
|
21
|
-
borderColor:
|
|
20
|
+
borderColor: theme.palette.common.white
|
|
22
21
|
},
|
|
23
22
|
':before': {
|
|
24
23
|
top: theme.spacing(8),
|
|
@@ -5,13 +5,13 @@ import { SCANNER_FLASH } from '@shopgate/engage/scanner/constants';
|
|
|
5
5
|
import { i18n } from '@shopgate/engage/core/helpers';
|
|
6
6
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
7
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
const useStyles = makeStyles()({
|
|
8
|
+
const useStyles = makeStyles()(theme => ({
|
|
9
9
|
button: {
|
|
10
10
|
alignItems: 'center',
|
|
11
11
|
color: 'inherit',
|
|
12
12
|
display: 'flex',
|
|
13
13
|
flexShrink: 0,
|
|
14
|
-
fontSize:
|
|
14
|
+
fontSize: theme.components.icon.medium,
|
|
15
15
|
height: 44,
|
|
16
16
|
justifyContent: 'center',
|
|
17
17
|
outline: 0,
|
|
@@ -22,9 +22,9 @@ const useStyles = makeStyles()({
|
|
|
22
22
|
},
|
|
23
23
|
icon: {
|
|
24
24
|
boxSizing: 'content-box',
|
|
25
|
-
color:
|
|
25
|
+
color: theme.palette.secondary.main
|
|
26
26
|
}
|
|
27
|
-
});
|
|
27
|
+
}));
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Renders the flashlight button for the scanner bar.
|
|
@@ -3,7 +3,6 @@ import { createPortal } from 'react-dom';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { Grid, SurroundPortals } from '@shopgate/engage/components';
|
|
5
5
|
import { SCANNER_BAR } from '@shopgate/engage/scanner/constants';
|
|
6
|
-
import { themeShadows, themeColors } from '@shopgate/pwa-common/helpers/config';
|
|
7
6
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
8
7
|
import FlashlightButton from "./components/FlashlightButton";
|
|
9
8
|
import ScannerInstructions from "./components/ScannerInstructions";
|
|
@@ -11,11 +10,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
10
|
const useStyles = makeStyles()(theme => ({
|
|
12
11
|
container: {
|
|
13
12
|
bottom: 0,
|
|
14
|
-
backgroundColor:
|
|
15
|
-
boxShadow:
|
|
16
|
-
fontSize:
|
|
13
|
+
backgroundColor: theme.palette.background.emphasized,
|
|
14
|
+
boxShadow: '0 0 0 1px rgba(0, 0, 0, 0.1)',
|
|
15
|
+
fontSize: theme.typography.body2.fontSize,
|
|
17
16
|
alignItems: 'center',
|
|
18
|
-
paddingBottom:
|
|
17
|
+
paddingBottom: theme.layout.safeArea.bottom
|
|
19
18
|
},
|
|
20
19
|
column: {
|
|
21
20
|
margin: theme.spacing(2),
|
|
@@ -2,11 +2,10 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { I18n } from '@shopgate/engage/components';
|
|
4
4
|
import Input from '@shopgate/pwa-common/components/Input';
|
|
5
|
-
import { themeColors } from '@shopgate/pwa-common/helpers/config';
|
|
6
5
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
7
6
|
import MagnifierIcon from "../../../../../icons/MagnifierIcon";
|
|
8
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
const useStyles = makeStyles()({
|
|
8
|
+
const useStyles = makeStyles()(theme => ({
|
|
10
9
|
container: {
|
|
11
10
|
display: 'flex',
|
|
12
11
|
flexDirection: 'row',
|
|
@@ -27,13 +26,13 @@ const useStyles = makeStyles()({
|
|
|
27
26
|
padding: '4px 10px 4px 30px',
|
|
28
27
|
lineHeight: '28px',
|
|
29
28
|
outline: 'none',
|
|
30
|
-
background:
|
|
29
|
+
background: theme.palette.grey.light,
|
|
31
30
|
verticalAlign: 'middle',
|
|
32
31
|
WebkitAppearance: 'none'
|
|
33
32
|
},
|
|
34
33
|
label: {
|
|
35
34
|
alignItems: 'center',
|
|
36
|
-
color:
|
|
35
|
+
color: theme.palette.grey.medium,
|
|
37
36
|
display: 'flex',
|
|
38
37
|
height: '36px',
|
|
39
38
|
position: 'absolute',
|
|
@@ -42,10 +41,10 @@ const useStyles = makeStyles()({
|
|
|
42
41
|
},
|
|
43
42
|
icon: {
|
|
44
43
|
padding: '0 6px',
|
|
45
|
-
color:
|
|
46
|
-
fontSize:
|
|
44
|
+
color: theme.palette.grey.medium,
|
|
45
|
+
fontSize: theme.components.icon.small
|
|
47
46
|
}
|
|
48
|
-
});
|
|
47
|
+
}));
|
|
49
48
|
|
|
50
49
|
/**
|
|
51
50
|
* @param {Object} props Props.
|
|
@@ -2,7 +2,7 @@ import React, { memo } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import Grid from '@shopgate/pwa-common/components/Grid';
|
|
4
4
|
import { i18n } from '@shopgate/engage/core/helpers';
|
|
5
|
-
import {
|
|
5
|
+
import { Typography } from '@shopgate/engage/components';
|
|
6
6
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
7
7
|
import Ripple from "../../../Ripple";
|
|
8
8
|
import CrossIcon from "../../../icons/CrossIcon";
|
|
@@ -14,16 +14,14 @@ const useStyles = makeStyles()(theme => ({
|
|
|
14
14
|
zIndex: 2
|
|
15
15
|
},
|
|
16
16
|
closePlaceholder: {
|
|
17
|
-
height:
|
|
18
|
-
padding: 0
|
|
19
|
-
lineHeight: 1
|
|
17
|
+
height: theme.components.navigator.height,
|
|
18
|
+
padding: 0
|
|
20
19
|
},
|
|
21
20
|
closeButton: {
|
|
22
|
-
lineHeight: 1,
|
|
23
21
|
outline: 0,
|
|
24
22
|
padding: 0,
|
|
25
|
-
minWidth:
|
|
26
|
-
height:
|
|
23
|
+
minWidth: theme.components.navigator.height,
|
|
24
|
+
height: theme.components.navigator.height,
|
|
27
25
|
position: 'relative',
|
|
28
26
|
zIndex: 2,
|
|
29
27
|
color: theme.palette.text.primary
|
|
@@ -36,18 +34,17 @@ const useStyles = makeStyles()(theme => ({
|
|
|
36
34
|
alignItems: 'center'
|
|
37
35
|
},
|
|
38
36
|
title: {
|
|
39
|
-
fontSize: '1.25rem',
|
|
40
|
-
fontWeight: 500,
|
|
41
37
|
position: 'relative',
|
|
42
38
|
alignItems: 'center',
|
|
43
39
|
padding: theme.spacing(0, 2),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
alignSelf: 'center',
|
|
41
|
+
minWidth: 0
|
|
42
|
+
},
|
|
43
|
+
titleText: {
|
|
44
|
+
minWidth: 0
|
|
48
45
|
},
|
|
49
46
|
headerShadow: {
|
|
50
|
-
boxShadow:
|
|
47
|
+
boxShadow: '0 1px 6px rgba(0, 0, 0, .117647), 0 1px 4px rgba(0, 0, 0, .117647)'
|
|
51
48
|
}
|
|
52
49
|
}));
|
|
53
50
|
|
|
@@ -96,7 +93,13 @@ const Header = ({
|
|
|
96
93
|
...(allowClose ? {
|
|
97
94
|
tabIndex: 0
|
|
98
95
|
} : null),
|
|
99
|
-
children:
|
|
96
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
97
|
+
variant: "h3",
|
|
98
|
+
component: "div",
|
|
99
|
+
noWrap: true,
|
|
100
|
+
className: classes.titleText,
|
|
101
|
+
children: title
|
|
102
|
+
})
|
|
100
103
|
})]
|
|
101
104
|
}), showSearch && /*#__PURE__*/_jsx(SearchBar, {
|
|
102
105
|
handleChange: handleChange
|
|
@@ -10,6 +10,8 @@ describe('<Header />', () => {
|
|
|
10
10
|
title: title
|
|
11
11
|
}), mockRenderOptions);
|
|
12
12
|
expect(wrapper).toMatchSnapshot();
|
|
13
|
-
expect(wrapper.find(
|
|
13
|
+
expect(wrapper.find({
|
|
14
|
+
variant: 'h3'
|
|
15
|
+
}).first().props().children).toEqual(title);
|
|
14
16
|
});
|
|
15
17
|
});
|
package/Sheet/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import throttle from 'lodash/throttle';
|
|
|
4
4
|
import UIEvents from '@shopgate/pwa-core/emitters/ui';
|
|
5
5
|
import Backdrop from '@shopgate/pwa-common/components/Backdrop';
|
|
6
6
|
import Drawer from '@shopgate/pwa-common/components/Drawer';
|
|
7
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
8
7
|
import { makeStyles, keyframes, responsiveMediaQuery } from '@shopgate/engage/styles';
|
|
9
8
|
import ProgressBar from "../ProgressBar";
|
|
10
9
|
import Header from "./components/Header";
|
|
@@ -67,7 +66,7 @@ const useStyles = makeStyles()(theme => ({
|
|
|
67
66
|
},
|
|
68
67
|
container: {
|
|
69
68
|
bottom: 0,
|
|
70
|
-
background:
|
|
69
|
+
background: theme.palette.background.surface,
|
|
71
70
|
width: '100vw',
|
|
72
71
|
[responsiveMediaQuery('<xl', {
|
|
73
72
|
appOnly: true
|
|
@@ -90,22 +89,22 @@ const useStyles = makeStyles()(theme => ({
|
|
|
90
89
|
}
|
|
91
90
|
},
|
|
92
91
|
containerFullScreen: {
|
|
93
|
-
height: [`calc(100vh - ${
|
|
92
|
+
height: [`calc(100vh - ${theme.components.navigator.height} - 51px)`, `calc(100vh - ${theme.components.navigator.height} - 51px - ${theme.layout.safeArea.top})`]
|
|
94
93
|
},
|
|
95
94
|
progressBarContainer: {
|
|
96
95
|
position: 'relative'
|
|
97
96
|
},
|
|
98
97
|
sheetShadow: {
|
|
99
|
-
boxShadow:
|
|
98
|
+
boxShadow: '0 -2px 4px rgba(0, 0, 0, 0.1)'
|
|
100
99
|
},
|
|
101
100
|
content: {
|
|
102
|
-
maxHeight: [`calc(var(--vh-100, 100vh) - ${
|
|
101
|
+
maxHeight: [`calc(var(--vh-100, 100vh) - ${theme.components.navigator.height})`, `calc(var(--vh-100, 100vh) - ${theme.components.navigator.height} - ${theme.layout.safeArea.top})`],
|
|
103
102
|
[responsiveMediaQuery('>sm', {
|
|
104
103
|
webOnly: true
|
|
105
104
|
})]: {
|
|
106
|
-
maxHeight: [`calc(var(--vh-80, 80vh) - ${
|
|
105
|
+
maxHeight: [`calc(var(--vh-80, 80vh) - ${theme.components.navigator.height})`, `calc(var(--vh-80, 80vh) - ${theme.components.navigator.height} - ${theme.layout.safeArea.top})`]
|
|
107
106
|
},
|
|
108
|
-
paddingBottom: [
|
|
107
|
+
paddingBottom: [theme.layout.safeArea.bottom],
|
|
109
108
|
overflowY: 'scroll',
|
|
110
109
|
WebkitOverflowScrolling: 'touch'
|
|
111
110
|
},
|
package/TaxDisclaimer/index.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import SurroundPortals from '@shopgate/pwa-common/components/SurroundPortals';
|
|
3
3
|
import { PRODUCT_TAX_DISCLAIMER } from '@shopgate/pwa-common-commerce/product/constants/Portals';
|
|
4
|
-
import { I18n } from '@shopgate/engage/components';
|
|
4
|
+
import { I18n, Typography } from '@shopgate/engage/components';
|
|
5
5
|
import showTaxDisclaimer from '@shopgate/pwa-common-commerce/market/helpers/showTaxDisclaimer';
|
|
6
6
|
import { useWidgetSettings } from '@shopgate/engage/core/hooks/useWidgetSettings';
|
|
7
7
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
const useStyles = makeStyles()(theme => ({
|
|
10
10
|
text: {
|
|
11
|
-
background: theme.palette.background.
|
|
12
|
-
|
|
13
|
-
fontSize: 12,
|
|
14
|
-
padding: theme.spacing(2.5, 2),
|
|
15
|
-
textAlign: 'left'
|
|
11
|
+
background: theme.palette.background.surface,
|
|
12
|
+
padding: theme.spacing(2.5, 2)
|
|
16
13
|
}
|
|
17
14
|
}));
|
|
18
15
|
|
|
@@ -22,7 +19,8 @@ const useStyles = makeStyles()(theme => ({
|
|
|
22
19
|
*/
|
|
23
20
|
const TaxDisclaimer = () => {
|
|
24
21
|
const {
|
|
25
|
-
classes
|
|
22
|
+
classes,
|
|
23
|
+
cx
|
|
26
24
|
} = useStyles();
|
|
27
25
|
|
|
28
26
|
// Added with PWA 6 - CCP-2372
|
|
@@ -38,12 +36,15 @@ const TaxDisclaimer = () => {
|
|
|
38
36
|
portalProps: {
|
|
39
37
|
showTaxDisclaimer: showDisclaimer
|
|
40
38
|
},
|
|
41
|
-
children: showDisclaimer && /*#__PURE__*/_jsx(
|
|
39
|
+
children: showDisclaimer && /*#__PURE__*/_jsx(Typography, {
|
|
40
|
+
variant: "caption",
|
|
41
|
+
display: "block",
|
|
42
|
+
align: "left",
|
|
43
|
+
component: "div",
|
|
42
44
|
"data-test-id": "taxDisclaimer",
|
|
43
45
|
"aria-hidden": true,
|
|
44
|
-
className:
|
|
46
|
+
className: cx(classes.text, 'ui-shared__tax-disclaimer'),
|
|
45
47
|
children: /*#__PURE__*/_jsx(I18n.Text, {
|
|
46
|
-
className: classes.text,
|
|
47
48
|
string: text || 'product.tax_disclaimer'
|
|
48
49
|
})
|
|
49
50
|
})
|
package/TaxDisclaimer/spec.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { I18n } from '@shopgate/engage/components';
|
|
3
|
+
import { I18n, Typography } from '@shopgate/engage/components';
|
|
4
4
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
6
|
const ellipsisLine = {
|
|
@@ -9,16 +9,13 @@ const ellipsisLine = {
|
|
|
9
9
|
whiteSpace: 'nowrap',
|
|
10
10
|
textOverflow: 'ellipsis'
|
|
11
11
|
};
|
|
12
|
-
const useStyles = makeStyles()(
|
|
12
|
+
const useStyles = makeStyles()({
|
|
13
13
|
error: {
|
|
14
14
|
position: 'absolute',
|
|
15
15
|
bottom: 2,
|
|
16
|
-
fontSize: 12,
|
|
17
|
-
lineHeight: '14px',
|
|
18
|
-
color: theme.palette.error.main,
|
|
19
16
|
...ellipsisLine
|
|
20
17
|
}
|
|
21
|
-
})
|
|
18
|
+
});
|
|
22
19
|
|
|
23
20
|
/**
|
|
24
21
|
* Error message component.
|
|
@@ -37,7 +34,10 @@ const ErrorText = ({
|
|
|
37
34
|
classes,
|
|
38
35
|
cx
|
|
39
36
|
} = useStyles();
|
|
40
|
-
return /*#__PURE__*/_jsxs(
|
|
37
|
+
return /*#__PURE__*/_jsxs(Typography, {
|
|
38
|
+
variant: "caption",
|
|
39
|
+
component: "div",
|
|
40
|
+
color: "error",
|
|
41
41
|
id: `ariaError-${elementName}`,
|
|
42
42
|
className: cx(classes.error, className, 'errorText'),
|
|
43
43
|
"aria-live": "assertive",
|