Skip to content

Wildcard [Popover]: Adjust `<Popover />` API with possible future needs

Administrator requested to merge vk/update-popover-api into main

Created by: vovakulikov

Closes https://github.com/sourcegraph/sourcegraph/issues/36212

Background

Based on this PR https://github.com/sourcegraph/sourcegraph/pull/35870 about creation <Tooltip/> component we are going to have a part of radix-ui - tooltip component. This radix Tooltip component has a compound like API.

 <Tooltip.Provider>
    <Tooltip.Root>
      <Tooltip.Trigger />
      <Tooltip.Content>
        <Tooltip.Arrow />
      </Tooltip.Content>
    </Tooltip.Root>
  </Tooltip.Provider>

Since It's possible that in the (near) future we would try to replace the radix tooltip with our own implementation of the floating UI - Popover component, this PR updates the <Popover /> component API in order to have a similar API with radix-ui <Tooltip />. To be more specific in this PR we rework the ` component API and refactor the popover implementation by splitting it into separate compound components.

The next step here would be trying to come up with a minimal example/demo of our own <Tooltip /> component with all vital a11y requirements.

Test plan

  • Make sure that any consumers of the Popover components don't have any regression around positions and tail styling.
  • Make sure that the browser extension popover element looks good on the repository page

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading