-
Notifications
You must be signed in to change notification settings - Fork 2.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
[core] feat: OverlaysProvider #6674
Merged
Merged
Changes from 7 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f0a5a51
[core] feat: create OverlayProvider to manage global overlay stack
adidahiya 5d8f73b
WIP fix Overlay2 tests
adidahiya de661aa
WIP continue fixing Overlay2 tests
adidahiya 95cc4fa
fix Overlay2 tests
adidahiya 041884f
OverlaysProvider docs; export more hooks
adidahiya 0d914b0
Fix core:iso test:
adidahiya e7b5c38
Overlay2 backcompat
adidahiya 0a8b02a
address self-review, attempt to fix test
adidahiya eeb29a0
Fix tests
adidahiya 91d46fd
update docs
adidahiya 2eb5d64
more docs; omit deprecated 'portalStopPropagationEvents' from Overlay2
adidahiya b1e9c2f
render OverlaysProvider in demo-app
adidahiya a04afe6
render OverlaysProvider in table-dev-app
adidahiya aadcde4
revert stopPropagationEvents removal
adidahiya 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
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
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
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
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
adidahiya marked this conversation as resolved.
Show resolved
Hide resolved
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@# OverlaysProvider | ||
|
||
<div class="@ns-callout @ns-intent-primary @ns-icon-info-sign @ns-callout-has-body-content"> | ||
<h5 class="@ns-heading"> | ||
|
||
Migrating from [Overlay](#core/components/overlay)? | ||
|
||
</h5> | ||
|
||
**OverlaysProvider** and [`useOverlayStack()`](#core/hooks/overlays/use-overlay-stack), when used | ||
together, are a replacement for **Overlay**. You are encouraged to use these new APIs, as they will | ||
become the standard in a future major version of Blueprint. See the full | ||
[migration guide](https://github.com/palantir/blueprint/wiki/Overlay2-migration) on the wiki. | ||
|
||
</div> | ||
|
||
**OverlaysProvider** is responsible for managing global overlay state in the application, | ||
specifically the stack of all overlays which are currently open. It provides a | ||
[React context](https://react.dev/learn/passing-data-deeply-with-context) which is used primarily by | ||
the [**Overlay2** component](#core/components/overlay2). | ||
|
||
## Usage | ||
|
||
To use **OverlaysProvider**, wrap your application with it at the root level: | ||
|
||
```tsx | ||
import { OverlaysProvider } from "@blueprintjs/core"; | ||
import * as React from "react"; | ||
import * as ReactDOM from "react-dom"; | ||
|
||
ReactDOM.render( | ||
<OverlaysProvider> | ||
<div>My app has overlays 😎</div> | ||
</OverlaysProvider>, | ||
document.querySelector("#app"), | ||
); | ||
``` | ||
|
||
@## Props interface | ||
|
||
@interface OverlaysProviderProps |
Oops, something went wrong.
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.
note that this does not need to be in "dependencies" because it's not exposed in the generated types: