@shopgate/pwa-ui-shared 7.31.6 → 7.32.0-beta.10
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/index.js +4 -0
- package/AddToCartButton/index.js +18 -15
- package/Availability/index.js +11 -28
- package/Button/index.js +16 -12
- package/ButtonLink/index.js +4 -0
- package/Card/index.js +13 -37
- package/CardList/components/Item/index.js +26 -21
- package/CardList/index.js +2 -1
- 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/DiscountBadge/index.js +35 -32
- package/FavoritesButton/connector.js +1 -1
- package/FavoritesButton/index.js +26 -23
- package/Form/Checkbox/index.js +1 -1
- 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/SelectContextChoices/index.js +8 -8
- 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 +4 -4
- 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 +6 -6
- 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 +20 -10
- package/Ripple/components/RippleAnimation/index.js +1 -2
- package/Ripple/index.js +1 -2
- package/RippleButton/index.js +5 -1
- 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/index.js +17 -8
- package/TaxDisclaimer/index.js +10 -10
- 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/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,10 +12,10 @@ 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
|
-
display: 'inline-
|
|
18
|
+
display: 'inline-flex',
|
|
20
19
|
verticalAlign: 'middle',
|
|
21
20
|
maxWidth: '100%'
|
|
22
21
|
},
|
|
@@ -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,17 @@ const useStyles = makeStyles()({
|
|
|
44
43
|
position: 'absolute',
|
|
45
44
|
left: 0,
|
|
46
45
|
top: 0,
|
|
47
|
-
|
|
46
|
+
// Purely decorative overlay: let every pointer event fall through to the
|
|
47
|
+
// empty-star buttons underneath, which span all slots and handle selection.
|
|
48
|
+
// Without this, the invisible spacers/half-stars cover the higher-index
|
|
49
|
+
// buttons and swallow clicks in selectable mode.
|
|
50
|
+
pointerEvents: 'none',
|
|
51
|
+
color: theme.components.ratingStars.filled,
|
|
48
52
|
display: 'inline-flex',
|
|
49
53
|
alignItems: 'center',
|
|
50
54
|
flexWrap: 'nowrap'
|
|
51
55
|
}
|
|
52
|
-
});
|
|
56
|
+
}));
|
|
53
57
|
const numStars = 5;
|
|
54
58
|
|
|
55
59
|
/**
|
|
@@ -108,10 +112,10 @@ const RatingStars = ({
|
|
|
108
112
|
const starProps = {
|
|
109
113
|
className: iconClassName,
|
|
110
114
|
key: numStars + pos,
|
|
115
|
+
// Decorative duplicate of the underlying empty-star button; hidden from
|
|
116
|
+
// assistive tech and non-interactive (the empty layer handles clicks).
|
|
111
117
|
...(isSelectable && {
|
|
112
|
-
'aria-hidden': true
|
|
113
|
-
role: 'button',
|
|
114
|
-
onClick: e => handleSelection(e, pos)
|
|
118
|
+
'aria-hidden': true
|
|
115
119
|
})
|
|
116
120
|
};
|
|
117
121
|
return /*#__PURE__*/_jsx("div", {
|
|
@@ -125,7 +129,13 @@ const RatingStars = ({
|
|
|
125
129
|
children: /*#__PURE__*/_jsx(StarHalfIcon, {
|
|
126
130
|
size: size
|
|
127
131
|
})
|
|
128
|
-
}, i + numFullStars))
|
|
132
|
+
}, i + numFullStars)), times(Math.max(numStars - numFullStars - numHalfStars, 0), i => /*#__PURE__*/_jsx("div", {
|
|
133
|
+
className: iconClassName,
|
|
134
|
+
style: {
|
|
135
|
+
width: size
|
|
136
|
+
},
|
|
137
|
+
"aria-hidden": true
|
|
138
|
+
}, `placeholder-${i}`))), [iconClassName, numFullStars, numHalfStars, size, isSelectable]);
|
|
129
139
|
return /*#__PURE__*/_jsxs("div", {
|
|
130
140
|
role: isSelectable ? undefined : 'img',
|
|
131
141
|
className: rootClassName,
|
|
@@ -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: () => {},
|
package/RippleButton/index.js
CHANGED
|
@@ -14,6 +14,10 @@ const useStyles = makeStyles()(theme => ({
|
|
|
14
14
|
/**
|
|
15
15
|
* The ripple button component is a special derivation of the basic button component
|
|
16
16
|
* that adds a ripple effect when clicked.
|
|
17
|
+
* @deprecated Use `Button` from `@shopgate/engage/components/v2` instead — it ripples by default,
|
|
18
|
+
* so `rippleClassName` and `rippleSize` are gone and `disableRipple` turns the effect off. Map
|
|
19
|
+
* `flat` to `variant="text"`, `type="secondary"` to `color="primary"`, and `type="primary"` or the
|
|
20
|
+
* default to `color="secondary"`.
|
|
17
21
|
* @param {Object} props Props.
|
|
18
22
|
* @returns {JSX.Element}
|
|
19
23
|
*/
|
|
@@ -34,7 +38,7 @@ const RippleButton = ({
|
|
|
34
38
|
classes
|
|
35
39
|
} = useStyles();
|
|
36
40
|
const buttonProps = {
|
|
37
|
-
className:
|
|
41
|
+
className: cx(className, 'ui-shared__ripple-button'),
|
|
38
42
|
disabled,
|
|
39
43
|
onClick,
|
|
40
44
|
flat,
|
|
@@ -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
|
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,24 +89,34 @@ 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
|
-
WebkitOverflowScrolling: 'touch'
|
|
109
|
+
WebkitOverflowScrolling: 'touch',
|
|
110
|
+
'@media (hover: hover) and (pointer: fine)': {
|
|
111
|
+
'::-webkit-scrollbar': {
|
|
112
|
+
width: 6,
|
|
113
|
+
background: 'transparent'
|
|
114
|
+
},
|
|
115
|
+
'::-webkit-scrollbar-thumb': {
|
|
116
|
+
background: theme.components.border.medium,
|
|
117
|
+
borderRadius: 4
|
|
118
|
+
}
|
|
119
|
+
}
|
|
111
120
|
},
|
|
112
121
|
drawerAnimIn: {
|
|
113
122
|
[responsiveMediaQuery('<=sm', {
|
package/TaxDisclaimer/index.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
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
|
-
|
|
12
|
-
display: 'block',
|
|
13
|
-
fontSize: 12,
|
|
14
|
-
padding: theme.spacing(2.5, 2),
|
|
15
|
-
textAlign: 'left'
|
|
11
|
+
padding: theme.spacing(2.5, 2)
|
|
16
12
|
}
|
|
17
13
|
}));
|
|
18
14
|
|
|
@@ -22,7 +18,8 @@ const useStyles = makeStyles()(theme => ({
|
|
|
22
18
|
*/
|
|
23
19
|
const TaxDisclaimer = () => {
|
|
24
20
|
const {
|
|
25
|
-
classes
|
|
21
|
+
classes,
|
|
22
|
+
cx
|
|
26
23
|
} = useStyles();
|
|
27
24
|
|
|
28
25
|
// Added with PWA 6 - CCP-2372
|
|
@@ -38,12 +35,15 @@ const TaxDisclaimer = () => {
|
|
|
38
35
|
portalProps: {
|
|
39
36
|
showTaxDisclaimer: showDisclaimer
|
|
40
37
|
},
|
|
41
|
-
children: showDisclaimer && /*#__PURE__*/_jsx(
|
|
38
|
+
children: showDisclaimer && /*#__PURE__*/_jsx(Typography, {
|
|
39
|
+
variant: "caption",
|
|
40
|
+
display: "block",
|
|
41
|
+
align: "left",
|
|
42
|
+
component: "div",
|
|
42
43
|
"data-test-id": "taxDisclaimer",
|
|
43
44
|
"aria-hidden": true,
|
|
44
|
-
className:
|
|
45
|
+
className: cx(classes.text, 'ui-shared__tax-disclaimer'),
|
|
45
46
|
children: /*#__PURE__*/_jsx(I18n.Text, {
|
|
46
|
-
className: classes.text,
|
|
47
47
|
string: text || 'product.tax_disclaimer'
|
|
48
48
|
})
|
|
49
49
|
})
|
|
@@ -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",
|
|
@@ -3,14 +3,14 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import Input from '@shopgate/pwa-common/components/Input';
|
|
4
4
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const useStyles = makeStyles()({
|
|
6
|
+
const useStyles = makeStyles()(theme => ({
|
|
7
7
|
input: {
|
|
8
8
|
position: 'relative',
|
|
9
9
|
padding: 0,
|
|
10
10
|
width: '100%',
|
|
11
11
|
marginTop: 24,
|
|
12
12
|
outline: 0,
|
|
13
|
-
fontSize:
|
|
13
|
+
fontSize: theme.typography.body1.fontSize,
|
|
14
14
|
lineHeight: '19px'
|
|
15
15
|
},
|
|
16
16
|
multiLine: {
|
|
@@ -25,7 +25,7 @@ const useStyles = makeStyles()({
|
|
|
25
25
|
lineHeight: '19px',
|
|
26
26
|
verticalAlign: 'top'
|
|
27
27
|
}
|
|
28
|
-
});
|
|
28
|
+
}));
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Creates an input or a multiLine based on the type prop.
|