diff --git a/packages/yoga/src/Popover/web/Popover.jsx b/packages/yoga/src/Popover/web/Popover.jsx index 36e76d0c96..4e8637c646 100644 --- a/packages/yoga/src/Popover/web/Popover.jsx +++ b/packages/yoga/src/Popover/web/Popover.jsx @@ -2,7 +2,7 @@ import React, { useState } from 'react'; import { node, number, oneOf, string } from 'prop-types'; import { Text } from '@gympass/yoga'; -import { PopoverContainer, Wrapper } from './styles'; +import { PopoverContainer, PopoverButton, Wrapper } from './styles'; function Popover({ children, @@ -11,26 +11,30 @@ function Popover({ position, width, height, + zIndex, + a11yId, ...props }) { const [isPopoverOpen, setIsPopoverOpen] = useState(false); - function handleShowPopover() { + const handleShowPopover = () => { setIsPopoverOpen(true); - } + }; - function handleHidePopover() { + const handleHidePopover = () => { setIsPopoverOpen(false); - } + }; return ( {isPopoverOpen && ( {!!title && ( @@ -43,22 +47,27 @@ function Popover({ )} - + ); } Popover.propTypes = { + a11yId: string, children: node.isRequired, title: string, description: string.isRequired, @@ -79,13 +88,16 @@ Popover.propTypes = { ]), width: number, height: number, + zIndex: number, }; Popover.defaultProps = { + a11yId: undefined, title: undefined, position: 'bottom-center', width: 265, - height: 116, + height: 200, + zIndex: 1, }; export default Popover; diff --git a/packages/yoga/src/Popover/web/__snapshots__/Popover.test.jsx.snap b/packages/yoga/src/Popover/web/__snapshots__/Popover.test.jsx.snap index 44cda9b3c9..04b26a32ab 100644 --- a/packages/yoga/src/Popover/web/__snapshots__/Popover.test.jsx.snap +++ b/packages/yoga/src/Popover/web/__snapshots__/Popover.test.jsx.snap @@ -5,12 +5,24 @@ exports[` should match snapshot 1`] = ` position: relative; } +.c1 { + all: unset; +} + +@media (hover:hover) and (pointer:fine) { + .c1:focus { + box-shadow: 0 2px 4px -1px rgba(152,152,166,0.2),0 4px 5px 0px rgba(152,152,166,0.14),0 1px 10px 0px rgba(152,152,166,0.12); + -webkit-transition: box-shadow ease 0.5s; + transition: box-shadow ease 0.5s; + } +} +