Skip to content

Commit 0fa2443

Browse files
ECHOES-1019 Allow Popover customization (#558)
1 parent d82872d commit 0fa2443

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/components/popover/Popover.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export enum PopoverSide {
4444
export interface PopoverProps {
4545
align?: `${PopoverAlign}`;
4646
children: ReactElement;
47+
className?: string;
4748
description?: TextNodeOptional;
4849
extraContent?: ReactNode;
4950
footer?: ReactNode; // Enforce Button, ButtonGroup or Link ?
@@ -75,8 +76,18 @@ const ARROW_PADDING = 16;
7576
* Since the popovers are appended to the body, they are in the root Stacking Context. If other elements are also there, the z-index will determine which appears on top. By creating a new Stacking Context for your app, it ensures that z-indexed elements will stay within that context, while popovers will be painted on top, in the parent Stacking Context.
7677
*/
7778
export const Popover = forwardRef<HTMLButtonElement, PopoverProps>((props, ref) => {
78-
const { align, children, description, extraContent, footer, isOpen, side, title, ...radixProps } =
79-
props;
79+
const {
80+
align,
81+
children,
82+
className,
83+
description,
84+
extraContent,
85+
footer,
86+
isOpen,
87+
side,
88+
title,
89+
...radixProps
90+
} = props;
8091
const theme = useContext(ThemeContext);
8192
const themeOverrideProp = isDefined(theme) ? { [THEME_DATA_ATTRIBUTE]: theme } : {};
8293

@@ -90,6 +101,7 @@ export const Popover = forwardRef<HTMLButtonElement, PopoverProps>((props, ref)
90101
{...themeOverrideProp}
91102
align={align}
92103
arrowPadding={ARROW_PADDING}
104+
className={className}
93105
side={side}
94106
sideOffset={POPOVER_OFFSET}>
95107
{title && (

0 commit comments

Comments
 (0)