Skip to content

Commit 51551f5

Browse files
author
Kubit
committed
Include popover props to snackbar
1 parent 7ae30b7 commit 51551f5

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/components/snackbar/snackbarStandAlone.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ const SnackbarStandAloneComponent = (
9595
open={props.open}
9696
pressEscapeClose={false}
9797
variant={props.styles?.popoverVariants?.[align]}
98+
{...props.popover}
9899
>
99100
<SnackbarStyled
100101
ref={ref}

src/components/snackbar/stories/argtypes.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,15 @@ export const argtypes = (variants: IThemeObjectVariants, themeSelected: string):
150150
category: CATEGORY_CONTROL.MODIFIERS,
151151
},
152152
},
153+
popover: {
154+
description: 'Override popover configuration',
155+
type: { name: 'object' },
156+
control: { type: 'object' },
157+
table: {
158+
type: { summary: 'SnackbarPopoverType' },
159+
category: CATEGORY_CONTROL.MODIFIERS,
160+
},
161+
},
153162
onSecondaryActionClick: {
154163
description: 'Click of the link',
155164
type: { name: 'function' },

src/components/snackbar/types/snackbar.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { IButton } from '@/components/button';
22
import { IElementOrIcon } from '@/components/elementOrIcon';
33
import { ILink } from '@/components/link';
4+
import { IPopoverControlled } from '@/components/popover';
45
import { IText } from '@/components/text';
56
import { CustomTokenTypes } from '@/types';
67
import { POSITIONS } from '@/types/positions';
@@ -28,6 +29,8 @@ export type SnackbarActionButtonType = Omit<
2829
size?: string;
2930
};
3031

32+
export type SnackbarPopoverType = Omit<IPopoverControlled, 'children' | 'open'>;
33+
3134
export interface ISnackbarStandAlone {
3235
icon?: IElementOrIcon;
3336
closeIcon?: SnackbarCloseIconType;
@@ -41,6 +44,7 @@ export interface ISnackbarStandAlone {
4144
secondaryActionAriaLabel?: string;
4245
onSecondaryActionClick?: React.MouseEventHandler<HTMLButtonElement>;
4346
align?: POSITIONS.TOP_CENTER_FIXED | POSITIONS.BOTTOM_CENTER_FIXED;
47+
popover?: SnackbarPopoverType;
4448
styles?: SnackbarProps;
4549
dataTestId?: string;
4650
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;

0 commit comments

Comments
 (0)