@wonderflow/react-components 11.0.1 → 11.0.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.
|
@@ -42,7 +42,7 @@ const AutocompleteAnimation = {
|
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
};
|
|
45
|
-
export const Autocomplete = forwardRef(({ children, onChange, disabled, readOnly, value: val, busy, maxHeight = '200px', emptyContent = 'No items to show', root
|
|
45
|
+
export const Autocomplete = forwardRef(({ children, onChange, disabled, readOnly, value: val, busy, maxHeight = '200px', emptyContent = 'No items to show', root, ...otherProps }, forwardedRef) => {
|
|
46
46
|
const seedID = useUIDSeed();
|
|
47
47
|
const autocompleteRef = useRef(null);
|
|
48
48
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -111,7 +111,7 @@ export const Autocomplete = forwardRef(({ children, onChange, disabled, readOnly
|
|
|
111
111
|
? _jsx(Stack, { hPadding: 8, as: "span", children: _jsx(Skeleton, { count: 3 }) })
|
|
112
112
|
: Children.map(filteredOptions, child => isValidElement(child) && cloneElement(child, {
|
|
113
113
|
onClick: handleOptionClick,
|
|
114
|
-
}))] }) }) }) }) }), root)] }));
|
|
114
|
+
}))] }) }) }) }) }), root ?? document.body)] }));
|
|
115
115
|
});
|
|
116
116
|
Autocomplete.Option = AutocompleteOption;
|
|
117
117
|
Autocomplete.displayName = 'Autocomplete';
|
|
@@ -20,13 +20,13 @@ import { createPortal } from 'react-dom';
|
|
|
20
20
|
import { useUIDSeed } from 'react-uid';
|
|
21
21
|
import { OverlayProvider } from '../..';
|
|
22
22
|
import * as styles from './overlay-container.module.css';
|
|
23
|
-
export const OverlayContainer = ({ children, root
|
|
23
|
+
export const OverlayContainer = ({ children, root, overlayColor = 'dark', index = 4, obfuscate = true, onClose, }) => {
|
|
24
24
|
const seedID = useUIDSeed();
|
|
25
25
|
useEffect(() => {
|
|
26
|
-
if (root
|
|
26
|
+
if (root?.closest('[data-overlay-container]')) {
|
|
27
27
|
throw new Error('An OverlayContainer must not be inside another container. Please change the root prop.');
|
|
28
28
|
}
|
|
29
29
|
}, [root]);
|
|
30
30
|
const content = (_jsx(OverlayProvider, { onClose: onClose, children: _jsx(AnimatePresence, { exitBeforeEnter: true, children: children && (_jsx("div", { "data-overlay-container": true, "data-overlay-container-obfuscate": obfuscate, className: styles.OverlayContainer, style: { zIndex: index }, children: _jsxs(LazyMotion, { features: domMax, children: [obfuscate && (_jsx(m.span, { className: styles.Backdrop, "data-overlay-color": overlayColor, initial: { opacity: 0 }, animate: { opacity: 0.95 }, transition: { duration: 0.2 }, exit: { opacity: 0 } }, seedID('modal-backdrop'))), children] }) })) }) }));
|
|
31
|
-
return createPortal(content, root);
|
|
31
|
+
return createPortal(content, root ?? document.body);
|
|
32
32
|
};
|
|
@@ -6,7 +6,7 @@ import { usePopperTooltip } from 'react-popper-tooltip';
|
|
|
6
6
|
import { useUIDSeed } from 'react-uid';
|
|
7
7
|
import { Elevator } from '../..';
|
|
8
8
|
import * as styles from './tooltip.module.css';
|
|
9
|
-
export const Tooltip = ({ children, trigger, placement = 'bottom-start', open, style, maxWidth = '40ch', fill = false, interactive = false, delay = 500, root
|
|
9
|
+
export const Tooltip = ({ children, trigger, placement = 'bottom-start', open, style, maxWidth = '40ch', fill = false, interactive = false, delay = 500, root, }) => {
|
|
10
10
|
const [isOpen, setIsOpen] = useState(false);
|
|
11
11
|
const seedID = useUIDSeed();
|
|
12
12
|
const id = seedID('tooltip-content');
|
|
@@ -43,5 +43,5 @@ export const Tooltip = ({ children, trigger, placement = 'bottom-start', open, s
|
|
|
43
43
|
ref: setTriggerRef,
|
|
44
44
|
tabIndex: 0,
|
|
45
45
|
'aria-describedby': id,
|
|
46
|
-
})), visible && createPortal(_jsx(Elevator, { resting: 1, children: _jsxs("div", { ref: setTooltipRef, role: "tooltip", id: id, "data-theme": "dark", ...getTooltipProps({ className: styles.Balloon, style: dynamycStyle }), children: [children, _jsx("div", { ...getArrowProps({ className: styles.Arrow }) })] }) }), root)] }));
|
|
46
|
+
})), visible && createPortal(_jsx(Elevator, { resting: 1, children: _jsxs("div", { ref: setTooltipRef, role: "tooltip", id: id, "data-theme": "dark", ...getTooltipProps({ className: styles.Balloon, style: dynamycStyle }), children: [children, _jsx("div", { ...getArrowProps({ className: styles.Arrow }) })] }) }), root ?? document.body)] }));
|
|
47
47
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wonderflow/react-components",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.2",
|
|
4
4
|
"description": "UI components from Wonderflow's Wanda design system",
|
|
5
5
|
"author": "Wonderflow",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"@types/react-dom": "17.0.14",
|
|
83
83
|
"@types/react-table": "7.7.12",
|
|
84
84
|
"@types/react-test-renderer": "18.0.0",
|
|
85
|
-
"@wonderflow/config": "11.0.
|
|
86
|
-
"@wonderflow/tokens": "11.0.
|
|
85
|
+
"@wonderflow/config": "11.0.2",
|
|
86
|
+
"@wonderflow/tokens": "11.0.2",
|
|
87
87
|
"babel-loader": "8.2.5",
|
|
88
88
|
"cpy-cli": "3.1.1",
|
|
89
89
|
"postcss": "8.4.17",
|