@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
package/ActionButton/index.js
CHANGED
|
@@ -1,80 +1,78 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
3
|
-
import React, { Component } from 'react';
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
4
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { makeStyles, cx } from '@shopgate/engage/styles';
|
|
5
4
|
import IndicatorCircle from "../IndicatorCircle";
|
|
6
5
|
import RippleButton from "../RippleButton";
|
|
7
|
-
import
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const useStyles = makeStyles()(theme => ({
|
|
8
|
+
withGap: {
|
|
9
|
+
textAlign: 'center',
|
|
10
|
+
margin: theme.spacing(1, 0)
|
|
11
|
+
},
|
|
12
|
+
noGap: {
|
|
13
|
+
textAlign: 'center'
|
|
14
|
+
},
|
|
15
|
+
containerCircle: {
|
|
16
|
+
textAlign: 'center',
|
|
17
|
+
margin: `${theme.spacing(1) + 5}px 0`
|
|
18
|
+
}
|
|
19
|
+
}));
|
|
20
|
+
const CLICK_DELAY = 300;
|
|
8
21
|
|
|
9
22
|
/**
|
|
10
23
|
* The action button component.
|
|
24
|
+
* @param {Object} props Props.
|
|
25
|
+
* @returns {JSX.Element}
|
|
11
26
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
return _this;
|
|
34
|
-
}
|
|
35
|
-
_inheritsLoose(ActionButton, _Component);
|
|
36
|
-
var _proto = ActionButton.prototype;
|
|
37
|
-
/**
|
|
38
|
-
* The render function.
|
|
39
|
-
* @returns {JSX}
|
|
40
|
-
*/
|
|
41
|
-
_proto.render = function render() {
|
|
42
|
-
const containerClass = this.props.noGap ? styles.noGapContainer : styles.container;
|
|
43
|
-
if (this.props.loading) {
|
|
44
|
-
return /*#__PURE__*/_jsx("div", {
|
|
45
|
-
className: styles.containerCircle,
|
|
46
|
-
children: /*#__PURE__*/_jsx(IndicatorCircle, {})
|
|
47
|
-
});
|
|
27
|
+
const ActionButton = ({
|
|
28
|
+
children,
|
|
29
|
+
className,
|
|
30
|
+
disabled,
|
|
31
|
+
flat,
|
|
32
|
+
type,
|
|
33
|
+
onClick,
|
|
34
|
+
disableClickDelay,
|
|
35
|
+
loading,
|
|
36
|
+
noGap,
|
|
37
|
+
testId,
|
|
38
|
+
...rest
|
|
39
|
+
}) => {
|
|
40
|
+
const {
|
|
41
|
+
classes
|
|
42
|
+
} = useStyles();
|
|
43
|
+
const handleClick = useCallback(event => {
|
|
44
|
+
if (disableClickDelay) {
|
|
45
|
+
onClick(event);
|
|
46
|
+
return;
|
|
48
47
|
}
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
onClick(event);
|
|
50
|
+
}, CLICK_DELAY);
|
|
51
|
+
}, [disableClickDelay, onClick]);
|
|
52
|
+
const buttonProps = {
|
|
53
|
+
className,
|
|
54
|
+
disabled,
|
|
55
|
+
flat,
|
|
56
|
+
type
|
|
57
|
+
};
|
|
58
|
+
if (loading) {
|
|
49
59
|
return /*#__PURE__*/_jsx("div", {
|
|
50
|
-
className:
|
|
51
|
-
|
|
52
|
-
children: /*#__PURE__*/_jsx(RippleButton, {
|
|
53
|
-
...this.buttonProps,
|
|
54
|
-
onClick: this.handleClick,
|
|
55
|
-
children: this.props.children
|
|
56
|
-
})
|
|
60
|
+
className: classes.containerCircle,
|
|
61
|
+
children: /*#__PURE__*/_jsx(IndicatorCircle, {})
|
|
57
62
|
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
type: this.props.type
|
|
72
|
-
};
|
|
73
|
-
return buttonProps;
|
|
74
|
-
}
|
|
75
|
-
}]);
|
|
76
|
-
}(Component);
|
|
77
|
-
ActionButton.clickDelay = 300;
|
|
63
|
+
}
|
|
64
|
+
const containerClass = noGap ? classes.noGap : classes.withGap;
|
|
65
|
+
return /*#__PURE__*/_jsx("div", {
|
|
66
|
+
className: cx('ui-shared__action-button', containerClass),
|
|
67
|
+
"data-test-id": testId,
|
|
68
|
+
children: /*#__PURE__*/_jsx(RippleButton, {
|
|
69
|
+
...rest,
|
|
70
|
+
...buttonProps,
|
|
71
|
+
onClick: handleClick,
|
|
72
|
+
children: children
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
};
|
|
78
76
|
ActionButton.defaultProps = {
|
|
79
77
|
...RippleButton.defaultProps,
|
|
80
78
|
loading: false,
|
|
@@ -84,4 +82,5 @@ ActionButton.defaultProps = {
|
|
|
84
82
|
testId: null,
|
|
85
83
|
disableClickDelay: false
|
|
86
84
|
};
|
|
85
|
+
ActionButton.clickDelay = CLICK_DELAY;
|
|
87
86
|
export default ActionButton;
|
package/AddToCartButton/index.js
CHANGED
|
@@ -1,212 +1,244 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { Component } from 'react';
|
|
1
|
+
import React, { useCallback, useState } from 'react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import spring from 'css-spring';
|
|
4
4
|
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
5
|
import { withForwardedRef } from '@shopgate/engage/core';
|
|
6
|
+
import { keyframes, makeStyles } from '@shopgate/engage/styles';
|
|
6
7
|
import CartPlusIcon from "../icons/CartPlusIcon";
|
|
7
8
|
import TickIcon from "../icons/TickIcon";
|
|
8
9
|
import IndicatorCircle from "../IndicatorCircle";
|
|
9
|
-
import
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const DEFAULT_BUTTON_SIZE = 40;
|
|
12
|
+
const DEFAULT_ICON_SIZE = 20;
|
|
13
|
+
const springOptions = {
|
|
14
|
+
stiffness: 381.47,
|
|
15
|
+
damping: 15
|
|
16
|
+
};
|
|
17
|
+
const springFromTopKeyframes = keyframes(spring({
|
|
18
|
+
transform: 'translate3d(0, 300%, 0)'
|
|
19
|
+
}, {
|
|
20
|
+
transform: 'translate3d(0, -50%, 0)'
|
|
21
|
+
}, springOptions));
|
|
22
|
+
const springFromBottomKeyframes = keyframes(spring({
|
|
23
|
+
transform: 'translate3d(0, -300%, 0)'
|
|
24
|
+
}, {
|
|
25
|
+
transform: 'translate3d(0, -50%, 0)'
|
|
26
|
+
}, springOptions));
|
|
27
|
+
const springToTopKeyframes = keyframes(spring({
|
|
28
|
+
transform: 'translate3d(0, -50%, 0)'
|
|
29
|
+
}, {
|
|
30
|
+
transform: 'translate3d(0, 300%, 0)'
|
|
31
|
+
}, springOptions));
|
|
32
|
+
const springToBottomKeyframes = keyframes(spring({
|
|
33
|
+
transform: 'translate3d(0, -50%, 0)'
|
|
34
|
+
}, {
|
|
35
|
+
transform: 'translate3d(0, -300%, 0)'
|
|
36
|
+
}, springOptions));
|
|
37
|
+
const useStyles = makeStyles()({
|
|
38
|
+
springFromBottom: {
|
|
39
|
+
animation: `${springFromBottomKeyframes} 600ms`
|
|
40
|
+
},
|
|
41
|
+
springFromTop: {
|
|
42
|
+
animation: `${springFromTopKeyframes} 600ms`
|
|
43
|
+
},
|
|
44
|
+
springToTop: {
|
|
45
|
+
animation: `${springToTopKeyframes} 600ms`
|
|
46
|
+
},
|
|
47
|
+
springToBottom: {
|
|
48
|
+
animation: `${springToBottomKeyframes} 600ms`
|
|
49
|
+
},
|
|
50
|
+
icon: {
|
|
51
|
+
transition: 'opacity 450ms cubic-bezier(0.4, 0.0, 0.2, 1)',
|
|
52
|
+
opacity: 1,
|
|
53
|
+
position: 'absolute'
|
|
54
|
+
},
|
|
55
|
+
spinnerIcon: {
|
|
56
|
+
left: '50%',
|
|
57
|
+
top: '50%',
|
|
58
|
+
marginTop: -themeConfig.variables.loadingIndicator.size / 2,
|
|
59
|
+
marginLeft: -themeConfig.variables.loadingIndicator.size / 2
|
|
60
|
+
},
|
|
61
|
+
buttonReady: {
|
|
62
|
+
background: `var(--color-button-cta, ${themeConfig.colors.cta})`,
|
|
63
|
+
color: `var(--color-button-cta-contrast, ${themeConfig.colors.ctaContrast})`
|
|
64
|
+
},
|
|
65
|
+
buttonSuccess: {
|
|
66
|
+
background: `var(--color-button-cta-contrast, ${themeConfig.colors.ctaContrast})`,
|
|
67
|
+
color: `var(--color-button-cta, ${themeConfig.colors.cta})`
|
|
68
|
+
},
|
|
69
|
+
buttonDisabled: {
|
|
70
|
+
background: themeConfig.colors.shade5,
|
|
71
|
+
color: `var(--color-button-cta-contrast, ${themeConfig.colors.ctaContrast})`,
|
|
72
|
+
boxShadow: themeConfig.shadows.buttons.disabled
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @param {number} bSize .
|
|
78
|
+
* @param {number} iSize .
|
|
79
|
+
* @returns {Object}
|
|
80
|
+
*/
|
|
81
|
+
const getWrapperStyle = (bSize, iSize) => ({
|
|
82
|
+
transition: 'background 450ms cubic-bezier(0.4, 0.0, 0.2, 1)',
|
|
83
|
+
borderRadius: '50%',
|
|
84
|
+
width: bSize,
|
|
85
|
+
height: bSize,
|
|
86
|
+
position: 'relative',
|
|
87
|
+
fontSize: iSize,
|
|
88
|
+
outline: 0,
|
|
89
|
+
paddingLeft: (bSize - iSize) / 2,
|
|
90
|
+
paddingRight: (bSize - iSize) / 2,
|
|
91
|
+
zIndex: 2,
|
|
92
|
+
overflow: 'hidden',
|
|
93
|
+
flexShrink: 0
|
|
94
|
+
});
|
|
10
95
|
|
|
11
96
|
/**
|
|
12
97
|
* AddToCartButton component.
|
|
98
|
+
* @param {Object} props Props.
|
|
99
|
+
* @returns {JSX.Element}
|
|
13
100
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
_this.handleClick = e => {
|
|
32
|
-
// Ignore clicks when check mark or loading spinner is shown or the button is disabled.
|
|
33
|
-
if (_this.state.showCheckmark || _this.props.isLoading || _this.props.isDisabled) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
101
|
+
const AddToCartButton = ({
|
|
102
|
+
'aria-hidden': ariaHidden,
|
|
103
|
+
'aria-label': ariaLabel,
|
|
104
|
+
buttonSize,
|
|
105
|
+
className,
|
|
106
|
+
forwardedRef,
|
|
107
|
+
iconSize,
|
|
108
|
+
isDisabled,
|
|
109
|
+
isLoading,
|
|
110
|
+
onClick,
|
|
111
|
+
onReset
|
|
112
|
+
}) => {
|
|
113
|
+
const {
|
|
114
|
+
classes,
|
|
115
|
+
cx
|
|
116
|
+
} = useStyles();
|
|
117
|
+
const [showCheckmark, setShowCheckmark] = useState(null);
|
|
36
118
|
|
|
37
|
-
/** */
|
|
38
|
-
const handleCompletion = () => {
|
|
39
|
-
_this.setState({
|
|
40
|
-
showCheckmark: true
|
|
41
|
-
});
|
|
42
|
-
setTimeout(() => {
|
|
43
|
-
_this.setState({
|
|
44
|
-
showCheckmark: false
|
|
45
|
-
});
|
|
46
|
-
}, 900);
|
|
47
|
-
};
|
|
48
|
-
const result = _this.props.onClick(e);
|
|
49
|
-
if (result === false) {
|
|
50
|
-
// Do not trigger animation when adding to cart was aborted by the parent component (PWA-2764)
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (result instanceof Promise) {
|
|
54
|
-
(async () => {
|
|
55
|
-
try {
|
|
56
|
-
await result;
|
|
57
|
-
handleCompletion();
|
|
58
|
-
} catch (error) {
|
|
59
|
-
// ignore error in button.
|
|
60
|
-
}
|
|
61
|
-
})();
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
handleCompletion();
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Handles the cart animation end event.
|
|
68
|
-
* Resets the showCheckmark state to null in order to
|
|
69
|
-
* prevent the icon from animating after changing visibility
|
|
70
|
-
* of the view.
|
|
71
|
-
* This is caused by CSS animations that get re-applied when
|
|
72
|
-
* setting an element from hidden (display: none) to visible.
|
|
73
|
-
*/
|
|
74
|
-
_this.handleCartAnimationEnd = () => {
|
|
75
|
-
if (_this.state.showCheckmark === false) {
|
|
76
|
-
_this.setState({
|
|
77
|
-
showCheckmark: null
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
_this.props.onReset();
|
|
81
|
-
};
|
|
82
|
-
_this.state = {
|
|
83
|
-
showCheckmark: null
|
|
84
|
-
};
|
|
85
|
-
return _this;
|
|
86
|
-
}
|
|
87
|
-
_inheritsLoose(AddToCartButton, _Component);
|
|
88
|
-
var _proto = AddToCartButton.prototype;
|
|
89
119
|
/**
|
|
90
|
-
*
|
|
91
|
-
* @returns {JSX}
|
|
120
|
+
* @param {Event} e Click event.
|
|
92
121
|
*/
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
let cartPlusIconStyle = styles.icon;
|
|
122
|
+
const handleClick = useCallback(e => {
|
|
123
|
+
if (showCheckmark || isLoading || isDisabled) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
98
126
|
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
127
|
+
/** Completes the success checkmark animation cycle. */
|
|
128
|
+
const handleCompletion = () => {
|
|
129
|
+
setShowCheckmark(true);
|
|
130
|
+
setTimeout(() => {
|
|
131
|
+
setShowCheckmark(false);
|
|
132
|
+
}, 900);
|
|
104
133
|
};
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
134
|
+
const result = onClick(e);
|
|
135
|
+
if (result === false) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (result instanceof Promise) {
|
|
139
|
+
(async () => {
|
|
140
|
+
try {
|
|
141
|
+
await result;
|
|
142
|
+
handleCompletion();
|
|
143
|
+
} catch (error) {
|
|
144
|
+
// ignore error in button.
|
|
145
|
+
}
|
|
146
|
+
})();
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
handleCompletion();
|
|
150
|
+
}, [showCheckmark, isLoading, isDisabled, onClick]);
|
|
151
|
+
const handleCartAnimationEnd = useCallback(() => {
|
|
152
|
+
if (showCheckmark === false) {
|
|
153
|
+
setShowCheckmark(null);
|
|
154
|
+
}
|
|
155
|
+
onReset();
|
|
156
|
+
}, [showCheckmark, onReset]);
|
|
157
|
+
let buttonStateClass = classes.buttonReady;
|
|
158
|
+
let tickIconClass = classes.icon;
|
|
159
|
+
let cartPlusIconClass = classes.icon;
|
|
160
|
+
const iconOpacity = isLoading ? {
|
|
161
|
+
opacity: 0
|
|
162
|
+
} : {
|
|
163
|
+
opacity: 1
|
|
164
|
+
};
|
|
165
|
+
const spinnerInlineStyle = isLoading ? {
|
|
166
|
+
opacity: 1
|
|
167
|
+
} : {
|
|
168
|
+
opacity: 0
|
|
169
|
+
};
|
|
170
|
+
let tickInlineStyle = showCheckmark === null ? {
|
|
171
|
+
transform: 'translate3d(0, 300%, 0)',
|
|
172
|
+
...iconOpacity
|
|
173
|
+
} : null;
|
|
174
|
+
let cartInlineStyle = showCheckmark === null ? {
|
|
175
|
+
transform: 'translate3d(0, -50%, 0)',
|
|
176
|
+
...iconOpacity
|
|
177
|
+
} : null;
|
|
178
|
+
if (isDisabled && !isLoading) {
|
|
179
|
+
buttonStateClass = classes.buttonDisabled;
|
|
180
|
+
} else if (showCheckmark) {
|
|
181
|
+
tickIconClass = cx(classes.icon, classes.springFromBottom);
|
|
182
|
+
cartPlusIconClass = cx(classes.icon, classes.springToTop);
|
|
183
|
+
buttonStateClass = classes.buttonSuccess;
|
|
184
|
+
tickInlineStyle = {
|
|
185
|
+
transform: 'translate3d(0, -50%, 0)',
|
|
186
|
+
...iconOpacity
|
|
109
187
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
* The initial positions for the icons:
|
|
113
|
-
* Tick icon stays hidden on top, Cart icon stays visibly at the center
|
|
114
|
-
*/
|
|
115
|
-
let tickInlineStyle = this.state.showCheckmark === null ? {
|
|
116
|
-
transform: 'translate3d(0, 300%, 0)',
|
|
188
|
+
cartInlineStyle = {
|
|
189
|
+
transform: 'translate3d(0, -300%, 0)',
|
|
117
190
|
...iconOpacity
|
|
118
|
-
}
|
|
119
|
-
|
|
191
|
+
};
|
|
192
|
+
} else if (showCheckmark !== null) {
|
|
193
|
+
tickIconClass = cx(classes.icon, classes.springToBottom);
|
|
194
|
+
cartPlusIconClass = cx(classes.icon, classes.springFromTop);
|
|
195
|
+
cartInlineStyle = {
|
|
120
196
|
transform: 'translate3d(0, -50%, 0)',
|
|
121
197
|
...iconOpacity
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
transform: 'translate3d(0, -50%, 0)',
|
|
160
|
-
...iconOpacity
|
|
161
|
-
};
|
|
162
|
-
tickInlineStyle = {
|
|
163
|
-
transform: 'translate3d(0, -300%, 0)',
|
|
164
|
-
...iconOpacity
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
let className = styles.buttonWrapper(this.props.buttonSize, this.props.iconSize);
|
|
168
|
-
if (this.props.noShadow) {
|
|
169
|
-
className = styles.buttonWrapperNoShadow(this.props.buttonSize, this.props.iconSize);
|
|
170
|
-
}
|
|
171
|
-
return /*#__PURE__*/_jsxs("button", {
|
|
172
|
-
"data-test-id": "addToCartButton",
|
|
173
|
-
className: `ui-shared__add-to-cart-button ${this.props.className} ${className} ${buttonStyle}`,
|
|
174
|
-
onClick: this.handleClick,
|
|
175
|
-
"aria-hidden": this.props['aria-hidden'],
|
|
176
|
-
"aria-label": this.props['aria-label'],
|
|
177
|
-
"aria-disabled": this.props.isDisabled,
|
|
178
|
-
ref: this.props.forwardedRef,
|
|
179
|
-
type: "button",
|
|
180
|
-
children: [this.props.isLoading && /*#__PURE__*/_jsx("div", {
|
|
181
|
-
className: `${styles.icon} ${styles.spinnerIcon}`,
|
|
182
|
-
style: spinnerInlineStyle,
|
|
183
|
-
children: /*#__PURE__*/_jsx(IndicatorCircle, {
|
|
184
|
-
color: themeConfig.colors.primaryContrast,
|
|
185
|
-
strokeWidth: 5,
|
|
186
|
-
paused: !this.props.isLoading
|
|
187
|
-
})
|
|
188
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
189
|
-
className: tickIconStyle,
|
|
190
|
-
style: tickInlineStyle,
|
|
191
|
-
children: /*#__PURE__*/_jsx(TickIcon, {})
|
|
192
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
193
|
-
className: cartPlusIconStyle,
|
|
194
|
-
style: cartInlineStyle,
|
|
195
|
-
onAnimationEnd: this.handleCartAnimationEnd,
|
|
196
|
-
children: /*#__PURE__*/_jsx(CartPlusIcon, {})
|
|
197
|
-
})]
|
|
198
|
-
});
|
|
199
|
-
};
|
|
200
|
-
return AddToCartButton;
|
|
201
|
-
}(Component);
|
|
198
|
+
};
|
|
199
|
+
tickInlineStyle = {
|
|
200
|
+
transform: 'translate3d(0, -300%, 0)',
|
|
201
|
+
...iconOpacity
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
const wrapperStyle = getWrapperStyle(buttonSize, iconSize);
|
|
205
|
+
return /*#__PURE__*/_jsxs("button", {
|
|
206
|
+
"data-test-id": "addToCartButton",
|
|
207
|
+
className: cx('ui-shared__add-to-cart-button', buttonStateClass, className),
|
|
208
|
+
style: wrapperStyle,
|
|
209
|
+
onClick: handleClick,
|
|
210
|
+
"aria-hidden": ariaHidden,
|
|
211
|
+
"aria-label": ariaLabel,
|
|
212
|
+
"aria-disabled": isDisabled,
|
|
213
|
+
ref: forwardedRef,
|
|
214
|
+
type: "button",
|
|
215
|
+
children: [isLoading && /*#__PURE__*/_jsx("div", {
|
|
216
|
+
className: cx(classes.icon, classes.spinnerIcon),
|
|
217
|
+
style: spinnerInlineStyle,
|
|
218
|
+
children: /*#__PURE__*/_jsx(IndicatorCircle, {
|
|
219
|
+
color: themeConfig.colors.primaryContrast,
|
|
220
|
+
strokeWidth: 5,
|
|
221
|
+
paused: !isLoading
|
|
222
|
+
})
|
|
223
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
224
|
+
className: tickIconClass,
|
|
225
|
+
style: tickInlineStyle,
|
|
226
|
+
children: /*#__PURE__*/_jsx(TickIcon, {})
|
|
227
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
228
|
+
className: cartPlusIconClass,
|
|
229
|
+
style: cartInlineStyle,
|
|
230
|
+
onAnimationEnd: handleCartAnimationEnd,
|
|
231
|
+
children: /*#__PURE__*/_jsx(CartPlusIcon, {})
|
|
232
|
+
})]
|
|
233
|
+
});
|
|
234
|
+
};
|
|
202
235
|
AddToCartButton.defaultProps = {
|
|
203
236
|
'aria-hidden': false,
|
|
204
237
|
'aria-label': null,
|
|
205
|
-
buttonSize:
|
|
238
|
+
buttonSize: DEFAULT_BUTTON_SIZE,
|
|
206
239
|
className: null,
|
|
207
240
|
forwardedRef: null,
|
|
208
|
-
iconSize:
|
|
209
|
-
noShadow: false,
|
|
241
|
+
iconSize: DEFAULT_ICON_SIZE,
|
|
210
242
|
onReset: () => {}
|
|
211
243
|
};
|
|
212
244
|
export default withForwardedRef(AddToCartButton);
|
package/AddToCartButton/style.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { css } from 'glamor';
|
|
2
2
|
import spring from 'css-spring';
|
|
3
3
|
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
4
|
+
|
|
5
|
+
/* eslint-disable max-len */
|
|
6
|
+
// TODO This file was brought back since some extensions import it (@shopgate-project/tablet-adjustments, @shopgate/grouped-products).
|
|
7
|
+
// It's not used anymore by the component. To reduce the effort of updating all shops to a new version
|
|
8
|
+
// of the extension, we temporarily keep this file. It should be removed in the future and the extensions should handle their styling
|
|
9
|
+
// on their own
|
|
10
|
+
/* eslint-enable max-len */
|
|
11
|
+
|
|
4
12
|
const options = {
|
|
5
13
|
stiffness: 381.47,
|
|
6
14
|
damping: 15
|
package/Availability/index.js
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { AVAILABILITY_STATE_OK, AVAILABILITY_STATE_WARNING, AVAILABILITY_STATE_ALERT } from '@shopgate/pwa-common-commerce/product/constants';
|
|
4
|
-
import
|
|
4
|
+
import { makeStyles } from '@shopgate/engage/styles';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const useStyles = makeStyles()(theme => ({
|
|
7
|
+
base: {
|
|
8
|
+
fontSize: '0.875rem'
|
|
9
|
+
},
|
|
10
|
+
stateOk: {
|
|
11
|
+
color: theme.palette.success.main
|
|
12
|
+
},
|
|
13
|
+
stateWarning: {
|
|
14
|
+
color: theme.palette.warning.main
|
|
15
|
+
},
|
|
16
|
+
stateAlert: {
|
|
17
|
+
color: theme.palette.error.main
|
|
18
|
+
}
|
|
19
|
+
}));
|
|
5
20
|
|
|
6
21
|
/**
|
|
7
22
|
* This component renders the availability text for a product
|
|
@@ -13,25 +28,28 @@ import styles from "./style";
|
|
|
13
28
|
* @param {string} [props.className] CSS classes
|
|
14
29
|
* @return {JSX}
|
|
15
30
|
*/
|
|
16
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
31
|
const Availability = ({
|
|
18
32
|
text,
|
|
19
33
|
state,
|
|
20
34
|
showWhenAvailable = false,
|
|
21
35
|
className = null
|
|
22
36
|
}) => {
|
|
37
|
+
const {
|
|
38
|
+
classes,
|
|
39
|
+
cx
|
|
40
|
+
} = useStyles();
|
|
23
41
|
if (!text || state === AVAILABILITY_STATE_OK && !showWhenAvailable) {
|
|
24
42
|
return null;
|
|
25
43
|
}
|
|
26
|
-
let
|
|
44
|
+
let stateClass = classes.stateOk;
|
|
27
45
|
if (state === AVAILABILITY_STATE_WARNING) {
|
|
28
|
-
|
|
46
|
+
stateClass = classes.stateWarning;
|
|
29
47
|
}
|
|
30
48
|
if (state === AVAILABILITY_STATE_ALERT) {
|
|
31
|
-
|
|
49
|
+
stateClass = classes.stateAlert;
|
|
32
50
|
}
|
|
33
51
|
return /*#__PURE__*/_jsx("div", {
|
|
34
|
-
className:
|
|
52
|
+
className: cx('ui-shared__availability', classes.base, stateClass, className),
|
|
35
53
|
"data-test-id": `availabilityText: ${text}`,
|
|
36
54
|
children: text
|
|
37
55
|
});
|