-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Components: Add experimental ConfirmDialog
#34153
Merged
+710
−2
Merged
Changes from 1 commit
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
72cd96b
Proof of Concept
fullofcaffeine 335053a
Improve UX to more closely resembles a native confirm
fullofcaffeine f4a3396
Remove unused import and outdated comment
fullofcaffeine 1b2f104
Improve the story
fullofcaffeine d5e8d73
Spelling fix
fullofcaffeine f7250b6
Remove debug code
fullofcaffeine 6062648
Fix invalid props warning
fullofcaffeine a01225f
Empty dependency array to avoid listener from being re-added at each …
fullofcaffeine a4d2453
Remove unused style
fullofcaffeine 18e0231
wip
fullofcaffeine 2391e35
Address code review suggestions partially, and refactor to use the ex…
fullofcaffeine a878802
Improve component by allowing it to be used without the `confirm` hel…
fullofcaffeine b09651b
Update README
fullofcaffeine c221e9d
Update confirm call in post-visibility
fullofcaffeine cac2732
Remove role prop as it is not explicitely used at the moment
fullofcaffeine 0942707
Add basic tests
fullofcaffeine 7d629b8
Test that the Confirm closes when clicking the overlay
fullofcaffeine 12f0b18
Test that the Confirm closes when pressing Escape
fullofcaffeine f99c357
Merge branch 'trunk' into replace/confirm-et-al
fullofcaffeine f746119
Fix types and forwardRef, and adapt to the new functional Modal compo…
fullofcaffeine 5fd979f
Merge branch 'trunk' into replace/confirm-et-al
fullofcaffeine 13bf86a
Fix tests
fullofcaffeine d68508f
Simple naive inline declarative usage without a Context
fullofcaffeine 56ea610
Fix z-index to show it above all elements, and forwardRef to Modal's …
fullofcaffeine 6245385
Improve callback handler name
fullofcaffeine 814fc6f
Make `onCancel` optional
fullofcaffeine 2b47a46
Add styles.ts
fullofcaffeine bf9c062
Add more tests
fullofcaffeine 37befa2
Handle confirm on enter and add corresponding test
fullofcaffeine 31b88e2
Rename to `ConfirmDialog`
fullofcaffeine 2cd86e9
Redo stories, improve types and `selfClose` handling
fullofcaffeine 21600b0
Fix tests after renaming to `ConfirmDialog`
fullofcaffeine b21c175
Update the post-visibility example after renaming to `ConfirmDialog`
fullofcaffeine 922c103
Forward all other props to the underlying `Modal`
fullofcaffeine 9c931c6
Refactor tests to test controlled and uncontrolled scenarios
fullofcaffeine 5494585
Mark it as experimental, linter autofixes and snapshot updates
fullofcaffeine 2c43770
Add a proper README
fullofcaffeine fdab69f
Fix typo
fullofcaffeine 835c2e6
Fix grammar and add section about multiple instances to the README
fullofcaffeine 61f7c1a
Fix stories
fullofcaffeine c1cf65a
Add message text knob to stories
fullofcaffeine 20e2d23
Reset components/package.json
fullofcaffeine 33e97e1
Merge branch 'trunk' into replace/confirm-et-al
fullofcaffeine 566fe18
Misc changes after code review
fullofcaffeine d1be655
Abstract polymorphic event
fullofcaffeine 81d9e76
Simplify tests to not use snapshots and be more explicit
fullofcaffeine 8665ad6
Update README.md to reflect the new polymorphic event type
fullofcaffeine 29c8c3a
Make the `Cancel` button a `tertiary` and DRY and improve types
fullofcaffeine f59553d
Make the title optional and adjust some styles
fullofcaffeine 55ac46a
Fix typo
fullofcaffeine c96f575
Update packages/components/src/confirm-dialog/README.md
fullofcaffeine 3abfc81
Update packages/components/src/confirm-dialog/README.md
fullofcaffeine 605c2ae
Update packages/components/src/confirm-dialog/README.md
fullofcaffeine 6a60f92
Remove unused imported `MouseEvent`
fullofcaffeine 995f45f
Type `handleEvent`'s `callback` argument as optional
fullofcaffeine 40cb594
Update packages/components/src/confirm-dialog/README.md
fullofcaffeine ceabb07
Update packages/components/src/confirm-dialog/README.md
fullofcaffeine aa7025d
Remove portion about the singleton wrapper component as it will not b…
fullofcaffeine d130ed1
Improve component types
fullofcaffeine 054caae
Use `props.children` to pass the dialog message contents
fullofcaffeine 85e9510
Add DOM structure tests
fullofcaffeine c20f85d
Convert all findBy* to getBy*
fullofcaffeine e9ee813
Update README to reflect the new API
fullofcaffeine 316afc5
Improve title and xCloseButton tests
fullofcaffeine 5b2b026
Add better and more concise description for the `title` prop in the R…
fullofcaffeine 4e5abed
Try stacked margin
fullofcaffeine 9bf6f88
Update packages/components/tsconfig.json
fullofcaffeine 64c2816
Update packages/components/src/modal/index.js
fullofcaffeine 414ab15
Destructure props in the function body in `Modal` to prevent TS error…
fullofcaffeine 49eaa0e
Merge branch 'trunk' into replace/confirm-et-al
fullofcaffeine 9f62ad3
Use VStack for a stacked margin approach and remove ability to set a …
fullofcaffeine af340b2
Update snapshots for the `preferences-modal` unit tests
fullofcaffeine 710932d
Update snapshots for the `keyboard-shortcut-help-modal` unit tests
fullofcaffeine 5e24ff0
Merge branch 'trunk' into replace/confirm-et-al
fullofcaffeine 7d5860c
Merge branch 'trunk' into replace/confirm-et-al
fullofcaffeine febda4a
Revert post-visibility sample changes
fullofcaffeine 8bed797
Keep modal's default behavior of showing the title div and remove an …
fullofcaffeine 16ce455
Fix wrong message string in one of the stories
fullofcaffeine 2ddbabc
Remove unnecessary explanation about unset props
ciampo bd6eb33
Rename selfClose to shouldSelfClose
ciampo 94f8b47
Memoize callbacks
ciampo 4d35f84
Extract `confirm` and `cancel` labels
ciampo 74c5293
Improve stories: use `Heading`, better status sentence
ciampo f69a973
Temporarily enable knobs
ciampo 541490c
Fix typo in test name
ciampo 8eeb0c7
More descriptive storybook sentende, take 2
ciampo 3c3f49a
Sort export alphabetically
ciampo 173f2d4
Undo changes to `Modal` component (to be carried out in a separate PR)
ciampo 4a81ba6
Undo changes to `Modal`-related snapshots (to be carried out in a sep…
ciampo e2ce3ef
Merge branch 'trunk' into replace/confirm-et-al
ciampo c2a9adb
Refactor `showTitle` prop on the Modal to `__experimentalHideHeader`
ciampo a320d85
CHANGELOG
ciampo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!