@hitachivantara/uikit-react-core 6.6.1 → 6.7.0

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.
@@ -1,20 +1,16 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useState, useCallback, useMemo, useId, isValidElement, cloneElement, Fragment } from "react";
3
- import { usePopper } from "react-popper";
4
- import { useForkRef } from "@mui/material/utils";
5
- import { detectOverflow } from "@popperjs/core";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { forwardRef, useState, useId, useCallback, isValidElement, cloneElement, Fragment } from "react";
3
+ import useForkRef from "@mui/utils/useForkRef";
6
4
  import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
7
5
  import { useControlled } from "../hooks/useControlled.js";
8
6
  import { useUniqueId } from "../hooks/useUniqueId.js";
9
7
  import { HvIcon } from "../icons.js";
10
- import { getFirstAndLastFocus } from "../utils/focusableElementFinder.js";
11
8
  import { isKey, isOneOfKeys } from "../utils/keyboardUtils.js";
12
9
  import { useClasses } from "./BaseDropdown.styles.js";
13
10
  import { staticClasses } from "./BaseDropdown.styles.js";
14
- import { BaseDropdownPanel } from "./BaseDropdownPanel.js";
15
- import { BaseDropdownContext, useBaseDropdownContext } from "./context.js";
11
+ import { HvDropdownPanel } from "./BaseDropdownPanel.js";
16
12
  import { HvTypography } from "../Typography/Typography.js";
17
- const BaseDropdown = forwardRef(function BaseDropdown2(props, ref) {
13
+ const HvBaseDropdown = forwardRef(function BaseDropdown(props, ref) {
18
14
  const {
19
15
  id: idProp,
20
16
  className,
@@ -26,6 +22,9 @@ const BaseDropdown = forwardRef(function BaseDropdown2(props, ref) {
26
22
  headerComponent: HeaderComponentProp,
27
23
  adornment,
28
24
  expanded,
25
+ popperProps,
26
+ variableWidth,
27
+ placement: placementProp = "right",
29
28
  dropdownHeaderProps,
30
29
  defaultExpanded,
31
30
  disabled,
@@ -38,15 +37,14 @@ const BaseDropdown = forwardRef(function BaseDropdown2(props, ref) {
38
37
  dropdownHeaderRef: dropdownHeaderRefProp,
39
38
  onToggle,
40
39
  onClickOutside,
40
+ onContainerCreation,
41
41
  ...others
42
- } = props;
42
+ } = useDefaultProps("HvBaseDropdown", props);
43
43
  const { classes, cx } = useClasses(classesProp);
44
- const {
45
- popperPlacement,
46
- popperElement,
47
- referenceElement,
48
- setReferenceElement
49
- } = useBaseDropdownContext();
44
+ const [computedPlacement, setComputedPlacement] = useState();
45
+ const [referenceElement, setReferenceElement] = useState(
46
+ null
47
+ );
50
48
  const [isOpen, setIsOpen] = useControlled(expanded, Boolean(defaultExpanded));
51
49
  const headerRef = useForkRef(
52
50
  setReferenceElement,
@@ -92,7 +90,7 @@ const BaseDropdown = forwardRef(function BaseDropdown2(props, ref) {
92
90
  const defaultHeaderElement = /* @__PURE__ */ jsxs(
93
91
  "div",
94
92
  {
95
- "data-popper-placement": popperPlacement,
93
+ "data-popper-placement": computedPlacement,
96
94
  className: cx(classes.header, {
97
95
  [classes.headerOpen]: isOpen,
98
96
  [classes.headerReadOnly]: readOnly,
@@ -130,18 +128,6 @@ const BaseDropdown = forwardRef(function BaseDropdown2(props, ref) {
130
128
  ref: headerRef,
131
129
  ...headerControlArias
132
130
  }) : defaultHeaderElement;
133
- const handleContainerKeyDown = (event) => {
134
- if (isKey(event, "Esc")) {
135
- handleToggle(event);
136
- }
137
- if (isKey(event, "Tab") && !event.shiftKey) {
138
- const focusList = getFirstAndLastFocus(popperElement);
139
- if (document.activeElement === focusList?.last) {
140
- event.preventDefault();
141
- focusList?.first?.focus();
142
- }
143
- }
144
- };
145
131
  const handleOutside = (event) => {
146
132
  const isButtonClick = referenceElement?.contains(event.target);
147
133
  if (!isButtonClick) {
@@ -178,106 +164,28 @@ const BaseDropdown = forwardRef(function BaseDropdown2(props, ref) {
178
164
  children: headerElement
179
165
  }
180
166
  ),
181
- isOpen && /* @__PURE__ */ jsx(
182
- BaseDropdownPanel,
167
+ /* @__PURE__ */ jsx(
168
+ HvDropdownPanel,
183
169
  {
184
- classes,
170
+ open: isOpen,
171
+ classes: { container: classes.container, panel: classes.panel },
172
+ placement: `bottom-${placementProp === "right" ? "start" : "end"}`,
173
+ variableWidth,
185
174
  containerId,
186
175
  onClickAway: handleOutside,
187
176
  disablePortal,
188
- onContainerKeyDown: handleContainerKeyDown,
177
+ anchorEl: referenceElement,
178
+ onToggle: handleToggle,
179
+ onFirstUpdate: (state) => {
180
+ setComputedPlacement(state.placement);
181
+ onContainerCreation?.(state.elements?.popper ?? null, state);
182
+ },
183
+ popperOptions: popperProps,
189
184
  children
190
185
  }
191
186
  )
192
187
  ] });
193
188
  });
194
- const HvBaseDropdown = forwardRef(
195
- function HvBaseDropdown2(props, ref) {
196
- const {
197
- popperProps = {},
198
- variableWidth,
199
- placement: placementProp = "right",
200
- onContainerCreation,
201
- ...others
202
- } = useDefaultProps("HvBaseDropdown", props);
203
- const placement = `bottom-${placementProp === "right" ? "start" : "end"}`;
204
- const { modifiers: popperPropsModifiers, ...otherPopperProps } = popperProps;
205
- const [referenceElement, setReferenceElement] = useState(null);
206
- const [popperElement, setPopperElement] = useState(
207
- null
208
- );
209
- const onFirstUpdate = useCallback(() => {
210
- onContainerCreation?.(popperElement);
211
- }, [onContainerCreation, popperElement]);
212
- const modifiers = useMemo(
213
- () => [
214
- {
215
- name: "variableWidth",
216
- enabled: !variableWidth,
217
- phase: "beforeWrite",
218
- requires: ["computeStyles"],
219
- fn: ({ state }) => {
220
- state.styles.popper.width = `${state.rects.reference.width}px`;
221
- },
222
- effect: ({ state }) => {
223
- state.elements.popper.style.width = `${state.elements.reference.offsetWidth}px`;
224
- }
225
- },
226
- {
227
- name: "maxSize",
228
- enabled: true,
229
- phase: "main",
230
- requiresIfExists: ["offset", "preventOverflow", "flip"],
231
- fn: ({ state, name, options }) => {
232
- const overflow = detectOverflow(state, options);
233
- const x = state.modifiersData.preventOverflow?.x || 0;
234
- const y = state.modifiersData.preventOverflow?.y || 0;
235
- const popperWidth = state.rects.popper.width;
236
- const popperHeight = state.rects.popper.height;
237
- const basePlacement = state.placement.split("-")[0];
238
- const widthProp = basePlacement === "left" ? "left" : "right";
239
- const heightProp = basePlacement === "top" ? "top" : "bottom";
240
- state.modifiersData[name] = {
241
- width: popperWidth - overflow[widthProp] - x,
242
- height: popperHeight - overflow[heightProp] - y
243
- };
244
- }
245
- },
246
- {
247
- name: "applyMaxSize",
248
- enabled: true,
249
- phase: "beforeWrite",
250
- requires: ["maxSize"],
251
- fn: ({ state }) => {
252
- const { width, height } = state.modifiersData.maxSize;
253
- state.styles.popper.maxWidth = `${width}px`;
254
- state.styles.popper.maxHeight = `${height}px`;
255
- }
256
- },
257
- ...popperPropsModifiers || []
258
- ],
259
- [popperPropsModifiers, variableWidth]
260
- );
261
- const popper = usePopper(referenceElement, popperElement, {
262
- placement,
263
- modifiers,
264
- onFirstUpdate,
265
- ...otherPopperProps
266
- });
267
- const value = useMemo(
268
- () => ({
269
- popperPlacement: popper?.attributes.popper?.["data-popper-placement"] ?? "bottom",
270
- popper,
271
- popperElement,
272
- setPopperElement,
273
- referenceElement,
274
- setReferenceElement
275
- }),
276
- [popper, popperElement, referenceElement]
277
- );
278
- return /* @__PURE__ */ jsx(BaseDropdownContext.Provider, { value, children: /* @__PURE__ */ jsx(BaseDropdown, { ref, ...others }) });
279
- }
280
- );
281
189
  export {
282
190
  HvBaseDropdown,
283
191
  staticClasses as baseDropdownClasses
@@ -10,7 +10,7 @@ const { useClasses, staticClasses } = createClasses("HvBaseDropdown", {
10
10
  }
11
11
  },
12
12
  anchor: { display: "inline-block", width: "100%" },
13
- container: { zIndex: theme.zIndices.popover, width: "auto" },
13
+ container: {},
14
14
  header: {
15
15
  cursor: "pointer",
16
16
  userSelect: "none",
@@ -75,25 +75,7 @@ const { useClasses, staticClasses } = createClasses("HvBaseDropdown", {
75
75
  display: "block",
76
76
  color: theme.colors.textSubtle
77
77
  },
78
- panel: {
79
- // TODO: remove padding override in v6 (most elements need it)
80
- padding: 0,
81
- border: `1px solid ${theme.colors.text}`
82
- },
83
- inputExtensionOpen: {
84
- height: "0px",
85
- backgroundColor: theme.colors.bgContainer,
86
- borderTop: "none",
87
- borderBottom: "none",
88
- borderRight: `1px solid ${theme.colors.text}`,
89
- borderLeft: `1px solid ${theme.colors.text}`
90
- },
91
- inputExtensionLeftPosition: { marginLeft: "auto" },
92
- inputExtensionOpenShadow: {
93
- boxShadow: `0px 8px 0px ${theme.colors.textDimmed}, 0px 0px 9px 0px rgba(65,65,65,.12)`
94
- },
95
- inputExtensionFloatRight: { float: "right" },
96
- inputExtensionFloatLeft: { float: "left" }
78
+ panel: {}
97
79
  });
98
80
  export {
99
81
  staticClasses,
@@ -1,77 +1,92 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { Portal, ClickAwayListener } from "@mui/base";
3
- import { useCss, useTheme } from "@hitachivantara/uikit-react-utils";
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useRef, useState } from "react";
3
+ import ClickAwayListener from "@mui/material/ClickAwayListener";
4
+ import Popper from "@mui/material/Popper";
5
+ import { useDefaultProps, useTheme, createClasses } from "@hitachivantara/uikit-react-utils";
6
+ import { theme } from "@hitachivantara/uikit-styles";
4
7
  import { getContainerElement } from "../utils/document.js";
5
- import { useBaseDropdownContext } from "./context.js";
8
+ import { getFirstAndLastFocus } from "../utils/focusableElementFinder.js";
9
+ import { isKey } from "../utils/keyboardUtils.js";
10
+ import { usePopperModifiers } from "./utils.js";
6
11
  import { HvPanel } from "../Panel/Panel.js";
7
- const BaseDropdownPanel = ({
8
- classes,
9
- containerId,
10
- children,
11
- disablePortal,
12
- onContainerKeyDown,
13
- onClickAway
14
- }) => {
15
- const { cx } = useCss();
16
- const { popperPlacement, popper, referenceElement, setPopperElement } = useBaseDropdownContext();
12
+ const name = "HvDropdownPanel";
13
+ const { useClasses } = createClasses(name, {
14
+ container: {
15
+ zIndex: theme.zIndices.popover,
16
+ width: "auto"
17
+ },
18
+ panel: {
19
+ padding: 0,
20
+ // TODO(major): remove padding as most elements need it
21
+ border: `1px solid ${theme.colors.text}`
22
+ }
23
+ });
24
+ const HvDropdownPanel = (props) => {
25
+ const {
26
+ classes: classesProp,
27
+ className,
28
+ containerId,
29
+ children,
30
+ variableWidth,
31
+ anchorEl,
32
+ disablePortal,
33
+ modifiers: modifiersProp,
34
+ popperOptions,
35
+ onToggle,
36
+ onClickAway,
37
+ onFirstUpdate,
38
+ ...others
39
+ } = useDefaultProps(name, props);
40
+ const { classes, cx } = useClasses(classesProp, false);
17
41
  const { rootId } = useTheme();
18
- const extensionWidth = referenceElement ? referenceElement?.offsetWidth : "inherit";
19
- const container = (
20
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions
21
- /* @__PURE__ */ jsxs(
22
- "div",
23
- {
24
- ref: setPopperElement,
25
- className: classes.container,
26
- onKeyDown: onContainerKeyDown,
27
- style: popper?.styles.popper,
28
- ...popper?.attributes.popper,
29
- children: [
30
- popperPlacement?.includes("bottom") && /* @__PURE__ */ jsx(
31
- "div",
32
- {
33
- style: { width: extensionWidth },
34
- className: cx(classes.inputExtensionOpen, {
35
- [classes.inputExtensionLeftPosition]: popperPlacement.includes("end")
36
- })
37
- }
38
- ),
39
- /* @__PURE__ */ jsx(
40
- HvPanel,
41
- {
42
- id: containerId,
43
- "data-popper-placement": popperPlacement,
44
- className: classes.panel,
45
- children
46
- }
47
- ),
48
- popperPlacement?.includes("top") && /* @__PURE__ */ jsx(
49
- "div",
50
- {
51
- style: { width: extensionWidth },
52
- className: cx(
53
- classes.inputExtensionOpen,
54
- classes.inputExtensionOpenShadow,
55
- {
56
- [classes.inputExtensionFloatRight]: popperPlacement.includes("end"),
57
- [classes.inputExtensionFloatLeft]: popperPlacement.includes("start")
58
- }
59
- )
60
- }
61
- )
62
- ]
42
+ const popperRef = useRef(null);
43
+ const [placement, setPlacement] = useState();
44
+ const modifiers = usePopperModifiers({
45
+ variableWidth,
46
+ modifiers: modifiersProp,
47
+ onPlacementChange: setPlacement
48
+ });
49
+ const handleKeyDown = (event) => {
50
+ if (isKey(event, "Esc")) {
51
+ onToggle?.(event);
52
+ }
53
+ if (isKey(event, "Tab") && !event.shiftKey) {
54
+ const focusList = getFirstAndLastFocus(
55
+ popperRef.current?.state?.elements.popper
56
+ );
57
+ if (document.activeElement === focusList?.last) {
58
+ event.preventDefault();
59
+ focusList?.first?.focus();
63
60
  }
64
- )
65
- );
61
+ }
62
+ };
66
63
  return /* @__PURE__ */ jsx(
67
- Portal,
64
+ Popper,
68
65
  {
69
- container: getContainerElement(rootId),
66
+ anchorEl,
67
+ popperRef,
70
68
  disablePortal,
71
- children: /* @__PURE__ */ jsx(ClickAwayListener, { onClickAway, children: container })
69
+ container: !disablePortal ? getContainerElement(rootId) : void 0,
70
+ className: cx(classes.container, className),
71
+ modifiers,
72
+ onKeyDown: handleKeyDown,
73
+ popperOptions: {
74
+ onFirstUpdate,
75
+ ...popperOptions
76
+ },
77
+ ...others,
78
+ children: /* @__PURE__ */ jsx(ClickAwayListener, { onClickAway, children: /* @__PURE__ */ jsx(
79
+ HvPanel,
80
+ {
81
+ id: containerId,
82
+ className: classes.panel,
83
+ "data-popper-placement": placement,
84
+ children
85
+ }
86
+ ) })
72
87
  }
73
88
  );
74
89
  };
75
90
  export {
76
- BaseDropdownPanel
91
+ HvDropdownPanel
77
92
  };
@@ -0,0 +1,79 @@
1
+ import { useMemo } from "react";
2
+ import { detectOverflow } from "@popperjs/core";
3
+ function usePopperModifiers({
4
+ variableWidth,
5
+ modifiers,
6
+ onPlacementChange
7
+ }) {
8
+ return useMemo(
9
+ () => [
10
+ {
11
+ name: "placementListener",
12
+ enabled: true,
13
+ phase: "main",
14
+ fn: ({ state }) => onPlacementChange?.(state.placement)
15
+ },
16
+ {
17
+ name: "fixedWidth",
18
+ enabled: !variableWidth,
19
+ phase: "beforeWrite",
20
+ requires: ["computeStyles"],
21
+ fn: ({ state }) => {
22
+ state.styles.popper.width = `${state.rects.reference.width}px`;
23
+ },
24
+ effect: ({ state }) => {
25
+ const { popper, reference } = state.elements;
26
+ popper.style.width = `${reference.offsetWidth}px`;
27
+ }
28
+ },
29
+ {
30
+ name: "minSize",
31
+ enabled: true,
32
+ phase: "main",
33
+ fn: ({ state }) => {
34
+ state.styles.popper.minWidth = `${state.rects.reference.width}px`;
35
+ },
36
+ effect: ({ state }) => {
37
+ const { popper, reference } = state.elements;
38
+ popper.style.minWidth = `${reference.offsetWidth}px`;
39
+ }
40
+ },
41
+ {
42
+ name: "maxSize",
43
+ enabled: true,
44
+ phase: "main",
45
+ requiresIfExists: ["offset", "preventOverflow", "flip"],
46
+ fn: ({ state, name, options }) => {
47
+ const overflow = detectOverflow(state, options);
48
+ const x = state.modifiersData.preventOverflow?.x || 0;
49
+ const y = state.modifiersData.preventOverflow?.y || 0;
50
+ const popperWidth = state.rects.popper.width;
51
+ const popperHeight = state.rects.popper.height;
52
+ const basePlacement = state.placement.split("-")[0];
53
+ const widthProp = basePlacement === "left" ? "left" : "right";
54
+ const heightProp = basePlacement === "top" ? "top" : "bottom";
55
+ state.modifiersData[name] = {
56
+ width: popperWidth - overflow[widthProp] - x,
57
+ height: popperHeight - overflow[heightProp] - y
58
+ };
59
+ }
60
+ },
61
+ {
62
+ name: "applyMaxSize",
63
+ enabled: true,
64
+ phase: "beforeWrite",
65
+ requires: ["maxSize"],
66
+ fn: ({ state }) => {
67
+ const { width, height } = state.modifiersData.maxSize;
68
+ state.styles.popper.maxWidth = `${width}px`;
69
+ state.styles.popper.maxHeight = `${height}px`;
70
+ }
71
+ },
72
+ ...modifiers || []
73
+ ],
74
+ [modifiers, variableWidth, onPlacementChange]
75
+ );
76
+ }
77
+ export {
78
+ usePopperModifiers
79
+ };
@@ -1,7 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { forwardRef, useMemo } from "react";
2
+ import { forwardRef, useState, useMemo } from "react";
3
3
  import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
4
- import { useBaseDropdownContext } from "../BaseDropdown/context.js";
5
4
  import { useControlled } from "../hooks/useControlled.js";
6
5
  import { useLabels } from "../hooks/useLabels.js";
7
6
  import { useUniqueId } from "../hooks/useUniqueId.js";
@@ -19,7 +18,6 @@ const DEFAULT_LABELS = {
19
18
  const HeaderComponent = forwardRef(
20
19
  function HeaderComponent2(props, ref) {
21
20
  const { open, icon, disabled, ...others } = props;
22
- const { popperPlacement } = useBaseDropdownContext();
23
21
  return /* @__PURE__ */ jsx(
24
22
  HvDropdownButton,
25
23
  {
@@ -29,7 +27,6 @@ const HeaderComponent = forwardRef(
29
27
  disabled,
30
28
  "aria-expanded": open,
31
29
  "aria-haspopup": "menu",
32
- placement: popperPlacement,
33
30
  ...others,
34
31
  children: icon || /* @__PURE__ */ jsx(HvIcon, { name: "DotsVertical" })
35
32
  }
@@ -58,6 +55,7 @@ const HvDropDownMenu = forwardRef(function HvDropDownMenu2(props, ref) {
58
55
  } = useDefaultProps("HvDropDownMenu", props);
59
56
  const { classes, cx } = useClasses(classesProp);
60
57
  const labels = useLabels(DEFAULT_LABELS, labelsProp);
58
+ const [computedPlacement, setComputedPlacement] = useState();
61
59
  const [open, setOpen] = useControlled(expanded, Boolean(defaultExpanded));
62
60
  const id = useUniqueId(idProp);
63
61
  const handleClose = (event) => {
@@ -87,6 +85,7 @@ const HvDropDownMenu = forwardRef(function HvDropDownMenu2(props, ref) {
87
85
  },
88
86
  expanded: open && !disabled,
89
87
  headerComponent: HeaderComponent,
88
+ "data-popper-placement": computedPlacement,
90
89
  size,
91
90
  variant,
92
91
  open,
@@ -100,7 +99,8 @@ const HvDropDownMenu = forwardRef(function HvDropDownMenu2(props, ref) {
100
99
  onToggle?.(e, s);
101
100
  },
102
101
  disabled,
103
- onContainerCreation: (containerEl) => {
102
+ onContainerCreation: (containerEl, state) => {
103
+ setComputedPlacement(state.placement);
104
104
  containerEl?.getElementsByTagName("li")[0]?.focus();
105
105
  },
106
106
  ...others,
@@ -76,6 +76,7 @@ const HvDropdown = fixedForwardRef(function HvDropdown2(props, ref) {
76
76
  const { classes, cx } = useClasses(classesProp);
77
77
  const labels = useLabels(DEFAULT_LABELS, labelsProp);
78
78
  const elementId = useUniqueId(id);
79
+ const [popperStyles, setPopperStyles] = useState();
79
80
  const [validationState, setValidationState] = useControlled(
80
81
  status,
81
82
  "standBy"
@@ -254,7 +255,10 @@ const HvDropdown = fixedForwardRef(function HvDropdown2(props, ref) {
254
255
  placeholder: buildHeaderLabel(),
255
256
  onToggle: handleToggle,
256
257
  onClickOutside: handleClickOutside,
257
- onContainerCreation: setFocusToContent,
258
+ onContainerCreation: (el, state) => {
259
+ setFocusToContent(el);
260
+ setPopperStyles(state.elements?.popper.style);
261
+ },
258
262
  role: "combobox",
259
263
  variableWidth,
260
264
  "aria-label": ariaLabel,
@@ -276,6 +280,7 @@ const HvDropdown = fixedForwardRef(function HvDropdown2(props, ref) {
276
280
  },
277
281
  values: internalValues,
278
282
  multiSelect,
283
+ popperStyles,
279
284
  showSearch,
280
285
  onChange: handleSelection,
281
286
  onCancel: handleCancel,
@@ -287,7 +292,7 @@ const HvDropdown = fixedForwardRef(function HvDropdown2(props, ref) {
287
292
  height,
288
293
  maxHeight,
289
294
  virtualized,
290
- "data-is-dropdown": "true",
295
+ "data-is-dropdown": true,
291
296
  ...listProps
292
297
  }
293
298
  )
@@ -2,7 +2,6 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useState, useMemo, useEffect } from "react";
3
3
  import { useDefaultProps, mergeStyles } from "@hitachivantara/uikit-react-utils";
4
4
  import { theme } from "@hitachivantara/uikit-styles";
5
- import { useBaseDropdownContext } from "../../BaseDropdown/context.js";
6
5
  import { CounterLabel } from "../../utils/CounterLabel.js";
7
6
  import { getSelected } from "../utils.js";
8
7
  import { useClasses } from "./List.styles.js";
@@ -29,6 +28,7 @@ const HvDropdownList = (props) => {
29
28
  notifyChangesOnFirstRender = false,
30
29
  singleSelectionToggle,
31
30
  height: heightProp,
31
+ popperStyles,
32
32
  maxHeight: maxHeightProp,
33
33
  virtualized = false,
34
34
  ...others
@@ -38,8 +38,7 @@ const HvDropdownList = (props) => {
38
38
  const [list, setList] = useState(clone(values));
39
39
  const [allSelected, setAllSelected] = useState(false);
40
40
  const [anySelected, setAnySelected] = useState(false);
41
- const { popper } = useBaseDropdownContext();
42
- const { maxWidth, maxHeight } = popper?.styles.popper || {};
41
+ const { maxWidth, maxHeight } = popperStyles || {};
43
42
  const hasChanges = useMemo(() => {
44
43
  return String(getSelectedIds(values)) !== String(getSelectedIds(list));
45
44
  }, [list, values]);
@@ -9,7 +9,6 @@ const HvDropdownButton = forwardRef(function HvDropdownButton2(props, ref) {
9
9
  const {
10
10
  className,
11
11
  classes: classesProp,
12
- placement = "bottom",
13
12
  disabled,
14
13
  open,
15
14
  icon,
@@ -27,7 +26,6 @@ const HvDropdownButton = forwardRef(function HvDropdownButton2(props, ref) {
27
26
  ref,
28
27
  icon,
29
28
  disabled: disabled || readOnly,
30
- "data-popper-placement": placement,
31
29
  className: cx(
32
30
  classes.root,
33
31
  {
@@ -1,6 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useContext, useRef } from "react";
3
- import { ClickAwayListener, Popper } from "@mui/base";
3
+ import ClickAwayListener from "@mui/material/ClickAwayListener";
4
+ import Popper from "@mui/material/Popper";
4
5
  import { useForkRef } from "@mui/material/utils";
5
6
  import { useDefaultProps, useTheme } from "@hitachivantara/uikit-react-utils";
6
7
  import { getContainerElement } from "../../utils/document.js";