@lumx/react 3.9.2-alpha.7 → 3.9.2-alpha.9
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/index.js +26 -6
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/popover/Popover.tsx +2 -2
- package/src/components/popover/constants.ts +5 -0
- package/src/components/tooltip/Tooltip.tsx +21 -5
- package/src/components/tooltip/constants.ts +7 -0
- package/src/stories/generated/TextField/Demos.stories.tsx +1 -0
package/index.js
CHANGED
|
@@ -6409,6 +6409,11 @@ const FitAnchorWidth = {
|
|
|
6409
6409
|
*/
|
|
6410
6410
|
const ARROW_SIZE$1 = 14;
|
|
6411
6411
|
|
|
6412
|
+
/**
|
|
6413
|
+
* Popover default z-index
|
|
6414
|
+
*/
|
|
6415
|
+
const POPOVER_ZINDEX = 9999;
|
|
6416
|
+
|
|
6412
6417
|
/**
|
|
6413
6418
|
* Popper js modifier to fit popover min width to the anchor width.
|
|
6414
6419
|
*/
|
|
@@ -6602,7 +6607,7 @@ const DEFAULT_PROPS$P = {
|
|
|
6602
6607
|
placement: Placement.AUTO,
|
|
6603
6608
|
focusAnchorOnClose: true,
|
|
6604
6609
|
usePortal: true,
|
|
6605
|
-
zIndex:
|
|
6610
|
+
zIndex: POPOVER_ZINDEX
|
|
6606
6611
|
};
|
|
6607
6612
|
|
|
6608
6613
|
/** Method to render the popover inside a portal if usePortal is true */
|
|
@@ -13909,6 +13914,11 @@ Toolbar.displayName = COMPONENT_NAME$3;
|
|
|
13909
13914
|
Toolbar.className = CLASSNAME$3;
|
|
13910
13915
|
Toolbar.defaultProps = DEFAULT_PROPS$3;
|
|
13911
13916
|
|
|
13917
|
+
/**
|
|
13918
|
+
* Make sure tooltip appear above popovers.
|
|
13919
|
+
*/
|
|
13920
|
+
const TOOLTIP_ZINDEX = POPOVER_ZINDEX + 1;
|
|
13921
|
+
|
|
13912
13922
|
/**
|
|
13913
13923
|
* Add ref and ARIA attribute(s) in tooltip children or wrapped children.
|
|
13914
13924
|
* Button, IconButton, Icon and React HTML elements don't need to be wrapped but any other kind of children (array, fragment, custom components)
|
|
@@ -14092,7 +14102,7 @@ function useTooltipOpen(delay, anchorElement) {
|
|
|
14092
14102
|
};
|
|
14093
14103
|
}
|
|
14094
14104
|
|
|
14095
|
-
const _excluded$2 = ["label", "children", "className", "delay", "placement", "forceOpen", "closeMode", "ariaLinkMode"];
|
|
14105
|
+
const _excluded$2 = ["label", "children", "className", "delay", "placement", "forceOpen", "closeMode", "ariaLinkMode", "zIndex"];
|
|
14096
14106
|
|
|
14097
14107
|
/** Position of the tooltip relative to the anchor element. */
|
|
14098
14108
|
|
|
@@ -14116,7 +14126,8 @@ const CLASSNAME$2 = getRootClassName(COMPONENT_NAME$2);
|
|
|
14116
14126
|
const DEFAULT_PROPS$2 = {
|
|
14117
14127
|
placement: Placement.BOTTOM,
|
|
14118
14128
|
closeMode: 'unmount',
|
|
14119
|
-
ariaLinkMode: 'aria-describedby'
|
|
14129
|
+
ariaLinkMode: 'aria-describedby',
|
|
14130
|
+
zIndex: TOOLTIP_ZINDEX
|
|
14120
14131
|
};
|
|
14121
14132
|
|
|
14122
14133
|
/**
|
|
@@ -14141,7 +14152,8 @@ const Tooltip = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
14141
14152
|
placement,
|
|
14142
14153
|
forceOpen,
|
|
14143
14154
|
closeMode,
|
|
14144
|
-
ariaLinkMode
|
|
14155
|
+
ariaLinkMode,
|
|
14156
|
+
zIndex
|
|
14145
14157
|
} = props,
|
|
14146
14158
|
forwardedProps = _objectWithoutProperties(props, _excluded$2);
|
|
14147
14159
|
// Disable in SSR.
|
|
@@ -14153,7 +14165,8 @@ const Tooltip = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
14153
14165
|
const [anchorElement, setAnchorElement] = useState(null);
|
|
14154
14166
|
const {
|
|
14155
14167
|
styles,
|
|
14156
|
-
attributes
|
|
14168
|
+
attributes,
|
|
14169
|
+
update
|
|
14157
14170
|
} = usePopper(anchorElement, popperElement, {
|
|
14158
14171
|
placement,
|
|
14159
14172
|
modifiers: [{
|
|
@@ -14178,6 +14191,11 @@ const Tooltip = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
14178
14191
|
label,
|
|
14179
14192
|
ariaLinkMode: ariaLinkMode
|
|
14180
14193
|
});
|
|
14194
|
+
|
|
14195
|
+
// Update on open
|
|
14196
|
+
React__default.useEffect(() => {
|
|
14197
|
+
if (isOpen) update === null || update === void 0 ? void 0 : update();
|
|
14198
|
+
}, [isOpen, update]);
|
|
14181
14199
|
const labelLines = label ? label.split('\n') : [];
|
|
14182
14200
|
const tooltipRef = useMergeRefs(ref, setPopperElement, onPopperMount);
|
|
14183
14201
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TooltipContextProvider, null, wrappedChildren), isMounted && /*#__PURE__*/createPortal( /*#__PURE__*/React__default.createElement("div", _extends({
|
|
@@ -14191,7 +14209,9 @@ const Tooltip = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
14191
14209
|
position,
|
|
14192
14210
|
hidden: !isOpen && closeMode === 'hide'
|
|
14193
14211
|
})),
|
|
14194
|
-
style: styles.popper
|
|
14212
|
+
style: _objectSpread2(_objectSpread2({}, styles.popper), {}, {
|
|
14213
|
+
zIndex
|
|
14214
|
+
})
|
|
14195
14215
|
}, attributes.popper), /*#__PURE__*/React__default.createElement("div", {
|
|
14196
14216
|
className: `${CLASSNAME$2}__arrow`
|
|
14197
14217
|
}), /*#__PURE__*/React__default.createElement("div", {
|