diff --git a/packages/shoreline/src/components/date-picker/date-picker.tsx b/packages/shoreline/src/components/date-picker/date-picker.tsx index 467d18695f..7f23c45a47 100644 --- a/packages/shoreline/src/components/date-picker/date-picker.tsx +++ b/packages/shoreline/src/components/date-picker/date-picker.tsx @@ -22,7 +22,13 @@ import { useStore } from '@vtex/shoreline-utils' * */ export function DatePicker(props: DatePickerProps) { - const { className, id: defaultId, error: defaultError, ...domProps } = props + const { + className, + id: defaultId, + error: defaultError, + portal = true, + ...domProps + } = props const state = useDatePickerState(domProps) const ref = useRef(null) const anchorRef = useRef(null) @@ -68,6 +74,7 @@ export function DatePicker(props: DatePickerProps) { { if (anchorRef?.current) { return anchorRef.current.getBoundingClientRect() @@ -92,6 +99,11 @@ export interface DatePickerOptions * Wether has error */ error?: boolean + /** + * Should activate portal + * @default true + */ + portal?: boolean } export type DatePickerProps = DatePickerOptions diff --git a/packages/shoreline/src/components/menu/menu-popover.tsx b/packages/shoreline/src/components/menu/menu-popover.tsx index f6c10f5417..df173fec58 100644 --- a/packages/shoreline/src/components/menu/menu-popover.tsx +++ b/packages/shoreline/src/components/menu/menu-popover.tsx @@ -8,7 +8,7 @@ import { Menu } from '@ariakit/react' */ export const MenuPopover = forwardRef( function MenuPopover(props, ref) { - const { children, asChild = false, ...otherProps } = props + const { children, asChild = false, portal = true, ...otherProps } = props return ( ( ref={ref} render={asChild && (children as any)} gutter={4} - portal + portal={portal} {...otherProps} > {children} @@ -31,6 +31,11 @@ export interface MenuPopoverOptions { * @default false */ asChild?: boolean + /** + * Should activate portal + * @default true + */ + portal?: boolean } export type MenuPopoverProps = MenuPopoverOptions & diff --git a/packages/shoreline/src/components/popover/popover.tsx b/packages/shoreline/src/components/popover/popover.tsx index da5a0bdda8..6c1f0648a4 100644 --- a/packages/shoreline/src/components/popover/popover.tsx +++ b/packages/shoreline/src/components/popover/popover.tsx @@ -15,14 +15,14 @@ import { Popover as BasePopover } from '@ariakit/react' */ export const Popover = forwardRef( function Popover(props, ref) { - const { children, asChild = false, ...otherProps } = props + const { children, asChild = false, portal = true, ...otherProps } = props return ( @@ -38,6 +38,11 @@ export interface PopoverOptions extends Pick { * @default false */ asChild?: boolean + /** + * Should activate portal + * @default true + */ + portal?: boolean } export type PopoverProps = PopoverOptions & ComponentPropsWithoutRef<'div'>