@mailstep/design-system 0.5.0-beta.26 → 0.5.0-beta.27
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/package.json +1 -1
- package/ui/Blocks/Popover/index.d.ts +2 -0
- package/ui/Blocks/Popover/index.js +3 -2
- package/ui/index.es.js +10107 -10206
- package/ui/index.umd.js +323 -323
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
import { Placement } from '@popperjs/core';
|
|
3
|
+
import { StyledComponent } from 'styled-components';
|
|
3
4
|
type DropdownMenuProps = {
|
|
4
5
|
parentRef: React.MutableRefObject<HTMLDivElement | null | undefined>;
|
|
5
6
|
onClose: () => void;
|
|
6
7
|
children: React.ReactChild;
|
|
7
8
|
placement?: Placement;
|
|
9
|
+
wrapper?: StyledComponent<any, any>;
|
|
8
10
|
};
|
|
9
11
|
declare const Popover: FC<DropdownMenuProps>;
|
|
10
12
|
export default Popover;
|
|
@@ -9,11 +9,12 @@ import { useClickOutside } from '../Modal/hooks/useClickOutside';
|
|
|
9
9
|
import Portal from '../../Elements/Portal';
|
|
10
10
|
var PopoverWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n z-index: 5;\n"], ["\n z-index: 5;\n"])));
|
|
11
11
|
var Popover = function (_a) {
|
|
12
|
-
var placement = _a.placement, children = _a.children, onClose = _a.onClose, parentRef = _a.parentRef;
|
|
12
|
+
var placement = _a.placement, wrapper = _a.wrapper, children = _a.children, onClose = _a.onClose, parentRef = _a.parentRef;
|
|
13
13
|
var popperRef = useClickOutside({ onClose: onClose, parentRef: parentRef });
|
|
14
|
+
var Wrapper = wrapper || PopoverWrapper;
|
|
14
15
|
return (_jsx(Portal, { children: _jsx("div", { ref: popperRef, children: _jsx(Popper, { innerRef: popperRef, referenceElement: parentRef.current, placement: placement, children: function (_a) {
|
|
15
16
|
var ref = _a.ref, style = _a.style;
|
|
16
|
-
return (_jsx(
|
|
17
|
+
return (_jsx(Wrapper, { ref: ref, style: style, children: children }));
|
|
17
18
|
} }) }) }));
|
|
18
19
|
};
|
|
19
20
|
export default Popover;
|