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

Popover: new element contribution #588

Merged
merged 25 commits into from
Aug 29, 2023
Merged

Popover: new element contribution #588

merged 25 commits into from
Aug 29, 2023

Conversation

michael-iden
Copy link
Contributor

@michael-iden michael-iden commented Aug 18, 2023

This change: (check at least one)

  • Adds a new feature
  • Fixes a bug
  • Improves maintainability
  • Improves documentation
  • Is a release activity

Is this a breaking change? (check one)

  • Yes
  • No

Is the: (complete all)

  • Title of this pull request clear, concise, and indicative of the issue number it addresses, if any?
  • Test suite(s) passing?
  • Code coverage maximal?
  • Changeset added?
  • Component status page up to date?

What does this change address?
Adds a popover element to pharos that fills the role of non-modal dialog

How does this change work?
Adds new popover element that is based heavily off of the existing dropdown-menu component but with relaxed requirements so that any contents can be slotted

Additional context

@changeset-bot
Copy link

changeset-bot bot commented Aug 18, 2023

🦋 Changeset detected

Latest commit: 25314cd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@ithaka/pharos Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Aug 18, 2023

size-limit report 📦

Path Size
packages/pharos/lib/index.js 49.76 KB (+3.28% 🔺)

@michael-iden michael-iden marked this pull request as ready for review August 18, 2023 20:16
@michael-iden michael-iden requested a review from a team as a code owner August 18, 2023 20:16
@michael-iden michael-iden requested review from brentswisher, SMQuazi and mtorres3 and removed request for a team August 18, 2023 20:16
…dius var

Co-authored-by: Dane Hillard <github@danehillard.com>
@daneah daneah requested a review from sirrah-tam August 22, 2023 12:32
Comment on lines 94 to 107
<div>Some really cool stuff</div>
<div>Some really cool stuff</div>
<div>Some really cool stuff</div>
<div>Some really cool stuff</div>
<div>Some really cool stuff</div>
<div>Some really cool stuff</div>
<div>Some really cool stuff</div>
<div>Some really cool stuff</div>
<div>Some really cool stuff</div>
<div>Some really cool stuff</div>
<div>Some really cool stuff</div>
<div>Some really cool stuff</div>
<div>Some really cool stuff</div>
<div>Some really cool stuff</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We typically put some slightly higher fidelity content into these for demonstrative purposes. Maybe @lorilundy711 can make a suggestion here that is in keeping with other components' content?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I converted this to a paragraph of lorem ipsum text as a start but can do whatever if we want different content in there

display: block;
position: fixed;
z-index: 140;
pointer-events: none;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is often a red flag for accessibility; I've added @sirrah-tam to review

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if desirable, but I stole this from the dropdown-menu css

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think as long as the content is inline in the DOM from the triggering element, the use of z-index and position: fixed seem okay to me. Depending on the visual layout, we just want to make sure it matches the expected reading order.

packages/pharos/src/components/popover/pharos-popover.scss Outdated Show resolved Hide resolved
list-style-type: none;
padding-left: 0;
padding-inline-start: 0;
box-shadow: 0 1px 2px rgb(18 18 18 / 0.3), 0 4px 8px 3px rgb(18 18 18 / 0.15);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lorilundy711 I think this is the first time we've introduced height to a component, is there any concern with the inconsistency here compared to e.g. dropdown menus?

packages/pharos/src/components/popover/pharos-popover.scss Outdated Show resolved Hide resolved
Copy link
Contributor

@chrisjbrown chrisjbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested in chromatic storybook. worked as i expected 👍

Copy link
Contributor

@sirrah-tam sirrah-tam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! The popover was perceived as a dialog and the user was able to navigate through it's content without issue. Users are able to perceive the name of the dialog based on its supplied label attribute and focus is moved to the first interactive element (often close button).

@jialin-he jialin-he merged commit 130ce55 into develop Aug 29, 2023
8 checks passed
@jialin-he jialin-he deleted the feature/popover branch August 29, 2023 12:57
@github-actions github-actions bot mentioned this pull request Aug 29, 2023
daneah added a commit that referenced this pull request Sep 15, 2023
* develop:
  chore: version packages (#611)
  Popover: Border radius styling enforcement (#610)
  Sheet: Component Contribution (#603)
  docs: add @sirrah-tam as a contributor (#607)
  Tokens: improve glacier-blue-40 AAA color contrast (#606)
  chore: bump dependencies and update resolutions (#605)
  Dropdown: add line rules for light variants (#599)
  chore: version packages (#601)
  feat(icon): add compare and side-panel icons (#596)
  chore(sidenav): fix flaky test (#600)
  chore: version packages (#595)
  Popover: new element contribution (#588)
sirrah-tam pushed a commit to sirrah-tam/pharos that referenced this pull request Dec 1, 2023
* feat(popover): initial commit of the new popover component

* feat(popover): iterating on popover in storybook

* feat(popover): allow popover to show and dismiss

* feat(popover): add more examples for a popover

* feat(popover): clean up component

* feat(popover): adding react examples

* feat(popover): add changeset

* feat(popover): add unit tests

* feat(popover): rename unit test names and vars

* feat(popover): fix tests initialization, remove unused tests, add aria-label for dialog

* feat(popover): simplify template rendering

* feat(popover): remove shadow when on background

* feat(popver): fix inline style of react storybook and use existing radius var

Co-authored-by: Dane Hillard <github@danehillard.com>

* feat(popover): update inlines styles for web component storybook

* feat(popover): update inlines styles for web component storybook

* feat(popover): use storybook dark background

* feat(popover): update shadow to latest

* feat(popover): fix radius definition

* feat(popover): add additional scenario to cover popups with dark contents on different backgrounds

* feat(popover): fix focus logic for popover and remove old styles

* feat(popover): convert placeholder copy to lorem ipsum

* feat(popover): accessibility tweaks for pharos popover

* feat(popover): update stories to use label

---------

Co-authored-by: Dane Hillard <github@danehillard.com>
Co-authored-by: Jialin He <38861633+jialin-he@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants