diff --git a/packages/core/src/components/BaseDropdown/BaseDropdown.styles.tsx b/packages/core/src/components/BaseDropdown/BaseDropdown.styles.tsx
index 7737b3503d..993200a2d9 100644
--- a/packages/core/src/components/BaseDropdown/BaseDropdown.styles.tsx
+++ b/packages/core/src/components/BaseDropdown/BaseDropdown.styles.tsx
@@ -1,6 +1,5 @@
import { CSSProperties } from "@emotion/serialize";
import styled from "@emotion/styled";
-import { DropDownXS, DropUpXS } from "@hitachivantara/uikit-react-icons";
import { theme } from "@hitachivantara/uikit-styles";
import { HvTypography } from "@core/components";
import { outlineStyles } from "@core/utils";
@@ -107,7 +106,7 @@ export const StyledSelection = styled("div")({
alignItems: "center",
height: "30px",
boxSizing: "border-box",
- padding: `0px ${theme.space.md} 0px ${theme.space.xs}`,
+ paddingLeft: theme.space.xs,
});
export const StyledPlaceholder = styled(
@@ -126,32 +125,13 @@ export const StyledPlaceholder = styled(
}),
}));
-const iconsStyles: CSSProperties = {
+export const StyledAdornment = styled("div")({
position: "absolute",
pointerEvents: "none",
top: -1,
right: -1,
-};
-
-export const StyledDropUpXS = styled(DropUpXS)({
- ...iconsStyles,
});
-export const StyledDropDownXS = styled(
- DropDownXS,
- transientOptions
-)(({ $disabled }: { $disabled: boolean }) => ({
- ...iconsStyles,
-
- ...($disabled && {
- "& svg": {
- "& path": {
- fill: theme.colors.secondary_60,
- },
- },
- }),
-}));
-
export const StyledContainer = styled("div")({
zIndex: theme.zIndices.popover,
width: "auto",
@@ -203,10 +183,14 @@ export const StyledPanel = styled(
)(({ $popperPlacement }: { $popperPlacement: string }) => ({
position: "relative",
boxShadow: theme.baseDropdown.shadow,
+ backgroundColor: theme.colors.atmo1,
+ border: `1px solid ${theme.baseDropdown.openBorderColor}`,
...($popperPlacement === "top" && {
- top: "1px",
+ top: 1,
+ borderRadius: `${theme.radii.base} ${theme.radii.base} 0 0`,
}),
...($popperPlacement === "bottom" && {
- top: "-1px",
+ top: -1,
+ borderRadius: `0 0 ${theme.radii.base} ${theme.radii.base}`,
}),
}));
diff --git a/packages/core/src/components/BaseDropdown/BaseDropdown.tsx b/packages/core/src/components/BaseDropdown/BaseDropdown.tsx
index d881e62b44..4ce0460516 100644
--- a/packages/core/src/components/BaseDropdown/BaseDropdown.tsx
+++ b/packages/core/src/components/BaseDropdown/BaseDropdown.tsx
@@ -6,6 +6,8 @@ import {
PopperPlacementType,
PopperProps,
} from "@mui/material";
+import { theme } from "@hitachivantara/uikit-styles";
+import { DropDownXS, DropUpXS } from "@hitachivantara/uikit-react-icons";
import { useControlled, useForkRef, useTheme, useUniqueId } from "@core/hooks";
import { isKeypress, keyboardCodes, setId } from "@core/utils";
import { getFirstAndLastFocus } from "@core/utils/focusableElementFinder";
@@ -13,10 +15,9 @@ import { HvBaseProps } from "@core/types";
import { usePopper } from "react-popper";
import { detectOverflow, ModifierArguments, Options } from "@popperjs/core";
import {
+ StyledAdornment,
StyledAnchor,
StyledContainer,
- StyledDropDownXS,
- StyledDropUpXS,
StyledExtension,
StyledHeaderRoot,
StyledPanel,
@@ -236,7 +237,7 @@ export const HvBaseDropdown = ({
[]
);
- const modifiers: any = useMemo(
+ const modifiers: PopperProps["modifiers"] = useMemo(
() => [
{
name: "variableWidth",
@@ -283,10 +284,8 @@ export const HvBaseDropdown = ({
}
);
- let popperPlacement = "bottom";
- if (attributes.popper) {
- popperPlacement = attributes.popper["data-popper-placement"];
- }
+ const popperPlacement =
+ attributes.popper?.["data-popper-placement"] ?? "bottom";
const handleToggle = useCallback(
(event) => {
@@ -332,6 +331,8 @@ export const HvBaseDropdown = ({
});
}
+ const ExpanderComponent = isOpen ? DropUpXS : DropDownXS;
+
return (
- {adornment ||
- (isOpen ? (
-
+ {adornment || (
+
- ) : (
-
- ))}
+ )}
+
);
})();
diff --git a/packages/core/src/components/BaseDropdown/__snapshots__/BaseDropdown.test.tsx.snap b/packages/core/src/components/BaseDropdown/__snapshots__/BaseDropdown.test.tsx.snap
index 20b5139950..4f460e120d 100644
--- a/packages/core/src/components/BaseDropdown/__snapshots__/BaseDropdown.test.tsx.snap
+++ b/packages/core/src/components/BaseDropdown/__snapshots__/BaseDropdown.test.tsx.snap
@@ -6,47 +6,51 @@ exports[`BaseDropDown > should render correctly 1`] = `
style="width: 121px;"
>
diff --git a/packages/core/src/components/BulkActions/__snapshots__/BulkActions.test.tsx.snap b/packages/core/src/components/BulkActions/__snapshots__/BulkActions.test.tsx.snap
index 5b1e130fed..7424180083 100644
--- a/packages/core/src/components/BulkActions/__snapshots__/BulkActions.test.tsx.snap
+++ b/packages/core/src/components/BulkActions/__snapshots__/BulkActions.test.tsx.snap
@@ -150,12 +150,12 @@ exports[`BulkActions > With actions > should render correctly 1`] = `
@@ -75,56 +79,60 @@ exports[`ColorPicker > should render correctly full color picker 1`] = `
class="HvColorPicker-labelContainer css-1yp4ln"
>
Color
@@ -146,35 +154,35 @@ exports[`ColorPicker > should render correctly recommended colors only color pic
class="HvColorPicker-labelContainer css-1yp4ln"
>
Color
@@ -239,52 +252,57 @@ exports[`ColorPicker > should render correctly recommended colors only icon colo
class="HvColorPicker-labelContainer css-1yp4ln"
>
Color
@@ -306,35 +324,35 @@ exports[`ColorPicker > should render correctly without saved colors color picker
class="HvColorPicker-labelContainer css-1yp4ln"
>
Color
@@ -399,48 +422,52 @@ exports[`ColorPicker > should render correctly without saved colors icon color p
class="HvColorPicker-labelContainer css-1yp4ln"
>
Color
diff --git a/packages/core/src/components/Controls/__snapshots__/Controls.test.tsx.snap b/packages/core/src/components/Controls/__snapshots__/Controls.test.tsx.snap
index ecc2733577..6b272f2cc6 100644
--- a/packages/core/src/components/Controls/__snapshots__/Controls.test.tsx.snap
+++ b/packages/core/src/components/Controls/__snapshots__/Controls.test.tsx.snap
@@ -84,21 +84,21 @@ exports[` > sample snapshot testing > Controls 1`] = `
class=" e16dy5r70 HvDropdown-root css-u5677i-StyledHvFormElement-StyledDropdown etta2py4 HvFormElement-root"
>
@@ -700,21 +704,21 @@ exports[` > sample snapshot testing > Controls Controlled 1`] = `
class=" e16dy5r70 HvDropdown-root css-u5677i-StyledHvFormElement-StyledDropdown etta2py4 HvFormElement-root"
>
diff --git a/packages/core/src/components/DatePicker/DatePicker.styles.tsx b/packages/core/src/components/DatePicker/DatePicker.styles.tsx
index e60d1849ba..b57a72b2fe 100644
--- a/packages/core/src/components/DatePicker/DatePicker.styles.tsx
+++ b/packages/core/src/components/DatePicker/DatePicker.styles.tsx
@@ -28,10 +28,7 @@ export const styles: Partial<
dropdown: {
display: "block",
},
- panel: {
- border: theme.datePicker.panelBorder,
- backgroundColor: theme.datePicker.panelBackgroundColor,
- },
+ panel: {},
dropdownHeaderInvalid: {
border: `1px solid ${theme.colors.negative}`,
@@ -39,17 +36,8 @@ export const styles: Partial<
border: `1px solid ${theme.colors.negative}`,
},
},
- dropdownHeaderOpen: {
- border: theme.datePicker.dropdownHeaderOpenBorder,
- "&:hover": {
- border: theme.datePicker.dropdownHeaderOpenBorder,
- },
- },
- icon: {
- position: "absolute",
- right: -1,
- bottom: -1,
- },
+ dropdownHeaderOpen: {},
+ icon: {},
action: {
"&:first-of-type": {
marginRight: theme.space.xs,
diff --git a/packages/core/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap b/packages/core/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap
index a6d537c9bf..fc05281aa9 100644
--- a/packages/core/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap
+++ b/packages/core/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap
@@ -7,22 +7,22 @@ exports[`HvDatepicker > calendar custom properties > should render correctly 1`]
id="testingDatePicker"
>
@@ -61,22 +65,22 @@ exports[`HvDatepicker > ranged calendar > should render correctly 1`] = `
class="HvDatePicker-root css-79elbk HvFormElement-root"
>
@@ -116,24 +124,24 @@ exports[`HvDatepicker > sample snapshot testing > Main 1`] = `
id="DatePicker"
>
@@ -172,22 +184,22 @@ exports[`HvDatepicker > single calendar > should render correctly 1`] = `
class="HvDatePicker-root css-79elbk HvFormElement-root"
>
@@ -226,44 +242,48 @@ exports[`HvDatepicker > with minimum configuration > should render correctly 1`]
class="HvDatePicker-root css-79elbk HvFormElement-root"
>
diff --git a/packages/core/src/components/DropDownMenu/DropDownMenu.styles.tsx b/packages/core/src/components/DropDownMenu/DropDownMenu.styles.tsx
index 88ce5219a2..18cb1a91d3 100644
--- a/packages/core/src/components/DropDownMenu/DropDownMenu.styles.tsx
+++ b/packages/core/src/components/DropDownMenu/DropDownMenu.styles.tsx
@@ -41,8 +41,5 @@ export const styles: Partial<
borderRadius: `${theme.radii.base} ${theme.radii.base} 0px 0px`,
border: theme.dropDownMenu.borderOpened,
},
- menuListRoot: {
- border: theme.dropDownMenu.borderOpened,
- borderRadius: theme.dropDownMenu.borderRadius,
- },
+ menuListRoot: {},
};
diff --git a/packages/core/src/components/DropDownMenu/__snapshots__/DropDownMenu.test.tsx.snap b/packages/core/src/components/DropDownMenu/__snapshots__/DropDownMenu.test.tsx.snap
index 2813cbffa6..9a8e9f06c0 100644
--- a/packages/core/src/components/DropDownMenu/__snapshots__/DropDownMenu.test.tsx.snap
+++ b/packages/core/src/components/DropDownMenu/__snapshots__/DropDownMenu.test.tsx.snap
@@ -3,12 +3,12 @@
exports[`DropDownMenu > should render correctly 1`] = `