@shopgate/pwa-ui-shared 7.30.3 → 7.31.0-alpha.1
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/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/AddToCartButton/style.js +0 -148
- 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/Ripple/index.js
CHANGED
|
@@ -1,240 +1,186 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
3
|
-
import React, { PureComponent } from 'react';
|
|
1
|
+
import React, { useState, useRef, useCallback, useLayoutEffect } from 'react';
|
|
4
2
|
import PropTypes from 'prop-types';
|
|
5
|
-
import { findDOMNode } from 'react-dom';
|
|
6
3
|
import clamp from 'lodash/clamp';
|
|
7
4
|
import { shift } from '@shopgate/pwa-common/helpers/data';
|
|
8
5
|
import { getOffset } from '@shopgate/pwa-common/helpers/dom';
|
|
9
6
|
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
7
|
+
import { makeStyles } from '@shopgate/engage/styles';
|
|
10
8
|
import RippleAnimation from "./components/RippleAnimation";
|
|
11
|
-
import
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
const useStyles = makeStyles()({
|
|
11
|
+
container: {
|
|
12
|
+
position: 'absolute',
|
|
13
|
+
zIndex: 0,
|
|
14
|
+
top: 0,
|
|
15
|
+
left: 0,
|
|
16
|
+
width: '100%',
|
|
17
|
+
height: '100%'
|
|
18
|
+
}
|
|
19
|
+
});
|
|
12
20
|
|
|
13
21
|
/**
|
|
14
22
|
* The ripple component.
|
|
23
|
+
* @param {Object} props Props.
|
|
24
|
+
* @returns {JSX.Element}
|
|
15
25
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
const Ripple = ({
|
|
27
|
+
children,
|
|
28
|
+
className,
|
|
29
|
+
color,
|
|
30
|
+
disabled,
|
|
31
|
+
fill,
|
|
32
|
+
onClick,
|
|
33
|
+
onComplete,
|
|
34
|
+
overflow,
|
|
35
|
+
size
|
|
36
|
+
}) => {
|
|
37
|
+
const {
|
|
38
|
+
classes,
|
|
39
|
+
cx
|
|
40
|
+
} = useStyles();
|
|
41
|
+
const [{
|
|
42
|
+
ripples,
|
|
43
|
+
hasRipples
|
|
44
|
+
}, setRippleState] = useState({
|
|
45
|
+
ripples: [],
|
|
46
|
+
nextKey: 0,
|
|
47
|
+
hasRipples: false
|
|
48
|
+
});
|
|
49
|
+
const durationRef = useRef(500);
|
|
50
|
+
const ignoreNextMouseDownRef = useRef(false);
|
|
51
|
+
const mountedRef = useRef(false);
|
|
52
|
+
const offsetRef = useRef(null);
|
|
53
|
+
const positionRef = useRef({
|
|
54
|
+
x: 0,
|
|
55
|
+
y: 0
|
|
56
|
+
});
|
|
57
|
+
const rootRef = useRef(null);
|
|
58
|
+
const [containerStyle, setContainerStyle] = useState(null);
|
|
59
|
+
const getRippleSize = useCallback(() => {
|
|
60
|
+
const rootNode = rootRef.current;
|
|
61
|
+
if (!rootNode) {
|
|
62
|
+
return 0;
|
|
63
|
+
}
|
|
64
|
+
if (size) {
|
|
65
|
+
return fill ? size * 2 : size;
|
|
66
|
+
}
|
|
67
|
+
if (fill) {
|
|
68
|
+
return Math.sqrt(rootNode.offsetWidth ** 2 + rootNode.offsetHeight ** 2) * 2;
|
|
69
|
+
}
|
|
70
|
+
return Math.min(rootNode.offsetWidth, rootNode.offsetHeight);
|
|
71
|
+
}, [fill, size]);
|
|
72
|
+
useLayoutEffect(() => {
|
|
73
|
+
const rootNode = rootRef.current;
|
|
74
|
+
if (!rootNode) {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
mountedRef.current = true;
|
|
78
|
+
positionRef.current = {
|
|
79
|
+
x: rootNode.offsetWidth / 2,
|
|
80
|
+
y: rootNode.offsetHeight / 2
|
|
35
81
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*/
|
|
40
|
-
_this.removeRipple = () => {
|
|
41
|
-
if (!_this.mounted) {
|
|
42
|
-
return;
|
|
82
|
+
const rippleSize = (() => {
|
|
83
|
+
if (size) {
|
|
84
|
+
return fill ? size * 2 : size;
|
|
43
85
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
_this.state = {
|
|
54
|
-
ripples: [],
|
|
55
|
-
nextKey: 0,
|
|
56
|
-
hasRipples: false
|
|
57
|
-
};
|
|
58
|
-
_this.duration = 500;
|
|
59
|
-
_this.ignoreNextMouseDown = false;
|
|
60
|
-
_this.mounted = false;
|
|
61
|
-
_this.offset = null;
|
|
62
|
-
_this.position = null;
|
|
63
|
-
_this.rootNode = null;
|
|
64
|
-
_this.style = null;
|
|
65
|
-
return _this;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Sets the `mounted` flag to true.
|
|
70
|
-
*/
|
|
71
|
-
_inheritsLoose(Ripple, _PureComponent);
|
|
72
|
-
var _proto = Ripple.prototype;
|
|
73
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
74
|
-
const {
|
|
75
|
-
fill
|
|
76
|
-
} = this.props;
|
|
77
|
-
|
|
78
|
-
// Reference to Ripple container (for now and later).
|
|
79
|
-
this.rootNode = findDOMNode(this); // eslint-disable-line react/no-find-dom-node
|
|
80
|
-
|
|
81
|
-
// Initially set the position values to be in the middle of the element.
|
|
82
|
-
// If the Ripple's starting point has to follow the user's touch
|
|
83
|
-
// Location then this is checked later.
|
|
84
|
-
this.position = {
|
|
85
|
-
x: this.rootNode.offsetWidth / 2,
|
|
86
|
-
y: this.rootNode.offsetHeight / 2
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
// Determine the duration based on the size of the ripple.
|
|
90
|
-
this.duration = clamp(Math.round(Math.log(this.rippleSize) * 100 - (fill ? -75 : 50)), 0, 10000);
|
|
91
|
-
|
|
92
|
-
// Set the `mounted` flag to true.
|
|
93
|
-
this.mounted = true;
|
|
94
|
-
|
|
95
|
-
// If the Ripple is not allowed to overflow then apply some styles to the parent container.
|
|
96
|
-
this.style = !this.props.overflow ? {
|
|
86
|
+
if (fill) {
|
|
87
|
+
return Math.sqrt(rootNode.offsetWidth ** 2 + rootNode.offsetHeight ** 2) * 2;
|
|
88
|
+
}
|
|
89
|
+
return Math.min(rootNode.offsetWidth, rootNode.offsetHeight);
|
|
90
|
+
})();
|
|
91
|
+
durationRef.current = clamp(Math.round(Math.log(rippleSize) * 100 - (fill ? -75 : 50)), 0, 10000);
|
|
92
|
+
setContainerStyle(!overflow ? {
|
|
97
93
|
overflow: 'hidden',
|
|
98
94
|
position: 'relative'
|
|
99
|
-
} : null;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
this.mounted = false;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Calculate the size of the ripple.
|
|
111
|
-
* @returns {number}
|
|
112
|
-
*/;
|
|
113
|
-
/**
|
|
114
|
-
* Calculates the ripple position from the event.
|
|
115
|
-
* @param {Object} event The event object.
|
|
116
|
-
* @returns {Object} An object containing x and y values for the ripple.
|
|
117
|
-
*/
|
|
118
|
-
_proto.getRipplePosition = function getRipplePosition(event) {
|
|
119
|
-
// If the Ripple is to fill the element then we should set the
|
|
120
|
-
// Starting position to be where the user clicked within that element.
|
|
121
|
-
if (this.props.fill) {
|
|
122
|
-
// Determine if event is a touch event.
|
|
95
|
+
} : null);
|
|
96
|
+
return () => {
|
|
97
|
+
mountedRef.current = false;
|
|
98
|
+
};
|
|
99
|
+
}, [fill, overflow, size]);
|
|
100
|
+
const getRipplePosition = useCallback(event => {
|
|
101
|
+
if (fill) {
|
|
123
102
|
const isTouchEvent = event.touches && event.touches.length;
|
|
124
|
-
|
|
125
|
-
// Find the center points of the event.
|
|
126
103
|
const pageX = isTouchEvent ? event.touches[0].pageX : event.pageX;
|
|
127
104
|
const pageY = isTouchEvent ? event.touches[0].pageY : event.pageY;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
105
|
+
positionRef.current = {
|
|
106
|
+
x: pageX - offsetRef.current.left,
|
|
107
|
+
y: pageY - offsetRef.current.top
|
|
108
|
+
};
|
|
132
109
|
}
|
|
133
|
-
return
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
* @param {Object} event The event object.
|
|
138
|
-
* @param {boolean} isTouchGenerated Whether the action was triggered by a touch or click.
|
|
139
|
-
*/
|
|
140
|
-
_proto.addRipple = function addRipple(event, isTouchGenerated) {
|
|
141
|
-
// If the adding of the Ripple was already triggered
|
|
142
|
-
// By a touch start event, no further action will be done.
|
|
143
|
-
if (this.ignoreNextMouseDown && !isTouchGenerated) {
|
|
144
|
-
this.ignoreNextMouseDown = false;
|
|
110
|
+
return positionRef.current;
|
|
111
|
+
}, [fill]);
|
|
112
|
+
const removeRipple = useCallback(() => {
|
|
113
|
+
if (!mountedRef.current) {
|
|
145
114
|
return;
|
|
146
115
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
116
|
+
setRippleState(prev => {
|
|
117
|
+
const nextRipples = shift(prev.ripples);
|
|
118
|
+
onComplete();
|
|
119
|
+
return {
|
|
120
|
+
ripples: nextRipples,
|
|
121
|
+
nextKey: prev.nextKey,
|
|
122
|
+
hasRipples: !!nextRipples.length
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
}, [onComplete]);
|
|
126
|
+
const addRipple = useCallback((event, isTouchGenerated) => {
|
|
127
|
+
if (ignoreNextMouseDownRef.current && !isTouchGenerated) {
|
|
128
|
+
ignoreNextMouseDownRef.current = false;
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const rootNode = rootRef.current;
|
|
132
|
+
if (!rootNode) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
offsetRef.current = getOffset(rootNode);
|
|
152
136
|
const {
|
|
153
137
|
x,
|
|
154
138
|
y
|
|
155
|
-
} =
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
this.setState(({
|
|
174
|
-
nextKey
|
|
175
|
-
}) => ({
|
|
176
|
-
ripples,
|
|
177
|
-
nextKey: nextKey + 1,
|
|
178
|
-
hasRipples: true
|
|
179
|
-
}));
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Renders all the ripples in the queue.
|
|
184
|
-
* @returns {JSX|null}
|
|
185
|
-
*/;
|
|
186
|
-
_proto.renderRipples = function renderRipples() {
|
|
187
|
-
// It only needs to render, if there is at least one ripple in the queue.
|
|
188
|
-
if (!this.state.hasRipples) {
|
|
189
|
-
return null;
|
|
190
|
-
}
|
|
191
|
-
return /*#__PURE__*/_jsx("div", {
|
|
192
|
-
className: style.container,
|
|
193
|
-
children: this.state.ripples
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Renders the final ripple component including it's contents.
|
|
199
|
-
* @returns {JSX}
|
|
200
|
-
*/;
|
|
201
|
-
_proto.render = function render() {
|
|
202
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events,
|
|
203
|
-
jsx-a11y/no-static-element-interactions */
|
|
204
|
-
return /*#__PURE__*/_jsxs("div", {
|
|
205
|
-
className: `ui-shared__ripple ${this.props.className}`,
|
|
206
|
-
"data-test-id": "Ripple",
|
|
207
|
-
onClick: this.handleClick,
|
|
208
|
-
style: this.style,
|
|
209
|
-
children: [this.renderRipples(), this.props.children]
|
|
139
|
+
} = getRipplePosition(event);
|
|
140
|
+
const rippleSize = getRippleSize();
|
|
141
|
+
setRippleState(prev => {
|
|
142
|
+
const nextRipples = [].concat(prev.ripples);
|
|
143
|
+
nextRipples.push(/*#__PURE__*/_jsx(RippleAnimation, {
|
|
144
|
+
color: color,
|
|
145
|
+
duration: durationRef.current,
|
|
146
|
+
fill: fill,
|
|
147
|
+
onComplete: removeRipple,
|
|
148
|
+
size: rippleSize,
|
|
149
|
+
x: x,
|
|
150
|
+
y: y
|
|
151
|
+
}, prev.nextKey));
|
|
152
|
+
return {
|
|
153
|
+
ripples: nextRipples,
|
|
154
|
+
nextKey: prev.nextKey + 1,
|
|
155
|
+
hasRipples: true
|
|
156
|
+
};
|
|
210
157
|
});
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
get: function () {
|
|
217
|
-
if (this.props.size) {
|
|
218
|
-
if (this.props.fill) {
|
|
219
|
-
return this.props.size * 2;
|
|
220
|
-
}
|
|
221
|
-
return this.props.size;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* We want the Ripple to fill the element. We set the diameter of the Ripple
|
|
226
|
-
* to double the distance of the opposing corners of the node. That way the Ripple
|
|
227
|
-
* will reach the furthest away corner if you click at a corner.
|
|
228
|
-
*/
|
|
229
|
-
if (this.props.fill) {
|
|
230
|
-
return Math.sqrt(this.rootNode.offsetWidth ** 2 + this.rootNode.offsetHeight ** 2) * 2;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
// Otherwise we set the size to be the smaller of the element's height and width.
|
|
234
|
-
return Math.min(this.rootNode.offsetWidth, this.rootNode.offsetHeight);
|
|
158
|
+
ignoreNextMouseDownRef.current = isTouchGenerated;
|
|
159
|
+
}, [color, fill, getRipplePosition, getRippleSize, removeRipple]);
|
|
160
|
+
const handleClick = useCallback(event => {
|
|
161
|
+
if (disabled) {
|
|
162
|
+
return;
|
|
235
163
|
}
|
|
236
|
-
|
|
237
|
-
|
|
164
|
+
addRipple(event, true);
|
|
165
|
+
onClick();
|
|
166
|
+
}, [addRipple, disabled, onClick]);
|
|
167
|
+
|
|
168
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events,
|
|
169
|
+
jsx-a11y/no-static-element-interactions */
|
|
170
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
171
|
+
ref: rootRef,
|
|
172
|
+
className: cx('ui-shared__ripple', className),
|
|
173
|
+
"data-test-id": "Ripple",
|
|
174
|
+
onClick: handleClick,
|
|
175
|
+
style: containerStyle,
|
|
176
|
+
children: [hasRipples ? /*#__PURE__*/_jsx("div", {
|
|
177
|
+
className: classes.container,
|
|
178
|
+
children: ripples
|
|
179
|
+
}) : null, children]
|
|
180
|
+
});
|
|
181
|
+
/* eslint-enable jsx-a11y/click-events-have-key-events,
|
|
182
|
+
jsx-a11y/no-static-element-interactions */
|
|
183
|
+
};
|
|
238
184
|
Ripple.defaultProps = {
|
|
239
185
|
className: '',
|
|
240
186
|
color: themeConfig.colors.dark,
|
package/RippleButton/index.js
CHANGED
|
@@ -1,75 +1,78 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
3
|
-
import React, { Component } from 'react';
|
|
1
|
+
import React from 'react';
|
|
4
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import BaseButton from '@shopgate/pwa-common/components/Button';
|
|
4
|
+
import { makeStyles, cx } from '@shopgate/engage/styles';
|
|
5
5
|
import Ripple from "../Ripple";
|
|
6
6
|
import Button from "../Button";
|
|
7
|
-
import
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const useStyles = makeStyles()(theme => ({
|
|
9
|
+
contentWrapper: {
|
|
10
|
+
padding: theme.spacing(0, 2, 0)
|
|
11
|
+
}
|
|
12
|
+
}));
|
|
8
13
|
|
|
9
14
|
/**
|
|
10
15
|
* The ripple button component is a special derivation of the basic button component
|
|
11
16
|
* that adds a ripple effect when clicked.
|
|
17
|
+
* @param {Object} props Props.
|
|
18
|
+
* @returns {JSX.Element}
|
|
12
19
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
20
|
+
const RippleButton = ({
|
|
21
|
+
children,
|
|
22
|
+
className,
|
|
23
|
+
disabled,
|
|
24
|
+
flat,
|
|
25
|
+
onClick,
|
|
26
|
+
rippleClassName,
|
|
27
|
+
rippleSize,
|
|
28
|
+
testId,
|
|
29
|
+
type,
|
|
30
|
+
'aria-label': ariaLabel,
|
|
31
|
+
'aria-haspopup': ariaHaspopup
|
|
32
|
+
}) => {
|
|
33
|
+
const {
|
|
34
|
+
classes
|
|
35
|
+
} = useStyles();
|
|
36
|
+
const buttonProps = {
|
|
37
|
+
className: `${className} ui-shared__ripple-button`,
|
|
38
|
+
disabled,
|
|
39
|
+
onClick,
|
|
40
|
+
flat,
|
|
41
|
+
type,
|
|
42
|
+
wrapContent: false,
|
|
43
|
+
'aria-label': ariaLabel,
|
|
44
|
+
'aria-haspopup': ariaHaspopup
|
|
45
|
+
};
|
|
46
|
+
if (disabled) {
|
|
39
47
|
return /*#__PURE__*/_jsx(Button, {
|
|
40
|
-
...
|
|
41
|
-
|
|
42
|
-
children:
|
|
43
|
-
...rippleProps,
|
|
44
|
-
children: this.props.children
|
|
45
|
-
})
|
|
48
|
+
...buttonProps,
|
|
49
|
+
wrapContent: true,
|
|
50
|
+
children: children
|
|
46
51
|
});
|
|
52
|
+
}
|
|
53
|
+
const rippleProps = {
|
|
54
|
+
className: cx(classes.contentWrapper, rippleClassName),
|
|
55
|
+
fill: true,
|
|
56
|
+
size: rippleSize,
|
|
57
|
+
overflow: true
|
|
47
58
|
};
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
className: `${this.props.className} ui-shared__ripple-button`,
|
|
58
|
-
disabled: this.props.disabled,
|
|
59
|
-
onClick: this.props.onClick,
|
|
60
|
-
flat: this.props.flat,
|
|
61
|
-
type: this.props.type,
|
|
62
|
-
wrapContent: false,
|
|
63
|
-
'aria-label': this.props['aria-label'],
|
|
64
|
-
'aria-haspopup': this.props['aria-haspopup']
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
}]);
|
|
68
|
-
}(Component);
|
|
59
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
60
|
+
...buttonProps,
|
|
61
|
+
testId: testId,
|
|
62
|
+
children: /*#__PURE__*/_jsx(Ripple, {
|
|
63
|
+
...rippleProps,
|
|
64
|
+
children: children
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
};
|
|
69
68
|
RippleButton.defaultProps = {
|
|
70
|
-
...
|
|
69
|
+
...BaseButton.defaultProps,
|
|
70
|
+
className: '',
|
|
71
|
+
flat: false,
|
|
72
|
+
type: 'primary',
|
|
73
|
+
wrapContent: true,
|
|
74
|
+
testId: 'Button',
|
|
71
75
|
rippleClassName: '',
|
|
72
|
-
rippleSize: null
|
|
73
|
-
testId: 'Button'
|
|
76
|
+
rippleSize: null
|
|
74
77
|
};
|
|
75
78
|
export default RippleButton;
|
package/RippleButton/spec.js
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import trim from 'lodash/trim';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { mount } from 'enzyme';
|
|
4
|
+
import BaseButton from '@shopgate/pwa-common/components/Button';
|
|
5
5
|
import Ripple from "../Ripple";
|
|
6
|
-
import styles from "../Button/style";
|
|
7
6
|
import RippleButton from "./index";
|
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
8
|
describe('<RippleButton />', () => {
|
|
10
9
|
it('should render as a regular ripple button effect if type is omitted', () => {
|
|
11
|
-
const wrapper =
|
|
10
|
+
const wrapper = mount(/*#__PURE__*/_jsx(RippleButton, {
|
|
12
11
|
children: "Press me"
|
|
13
12
|
}));
|
|
14
13
|
expect(wrapper).toMatchSnapshot();
|
|
15
|
-
expect(wrapper.find(Ripple).
|
|
14
|
+
expect(wrapper.find(Ripple).text()).toEqual('Press me');
|
|
16
15
|
});
|
|
17
16
|
it('should render as a regular ripple button if type is explicitly defined', () => {
|
|
18
17
|
const wrapper = mount(/*#__PURE__*/_jsx(RippleButton, {
|
|
19
18
|
type: "regular",
|
|
20
19
|
children: "Press me"
|
|
21
20
|
}));
|
|
22
|
-
|
|
21
|
+
const base = wrapper.find(BaseButton);
|
|
22
|
+
expect(base.exists()).toBe(true);
|
|
23
|
+
expect(trim(base.props().className)).toMatch(/^ui-shared__button /);
|
|
24
|
+
expect(trim(base.props().className)).toContain('ui-shared__ripple-button');
|
|
23
25
|
expect(wrapper.find(Ripple).render().text()).toEqual('Press me');
|
|
24
26
|
expect(wrapper).toMatchSnapshot();
|
|
25
27
|
});
|
|
@@ -28,7 +30,9 @@ describe('<RippleButton />', () => {
|
|
|
28
30
|
type: "primary",
|
|
29
31
|
children: "Press me"
|
|
30
32
|
}));
|
|
31
|
-
|
|
33
|
+
const base = wrapper.find(BaseButton);
|
|
34
|
+
expect(trim(base.props().className)).toMatch(/^ui-shared__button /);
|
|
35
|
+
expect(trim(base.props().className)).toContain('ui-shared__ripple-button');
|
|
32
36
|
expect(wrapper.find(Ripple).render().text()).toEqual('Press me');
|
|
33
37
|
expect(wrapper).toMatchSnapshot();
|
|
34
38
|
});
|
|
@@ -37,7 +41,9 @@ describe('<RippleButton />', () => {
|
|
|
37
41
|
type: "secondary",
|
|
38
42
|
children: "Press me"
|
|
39
43
|
}));
|
|
40
|
-
|
|
44
|
+
const base = wrapper.find(BaseButton);
|
|
45
|
+
expect(trim(base.props().className)).toMatch(/^ui-shared__button /);
|
|
46
|
+
expect(trim(base.props().className)).toContain('ui-shared__ripple-button');
|
|
41
47
|
expect(wrapper.find(Ripple).render().text()).toEqual('Press me');
|
|
42
48
|
expect(wrapper).toMatchSnapshot();
|
|
43
49
|
});
|
|
@@ -46,7 +52,7 @@ describe('<RippleButton />', () => {
|
|
|
46
52
|
disabled: true,
|
|
47
53
|
children: "Press me"
|
|
48
54
|
}));
|
|
49
|
-
expect(wrapper.find(
|
|
55
|
+
expect(wrapper.find(BaseButton).props().disabled).toBe(true);
|
|
50
56
|
expect(wrapper).toMatchSnapshot();
|
|
51
57
|
});
|
|
52
58
|
});
|
|
@@ -1,17 +1,61 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import SurroundPortals from '@shopgate/pwa-common/components/SurroundPortals';
|
|
3
3
|
import { SCANNER_CAMERA } from '@shopgate/pwa-common-commerce/scanner/constants/Portals';
|
|
4
|
-
import
|
|
4
|
+
import { themeColors } from '@shopgate/pwa-common/helpers/config';
|
|
5
|
+
import { makeStyles } from '@shopgate/engage/styles';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const edgeHeight = 45;
|
|
8
|
+
const edgeWidth = 35;
|
|
9
|
+
const edgeBorderWidth = 3;
|
|
10
|
+
const useStyles = makeStyles()(theme => ({
|
|
11
|
+
root: {
|
|
12
|
+
height: '90%',
|
|
13
|
+
width: '100%',
|
|
14
|
+
':before,:after,>:before,>:after': {
|
|
15
|
+
display: 'block',
|
|
16
|
+
content: '""',
|
|
17
|
+
width: edgeWidth,
|
|
18
|
+
height: edgeHeight,
|
|
19
|
+
position: 'absolute',
|
|
20
|
+
borderStyle: 'solid',
|
|
21
|
+
borderColor: themeColors.light
|
|
22
|
+
},
|
|
23
|
+
':before': {
|
|
24
|
+
top: theme.spacing(8),
|
|
25
|
+
left: theme.spacing(4),
|
|
26
|
+
borderWidth: `${edgeBorderWidth}px 0 0 ${edgeBorderWidth}px`
|
|
27
|
+
},
|
|
28
|
+
':after': {
|
|
29
|
+
top: theme.spacing(8),
|
|
30
|
+
right: theme.spacing(4),
|
|
31
|
+
borderWidth: `${edgeBorderWidth}px ${edgeBorderWidth}px 0 0`
|
|
32
|
+
},
|
|
33
|
+
'>:before': {
|
|
34
|
+
bottom: theme.spacing(8),
|
|
35
|
+
left: theme.spacing(4),
|
|
36
|
+
borderWidth: `0 0 ${edgeBorderWidth}px ${edgeBorderWidth}px`
|
|
37
|
+
},
|
|
38
|
+
'>:after': {
|
|
39
|
+
bottom: theme.spacing(8),
|
|
40
|
+
right: theme.spacing(4),
|
|
41
|
+
borderWidth: `0 ${edgeBorderWidth}px ${edgeBorderWidth}px 0`
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}));
|
|
5
45
|
|
|
6
46
|
/**
|
|
7
|
-
* @returns {JSX}
|
|
47
|
+
* @returns {JSX.Element}
|
|
8
48
|
*/
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
49
|
+
const CameraOverlay = () => {
|
|
50
|
+
const {
|
|
51
|
+
classes
|
|
52
|
+
} = useStyles();
|
|
53
|
+
return /*#__PURE__*/_jsx(SurroundPortals, {
|
|
54
|
+
portalName: SCANNER_CAMERA,
|
|
55
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
56
|
+
className: classes.root,
|
|
57
|
+
children: /*#__PURE__*/_jsx("div", {})
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
};
|
|
17
61
|
export default CameraOverlay;
|