Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New component: Popover #927

Open
orion-cengage opened this issue Oct 5, 2022 · 1 comment · May be fixed by #1595
Open

New component: Popover #927

orion-cengage opened this issue Oct 5, 2022 · 1 comment · May be fixed by #1595
Assignees
Labels
feature request Functionality that you believe is missing that you want added react-magma-dom Tasks related to react-magma-dom

Comments

@orion-cengage
Copy link
Contributor

orion-cengage commented Oct 5, 2022

Need to create a new component that is visually similar to a tooltip, but is better for containing interactive elements and more complex content.

Figma: https://www.figma.com/file/z2H2qv9iYQX942LqToCuQE/Components---Data-Display?type=design&node-id=625%3A21846&t=O0EUkNbsDC83olKU-1

Inspiration:

Image

AC

  • 1.0 Popover is triggered by clicking on a focusable element (button, input, etc.).
    -- 1.1 you can set popover to be triggered on hover if necessary.
  • 2.0 Positioning
    -- 2.1 Default positioning is centered below the trigger, but you can force it to appear above by default.
    -- 2.2 Use FloatingUI to adjust the position

Image

  • 3.0 Keyboard
    -- 3.1 Pressing Space or Enter also opens and closes the popover
    -- 3.2 When focus is inside the popover then you can press Escape to close, and focus goes back to the triggering element.
    -- 3.3 If there aren't any focusable elements inside the popover and focus is still on the triggering element, Escape does not close the popover. (note: this needs to be tested; if the screenreader can't read the content, then the focus does need to go inside the container like we do for Informational dropdowns right now)

Image

-- 3.4 If there are focusable elements inside the popover, you should set focus automatically to the first item and trap focus inside the popover.

Image

  • 4.0 Popover width
    -- 4.1 Width can be manually set to any pixel value

Image

-- 4.2 Width can also be set to automatically match the width of the triggering element

Image

  • 5.0 Disabled or unfocusable elements
    -- 5.1 (per Bootstrap) Elements with the disabled attribute aren’t interactive, meaning users cannot hover or click them to trigger a popover. As a workaround, you’ll want to trigger the popover from a wrapper
    or , ideally made keyboard-focusable using tabindex="0".

Image

  • 6.0 Popover anatomy and contents
    -- 6.1 You can put just about anything inside a popover, although putting something like a dropdown or tooltip is probably not advised.
    -- 6.2 Popover has a main content area, and optional header and footer
    --- 6.2.1 If scrolling is needed, in a dropdown like situation for instance, then the body section should scroll vertically with the header and footer remaining fixed in place if those elements are present. Do not scroll horizontally or let content bleed off the page.

Image

-- 6.3 There should be an option to turn off the pointer like in the example below:

Image

  • 7.0 Accessibility (Taken from Mantine. We can tweak if necessary)
    -- Popover element has role="dialog" and aria-labelledby="target-id" attributes
    -- Target element has aria-haspopup="dialog", aria-expanded, aria-controls="popover-id" attributes

  • 8.0 We need a function to show the Popover as open by default when the page loads or after a particular action is triggered. This can be useful for tutorial style prompts
    -- As a result, we need the user to be able to add a button inside the popover to manually close the popover.
    -- We need to make sure developers can add "don't show this again" functionality so the user can tell the system to stop opening the popover by default.

image

  • 9.0 Dark mode inverse available.

image

  • 10.0 Update Dropdown examples that are similar to Popover
    -- In the Dropdown docs, add suggestion for users to use Popover instead of Dropdown for content like Informational Content and filters (tbd?)

This component should be tested by Perkins before it's released.

@orion-cengage orion-cengage self-assigned this Oct 5, 2022
@orion-cengage orion-cengage added react-magma-dom Tasks related to react-magma-dom feature request Functionality that you believe is missing that you want added labels Oct 5, 2022
@orion-cengage orion-cengage moved this to To Do in React Magma Oct 5, 2022
@orion-cengage orion-cengage moved this from To Do to In Progress in React Magma May 3, 2023
@silvalaura silvalaura moved this from In Progress to Ready for Review in React Magma May 3, 2023
@orion-cengage orion-cengage moved this from Ready for Review to In Progress in React Magma May 15, 2023
@orion-cengage orion-cengage changed the title New component: Toggletip New component: Popover (formerly Toggletip) May 15, 2023
@orion-cengage orion-cengage removed their assignment May 16, 2023
@orion-cengage orion-cengage changed the title New component: Popover (formerly Toggletip) New component: Popover May 17, 2023
@silvalaura silvalaura moved this from In Progress to To Do in React Magma May 22, 2023
@silvalaura
Copy link
Collaborator

silvalaura commented Jul 6, 2023

Sarah has presented a use case that would like Popovers to support the ability of being open by default without click or hover. We should also have a got it button to dismiss it.

@nikitaorliak-cengage nikitaorliak-cengage self-assigned this Nov 6, 2024
@nikitaorliak-cengage nikitaorliak-cengage linked a pull request Dec 9, 2024 that will close this issue
5 tasks
@moathabuhamad-cengage moathabuhamad-cengage moved this from In Progress to To Do in React Magma Dec 11, 2024
@silvalaura silvalaura moved this from To Do to In Progress in React Magma Dec 11, 2024
@silvalaura silvalaura linked a pull request Dec 11, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Functionality that you believe is missing that you want added react-magma-dom Tasks related to react-magma-dom
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants