@shopgate/pwa-ui-shared 7.30.4-beta.1 → 7.31.0-alpha.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/index.js +66 -67
- package/AddToCartButton/index.js +217 -185
- package/AddToCartButton/style.js +8 -0
- package/Availability/index.js +24 -6
- package/Button/index.js +105 -82
- package/Button/spec.js +3 -4
- package/Card/index.js +26 -7
- package/CardList/components/Item/index.js +15 -3
- package/CartTotalLine/components/Amount/index.js +13 -4
- package/CartTotalLine/components/Hint/index.js +13 -4
- package/CartTotalLine/components/Label/index.js +23 -10
- package/CartTotalLine/index.js +41 -7
- package/Checkbox/index.js +41 -17
- package/Chip/index.js +82 -7
- package/ContextMenu/components/Item/index.js +38 -20
- package/ContextMenu/components/Position/index.js +38 -56
- package/ContextMenu/index.js +64 -28
- package/Dialog/components/BasicDialog/index.js +1 -0
- package/Dialog/components/HtmlContentDialog/spec.js +39 -0
- package/Dialog/components/PipelineErrorDialog/index.js +108 -157
- package/Dialog/components/PipelineErrorDialog/spec.js +12 -18
- package/Dialog/components/TextMessageDialog/index.js +1 -1
- package/Dialog/components/VariantSelectModal/index.js +1 -1
- package/Dialog/index.js +1 -1
- package/DiscountBadge/index.js +48 -15
- package/FavoritesButton/index.js +95 -100
- package/FavoritesButton/spec.js +5 -2
- package/Form/Builder/classes/ActionListener/index.js +1 -0
- package/Form/Checkbox/index.js +64 -56
- package/Form/InfoField/index.js +18 -6
- package/Form/Password/index.js +39 -52
- package/Form/RadioGroup/components/Item/index.js +72 -56
- package/Form/RadioGroup/index.js +79 -90
- package/Form/Select/index.js +108 -130
- package/Form/SelectContextChoices/index.js +30 -8
- package/Form/TextField/index.js +106 -82
- package/Form/TextField/spec.js +4 -3
- package/FormElement/components/ErrorText/index.js +32 -14
- package/FormElement/components/Label/index.js +56 -6
- package/FormElement/components/Placeholder/index.js +44 -11
- package/FormElement/components/Underline/index.js +63 -12
- package/FormElement/index.js +62 -85
- package/Glow/index.js +73 -83
- package/IndicatorCircle/index.js +73 -17
- package/IndicatorCircle/spec.js +2 -5
- package/LoadingIndicator/index.js +34 -12
- package/Manufacturer/index.js +21 -10
- package/MessageBar/index.js +12 -38
- package/NoResults/components/Icon/index.js +30 -14
- package/NoResults/index.js +35 -7
- package/Placeholder/index.js +34 -23
- package/PlaceholderLabel/index.js +17 -3
- package/Price/index.js +34 -21
- package/PriceInfo/index.js +23 -9
- package/PriceStriked/index.js +67 -77
- package/ProgressBar/index.js +112 -77
- package/RadioButton/index.js +29 -11
- package/RatingStars/index.js +122 -137
- package/Ripple/components/RippleAnimation/index.js +13 -3
- package/Ripple/index.js +158 -212
- package/RippleButton/index.js +63 -60
- package/RippleButton/spec.js +15 -9
- package/ScannerOverlay/components/CameraOverlay/index.js +54 -10
- package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/index.js +53 -27
- package/ScannerOverlay/components/ScannerBar/index.js +50 -26
- package/Sheet/components/Header/components/SearchBar/index.js +54 -10
- package/Sheet/components/Header/index.js +96 -76
- package/Sheet/index.js +295 -157
- package/Sheet/spec.js +8 -6
- package/TaxDisclaimer/index.js +17 -4
- package/TaxDisclaimer/spec.js +16 -5
- package/TextField/components/ErrorText/index.js +35 -14
- package/TextField/components/FormElement/index.js +29 -4
- package/TextField/components/Hint/index.js +39 -10
- package/TextField/components/Label/index.js +43 -6
- package/TextField/components/Underline/index.js +64 -13
- package/TextField/index.js +157 -171
- package/TextField/spec.js +5 -3
- package/icons/AccountBoxIcon.d.ts +7 -0
- package/icons/AccountBoxIcon.d.ts.map +1 -0
- package/icons/AccountBoxIcon.js +1 -4
- package/icons/AddMoreIcon.d.ts +7 -0
- package/icons/AddMoreIcon.d.ts.map +1 -0
- package/icons/AddMoreIcon.js +0 -3
- package/icons/ArrowDropIcon.d.ts +7 -0
- package/icons/ArrowDropIcon.d.ts.map +1 -0
- package/icons/ArrowDropIcon.js +0 -3
- package/icons/ArrowIcon.d.ts +10 -0
- package/icons/ArrowIcon.d.ts.map +1 -0
- package/icons/ArrowIcon.js +2 -11
- package/icons/BarcodeScannerIcon.d.ts +7 -0
- package/icons/BarcodeScannerIcon.d.ts.map +1 -0
- package/icons/BarcodeScannerIcon.js +0 -3
- package/icons/BoxIcon.d.ts +7 -0
- package/icons/BoxIcon.d.ts.map +1 -0
- package/icons/BoxIcon.js +0 -3
- package/icons/BrowseIcon.d.ts +7 -0
- package/icons/BrowseIcon.d.ts.map +1 -0
- package/icons/BrowseIcon.js +1 -3
- package/icons/BurgerIcon.d.ts +7 -0
- package/icons/BurgerIcon.d.ts.map +1 -0
- package/icons/BurgerIcon.js +0 -3
- package/icons/CalendarIcon.d.ts +7 -0
- package/icons/CalendarIcon.d.ts.map +1 -0
- package/icons/CalendarIcon.js +0 -2
- package/icons/CartCouponIcon.d.ts +7 -0
- package/icons/CartCouponIcon.d.ts.map +1 -0
- package/icons/CartCouponIcon.js +0 -2
- package/icons/CartIcon.d.ts +7 -0
- package/icons/CartIcon.d.ts.map +1 -0
- package/icons/CartIcon.js +0 -2
- package/icons/CartPlusIcon.d.ts +7 -0
- package/icons/CartPlusIcon.d.ts.map +1 -0
- package/icons/CartPlusIcon.js +0 -2
- package/icons/CheckIcon.d.ts +7 -0
- package/icons/CheckIcon.d.ts.map +1 -0
- package/icons/CheckIcon.js +0 -2
- package/icons/CheckedIcon.d.ts +7 -0
- package/icons/CheckedIcon.d.ts.map +1 -0
- package/icons/CheckedIcon.js +0 -3
- package/icons/ChevronIcon.d.ts +7 -0
- package/icons/ChevronIcon.d.ts.map +1 -0
- package/icons/ChevronIcon.js +0 -2
- package/icons/CreditCardIcon.d.ts +7 -0
- package/icons/CreditCardIcon.d.ts.map +1 -0
- package/icons/CreditCardIcon.js +0 -2
- package/icons/CrossIcon.d.ts +7 -0
- package/icons/CrossIcon.d.ts.map +1 -0
- package/icons/CrossIcon.js +0 -2
- package/icons/DescriptionIcon.d.ts +7 -0
- package/icons/DescriptionIcon.d.ts.map +1 -0
- package/icons/DescriptionIcon.js +0 -2
- package/icons/FilterIcon.d.ts +7 -0
- package/icons/FilterIcon.d.ts.map +1 -0
- package/icons/FilterIcon.js +0 -2
- package/icons/FlashDisabledIcon.d.ts +7 -0
- package/icons/FlashDisabledIcon.d.ts.map +1 -0
- package/icons/FlashDisabledIcon.js +0 -2
- package/icons/FlashEnabledIcon.d.ts +7 -0
- package/icons/FlashEnabledIcon.d.ts.map +1 -0
- package/icons/FlashEnabledIcon.js +0 -2
- package/icons/GridIcon.d.ts +7 -0
- package/icons/GridIcon.d.ts.map +1 -0
- package/icons/GridIcon.js +1 -3
- package/icons/HeartIcon.d.ts +7 -0
- package/icons/HeartIcon.d.ts.map +1 -0
- package/icons/HeartIcon.js +0 -2
- package/icons/HeartOutlineIcon.d.ts +7 -0
- package/icons/HeartOutlineIcon.d.ts.map +1 -0
- package/icons/HeartOutlineIcon.js +1 -3
- package/icons/HeartPlusIcon.d.ts +7 -0
- package/icons/HeartPlusIcon.d.ts.map +1 -0
- package/icons/HeartPlusIcon.js +1 -3
- package/icons/HeartPlusOutlineIcon.d.ts +7 -0
- package/icons/HeartPlusOutlineIcon.d.ts.map +1 -0
- package/icons/HeartPlusOutlineIcon.js +1 -3
- package/icons/HomeIcon.d.ts +7 -0
- package/icons/HomeIcon.d.ts.map +1 -0
- package/icons/HomeIcon.js +0 -2
- package/icons/InfoIcon.d.ts +7 -0
- package/icons/InfoIcon.d.ts.map +1 -0
- package/icons/InfoIcon.js +0 -2
- package/icons/InfoOutlineIcon.d.ts +7 -0
- package/icons/InfoOutlineIcon.d.ts.map +1 -0
- package/icons/InfoOutlineIcon.js +0 -2
- package/icons/ListIcon.d.ts +7 -0
- package/icons/ListIcon.d.ts.map +1 -0
- package/icons/ListIcon.js +0 -2
- package/icons/LocalShippingIcon.d.ts +7 -0
- package/icons/LocalShippingIcon.d.ts.map +1 -0
- package/icons/LocalShippingIcon.js +0 -2
- package/icons/LocationIcon.d.ts +7 -0
- package/icons/LocationIcon.d.ts.map +1 -0
- package/icons/LocationIcon.js +1 -4
- package/icons/LocatorIcon.d.ts +7 -0
- package/icons/LocatorIcon.d.ts.map +1 -0
- package/icons/LocatorIcon.js +1 -3
- package/icons/LockIcon.d.ts +9 -0
- package/icons/LockIcon.d.ts.map +1 -0
- package/icons/LockIcon.js +1 -2
- package/icons/LogoutIcon.d.ts +7 -0
- package/icons/LogoutIcon.d.ts.map +1 -0
- package/icons/LogoutIcon.js +0 -2
- package/icons/MagnifierIcon.d.ts +7 -0
- package/icons/MagnifierIcon.d.ts.map +1 -0
- package/icons/MagnifierIcon.js +0 -2
- package/icons/MapMarkerIcon.d.ts +7 -0
- package/icons/MapMarkerIcon.d.ts.map +1 -0
- package/icons/MapMarkerIcon.js +1 -3
- package/icons/MoreIcon.d.ts +7 -0
- package/icons/MoreIcon.d.ts.map +1 -0
- package/icons/MoreIcon.js +1 -3
- package/icons/MoreVertIcon.d.ts +7 -0
- package/icons/MoreVertIcon.d.ts.map +1 -0
- package/icons/MoreVertIcon.js +1 -3
- package/icons/NotificationIcon.d.ts +7 -0
- package/icons/NotificationIcon.d.ts.map +1 -0
- package/icons/NotificationIcon.js +1 -3
- package/icons/PersonIcon.d.ts +9 -0
- package/icons/PersonIcon.d.ts.map +1 -0
- package/icons/PersonIcon.js +0 -3
- package/icons/PhoneIcon.d.ts +7 -0
- package/icons/PhoneIcon.d.ts.map +1 -0
- package/icons/PhoneIcon.js +1 -4
- package/icons/PlaceholderIcon.d.ts +7 -0
- package/icons/PlaceholderIcon.d.ts.map +1 -0
- package/icons/PlaceholderIcon.js +0 -2
- package/icons/RadioCheckedIcon.d.ts +10 -0
- package/icons/RadioCheckedIcon.d.ts.map +1 -0
- package/icons/RadioCheckedIcon.js +0 -2
- package/icons/RadioUncheckedIcon.d.ts +10 -0
- package/icons/RadioUncheckedIcon.d.ts.map +1 -0
- package/icons/RadioUncheckedIcon.js +0 -2
- package/icons/SecurityIcon.d.ts +7 -0
- package/icons/SecurityIcon.d.ts.map +1 -0
- package/icons/SecurityIcon.js +0 -2
- package/icons/ShippingMethodIcon.d.ts +7 -0
- package/icons/ShippingMethodIcon.d.ts.map +1 -0
- package/icons/ShippingMethodIcon.js +0 -2
- package/icons/ShoppingCartIcon.d.ts +7 -0
- package/icons/ShoppingCartIcon.d.ts.map +1 -0
- package/icons/ShoppingCartIcon.js +0 -2
- package/icons/SortIcon.d.ts +7 -0
- package/icons/SortIcon.d.ts.map +1 -0
- package/icons/SortIcon.js +0 -2
- package/icons/StarHalfIcon.d.ts +7 -0
- package/icons/StarHalfIcon.d.ts.map +1 -0
- package/icons/StarHalfIcon.js +0 -9
- package/icons/StarIcon.d.ts +7 -0
- package/icons/StarIcon.d.ts.map +1 -0
- package/icons/StarIcon.js +0 -9
- package/icons/StarOutlineIcon.d.ts +7 -0
- package/icons/StarOutlineIcon.d.ts.map +1 -0
- package/icons/StarOutlineIcon.js +0 -2
- package/icons/StopIcon.d.ts +7 -0
- package/icons/StopIcon.d.ts.map +1 -0
- package/icons/StopIcon.js +0 -2
- package/icons/TickIcon.d.ts +7 -0
- package/icons/TickIcon.d.ts.map +1 -0
- package/icons/TickIcon.js +0 -2
- package/icons/TimeIcon.d.ts +7 -0
- package/icons/TimeIcon.d.ts.map +1 -0
- package/icons/TimeIcon.js +0 -2
- package/icons/TrashIcon.d.ts +7 -0
- package/icons/TrashIcon.d.ts.map +1 -0
- package/icons/TrashIcon.js +0 -3
- package/icons/TrashOutlineIcon.d.ts +8 -0
- package/icons/TrashOutlineIcon.d.ts.map +1 -0
- package/icons/TrashOutlineIcon.js +0 -2
- package/icons/UncheckedIcon.d.ts +7 -0
- package/icons/UncheckedIcon.d.ts.map +1 -0
- package/icons/UncheckedIcon.js +0 -2
- package/icons/ViewListIcon.d.ts +7 -0
- package/icons/ViewListIcon.d.ts.map +1 -0
- package/icons/ViewListIcon.js +0 -2
- package/icons/VisibilityIcon.d.ts +8 -0
- package/icons/VisibilityIcon.d.ts.map +1 -0
- package/icons/VisibilityIcon.js +2 -4
- package/icons/VisibilityOffIcon.d.ts +8 -0
- package/icons/VisibilityOffIcon.d.ts.map +1 -0
- package/icons/VisibilityOffIcon.js +2 -4
- package/icons/WarningIcon.d.ts +7 -0
- package/icons/WarningIcon.d.ts.map +1 -0
- package/icons/WarningIcon.js +1 -3
- package/package.json +5 -5
- package/tsconfig.build.json +16 -0
- package/tsconfig.json +3 -0
- package/ActionButton/style.js +0 -22
- package/Availability/style.js +0 -19
- package/Button/style.js +0 -155
- package/Card/style.js +0 -11
- package/CardList/components/Item/style.js +0 -7
- package/CartTotalLine/components/Amount/style.js +0 -8
- package/CartTotalLine/components/Hint/style.js +0 -12
- package/CartTotalLine/components/Label/style.js +0 -17
- package/CartTotalLine/style.js +0 -31
- package/Checkbox/style.js +0 -18
- package/Chip/style.js +0 -78
- package/ContextMenu/components/Item/style.js +0 -34
- package/ContextMenu/components/Position/style.js +0 -11
- package/ContextMenu/style.js +0 -45
- package/DiscountBadge/style.js +0 -36
- package/FavoritesButton/style.js +0 -26
- package/Form/Checkbox/style.js +0 -25
- package/Form/InfoField/style.js +0 -11
- package/Form/Password/style.js +0 -11
- package/Form/RadioGroup/components/Item/style.js +0 -32
- package/Form/RadioGroup/style.js +0 -20
- package/Form/Select/style.js +0 -27
- package/Form/SelectContextChoices/style.js +0 -23
- package/Form/TextField/style.js +0 -70
- package/FormElement/components/ErrorText/style.js +0 -13
- package/FormElement/components/Label/style.js +0 -89
- package/FormElement/components/Placeholder/style.js +0 -56
- package/FormElement/components/Underline/style.js +0 -60
- package/FormElement/style.js +0 -14
- package/Glow/style.js +0 -18
- package/IndicatorCircle/style.js +0 -65
- package/LoadingIndicator/style.js +0 -20
- package/Manufacturer/style.js +0 -5
- package/MessageBar/spec.js +0 -80
- package/MessageBar/style.js +0 -38
- package/NoResults/components/Icon/style.js +0 -17
- package/NoResults/style.js +0 -31
- package/Placeholder/style.js +0 -11
- package/PlaceholderLabel/style.js +0 -12
- package/Price/style.js +0 -22
- package/PriceInfo/style.js +0 -5
- package/PriceStriked/style.js +0 -36
- package/ProgressBar/style.js +0 -85
- package/RadioButton/style.js +0 -21
- package/RatingStars/style.js +0 -53
- package/Ripple/style.js +0 -18
- package/ScannerOverlay/components/CameraOverlay/style.js +0 -40
- package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/style.js +0 -28
- package/ScannerOverlay/components/ScannerBar/style.js +0 -20
- package/Sheet/components/Header/components/SearchBar/style.js +0 -47
- package/Sheet/components/Header/style.js +0 -50
- package/Sheet/style.js +0 -143
- package/TaxDisclaimer/style.js +0 -9
- package/TextField/components/ErrorText/style.js +0 -27
- package/TextField/components/FormElement/style.js +0 -34
- package/TextField/components/Hint/style.js +0 -46
- package/TextField/components/Label/style.js +0 -80
- package/TextField/components/Underline/style.js +0 -60
- package/TextField/style.js +0 -35
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import CryptoJs from 'crypto-js';
|
|
4
|
-
import
|
|
4
|
+
import { themeColors } from '@shopgate/pwa-common/helpers/config';
|
|
5
|
+
import { makeStyles } from '@shopgate/engage/styles';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const useStyles = makeStyles()({
|
|
8
|
+
magnifier: {
|
|
9
|
+
fill: 'currentColor'
|
|
10
|
+
},
|
|
11
|
+
background: {
|
|
12
|
+
fill: themeColors.light
|
|
13
|
+
},
|
|
14
|
+
circle: {
|
|
15
|
+
fill: 'currentColor',
|
|
16
|
+
opacity: 0.065
|
|
17
|
+
}
|
|
18
|
+
});
|
|
5
19
|
|
|
6
20
|
/**
|
|
7
21
|
* The no search results icon component.
|
|
8
22
|
* @param {Object} props Props of the component
|
|
9
23
|
* @returns {JSX}
|
|
10
24
|
*/
|
|
11
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
25
|
const NoResultIcon = props => {
|
|
26
|
+
const {
|
|
27
|
+
classes
|
|
28
|
+
} = useStyles();
|
|
13
29
|
const filterId = useMemo(() => {
|
|
14
30
|
const prefix = 'no-search-results-shadow';
|
|
15
31
|
const hash = CryptoJs.MD5(`${prefix}-${Date.now() + Math.random()}`).toString();
|
|
@@ -46,7 +62,7 @@ const NoResultIcon = props => {
|
|
|
46
62
|
children: [/*#__PURE__*/_jsx("g", {
|
|
47
63
|
transform: "translate(0 46)",
|
|
48
64
|
children: /*#__PURE__*/_jsx("circle", {
|
|
49
|
-
className:
|
|
65
|
+
className: classes.background,
|
|
50
66
|
cx: "104",
|
|
51
67
|
cy: "104",
|
|
52
68
|
r: "104",
|
|
@@ -55,7 +71,7 @@ const NoResultIcon = props => {
|
|
|
55
71
|
}), /*#__PURE__*/_jsx("g", {
|
|
56
72
|
transform: "translate(-4 42)",
|
|
57
73
|
children: /*#__PURE__*/_jsx("circle", {
|
|
58
|
-
className:
|
|
74
|
+
className: classes.background,
|
|
59
75
|
cx: "108",
|
|
60
76
|
cy: "108",
|
|
61
77
|
r: "108",
|
|
@@ -63,19 +79,19 @@ const NoResultIcon = props => {
|
|
|
63
79
|
})
|
|
64
80
|
}), /*#__PURE__*/_jsxs("g", {
|
|
65
81
|
children: [/*#__PURE__*/_jsx("circle", {
|
|
66
|
-
className:
|
|
82
|
+
className: classes.circle,
|
|
67
83
|
cx: "104",
|
|
68
84
|
cy: "104",
|
|
69
85
|
r: "104",
|
|
70
86
|
transform: "translate(76 162)"
|
|
71
87
|
}), /*#__PURE__*/_jsx("circle", {
|
|
72
|
-
className:
|
|
88
|
+
className: classes.circle,
|
|
73
89
|
cx: "92",
|
|
74
90
|
cy: "92",
|
|
75
91
|
r: "92",
|
|
76
92
|
transform: "translate(88 174)"
|
|
77
93
|
}), /*#__PURE__*/_jsx("circle", {
|
|
78
|
-
className:
|
|
94
|
+
className: classes.circle,
|
|
79
95
|
cx: "80",
|
|
80
96
|
cy: "80",
|
|
81
97
|
r: "80",
|
|
@@ -88,7 +104,7 @@ const NoResultIcon = props => {
|
|
|
88
104
|
children: /*#__PURE__*/_jsx("g", {
|
|
89
105
|
transform: "matrix(1, 0, 0, 1, 2686.4, -7054.12)",
|
|
90
106
|
children: /*#__PURE__*/_jsx("path", {
|
|
91
|
-
className:
|
|
107
|
+
className: classes.background,
|
|
92
108
|
d: "M90.216,116.652a24.732,24.732,0,0,1-20.61-10.992,13.394,13.394,0,0,1-7.263-1.374,20,20,0,0,1-7.655,1.767,20.473,20.473,0,0,1-18.255-10.6,20.009,20.009,0,0,1-6.478.981A23.584,23.584,0,0,1,6.4,73.076c0-10.6,6.085-19.236,15.507-22.181V50.11A13.07,13.07,0,0,1,34.862,37.155a13.905,13.905,0,0,1,2.748.2A18.6,18.6,0,0,1,52.724,29.7,19.248,19.248,0,0,1,65.876,35,14.4,14.4,0,0,1,75.1,31.659a13.191,13.191,0,0,1,6.281,1.963,24.851,24.851,0,0,1,40.239,1.767,21.962,21.962,0,0,1,20.61,5.3c.393-.2.589-.393.981-.589a16.9,16.9,0,0,1,7.459-1.963,15.491,15.491,0,0,1,15.311,13.937A22.951,22.951,0,0,1,181.49,64.439c2.944,6.478,2.355,13.544-1.57,20.218a21.266,21.266,0,0,1-18.059,10.011h-.2c-4.122,0-7.459-.785-10.207-2.552a13.109,13.109,0,0,1-7.263.393,24.871,24.871,0,0,1-15.311,15.114,24.1,24.1,0,0,1-18.451-.981A25.762,25.762,0,0,1,90.216,116.652Z",
|
|
93
109
|
transform: "translate(-2686.4 7054.12)"
|
|
94
110
|
})
|
|
@@ -99,7 +115,7 @@ const NoResultIcon = props => {
|
|
|
99
115
|
children: [/*#__PURE__*/_jsx("g", {
|
|
100
116
|
transform: "matrix(1, 0, 0, 1, 2770, -6819)",
|
|
101
117
|
children: /*#__PURE__*/_jsx("rect", {
|
|
102
|
-
className:
|
|
118
|
+
className: classes.magnifier,
|
|
103
119
|
width: "13.003",
|
|
104
120
|
height: "3.855",
|
|
105
121
|
transform: "matrix(0.53, 0.85, -0.85, 0.53, -2613.92, 7029.38)"
|
|
@@ -107,7 +123,7 @@ const NoResultIcon = props => {
|
|
|
107
123
|
}), /*#__PURE__*/_jsx("g", {
|
|
108
124
|
transform: "matrix(1, 0, 0, 1, 2770, -6819)",
|
|
109
125
|
children: /*#__PURE__*/_jsx("rect", {
|
|
110
|
-
className:
|
|
126
|
+
className: classes.magnifier,
|
|
111
127
|
width: "3.855",
|
|
112
128
|
height: "13.003",
|
|
113
129
|
transform: "translate(-2566.07 7029.56) rotate(37.01)"
|
|
@@ -115,13 +131,13 @@ const NoResultIcon = props => {
|
|
|
115
131
|
}), /*#__PURE__*/_jsx("g", {
|
|
116
132
|
transform: "matrix(1, 0, 0, 1, 2770, -6819)",
|
|
117
133
|
children: /*#__PURE__*/_jsx("rect", {
|
|
118
|
-
className:
|
|
134
|
+
className: classes.magnifier,
|
|
119
135
|
width: "3.856",
|
|
120
136
|
height: "13.002",
|
|
121
137
|
transform: "translate(-2592.67 7023)"
|
|
122
138
|
})
|
|
123
139
|
}), /*#__PURE__*/_jsx("circle", {
|
|
124
|
-
className:
|
|
140
|
+
className: classes.background,
|
|
125
141
|
cx: "34",
|
|
126
142
|
cy: "34",
|
|
127
143
|
r: "34",
|
|
@@ -135,12 +151,12 @@ const NoResultIcon = props => {
|
|
|
135
151
|
children: [/*#__PURE__*/_jsx("g", {
|
|
136
152
|
transform: "matrix(1, 0, 0, 1, 2623.3, -7041.94)",
|
|
137
153
|
children: /*#__PURE__*/_jsx("path", {
|
|
138
|
-
className:
|
|
154
|
+
className: classes.magnifier,
|
|
139
155
|
d: "M83.335,33.853a34.228,34.228,0,1,0-1.494,49.8l4.482,4.482L84.63,89.829a1.926,1.926,0,0,0,0,2.789l17.032,16.932a1.926,1.926,0,0,0,2.789,0l5.677-5.677a1.926,1.926,0,0,0,0-2.789L93.1,84.152a1.926,1.926,0,0,0-2.789,0l-1.1,1.1-4.482-4.482A34.352,34.352,0,0,0,83.335,33.853Zm22.51,68.625-2.789,2.789L88.912,91.124,91.7,88.335ZM37.718,79.47a30.214,30.214,0,1,1,42.729,0A30.3,30.3,0,0,1,37.718,79.47Z",
|
|
140
156
|
transform: "translate(-2648.22 7018.1)"
|
|
141
157
|
})
|
|
142
158
|
}), /*#__PURE__*/_jsx("path", {
|
|
143
|
-
className:
|
|
159
|
+
className: classes.magnifier,
|
|
144
160
|
d: "M111.291,55.583a1.972,1.972,0,1,0,2.789-2.789,28.585,28.585,0,0,0-40.338-.1,1.972,1.972,0,0,0,2.789,2.789A24.557,24.557,0,0,1,111.291,55.583Z",
|
|
145
161
|
transform: "translate(-59.748 -38.701)"
|
|
146
162
|
})]
|
package/NoResults/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
4
|
-
import I18n from '@shopgate/pwa-common/components/I18n';
|
|
3
|
+
import { I18n } from '@shopgate/engage/components';
|
|
5
4
|
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
6
5
|
import { svgToDataUrl } from '@shopgate/engage/core';
|
|
6
|
+
import { makeStyles } from '@shopgate/engage/styles';
|
|
7
7
|
import Icon from "./components/Icon";
|
|
8
|
-
import styles from "./style";
|
|
9
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
9
|
const {
|
|
11
10
|
svgImages = {}
|
|
@@ -13,6 +12,31 @@ const {
|
|
|
13
12
|
const {
|
|
14
13
|
noResultsImage = ''
|
|
15
14
|
} = svgImages || {};
|
|
15
|
+
const useStyles = makeStyles()(theme => ({
|
|
16
|
+
wrapper: {
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
display: 'flex',
|
|
19
|
+
flexDirection: 'column',
|
|
20
|
+
height: '100%',
|
|
21
|
+
width: '100%',
|
|
22
|
+
justifyContent: 'center',
|
|
23
|
+
textAlign: 'center',
|
|
24
|
+
background: 'var(--page-background-color)'
|
|
25
|
+
},
|
|
26
|
+
icon: {
|
|
27
|
+
width: 216,
|
|
28
|
+
color: 'var(--color-primary)'
|
|
29
|
+
},
|
|
30
|
+
headline: {
|
|
31
|
+
fontSize: '1.25rem',
|
|
32
|
+
fontWeight: 500,
|
|
33
|
+
marginTop: 30
|
|
34
|
+
},
|
|
35
|
+
text: {
|
|
36
|
+
marginTop: theme.spacing(2),
|
|
37
|
+
padding: theme.spacing(0, 2)
|
|
38
|
+
}
|
|
39
|
+
}));
|
|
16
40
|
|
|
17
41
|
/**
|
|
18
42
|
* The NoResults component.
|
|
@@ -20,12 +44,16 @@ const {
|
|
|
20
44
|
* @returns {JSX.Element}
|
|
21
45
|
*/
|
|
22
46
|
const NoResults = props => {
|
|
47
|
+
const {
|
|
48
|
+
classes,
|
|
49
|
+
cx
|
|
50
|
+
} = useStyles();
|
|
23
51
|
const imageSRC = useMemo(() => svgToDataUrl(noResultsImage), []);
|
|
24
52
|
return /*#__PURE__*/_jsxs("div", {
|
|
25
|
-
className:
|
|
53
|
+
className: cx(classes.wrapper, props.className, ' ui-shared__no-results'),
|
|
26
54
|
"data-test-id": "noResults",
|
|
27
55
|
children: [/*#__PURE__*/_jsx("div", {
|
|
28
|
-
className:
|
|
56
|
+
className: cx(classes.icon, 'no-results__image'),
|
|
29
57
|
children: noResultsImage ? /*#__PURE__*/_jsx("img", {
|
|
30
58
|
src: imageSRC,
|
|
31
59
|
alt: ""
|
|
@@ -34,13 +62,13 @@ const NoResults = props => {
|
|
|
34
62
|
role: "alert",
|
|
35
63
|
"aria-atomic": "true",
|
|
36
64
|
children: [/*#__PURE__*/_jsx("div", {
|
|
37
|
-
className:
|
|
65
|
+
className: classes.headline,
|
|
38
66
|
children: /*#__PURE__*/_jsx(I18n.Text, {
|
|
39
67
|
string: props.headlineText,
|
|
40
68
|
params: props
|
|
41
69
|
})
|
|
42
70
|
}), /*#__PURE__*/_jsx("div", {
|
|
43
|
-
className:
|
|
71
|
+
className: classes.text,
|
|
44
72
|
children: /*#__PURE__*/_jsx(I18n.Text, {
|
|
45
73
|
string: props.bodyText,
|
|
46
74
|
params: props
|
package/Placeholder/index.js
CHANGED
|
@@ -1,35 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { PureComponent } from 'react';
|
|
1
|
+
import React, { memo } from 'react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
|
-
import
|
|
3
|
+
import { makeStyles } from '@shopgate/engage/styles';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
const useStyles = makeStyles()(() => ({
|
|
6
|
+
root: {
|
|
7
|
+
background: 'var(--color-background-accent)',
|
|
8
|
+
position: 'relative'
|
|
9
|
+
}
|
|
10
|
+
}));
|
|
5
11
|
|
|
6
12
|
/**
|
|
7
13
|
* The placeholder component.
|
|
14
|
+
* @param {Object} props Props (also spread to style).
|
|
15
|
+
* @returns {JSX.Element}
|
|
8
16
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
const Placeholder = ({
|
|
18
|
+
height,
|
|
19
|
+
left,
|
|
20
|
+
top,
|
|
21
|
+
width,
|
|
22
|
+
...rest
|
|
23
|
+
}) => {
|
|
24
|
+
const {
|
|
25
|
+
classes,
|
|
26
|
+
cx
|
|
27
|
+
} = useStyles();
|
|
28
|
+
const style = {
|
|
29
|
+
height,
|
|
30
|
+
left,
|
|
31
|
+
top,
|
|
32
|
+
width,
|
|
33
|
+
...rest
|
|
24
34
|
};
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
return /*#__PURE__*/_jsx("div", {
|
|
36
|
+
className: cx(classes.root, 'ui-shared__placeholder'),
|
|
37
|
+
style: style
|
|
38
|
+
});
|
|
39
|
+
};
|
|
29
40
|
Placeholder.defaultProps = {
|
|
30
41
|
height: 0,
|
|
31
42
|
left: 0,
|
|
32
43
|
top: 0,
|
|
33
44
|
width: 0
|
|
34
45
|
};
|
|
35
|
-
export default Placeholder;
|
|
46
|
+
export default /*#__PURE__*/memo(Placeholder);
|
|
@@ -1,23 +1,37 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
3
|
+
import { makeStyles } from '@shopgate/engage/styles';
|
|
4
|
+
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const useStyles = makeStyles()(() => ({
|
|
7
|
+
label: {
|
|
8
|
+
background: themeConfig.colors.dark,
|
|
9
|
+
opacity: 0.1,
|
|
10
|
+
width: '100%',
|
|
11
|
+
height: 16,
|
|
12
|
+
marginBottom: 12
|
|
13
|
+
}
|
|
14
|
+
}));
|
|
4
15
|
|
|
5
16
|
/**
|
|
6
17
|
* Placeholder for one line texts.
|
|
7
18
|
* @param {Object} props The component props.
|
|
8
19
|
* @return {JSX}
|
|
9
20
|
*/
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
21
|
const PlaceholderLabel = ({
|
|
12
22
|
children,
|
|
13
23
|
className,
|
|
14
24
|
ready,
|
|
15
25
|
style
|
|
16
26
|
}) => {
|
|
27
|
+
const {
|
|
28
|
+
classes,
|
|
29
|
+
cx
|
|
30
|
+
} = useStyles();
|
|
17
31
|
if (!ready) {
|
|
18
32
|
return /*#__PURE__*/_jsx("div", {
|
|
19
33
|
style: style,
|
|
20
|
-
className:
|
|
34
|
+
className: cx(classes.label, className, 'ui-shared__placeholder-label')
|
|
21
35
|
});
|
|
22
36
|
}
|
|
23
37
|
return children;
|
package/Price/index.js
CHANGED
|
@@ -1,11 +1,29 @@
|
|
|
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 classNames from 'classnames';
|
|
5
4
|
import { I18n } from '@shopgate/engage/components';
|
|
5
|
+
import { i18n } from '@shopgate/engage/core/helpers';
|
|
6
|
+
import { makeStyles } from '@shopgate/engage/styles';
|
|
6
7
|
import showTaxDisclaimer from '@shopgate/pwa-common-commerce/market/helpers/showTaxDisclaimer';
|
|
7
8
|
import { useWidgetSettings } from '@shopgate/engage/core/hooks/useWidgetSettings';
|
|
8
|
-
import
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
const useStyles = makeStyles()({
|
|
11
|
+
container: {
|
|
12
|
+
display: 'flex',
|
|
13
|
+
position: 'relative',
|
|
14
|
+
whiteSpace: 'nowrap'
|
|
15
|
+
},
|
|
16
|
+
disclaimer: {
|
|
17
|
+
color: 'initial',
|
|
18
|
+
fontSize: 14,
|
|
19
|
+
position: 'absolute',
|
|
20
|
+
right: -10,
|
|
21
|
+
top: 0
|
|
22
|
+
},
|
|
23
|
+
discounted: {
|
|
24
|
+
color: 'var(--color-primary)'
|
|
25
|
+
}
|
|
26
|
+
});
|
|
9
27
|
|
|
10
28
|
/**
|
|
11
29
|
* The Price component
|
|
@@ -15,11 +33,13 @@ import styles from "./style";
|
|
|
15
33
|
* @param {number} props.unitPrice The price of the product
|
|
16
34
|
* @param {number} props.unitPriceMin The minimum price of possible child products
|
|
17
35
|
* @param {boolean} props.discounted Tells if the pice is discounted
|
|
18
|
-
* @param {Object} context The component context.
|
|
19
36
|
* @return {JSX.Element}
|
|
20
37
|
*/
|
|
21
|
-
|
|
22
|
-
const
|
|
38
|
+
const Price = props => {
|
|
39
|
+
const {
|
|
40
|
+
classes,
|
|
41
|
+
cx
|
|
42
|
+
} = useStyles();
|
|
23
43
|
// Added with PWA 6 - CCP-2372
|
|
24
44
|
const {
|
|
25
45
|
show,
|
|
@@ -28,13 +48,9 @@ const Price = (props, context) => {
|
|
|
28
48
|
|
|
29
49
|
// use widget setting if set to true/false, otherwise use market logic
|
|
30
50
|
const showDisclaimer = typeof show === 'boolean' ? show : showTaxDisclaimer;
|
|
31
|
-
const containerClasses =
|
|
32
|
-
[
|
|
51
|
+
const containerClasses = cx(classes.container, props.className, {
|
|
52
|
+
[classes.discounted]: props.discounted
|
|
33
53
|
}, 'price', props.discounted ? 'ui-shared__price-discounted' : 'ui-shared__price');
|
|
34
|
-
const {
|
|
35
|
-
__,
|
|
36
|
-
_p
|
|
37
|
-
} = context.i18n();
|
|
38
54
|
let ariaPrice;
|
|
39
55
|
const showFromPrice = useMemo(() => {
|
|
40
56
|
// unitPriceMin is falsy so we don't have a price range
|
|
@@ -43,11 +59,11 @@ const Price = (props, context) => {
|
|
|
43
59
|
return props.unitPriceMin !== props.unitPriceMax;
|
|
44
60
|
}, [props.unitPriceMax, props.unitPriceMin]);
|
|
45
61
|
if (showFromPrice) {
|
|
46
|
-
ariaPrice =
|
|
47
|
-
price:
|
|
62
|
+
ariaPrice = i18n.text('price.from', {
|
|
63
|
+
price: i18n.price(props.unitPriceMin, props.currency, props.fractions)
|
|
48
64
|
});
|
|
49
65
|
} else {
|
|
50
|
-
ariaPrice =
|
|
66
|
+
ariaPrice = i18n.price(props.unitPrice, props.currency, props.fractions);
|
|
51
67
|
}
|
|
52
68
|
ariaPrice = ariaPrice.replace('-', '\u2212');
|
|
53
69
|
|
|
@@ -86,19 +102,19 @@ const Price = (props, context) => {
|
|
|
86
102
|
className: containerClasses,
|
|
87
103
|
"data-test-id": `minPrice: ${props.unitPriceMin} price: ${props.unitPrice} currency: ${props.currency}`,
|
|
88
104
|
children: [/*#__PURE__*/_jsx("span", {
|
|
89
|
-
"aria-label":
|
|
105
|
+
"aria-label": i18n.text('price.label', {
|
|
90
106
|
price: ariaPrice
|
|
91
107
|
}),
|
|
92
108
|
children: priceContent
|
|
93
109
|
}), props.taxDisclaimer && showDisclaimer ? /*#__PURE__*/_jsxs("div", {
|
|
94
|
-
className:
|
|
110
|
+
className: classes.disclaimer,
|
|
95
111
|
children: [/*#__PURE__*/_jsx("span", {
|
|
96
112
|
"aria-hidden": true,
|
|
97
113
|
children: hint || '*'
|
|
98
114
|
}), /*#__PURE__*/_jsx("span", {
|
|
99
115
|
className: "sr-only",
|
|
100
|
-
"aria-label": hint ||
|
|
101
|
-
children:
|
|
116
|
+
"aria-label": hint || i18n.text('product.tax_disclaimer_aria'),
|
|
117
|
+
children: i18n.text('product.tax_disclaimer_aria')
|
|
102
118
|
})]
|
|
103
119
|
}) : null]
|
|
104
120
|
});
|
|
@@ -112,7 +128,4 @@ Price.defaultProps = {
|
|
|
112
128
|
taxDisclaimer: false,
|
|
113
129
|
allowFree: false
|
|
114
130
|
};
|
|
115
|
-
Price.contextTypes = {
|
|
116
|
-
i18n: PropTypes.func
|
|
117
|
-
};
|
|
118
131
|
export default Price;
|
package/PriceInfo/index.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
3
|
+
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
4
|
+
import { makeStyles } from '@shopgate/engage/styles';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const useStyles = makeStyles()({
|
|
7
|
+
root: {
|
|
8
|
+
color: themeConfig.colors.shade3
|
|
9
|
+
}
|
|
10
|
+
});
|
|
4
11
|
|
|
5
12
|
/**
|
|
6
13
|
* The price info component
|
|
@@ -9,17 +16,24 @@ import styles from "./style";
|
|
|
9
16
|
* @param {string} [props.className] CSS classes
|
|
10
17
|
* @return {JSX}
|
|
11
18
|
*/
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
19
|
const PriceInfo = ({
|
|
14
20
|
className,
|
|
15
21
|
text
|
|
16
|
-
}) =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
"
|
|
22
|
-
|
|
22
|
+
}) => {
|
|
23
|
+
const {
|
|
24
|
+
classes,
|
|
25
|
+
cx
|
|
26
|
+
} = useStyles();
|
|
27
|
+
return /*#__PURE__*/_jsx("div", {
|
|
28
|
+
className: cx(classes.root, className, 'ui-shared__price-info')
|
|
29
|
+
// eslint-disable-next-line react/no-danger
|
|
30
|
+
,
|
|
31
|
+
dangerouslySetInnerHTML: {
|
|
32
|
+
__html: text
|
|
33
|
+
},
|
|
34
|
+
"data-test-id": `priceInfo: ${text}`
|
|
35
|
+
});
|
|
36
|
+
};
|
|
23
37
|
PriceInfo.defaultProps = {
|
|
24
38
|
className: ''
|
|
25
39
|
};
|
package/PriceStriked/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { Component } from 'react';
|
|
1
|
+
import React, { useLayoutEffect, useRef, useState } from 'react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
|
-
import I18n from '@shopgate/
|
|
5
|
-
import
|
|
3
|
+
import { I18n } from '@shopgate/engage/components';
|
|
4
|
+
import { i18n } from '@shopgate/engage/core/helpers';
|
|
5
|
+
import { makeStyles } from '@shopgate/engage/styles';
|
|
6
|
+
import { themeColors } from '@shopgate/pwa-common/helpers/config';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Calculates the angle for the strike-through line
|
|
@@ -20,10 +21,33 @@ const calcAngle = element => {
|
|
|
20
21
|
const width = cloned.offsetWidth;
|
|
21
22
|
const height = cloned.offsetHeight;
|
|
22
23
|
document.body.removeChild(cloned);
|
|
23
|
-
|
|
24
|
-
// Calculate the correct angle for the strike-through line
|
|
25
24
|
return Math.round(90 - Math.atan(width / height) * (180 / Math.PI));
|
|
26
25
|
};
|
|
26
|
+
const useStyles = makeStyles()({
|
|
27
|
+
root: {
|
|
28
|
+
whiteSpace: 'nowrap',
|
|
29
|
+
color: themeColors.shade11,
|
|
30
|
+
'& span': {
|
|
31
|
+
position: 'relative',
|
|
32
|
+
'&::before': {
|
|
33
|
+
borderColor: 'currentColor',
|
|
34
|
+
content: '""',
|
|
35
|
+
position: 'absolute',
|
|
36
|
+
left: 0,
|
|
37
|
+
right: 0,
|
|
38
|
+
top: '50%'
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
strikeActive: {
|
|
43
|
+
'& span': {
|
|
44
|
+
'&::before': {
|
|
45
|
+
borderTop: '1px solid',
|
|
46
|
+
transform: 'rotate(calc(var(--price-strike-deg) * -1deg))'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
27
51
|
|
|
28
52
|
/**
|
|
29
53
|
* The price striked component
|
|
@@ -33,80 +57,46 @@ const calcAngle = element => {
|
|
|
33
57
|
* @param {string} [props.className] CSS classes
|
|
34
58
|
* @return {JSX}
|
|
35
59
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (_this.element) {
|
|
51
|
-
_this.angle = calcAngle(_this.element);
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
return false;
|
|
55
|
-
};
|
|
56
|
-
_this.angle = null;
|
|
57
|
-
_this.element = null;
|
|
58
|
-
return _this;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Updates the component one more time with the calculated angle
|
|
63
|
-
* based on the DOM element.
|
|
64
|
-
*/
|
|
65
|
-
_inheritsLoose(PriceStriked, _Component);
|
|
66
|
-
var _proto = PriceStriked.prototype;
|
|
67
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
68
|
-
if (this.setAngle()) {
|
|
69
|
-
this.forceUpdate();
|
|
60
|
+
const PriceStriked = ({
|
|
61
|
+
className,
|
|
62
|
+
currency,
|
|
63
|
+
value
|
|
64
|
+
}) => {
|
|
65
|
+
const {
|
|
66
|
+
classes,
|
|
67
|
+
cx
|
|
68
|
+
} = useStyles();
|
|
69
|
+
const [angle, setAngle] = useState(null);
|
|
70
|
+
const elementRef = useRef(null);
|
|
71
|
+
useLayoutEffect(() => {
|
|
72
|
+
if (elementRef.current) {
|
|
73
|
+
setAngle(calcAngle(elementRef.current));
|
|
70
74
|
}
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
children: /*#__PURE__*/_jsx("span", {
|
|
86
|
-
"aria-hidden": true,
|
|
87
|
-
ref: ref => {
|
|
88
|
-
this.element = ref;
|
|
89
|
-
},
|
|
90
|
-
"data-test-id": `strikedPrice: ${this.props.value}`,
|
|
91
|
-
children: /*#__PURE__*/_jsx(I18n.Price, {
|
|
92
|
-
price: this.props.value,
|
|
93
|
-
currency: this.props.currency
|
|
94
|
-
})
|
|
95
|
-
})
|
|
96
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
97
|
-
className: "sr-only",
|
|
98
|
-
children: __('price.label_old_price', {
|
|
99
|
-
price: _p(this.props.value, this.props.currency, true)
|
|
75
|
+
}, []);
|
|
76
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
77
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
78
|
+
className: cx(classes.root, angle != null && classes.strikeActive, className, 'price-striked', 'ui-shared__price-striked'),
|
|
79
|
+
style: angle != null ? {
|
|
80
|
+
'--price-strike-deg': angle
|
|
81
|
+
} : undefined,
|
|
82
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
83
|
+
"aria-hidden": true,
|
|
84
|
+
ref: elementRef,
|
|
85
|
+
"data-test-id": `strikedPrice: ${value}`,
|
|
86
|
+
children: /*#__PURE__*/_jsx(I18n.Price, {
|
|
87
|
+
price: value,
|
|
88
|
+
currency: currency
|
|
100
89
|
})
|
|
101
|
-
})
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
90
|
+
})
|
|
91
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
92
|
+
className: "sr-only",
|
|
93
|
+
children: i18n.text('price.label_old_price', {
|
|
94
|
+
price: i18n.price(value, currency, true)
|
|
95
|
+
})
|
|
96
|
+
})]
|
|
97
|
+
});
|
|
98
|
+
};
|
|
106
99
|
PriceStriked.defaultProps = {
|
|
107
100
|
className: ''
|
|
108
101
|
};
|
|
109
|
-
PriceStriked.contextTypes = {
|
|
110
|
-
i18n: PropTypes.func
|
|
111
|
-
};
|
|
112
102
|
export default PriceStriked;
|