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

add Popover docs #1598

Merged
merged 10 commits into from
Oct 3, 2023
Merged

add Popover docs #1598

merged 10 commits into from
Oct 3, 2023

Conversation

mayank99
Copy link
Contributor

@mayank99 mayank99 commented Sep 26, 2023

Changes

Changes to docs: added new /popover page with usage and accessibility details.

While working on docs, I found I had to make changes to Popover component (now moved into #1602).

Testing

Tested all examples in multiple browsers and with keyboard.

Docs

n/a. These are docs.

@mayank99 mayank99 added this to the React 3.0 milestone Sep 26, 2023
@mayank99 mayank99 requested a review from a team as a code owner September 26, 2023 21:15
@mayank99 mayank99 self-assigned this Sep 26, 2023
@mayank99 mayank99 requested a review from a team as a code owner September 26, 2023 21:15
@mayank99 mayank99 requested review from gretanausedaite and siddhantrawal and removed request for a team September 26, 2023 21:15
onVisibleChange={setIsOpen}
style={{ maxWidth: '45ch', border: 'none' }}
content={
<Surface elevation={0}>
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 had to add border: none override because Surface always insists on bringing its own border.

Also, for some reason Surface.Body only brings horizontal padding not vertical.

@FlyersPh9 Is this intentional?

Copy link
Collaborator

Choose a reason for hiding this comment

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

data-iui-padded="true" does have vertical padding, it's just very little.
Screenshot 2023-09-28 at 4 28 04 PM
The examples on the surface demo page look nice, but the agree button in your screenshot does not look so great. Was the padding changed when we implemented scrollbar-gutter?

Btw, just now found out scrollbar-gutter doesn't work in Safari. 😓

@mayank99 mayank99 mentioned this pull request Sep 27, 2023
@mayank99 mayank99 changed the title add Popover docs and fix focus add Popover docs Sep 27, 2023
@mayank99 mayank99 changed the base branch from dev to mayank/popover-focus September 27, 2023 19:52
@mayank99 mayank99 requested a review from r100-stack September 27, 2023 21:39
Copy link
Contributor Author

@mayank99 mayank99 left a comment

Choose a reason for hiding this comment

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

@rohan-kadkol Reading through these docs will help you make sense of the changes in #1602

</Text>

<Button
ref={(el) => el?.focus()}
Copy link
Member

Choose a reason for hiding this comment

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

nit: It might be helpful if there were an explanation comment here. Something like, "To grab focus when the popover opens".

<Surface.Body isPadded>
<Flex flexDirection='column' alignItems='start'>
<Text as='p' id={descriptionId}>
(TODO: improve text) Lorem ipsum dolor sit amet consectetur
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gretanausedaite @rohan-kadkol @siddhantrawal Can somebody suggest better text or a different example? I dunno how this has 3 approvals with TODO text 😅

Copy link
Member

@r100-stack r100-stack Sep 28, 2023

Choose a reason for hiding this comment

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

Can somebody suggest better text or a different example?

How about a "see image preview" popover? If we click on the trigger button that says "show image preview", the popover shows the image preview along with an "OK" button and a "Download" button.

I dunno how this has 3 approvals with TODO text 😅

I thought that TODO was for you so you will handle it yourself 😅 So I gave a preemptive approval to not block the PR because everything else LGTM.

Copy link
Contributor

@siddhantrawal siddhantrawal Sep 28, 2023

Choose a reason for hiding this comment

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

@gretanausedaite @rohan-kadkol @siddhantrawal Can somebody suggest better text or a different example? I dunno how this has 3 approvals with TODO text 😅

Maybe you can add something related to Bentley agreement or terms of use. If not, short summary about what you can add in the popover.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can somebody suggest better text or a different example?

Some sliders to "tune settings", eg. quality, grain, color, saturation, etc. (like in photoshop) with ok or save / cancel buttons at the bottom.

Copy link
Contributor

Choose a reason for hiding this comment

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

I dunno how this has 3 approvals with TODO text

We have more than one todo in repo that is supposed to be solved later.

Copy link
Contributor Author

@mayank99 mayank99 Oct 2, 2023

Choose a reason for hiding this comment

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

updated the example to show a settings dialog.

these are just text inputs for now, but let me know if you have ideas for other kinds of inputs

Copy link
Contributor

Choose a reason for hiding this comment

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

It's good. We have this in css fieldset tests if you want to switch inputs but you don't have to. This example is to show focus control, it does not have to be useful or realistic.
image

@siddhantrawal
Copy link
Contributor

React Visual Tests related to one of the Color Picker component is failing.

Base automatically changed from mayank/popover-focus to dev October 2, 2023 16:23
@mayank99 mayank99 merged commit 6051d42 into dev Oct 3, 2023
@mayank99 mayank99 deleted the mayank/popover-docs branch October 3, 2023 14:32
This was referenced Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants