-
Notifications
You must be signed in to change notification settings - Fork 625
Allow Overlay
contents to properly grow/shrink
#6365
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d383411
testing
langermank 4252885
add story
langermank 918b1ac
try portal width
langermank 97acb11
Update `Portal` width for `Overlay` contents
langermank 61aee97
test(vrt): update snapshots
langermank cf609d8
Merge branch 'main' into overlay-width-bug
langermank 4b3b124
reset
langermank 7534299
test(vrt): update snapshots
langermank 9bf04e1
fix
langermank 6494ca1
snaps
langermank 2058940
Merge branch 'main' into overlay-width-bug
langermank e8844ad
snaps
langermank a6b87f2
reset
langermank f6fd0d6
reset
langermank d4a1039
Merge branch 'main' into overlay-width-bug
langermank 2b62787
fix
langermank 912cfa1
test(vrt): update snapshots
langermank 158ece2
reset
langermank 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 hidden or 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,5 @@ | ||
--- | ||
"@primer/react": patch | ||
--- | ||
|
||
Add `width: 100%` to `Portal` |
Binary file modified
BIN
-1.17 KB
(96%)
...ctionMenu.test.ts-snapshots/ActionMenu-Inactive-Items-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.46 KB
(88%)
...ts/ActionMenu.test.ts-snapshots/ActionMenu-Inactive-Items-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.6 KB
(87%)
...onMenu.test.ts-snapshots/ActionMenu-Inactive-Items-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.17 KB
(96%)
...omponents/ActionMenu.test.ts-snapshots/ActionMenu-Inactive-Items-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.17 KB
(96%)
...ctionMenu.test.ts-snapshots/ActionMenu-Inactive-Items-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.57 KB
(85%)
...tionMenu.test.ts-snapshots/ActionMenu-Inactive-Items-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.28 KB
(86%)
...nMenu.test.ts-snapshots/ActionMenu-Inactive-Items-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.57 KB
(85%)
...mponents/ActionMenu.test.ts-snapshots/ActionMenu-Inactive-Items-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.57 KB
(85%)
...tionMenu.test.ts-snapshots/ActionMenu-Inactive-Items-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-98 Bytes
(99%)
.../ActionMenu.test.ts-snapshots/ActionMenu-Multi-Select-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-126 Bytes
(99%)
...ents/ActionMenu.test.ts-snapshots/ActionMenu-Multi-Select-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-97 Bytes
(99%)
...tionMenu.test.ts-snapshots/ActionMenu-Multi-Select-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-98 Bytes
(99%)
.../components/ActionMenu.test.ts-snapshots/ActionMenu-Multi-Select-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-98 Bytes
(99%)
.../ActionMenu.test.ts-snapshots/ActionMenu-Multi-Select-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-120 Bytes
(99%)
...ActionMenu.test.ts-snapshots/ActionMenu-Multi-Select-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-244 Bytes
(98%)
...ionMenu.test.ts-snapshots/ActionMenu-Multi-Select-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-120 Bytes
(99%)
...components/ActionMenu.test.ts-snapshots/ActionMenu-Multi-Select-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-120 Bytes
(99%)
...ActionMenu.test.ts-snapshots/ActionMenu-Multi-Select-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+79 Bytes
(100%)
...erlay.test.ts-snapshots/Overlay-Memex-Nested-Overlays-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+105 Bytes
(100%)
...s/Overlay.test.ts-snapshots/Overlay-Memex-Nested-Overlays-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+121 Bytes
(100%)
...ay.test.ts-snapshots/Overlay-Memex-Nested-Overlays-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+73 Bytes
(100%)
...mponents/Overlay.test.ts-snapshots/Overlay-Memex-Nested-Overlays-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+79 Bytes
(100%)
...erlay.test.ts-snapshots/Overlay-Memex-Nested-Overlays-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+128 Bytes
(100%)
...rlay.test.ts-snapshots/Overlay-Memex-Nested-Overlays-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+115 Bytes
(100%)
...y.test.ts-snapshots/Overlay-Memex-Nested-Overlays-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+127 Bytes
(100%)
...ponents/Overlay.test.ts-snapshots/Overlay-Memex-Nested-Overlays-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
+128 Bytes
(100%)
...rlay.test.ts-snapshots/Overlay-Memex-Nested-Overlays-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-404 Bytes
(99%)
...ctPanel.test.ts-snapshots/SelectPanel-Above-Tall-Body-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-387 Bytes
(99%)
...SelectPanel.test.ts-snapshots/SelectPanel-Above-Tall-Body-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
-436 Bytes
(99%)
...anel.test.ts-snapshots/SelectPanel-Above-Tall-Body-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-404 Bytes
(99%)
...onents/SelectPanel.test.ts-snapshots/SelectPanel-Above-Tall-Body-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
-404 Bytes
(99%)
...ctPanel.test.ts-snapshots/SelectPanel-Above-Tall-Body-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-462 Bytes
(99%)
...tPanel.test.ts-snapshots/SelectPanel-Above-Tall-Body-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-469 Bytes
(99%)
...nel.test.ts-snapshots/SelectPanel-Above-Tall-Body-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-462 Bytes
(99%)
...nents/SelectPanel.test.ts-snapshots/SelectPanel-Above-Tall-Body-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
-465 Bytes
(99%)
...tPanel.test.ts-snapshots/SelectPanel-Above-Tall-Body-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-881 Bytes
(97%)
...ts-snapshots/SelectPanel-Height-Variations-and-Scroll-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-827 Bytes
(97%)
...est.ts-snapshots/SelectPanel-Height-Variations-and-Scroll-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
-877 Bytes
(97%)
...snapshots/SelectPanel-Height-Variations-and-Scroll-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-884 Bytes
(97%)
...Panel.test.ts-snapshots/SelectPanel-Height-Variations-and-Scroll-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
-881 Bytes
(97%)
...ts-snapshots/SelectPanel-Height-Variations-and-Scroll-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-850 Bytes
(97%)
...s-snapshots/SelectPanel-Height-Variations-and-Scroll-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-866 Bytes
(97%)
...napshots/SelectPanel-Height-Variations-and-Scroll-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-850 Bytes
(97%)
...anel.test.ts-snapshots/SelectPanel-Height-Variations-and-Scroll-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
-846 Bytes
(97%)
...s-snapshots/SelectPanel-Height-Variations-and-Scroll-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.33 KB
(96%)
...ts/SelectPanel.test.ts-snapshots/SelectPanel-With-Css-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.34 KB
(96%)
...onents/SelectPanel.test.ts-snapshots/SelectPanel-With-Css-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.16 KB
(97%)
...SelectPanel.test.ts-snapshots/SelectPanel-With-Css-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.33 KB
(96%)
...ts/components/SelectPanel.test.ts-snapshots/SelectPanel-With-Css-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.33 KB
(96%)
...ts/SelectPanel.test.ts-snapshots/SelectPanel-With-Css-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.18 KB
(97%)
...s/SelectPanel.test.ts-snapshots/SelectPanel-With-Css-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.29 KB
(96%)
...electPanel.test.ts-snapshots/SelectPanel-With-Css-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.18 KB
(97%)
...s/components/SelectPanel.test.ts-snapshots/SelectPanel-With-Css-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.18 KB
(97%)
...s/SelectPanel.test.ts-snapshots/SelectPanel-With-Css-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.33 KB
(96%)
...ctPanel.test.ts-snapshots/SelectPanel-With-Sx-and-Css-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.34 KB
(96%)
...SelectPanel.test.ts-snapshots/SelectPanel-With-Sx-and-Css-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.16 KB
(97%)
...anel.test.ts-snapshots/SelectPanel-With-Sx-and-Css-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.33 KB
(96%)
...onents/SelectPanel.test.ts-snapshots/SelectPanel-With-Sx-and-Css-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.33 KB
(96%)
...ctPanel.test.ts-snapshots/SelectPanel-With-Sx-and-Css-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.18 KB
(97%)
...tPanel.test.ts-snapshots/SelectPanel-With-Sx-and-Css-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.29 KB
(96%)
...nel.test.ts-snapshots/SelectPanel-With-Sx-and-Css-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.18 KB
(97%)
...nents/SelectPanel.test.ts-snapshots/SelectPanel-With-Sx-and-Css-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.18 KB
(97%)
...tPanel.test.ts-snapshots/SelectPanel-With-Sx-and-Css-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-429 Bytes
(99%)
...nts/SelectPanel.test.ts-snapshots/SelectPanel-With-Sx-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-438 Bytes
(99%)
...ponents/SelectPanel.test.ts-snapshots/SelectPanel-With-Sx-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
-497 Bytes
(98%)
.../SelectPanel.test.ts-snapshots/SelectPanel-With-Sx-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-429 Bytes
(99%)
...ots/components/SelectPanel.test.ts-snapshots/SelectPanel-With-Sx-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
-429 Bytes
(99%)
...nts/SelectPanel.test.ts-snapshots/SelectPanel-With-Sx-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-581 Bytes
(98%)
...ts/SelectPanel.test.ts-snapshots/SelectPanel-With-Sx-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-530 Bytes
(98%)
...SelectPanel.test.ts-snapshots/SelectPanel-With-Sx-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-581 Bytes
(98%)
...ts/components/SelectPanel.test.ts-snapshots/SelectPanel-With-Sx-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
-581 Bytes
(98%)
...ts/SelectPanel.test.ts-snapshots/SelectPanel-With-Sx-light-tritanopia-linux.png
Oops, something went wrong.
This file contains hidden or 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 |
---|---|---|
|
@@ -9,6 +9,7 @@ import {Description} from './Description' | |
import Avatar from '../Avatar' | ||
import {FileDirectoryIcon, HeartFillIcon} from '@primer/octicons-react' | ||
import {Stack} from '../Stack' | ||
import {AnchoredOverlay} from '../AnchoredOverlay' | ||
|
||
export default { | ||
title: 'Components/ActionList/Dev', | ||
|
@@ -300,3 +301,77 @@ export const ItemLabelStylesWithMixedDescriptions = () => ( | |
</Stack> | ||
</Stack> | ||
) | ||
|
||
export const OverlayWrapping = () => { | ||
return ( | ||
<div style={{display: 'flex', flexDirection: 'column', gap: '100px'}}> | ||
<div style={{width: '300px', border: 'solid 1px gray'}}> | ||
<ActionList> | ||
<ActionList.Item>[email protected]</ActionList.Item> | ||
<ActionList.Item> | ||
[email protected] | ||
<ActionList.TrailingVisual> | ||
<HeartFillIcon /> | ||
</ActionList.TrailingVisual> | ||
</ActionList.Item> | ||
<ActionList.Item> | ||
[email protected] | ||
<ActionList.LeadingVisual> | ||
<HeartFillIcon /> | ||
</ActionList.LeadingVisual> | ||
</ActionList.Item> | ||
<ActionList.Item>This is a long item title long long long oh wow</ActionList.Item> | ||
<ActionList.Item> | ||
This is a long item title long long long oh wow | ||
<ActionList.TrailingVisual> | ||
<HeartFillIcon /> | ||
</ActionList.TrailingVisual> | ||
</ActionList.Item> | ||
</ActionList> | ||
</div> | ||
|
||
<div> | ||
<AnchoredOverlay | ||
open | ||
renderAnchor={props => ( | ||
<button type="button" {...props}> | ||
Overlay | ||
</button> | ||
)} | ||
> | ||
<ActionList role="menu"> | ||
<ActionList.Item role="menuitem">This menu should grow a bit</ActionList.Item> | ||
</ActionList> | ||
</AnchoredOverlay> | ||
</div> | ||
|
||
<div> | ||
<AnchoredOverlay | ||
open | ||
width="small" | ||
renderAnchor={props => ( | ||
<button type="button" {...props}> | ||
Overlay | ||
</button> | ||
)} | ||
> | ||
<ActionList role="menu"> | ||
<ActionList.Item role="menuitem">This menu should wrap because it has a small size</ActionList.Item> | ||
{/* <ActionList.Item role="menuitem"> | ||
[email protected] | ||
<ActionList.TrailingVisual> | ||
<HeartFillIcon /> | ||
</ActionList.TrailingVisual> | ||
</ActionList.Item> */} | ||
{/* <ActionList.Item role="menuitem"> | ||
[email protected] | ||
<ActionList.LeadingVisual> | ||
<HeartFillIcon /> | ||
</ActionList.LeadingVisual> | ||
</ActionList.Item> */} | ||
</ActionList> | ||
</AnchoredOverlay> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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.
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.
Remove commented-out code blocks (lines 360-371). If this code is needed for testing, consider creating separate test cases or explaining why it's commented out.
Copilot uses AI. Check for mistakes.