@veritone-ce/design-system 2.4.21 → 2.4.22
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.
|
@@ -37,7 +37,7 @@ function Menu({
|
|
|
37
37
|
const [activeIndex, setActiveIndex] = React.useState(null);
|
|
38
38
|
const elementsRef = React.useRef([]);
|
|
39
39
|
const labelsRef = React.useRef([]);
|
|
40
|
-
const { floatingStyles, refs, context } = react.useFloating({
|
|
40
|
+
const { floatingStyles, refs, context, middlewareData } = react.useFloating({
|
|
41
41
|
open: isOpen,
|
|
42
42
|
onOpenChange(newOpen) {
|
|
43
43
|
if (!newOpen && dismissEnabled) {
|
|
@@ -50,6 +50,7 @@ function Menu({
|
|
|
50
50
|
placement,
|
|
51
51
|
strategy,
|
|
52
52
|
middleware: [
|
|
53
|
+
react.hide(),
|
|
53
54
|
react.offset({
|
|
54
55
|
mainAxis: 4,
|
|
55
56
|
alignmentAxis: 0
|
|
@@ -113,7 +114,8 @@ function Menu({
|
|
|
113
114
|
tabIndex: 0,
|
|
114
115
|
"aria-labelledby": anchor?.id || props.anchorId,
|
|
115
116
|
style: {
|
|
116
|
-
...floatingStyles
|
|
117
|
+
...floatingStyles,
|
|
118
|
+
visibility: middlewareData.hide?.referenceHidden ? "hidden" : "visible"
|
|
117
119
|
},
|
|
118
120
|
...getFloatingProps(),
|
|
119
121
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -11,7 +11,7 @@ import '@mui/system';
|
|
|
11
11
|
import { PortalThemeRelay } from '../styles/portal.js';
|
|
12
12
|
import '../styles/styled.js';
|
|
13
13
|
import '../Box/index.js';
|
|
14
|
-
import { useListItem, useMergeRefs, useFloating, offset, flip, shift, size, autoUpdate, useRole, useDismiss, useListNavigation, useTypeahead, useInteractions, useTransitionStyles, FloatingList, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
|
|
14
|
+
import { useListItem, useMergeRefs, useFloating, hide, offset, flip, shift, size, autoUpdate, useRole, useDismiss, useListNavigation, useTypeahead, useInteractions, useTransitionStyles, FloatingList, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
|
|
15
15
|
import css from './styles.module.scss.js';
|
|
16
16
|
import { resolvePopoverAnchor } from '../popover/utils.js';
|
|
17
17
|
import Typography from '../Typography/index.js';
|
|
@@ -33,7 +33,7 @@ function Menu({
|
|
|
33
33
|
const [activeIndex, setActiveIndex] = React__default.useState(null);
|
|
34
34
|
const elementsRef = React__default.useRef([]);
|
|
35
35
|
const labelsRef = React__default.useRef([]);
|
|
36
|
-
const { floatingStyles, refs, context } = useFloating({
|
|
36
|
+
const { floatingStyles, refs, context, middlewareData } = useFloating({
|
|
37
37
|
open: isOpen,
|
|
38
38
|
onOpenChange(newOpen) {
|
|
39
39
|
if (!newOpen && dismissEnabled) {
|
|
@@ -46,6 +46,7 @@ function Menu({
|
|
|
46
46
|
placement,
|
|
47
47
|
strategy,
|
|
48
48
|
middleware: [
|
|
49
|
+
hide(),
|
|
49
50
|
offset({
|
|
50
51
|
mainAxis: 4,
|
|
51
52
|
alignmentAxis: 0
|
|
@@ -109,7 +110,8 @@ function Menu({
|
|
|
109
110
|
tabIndex: 0,
|
|
110
111
|
"aria-labelledby": anchor?.id || props.anchorId,
|
|
111
112
|
style: {
|
|
112
|
-
...floatingStyles
|
|
113
|
+
...floatingStyles,
|
|
114
|
+
visibility: middlewareData.hide?.referenceHidden ? "hidden" : "visible"
|
|
113
115
|
},
|
|
114
116
|
...getFloatingProps(),
|
|
115
117
|
children: /* @__PURE__ */ jsx(
|