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

react-dialog: spec #21992

Merged
merged 17 commits into from
Jun 16, 2022
Merged

react-dialog: spec #21992

merged 17 commits into from
Jun 16, 2022

Conversation

tringakrasniqi
Copy link
Contributor

@tringakrasniqi tringakrasniqi commented Mar 8, 2022

Current Behavior

Convergence spec for the Dialog component based on the design spec.

PREVIEW

Related Issue(s)

Fixes partially #20953

@tringakrasniqi tringakrasniqi changed the title Added dialog spec react-dialog: spec Mar 8, 2022
@tringakrasniqi tringakrasniqi mentioned this pull request Mar 8, 2022
33 tasks
@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 8, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d092977:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@fabricteam
Copy link
Collaborator

fabricteam commented Mar 8, 2022

📊 Bundle size report

Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
185.285 kB
51.364 kB
react-components
react-components: FluentProvider & webLightTheme
33.988 kB
11.108 kB
🤖 This report was generated against ee781875d8d21bda2d6ac8267a5b0a3abecb2da9

@size-auditor
Copy link

size-auditor bot commented Mar 8, 2022

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: ee781875d8d21bda2d6ac8267a5b0a3abecb2da9 (build)

@tringakrasniqi tringakrasniqi marked this pull request as ready for review March 9, 2022 09:08
@tringakrasniqi tringakrasniqi requested a review from a team as a code owner March 9, 2022 09:08
Copy link
Contributor

@Hotell Hotell left a comment

Choose a reason for hiding this comment

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

looks great, few questions/comments, thx!

@tringakrasniqi tringakrasniqi requested review from a team March 10, 2022 15:16
@layershifter layershifter self-requested a review March 10, 2022 15:41
@andrefcdias andrefcdias removed their assignment Mar 24, 2022
@bsunderhus bsunderhus marked this pull request as ready for review June 15, 2022 06:38
@bsunderhus bsunderhus merged commit c38b5bd into microsoft:master Jun 16, 2022
*
* `alert`: is a special type of modal dialogs that interrupts the user's workflow to communicate an important message or ask for a decision. Unlike a typical modal dialog, the user must take an action through the options given to dismiss the dialog, and it cannot be dismissed through the dimmed background or escape key.
*/
type?: 'modal' | 'non-modal' | 'alert';
Copy link
Member

Choose a reason for hiding this comment

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

As we learnt before it's not the best idea to use the same prop names as native elements with different semantics. Can we consider a different prop name for that?

Copy link
Contributor

@bsunderhus bsunderhus Jun 29, 2022

Choose a reason for hiding this comment

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

modalType perhaps? 🤔, or 3 booleans.... modal, nonModal, alert, WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

No three booleans, please 🐱 Tooltip uses relationship, but it obviously does not fit there. modalType is a bit verbose and kinda confusing as a component named Dialog...

* closing or toggling a Dialog visibility state.
* @default 'toggle'
*/
type?: 'open' | 'close' | 'toggle';
Copy link
Member

Choose a reason for hiding this comment

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

Do you have a scenario for open vs toogle? When open is needed?

I was thinking about DialogTrigger with toggle behavior as other components and DialogCloseTrigger (ugly name).


Again it might not be a good idea to use type as a prop name there.

Copy link
Contributor

@bsunderhus bsunderhus Jun 29, 2022

Choose a reason for hiding this comment

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

So, your suggestion would be a new compound component for the specific case of closing and keeping DialogTrigger as toggle.

I don't see a huge impact difference in supporting both scenarios in a single component instead though... I think for a moment I'll stick with a single component for this purpose, as they in the end do the same thing: they change open state.

As for the name of the props, how about action or perhaps 3 boolean properties: open, close, toggle?

Copy link
Member

Choose a reason for hiding this comment

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

action sounds better than type indeed.

<!-- ... portal ... -->
```

### Async Input submission dialog
Copy link
Member

Choose a reason for hiding this comment

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

Honestly, this looks like a usage example rather than something that needs to stay in the spec.

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.

9 participants