@shopgate/pwa-ui-shared 7.30.0-alpha.10 → 7.30.0-alpha.11
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/AccordionContainer/index.js +17 -11
- package/AccordionContainer/spec.js +12 -3
- package/ActionButton/index.js +47 -33
- package/ActionButton/spec.js +5 -1
- package/AddToCartButton/index.js +44 -33
- package/AddToCartButton/mock.js +20 -8
- package/AddToCartButton/spec.js +4 -3
- package/Availability/index.js +5 -3
- package/Availability/spec.js +6 -5
- package/Button/index.js +73 -58
- package/Button/spec.js +16 -10
- package/ButtonLink/index.js +20 -12
- package/ButtonLink/spec.js +5 -3
- package/Card/index.js +5 -3
- package/CardList/components/Item/index.js +5 -3
- package/CardList/index.js +21 -12
- package/CartTotalLine/components/Amount/index.js +10 -8
- package/CartTotalLine/components/Hint/index.js +7 -5
- package/CartTotalLine/components/Label/index.js +12 -10
- package/CartTotalLine/components/Spacer/index.js +5 -3
- package/CartTotalLine/index.js +5 -3
- package/Checkbox/index.js +6 -5
- package/Chip/index.js +28 -22
- package/Chip/spec.js +9 -6
- package/ContextMenu/ContextMenuProvider.js +5 -3
- package/ContextMenu/components/Item/index.js +14 -11
- package/ContextMenu/components/Position/index.js +20 -12
- package/ContextMenu/index.js +54 -44
- package/ContextMenu/spec.js +31 -20
- package/Dialog/components/HtmlContentDialog/index.js +9 -7
- package/Dialog/components/HtmlContentDialog/spec.js +9 -6
- package/Dialog/components/PipelineErrorDialog/index.js +106 -47
- package/Dialog/components/PipelineErrorDialog/spec.js +5 -4
- package/Dialog/components/TextMessageDialog/index.js +9 -7
- package/Dialog/components/TextMessageDialog/spec.js +9 -6
- package/Dialog/components/VariantSelectModal/index.js +7 -5
- package/Dialog/components/VariantSelectModal/spec.js +6 -3
- package/Dialog/index.js +12 -8
- package/Dialog/spec.js +7 -6
- package/DiscountBadge/index.js +10 -8
- package/DiscountBadge/spec.js +3 -2
- package/FavoritesButton/index.js +40 -31
- package/FavoritesButton/spec.js +7 -3
- package/Form/Builder/classes/ActionListener/index.js +400 -401
- package/Form/Builder/components/CheckboxElement.js +13 -5
- package/Form/Builder/components/CountryElement.js +13 -5
- package/Form/Builder/components/ProvinceElement.js +13 -5
- package/Form/Builder/components/RadioElement.js +19 -11
- package/Form/Builder/components/SelectElement.js +26 -16
- package/Form/Builder/components/TextElement.js +13 -5
- package/Form/Builder/index.js +70 -60
- package/Form/Builder/spec.js +10 -9
- package/Form/Checkbox/index.js +31 -21
- package/Form/InfoField/index.js +19 -12
- package/Form/InfoField/spec.js +4 -1
- package/Form/Password/index.js +22 -15
- package/Form/Password/spec.js +10 -5
- package/Form/RadioGroup/components/Item/index.js +34 -25
- package/Form/RadioGroup/index.js +37 -28
- package/Form/RadioGroup/spec.js +45 -31
- package/Form/Select/index.js +52 -43
- package/Form/Select/spec.js +5 -2
- package/Form/SelectContextChoices/index.js +26 -22
- package/Form/SelectContextChoices/spec.js +4 -1
- package/Form/TextField/index.js +40 -27
- package/Form/TextField/spec.js +34 -21
- package/Form/index.js +23 -15
- package/FormElement/components/ErrorText/index.js +7 -5
- package/FormElement/components/Label/index.js +6 -4
- package/FormElement/components/Placeholder/index.js +7 -5
- package/FormElement/components/Underline/index.js +8 -6
- package/FormElement/index.js +62 -46
- package/FormElement/spec.js +10 -9
- package/Glow/index.js +30 -22
- package/Glow/spec.js +6 -1
- package/IndicatorCircle/index.js +10 -8
- package/IndicatorCircle/spec.js +3 -2
- package/LoadingIndicator/index.js +8 -6
- package/Manufacturer/index.js +9 -7
- package/MessageBar/index.js +20 -17
- package/MessageBar/spec.js +6 -5
- package/NoResults/components/Icon/index.js +134 -110
- package/NoResults/index.js +27 -21
- package/Placeholder/index.js +13 -5
- package/PlaceholderLabel/index.js +2 -1
- package/PlaceholderLabel/spec.js +13 -6
- package/PlaceholderParagraph/index.js +13 -12
- package/PlaceholderParagraph/spec.js +13 -6
- package/Price/index.js +46 -28
- package/PriceInfo/index.js +2 -1
- package/PriceStriked/index.js +41 -29
- package/ProductProperties/index.js +13 -10
- package/ProgressBar/index.js +28 -19
- package/ProgressBar/spec.js +2 -1
- package/RadioButton/index.js +6 -5
- package/RadioButton/spec.js +3 -2
- package/RatingNumber/index.js +2 -1
- package/RatingStars/index.js +50 -34
- package/RatingStars/spec.js +7 -6
- package/Ripple/components/RippleAnimation/index.js +12 -10
- package/Ripple/index.js +72 -62
- package/RippleButton/index.js +44 -27
- package/RippleButton/spec.js +20 -13
- package/ScannerOverlay/components/CameraOverlay/index.js +8 -5
- package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/index.js +25 -21
- package/ScannerOverlay/components/ScannerBar/components/ScannerInstructions/index.js +7 -5
- package/ScannerOverlay/components/ScannerBar/index.js +17 -12
- package/ScannerOverlay/index.js +24 -15
- package/Sheet/components/Header/components/SearchBar/index.js +35 -28
- package/Sheet/components/Header/components/SearchBar/spec.js +2 -1
- package/Sheet/components/Header/index.js +47 -34
- package/Sheet/components/Header/spec.js +2 -1
- package/Sheet/index.js +80 -65
- package/Sheet/spec.js +27 -14
- package/TaxDisclaimer/index.js +13 -10
- package/TaxDisclaimer/spec.js +3 -2
- package/TextField/components/ErrorText/index.js +7 -5
- package/TextField/components/FormElement/index.js +4 -3
- package/TextField/components/Hint/index.js +7 -5
- package/TextField/components/Label/index.js +6 -4
- package/TextField/components/Underline/index.js +8 -6
- package/TextField/index.js +102 -85
- package/TextField/spec.js +37 -23
- package/ToggleIcon/index.js +23 -15
- package/ToggleIcon/spec.js +12 -8
- package/icons/AccountBoxIcon.js +5 -4
- package/icons/AddMoreIcon.js +5 -4
- package/icons/ArrowDropIcon.js +5 -4
- package/icons/ArrowIcon.js +5 -4
- package/icons/BarcodeScannerIcon.js +5 -4
- package/icons/BoxIcon.js +5 -4
- package/icons/BrowseIcon.js +5 -4
- package/icons/BurgerIcon.js +5 -4
- package/icons/CalendarIcon.js +5 -5
- package/icons/CartCouponIcon.js +5 -4
- package/icons/CartIcon.js +5 -4
- package/icons/CartPlusIcon.js +5 -4
- package/icons/CheckIcon.js +5 -4
- package/icons/CheckedIcon.js +5 -4
- package/icons/ChevronIcon.js +5 -4
- package/icons/CreditCardIcon.js +5 -4
- package/icons/CrossIcon.js +5 -4
- package/icons/DescriptionIcon.js +5 -4
- package/icons/FilterIcon.js +5 -4
- package/icons/FlashDisabledIcon.js +5 -4
- package/icons/FlashEnabledIcon.js +5 -4
- package/icons/GridIcon.js +5 -4
- package/icons/HeartIcon.js +5 -4
- package/icons/HeartOutlineIcon.js +5 -4
- package/icons/HeartPlusIcon.js +5 -4
- package/icons/HeartPlusOutlineIcon.js +5 -4
- package/icons/HomeIcon.js +5 -4
- package/icons/InfoIcon.js +5 -4
- package/icons/InfoOutlineIcon.js +5 -4
- package/icons/ListIcon.js +5 -4
- package/icons/LocalShippingIcon.js +5 -4
- package/icons/LocationIcon.js +5 -4
- package/icons/LocatorIcon.js +5 -4
- package/icons/LockIcon.js +5 -4
- package/icons/LogoutIcon.js +5 -4
- package/icons/MagnifierIcon.js +5 -4
- package/icons/MapMarkerIcon.js +5 -4
- package/icons/MoreIcon.js +5 -4
- package/icons/MoreVertIcon.js +5 -4
- package/icons/NotificationIcon.js +5 -4
- package/icons/PersonIcon.js +5 -4
- package/icons/PhoneIcon.js +5 -4
- package/icons/PlaceholderIcon.js +5 -4
- package/icons/RadioCheckedIcon.js +5 -4
- package/icons/RadioUncheckedIcon.js +5 -4
- package/icons/SecurityIcon.js +5 -4
- package/icons/ShippingMethodIcon.js +5 -4
- package/icons/ShoppingCartIcon.js +5 -4
- package/icons/SortIcon.js +5 -4
- package/icons/StarHalfIcon.js +5 -4
- package/icons/StarIcon.js +5 -4
- package/icons/StarOutlineIcon.js +5 -4
- package/icons/StopIcon.js +5 -4
- package/icons/TickIcon.js +5 -4
- package/icons/TimeIcon.js +5 -4
- package/icons/TrashIcon.js +5 -4
- package/icons/TrashOutlineIcon.js +5 -4
- package/icons/UncheckedIcon.js +5 -4
- package/icons/ViewListIcon.js +5 -4
- package/icons/VisibilityIcon.js +5 -4
- package/icons/VisibilityOffIcon.js +5 -4
- package/icons/WarningIcon.js +5 -4
- package/package.json +7 -8
|
@@ -8,124 +8,148 @@ import styles from "./style";
|
|
|
8
8
|
* @param {Object} props Props of the component
|
|
9
9
|
* @returns {JSX}
|
|
10
10
|
*/
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
const NoResultIcon = props => {
|
|
12
13
|
const filterId = useMemo(() => {
|
|
13
14
|
const prefix = 'no-search-results-shadow';
|
|
14
15
|
const hash = CryptoJs.MD5(`${prefix}-${Date.now() + Math.random()}`).toString();
|
|
15
16
|
return `${prefix}-${hash}`;
|
|
16
17
|
}, []);
|
|
17
|
-
return /*#__PURE__*/
|
|
18
|
+
return /*#__PURE__*/_jsxs("svg", {
|
|
18
19
|
className: props.className,
|
|
19
20
|
viewBox: "-2698 6977 216 216",
|
|
20
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
+
children: [/*#__PURE__*/_jsx("defs", {
|
|
23
|
+
children: /*#__PURE__*/_jsxs("filter", {
|
|
24
|
+
id: filterId,
|
|
25
|
+
height: "130%",
|
|
26
|
+
children: [/*#__PURE__*/_jsx("feGaussianBlur", {
|
|
27
|
+
in: "SourceAlpha",
|
|
28
|
+
stdDeviation: "3"
|
|
29
|
+
}), /*#__PURE__*/_jsx("feOffset", {
|
|
30
|
+
dx: "2",
|
|
31
|
+
dy: "2",
|
|
32
|
+
result: "offsetblur"
|
|
33
|
+
}), /*#__PURE__*/_jsx("feComponentTransfer", {
|
|
34
|
+
children: /*#__PURE__*/_jsx("feFuncA", {
|
|
35
|
+
type: "linear",
|
|
36
|
+
slope: "0.1"
|
|
37
|
+
})
|
|
38
|
+
}), /*#__PURE__*/_jsxs("feMerge", {
|
|
39
|
+
children: [/*#__PURE__*/_jsx("feMergeNode", {}), /*#__PURE__*/_jsx("feMergeNode", {
|
|
40
|
+
in: "SourceGraphic"
|
|
41
|
+
})]
|
|
42
|
+
})]
|
|
43
|
+
})
|
|
44
|
+
}), /*#__PURE__*/_jsxs("g", {
|
|
45
|
+
transform: "translate(-2770 6819)",
|
|
46
|
+
children: [/*#__PURE__*/_jsx("g", {
|
|
47
|
+
transform: "translate(0 46)",
|
|
48
|
+
children: /*#__PURE__*/_jsx("circle", {
|
|
49
|
+
className: styles.background,
|
|
50
|
+
cx: "104",
|
|
51
|
+
cy: "104",
|
|
52
|
+
r: "104",
|
|
53
|
+
transform: "translate(76 116)"
|
|
54
|
+
})
|
|
55
|
+
}), /*#__PURE__*/_jsx("g", {
|
|
56
|
+
transform: "translate(-4 42)",
|
|
57
|
+
children: /*#__PURE__*/_jsx("circle", {
|
|
58
|
+
className: styles.background,
|
|
59
|
+
cx: "108",
|
|
60
|
+
cy: "108",
|
|
61
|
+
r: "108",
|
|
62
|
+
transform: "translate(76 116)"
|
|
63
|
+
})
|
|
64
|
+
}), /*#__PURE__*/_jsxs("g", {
|
|
65
|
+
children: [/*#__PURE__*/_jsx("circle", {
|
|
66
|
+
className: styles.circle,
|
|
67
|
+
cx: "104",
|
|
68
|
+
cy: "104",
|
|
69
|
+
r: "104",
|
|
70
|
+
transform: "translate(76 162)"
|
|
71
|
+
}), /*#__PURE__*/_jsx("circle", {
|
|
72
|
+
className: styles.circle,
|
|
73
|
+
cx: "92",
|
|
74
|
+
cy: "92",
|
|
75
|
+
r: "92",
|
|
76
|
+
transform: "translate(88 174)"
|
|
77
|
+
}), /*#__PURE__*/_jsx("circle", {
|
|
78
|
+
className: styles.circle,
|
|
79
|
+
cx: "80",
|
|
80
|
+
cy: "80",
|
|
81
|
+
r: "80",
|
|
82
|
+
transform: "translate(100 186)"
|
|
83
|
+
})]
|
|
84
|
+
}), /*#__PURE__*/_jsx("g", {
|
|
85
|
+
name: "cloud",
|
|
86
|
+
filter: `url(#${filterId})`,
|
|
87
|
+
transform: "translate(83.6 235.124)",
|
|
88
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
89
|
+
transform: "matrix(1, 0, 0, 1, 2686.4, -7054.12)",
|
|
90
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
91
|
+
className: styles.background,
|
|
92
|
+
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
|
+
transform: "translate(-2686.4 7054.12)"
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
}), /*#__PURE__*/_jsxs("g", {
|
|
97
|
+
name: "magnifier",
|
|
98
|
+
filter: `url(#${filterId})`,
|
|
99
|
+
children: [/*#__PURE__*/_jsx("g", {
|
|
100
|
+
transform: "matrix(1, 0, 0, 1, 2770, -6819)",
|
|
101
|
+
children: /*#__PURE__*/_jsx("rect", {
|
|
102
|
+
className: styles.magnifier,
|
|
103
|
+
width: "13.003",
|
|
104
|
+
height: "3.855",
|
|
105
|
+
transform: "matrix(0.53, 0.85, -0.85, 0.53, -2613.92, 7029.38)"
|
|
106
|
+
})
|
|
107
|
+
}), /*#__PURE__*/_jsx("g", {
|
|
108
|
+
transform: "matrix(1, 0, 0, 1, 2770, -6819)",
|
|
109
|
+
children: /*#__PURE__*/_jsx("rect", {
|
|
110
|
+
className: styles.magnifier,
|
|
111
|
+
width: "3.855",
|
|
112
|
+
height: "13.003",
|
|
113
|
+
transform: "translate(-2566.07 7029.56) rotate(37.01)"
|
|
114
|
+
})
|
|
115
|
+
}), /*#__PURE__*/_jsx("g", {
|
|
116
|
+
transform: "matrix(1, 0, 0, 1, 2770, -6819)",
|
|
117
|
+
children: /*#__PURE__*/_jsx("rect", {
|
|
118
|
+
className: styles.magnifier,
|
|
119
|
+
width: "3.856",
|
|
120
|
+
height: "13.002",
|
|
121
|
+
transform: "translate(-2592.67 7023)"
|
|
122
|
+
})
|
|
123
|
+
}), /*#__PURE__*/_jsx("circle", {
|
|
124
|
+
className: styles.background,
|
|
125
|
+
cx: "34",
|
|
126
|
+
cy: "34",
|
|
127
|
+
r: "34",
|
|
128
|
+
transform: "translate(147 223)"
|
|
129
|
+
}), /*#__PURE__*/_jsx("g", {
|
|
130
|
+
transform: "translate(136 -7)",
|
|
131
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
132
|
+
transform: "translate(10.699 229.942)",
|
|
133
|
+
children: /*#__PURE__*/_jsxs("g", {
|
|
134
|
+
transform: "translate(0 0)",
|
|
135
|
+
children: [/*#__PURE__*/_jsx("g", {
|
|
136
|
+
transform: "matrix(1, 0, 0, 1, 2623.3, -7041.94)",
|
|
137
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
138
|
+
className: styles.magnifier,
|
|
139
|
+
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
|
+
transform: "translate(-2648.22 7018.1)"
|
|
141
|
+
})
|
|
142
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
143
|
+
className: styles.magnifier,
|
|
144
|
+
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
|
+
transform: "translate(-59.748 -38.701)"
|
|
146
|
+
})]
|
|
147
|
+
})
|
|
148
|
+
})
|
|
149
|
+
})]
|
|
150
|
+
})]
|
|
151
|
+
})]
|
|
152
|
+
});
|
|
129
153
|
};
|
|
130
154
|
NoResultIcon.defaultProps = {
|
|
131
155
|
className: ''
|
package/NoResults/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
|
6
6
|
import { svgToDataUrl } from '@shopgate/engage/core';
|
|
7
7
|
import Icon from "./components/Icon";
|
|
8
8
|
import styles from "./style";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
10
|
const {
|
|
10
11
|
svgImages = {}
|
|
11
12
|
} = themeConfig || {};
|
|
@@ -20,28 +21,33 @@ const {
|
|
|
20
21
|
*/
|
|
21
22
|
const NoResults = props => {
|
|
22
23
|
const imageSRC = useMemo(() => svgToDataUrl(noResultsImage), []);
|
|
23
|
-
return /*#__PURE__*/
|
|
24
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
24
25
|
className: classNames(styles.wrapper, props.className, ' ui-shared__no-results'),
|
|
25
|
-
"data-test-id": "noResults"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
26
|
+
"data-test-id": "noResults",
|
|
27
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
28
|
+
className: classNames(styles.icon, 'no-results__image'),
|
|
29
|
+
children: noResultsImage ? /*#__PURE__*/_jsx("img", {
|
|
30
|
+
src: imageSRC,
|
|
31
|
+
alt: ""
|
|
32
|
+
}) : /*#__PURE__*/_jsx(Icon, {})
|
|
33
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
34
|
+
role: "alert",
|
|
35
|
+
"aria-atomic": "true",
|
|
36
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
37
|
+
className: styles.headline,
|
|
38
|
+
children: /*#__PURE__*/_jsx(I18n.Text, {
|
|
39
|
+
string: props.headlineText,
|
|
40
|
+
params: props
|
|
41
|
+
})
|
|
42
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
43
|
+
className: styles.text,
|
|
44
|
+
children: /*#__PURE__*/_jsx(I18n.Text, {
|
|
45
|
+
string: props.bodyText,
|
|
46
|
+
params: props
|
|
47
|
+
})
|
|
48
|
+
})]
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
45
51
|
};
|
|
46
52
|
NoResults.defaultProps = {
|
|
47
53
|
className: null
|
package/Placeholder/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
1
2
|
import React, { PureComponent } from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import styles from "./style";
|
|
@@ -5,17 +6,24 @@ import styles from "./style";
|
|
|
5
6
|
/**
|
|
6
7
|
* The placeholder component.
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
let Placeholder = /*#__PURE__*/function (_PureComponent) {
|
|
11
|
+
function Placeholder() {
|
|
12
|
+
return _PureComponent.apply(this, arguments) || this;
|
|
13
|
+
}
|
|
14
|
+
_inheritsLoose(Placeholder, _PureComponent);
|
|
15
|
+
var _proto = Placeholder.prototype;
|
|
9
16
|
/**
|
|
10
17
|
* @returns {JSX}
|
|
11
18
|
*/
|
|
12
|
-
render() {
|
|
13
|
-
return /*#__PURE__*/
|
|
19
|
+
_proto.render = function render() {
|
|
20
|
+
return /*#__PURE__*/_jsx("div", {
|
|
14
21
|
className: `${styles} ui-shared__placeholder`,
|
|
15
22
|
style: this.props
|
|
16
23
|
});
|
|
17
|
-
}
|
|
18
|
-
|
|
24
|
+
};
|
|
25
|
+
return Placeholder;
|
|
26
|
+
}(PureComponent);
|
|
19
27
|
/* eslint-disable react/no-unused-prop-types */
|
|
20
28
|
/* eslint-enable react/no-unused-prop-types */
|
|
21
29
|
Placeholder.defaultProps = {
|
|
@@ -7,6 +7,7 @@ import styles from "./style";
|
|
|
7
7
|
* @param {Object} props The component props.
|
|
8
8
|
* @return {JSX}
|
|
9
9
|
*/
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
const PlaceholderLabel = ({
|
|
11
12
|
children,
|
|
12
13
|
className,
|
|
@@ -14,7 +15,7 @@ const PlaceholderLabel = ({
|
|
|
14
15
|
style
|
|
15
16
|
}) => {
|
|
16
17
|
if (!ready) {
|
|
17
|
-
return /*#__PURE__*/
|
|
18
|
+
return /*#__PURE__*/_jsx("div", {
|
|
18
19
|
style: style,
|
|
19
20
|
className: `${styles.label} ${className} ui-shared__placeholder-label`
|
|
20
21
|
});
|
package/PlaceholderLabel/spec.js
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { mount } from 'enzyme';
|
|
3
3
|
import PlaceholderLabel from "./index";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
describe('<PlaceholderLabel />', () => {
|
|
5
6
|
it('should render placeholder ', () => {
|
|
6
|
-
const wrapper = mount(/*#__PURE__*/
|
|
7
|
-
ready: false
|
|
8
|
-
|
|
7
|
+
const wrapper = mount(/*#__PURE__*/_jsx(PlaceholderLabel, {
|
|
8
|
+
ready: false,
|
|
9
|
+
children: /*#__PURE__*/_jsx("h1", {
|
|
10
|
+
children: "foo"
|
|
11
|
+
})
|
|
12
|
+
}));
|
|
9
13
|
expect(wrapper).toMatchSnapshot();
|
|
10
14
|
expect(wrapper.find('h1').length).toEqual(0);
|
|
11
15
|
});
|
|
12
16
|
it('should render children', () => {
|
|
13
|
-
const wrapper = mount(/*#__PURE__*/
|
|
14
|
-
ready: true
|
|
15
|
-
|
|
17
|
+
const wrapper = mount(/*#__PURE__*/_jsx(PlaceholderLabel, {
|
|
18
|
+
ready: true,
|
|
19
|
+
children: /*#__PURE__*/_jsx("h1", {
|
|
20
|
+
children: "foo"
|
|
21
|
+
})
|
|
22
|
+
}));
|
|
16
23
|
expect(wrapper).toMatchSnapshot();
|
|
17
24
|
expect(wrapper.find('h1').length).toEqual(1);
|
|
18
25
|
});
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import range from 'lodash/range';
|
|
4
4
|
import PlaceholderLabel from "../PlaceholderLabel";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
const widths = [95, 100, 92, 88, 96, 93, 96, 48];
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -19,18 +20,18 @@ const PlaceholderParagraph = ({
|
|
|
19
20
|
if (ready) {
|
|
20
21
|
return children;
|
|
21
22
|
}
|
|
22
|
-
return /*#__PURE__*/
|
|
23
|
-
className: "ui-shared__placeholder-paragraph"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
})
|
|
33
|
-
})
|
|
23
|
+
return /*#__PURE__*/_jsx("div", {
|
|
24
|
+
className: "ui-shared__placeholder-paragraph",
|
|
25
|
+
children: range(lines).map(num => {
|
|
26
|
+
const width = num % 2 === 0 ? `${widths[(num / 2 + widths.length) % widths.length]}%` : null;
|
|
27
|
+
return /*#__PURE__*/_jsx(PlaceholderLabel, {
|
|
28
|
+
style: width ? {
|
|
29
|
+
width
|
|
30
|
+
} : null,
|
|
31
|
+
className: className
|
|
32
|
+
}, num);
|
|
33
|
+
})
|
|
34
|
+
});
|
|
34
35
|
};
|
|
35
36
|
PlaceholderParagraph.defaultProps = {
|
|
36
37
|
className: '',
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { mount } from 'enzyme';
|
|
3
3
|
import PlaceholderParagraph from "./index";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
describe('<PlaceholderParagraph />', () => {
|
|
5
6
|
it('should render placeholder ', () => {
|
|
6
|
-
const wrapper = mount(/*#__PURE__*/
|
|
7
|
-
ready: false
|
|
8
|
-
|
|
7
|
+
const wrapper = mount(/*#__PURE__*/_jsx(PlaceholderParagraph, {
|
|
8
|
+
ready: false,
|
|
9
|
+
children: /*#__PURE__*/_jsx("h1", {
|
|
10
|
+
children: "foo"
|
|
11
|
+
})
|
|
12
|
+
}));
|
|
9
13
|
expect(wrapper).toMatchSnapshot();
|
|
10
14
|
expect(wrapper.find('h1').length).toEqual(0);
|
|
11
15
|
});
|
|
12
16
|
it('should render children', () => {
|
|
13
|
-
const wrapper = mount(/*#__PURE__*/
|
|
14
|
-
ready: true
|
|
15
|
-
|
|
17
|
+
const wrapper = mount(/*#__PURE__*/_jsx(PlaceholderParagraph, {
|
|
18
|
+
ready: true,
|
|
19
|
+
children: /*#__PURE__*/_jsx("h1", {
|
|
20
|
+
children: "foo"
|
|
21
|
+
})
|
|
22
|
+
}));
|
|
16
23
|
expect(wrapper).toMatchSnapshot();
|
|
17
24
|
expect(wrapper.find('h1').length).toEqual(1);
|
|
18
25
|
});
|
package/Price/index.js
CHANGED
|
@@ -18,6 +18,7 @@ import styles from "./style";
|
|
|
18
18
|
* @param {Object} context The component context.
|
|
19
19
|
* @return {JSX.Element}
|
|
20
20
|
*/
|
|
21
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
22
|
const Price = (props, context) => {
|
|
22
23
|
// Added with PWA 6 - CCP-2372
|
|
23
24
|
const {
|
|
@@ -55,35 +56,52 @@ const Price = (props, context) => {
|
|
|
55
56
|
* The unitPriceMin contains the lowest of these prices and will be
|
|
56
57
|
* displayed with a 'From' prefix.
|
|
57
58
|
*/
|
|
58
|
-
|
|
59
|
+
const priceContent = useMemo(() => {
|
|
60
|
+
let result = null;
|
|
61
|
+
if (showFromPrice) {
|
|
62
|
+
result = /*#__PURE__*/_jsx(I18n.Text, {
|
|
63
|
+
"aria-hidden": true,
|
|
64
|
+
string: "price.from",
|
|
65
|
+
children: /*#__PURE__*/_jsx(I18n.Price, {
|
|
66
|
+
currency: props.currency,
|
|
67
|
+
fractions: props.fractions,
|
|
68
|
+
forKey: "price",
|
|
69
|
+
price: props.unitPriceMin
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
} else if (props.allowFree && props.unitPrice === 0) {
|
|
73
|
+
result = /*#__PURE__*/_jsx(I18n.Text, {
|
|
74
|
+
string: "price.free"
|
|
75
|
+
});
|
|
76
|
+
} else {
|
|
77
|
+
result = /*#__PURE__*/_jsx(I18n.Price, {
|
|
78
|
+
currency: props.currency,
|
|
79
|
+
fractions: props.fractions,
|
|
80
|
+
price: props.unitPrice
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
}, [props.allowFree, props.currency, props.fractions, props.unitPrice, props.unitPriceMin, showFromPrice]);
|
|
85
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
59
86
|
className: containerClasses,
|
|
60
|
-
"data-test-id": `minPrice: ${props.unitPriceMin} price: ${props.unitPrice} currency: ${props.currency}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
price: props.unitPrice
|
|
79
|
-
}))), props.taxDisclaimer && showDisclaimer ? /*#__PURE__*/React.createElement("div", {
|
|
80
|
-
className: styles.disclaimer
|
|
81
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
82
|
-
"aria-hidden": true
|
|
83
|
-
}, hint || '*'), /*#__PURE__*/React.createElement("span", {
|
|
84
|
-
className: "sr-only",
|
|
85
|
-
"aria-label": hint || __('product.tax_disclaimer_aria')
|
|
86
|
-
}, __('product.tax_disclaimer_aria'))) : null);
|
|
87
|
+
"data-test-id": `minPrice: ${props.unitPriceMin} price: ${props.unitPrice} currency: ${props.currency}`,
|
|
88
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
89
|
+
"aria-label": __('price.label', {
|
|
90
|
+
price: ariaPrice
|
|
91
|
+
}),
|
|
92
|
+
children: priceContent
|
|
93
|
+
}), props.taxDisclaimer && showDisclaimer ? /*#__PURE__*/_jsxs("div", {
|
|
94
|
+
className: styles.disclaimer,
|
|
95
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
96
|
+
"aria-hidden": true,
|
|
97
|
+
children: hint || '*'
|
|
98
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
99
|
+
className: "sr-only",
|
|
100
|
+
"aria-label": hint || __('product.tax_disclaimer_aria'),
|
|
101
|
+
children: __('product.tax_disclaimer_aria')
|
|
102
|
+
})]
|
|
103
|
+
}) : null]
|
|
104
|
+
});
|
|
87
105
|
};
|
|
88
106
|
Price.defaultProps = {
|
|
89
107
|
className: '',
|
package/PriceInfo/index.js
CHANGED
|
@@ -9,10 +9,11 @@ import styles from "./style";
|
|
|
9
9
|
* @param {string} [props.className] CSS classes
|
|
10
10
|
* @return {JSX}
|
|
11
11
|
*/
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
13
|
const PriceInfo = ({
|
|
13
14
|
className,
|
|
14
15
|
text
|
|
15
|
-
}) => /*#__PURE__*/
|
|
16
|
+
}) => /*#__PURE__*/_jsx("div", {
|
|
16
17
|
className: `${styles} ${className} ui-shared__price-info`,
|
|
17
18
|
dangerouslySetInnerHTML: {
|
|
18
19
|
__html: text
|