-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat(dialog): use native HTML dialog element #2078
Open
adamjohnson
wants to merge
51
commits into
staging/cubone
Choose a base branch
from
feat/dialog/use-native-dialog-element-v2
base: staging/cubone
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 38 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
de89a75
feat(dialog): use native `<dialog>` element
adamjohnson 4a5f066
chore(dialog): add changeset
adamjohnson 6832da6
fix(dialog): update color values to use new semantic tokens
adamjohnson 9e1b552
fix(dialog): make surface wrap only dialog/modal
adamjohnson fb0dfda
docs(dialog): update a11y docs around focus and focus order
adamjohnson 3f8d621
fix(dialog): add `accessible-label` to the `no-headings.html` demo
adamjohnson 236f8c1
fix(dialog): update content in `no-header-content.html` demo
adamjohnson 74ee1a6
fix(dialog): horizontally center dialogs with `variant`/`width` attri…
adamjohnson bf34916
fix(dialog): position top / modal width variants sizing
adamjohnson e8ef16a
fix(dialog): add `rh-*` elements to list of focusable selectors.
adamjohnson 21f25fd
Merge branch 'main' into feat/dialog/use-native-dialog-element-v2
adamjohnson a3d886d
Merge branch 'main' into feat/dialog/use-native-dialog-element-v2
adamjohnson f659249
Merge branch 'main' into feat/dialog/use-native-dialog-element-v2
adamjohnson 4eff705
fix(dialog): update close button spacing/height/width.
adamjohnson accb3f6
fix(dialog): re-add `--rh-dialog-close-button-color`
adamjohnson 4ded108
fix(dialog): decrease close button size, fix video modal close button…
adamjohnson 0947d16
fix(dialog): add close button color variable to icon declaration
adamjohnson e275b6f
fix(dialog): remove `trapFocus();` function
adamjohnson 03fef8d
chore(dialog): update changeset wording about overlay
adamjohnson d1c59fc
fix(dialog): add `href` to `rh-cta` host
adamjohnson 4dab6fb
fix(dialog): add `href` to `rh-cta` host
adamjohnson acc962a
docs(dialog): update accessible name wording on a11y page
adamjohnson 48a29a1
docs(dialog): a11y accessible label wording
adamjohnson cd53da9
docs(dialog): tweak accessible label fallback text wording
adamjohnson a7ef98b
docs(dialog): spelling fix
adamjohnson 2eb2add
docs(dialog): a11y name jsdoc wording
adamjohnson fb242b0
fix(dialog): add `href` to CTA host's in all demos
adamjohnson 1399bee
Merge branch 'main' into feat/dialog/use-native-dialog-element-v2
adamjohnson 0ff425f
docs(dialog): add and improve JSDoc formatting
adamjohnson c292dbe
refactor(dialog): use IDREF's for styling shadowdom
adamjohnson 303f85f
docs(dialog): a11y focus order and a11y name content
adamjohnson 250a437
Merge branch 'main' into feat/dialog/use-native-dialog-element-v2
adamjohnson fde7762
Merge branch 'main' into feat/dialog/use-native-dialog-element-v2
adamjohnson 3b9e903
fix(dialog): only `sticky` the header when there's enough space
adamjohnson 4993118
fix(dialog): add surface background color to close button
adamjohnson 7ced6d6
fix(dialog): add padding to sticky `#header`
adamjohnson fea2b29
Merge branch 'feat/dialog/use-native-dialog-element-v2' of github.com…
adamjohnson 0c6b775
fix(dialog): add space to bottom of `#header`
adamjohnson f7d1fc4
fix(dialog): prevent header space from covering body content
adamjohnson 93fbfd5
docs(dialog): update demo wording
adamjohnson 06c2334
fix(dialog): remove `#onKeyDown` from `disconnectedCallback()`
adamjohnson b9c4011
Merge branch 'main' into feat/dialog/use-native-dialog-element-v2
adamjohnson 34d7598
docs(dialog): add extra note on `overlay` depreciation to changeset
adamjohnson db066c1
fix(dialog): ensure `#body` paragraph spacing is correct
adamjohnson 1848cfa
fix(dialog): remove `closeOnOutsideClick` static
adamjohnson a994deb
refactor(dialog): remove `@bound` from `onClick()` method
adamjohnson 887682d
fix(dialog): remove outdated tab/shift+tab methods
adamjohnson 4d1ecb5
refactor(dialog): remove `@bound` from public methods
adamjohnson 1d3abdc
fix(dialog): simplify color-palette logic
adamjohnson 541b0ed
Merge branch 'main' into feat/dialog/use-native-dialog-element-v2
adamjohnson 6745875
fix(dialog): allow `sm`/`md`/`lg` variants for video dialogs
adamjohnson 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
"@rhds/elements": minor | ||
--- | ||
|
||
`<rh-dialog>`: Dialog now uses the native HTML `<dialog>` element internally. | ||
|
||
Note: the `overlay` CSS shadow part is now deprecated in favor of the `--rh-dialog-backdrop-background-color` CSS custom property. | ||
|
||
Before: | ||
|
||
```css | ||
rh-dialog::part(overlay) { ... } | ||
``` | ||
|
||
After: | ||
|
||
```css | ||
rh-dialog { | ||
--rh-dialog-backdrop-background-color: ghostwhite; | ||
} | ||
``` |
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
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
Oops, something went wrong.
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.
does the part still work? if not, this will need a major version bump
Also, please confirm @coreyvickery that this deprecation aligns with design expectations: namely that in future versions the only customizable aspect of the backdrop will be its color (including transparency) - and that the existing ability to customize any css property for the backdrop should be removed.
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.
Current version of
overlay
on uxdot is the overlay/backdrop of the dialog.This PR's version keeps the
overlay
<div>
and many of the styles (lines 146-149 inrh-dialog.ts
and lines 35-44 inrh-dialog.css
).The only change is
overlay
is a transparent<div>
overlaying the contents of the page. It's invisible to the user and customizable via the existing CSS part—should a user want to do that.With this PR's upgrade to the native
<dialog>
element, the native::backdrop
property is being used alongside a customizable CSS variable.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.
Added Benny's note about removing
overlay
in a future version in 34d7598.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.
Paging Mr. @coreyvickery. 😇
See Benny's questions about overlay/backdrop and
--offset
vars below.