Skip to content

Commit

Permalink
Overlay documentation fixes (#2221)
Browse files Browse the repository at this point in the history
* Add/remove missing/nonexisting props

* Add AnchoredOverlay in the navigation

* Add wicked-otters-warn changeset
  • Loading branch information
Josep Martins authored Aug 8, 2022
1 parent 7625080 commit 9ce6493
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-otters-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Overlay documentation fixes
29 changes: 18 additions & 11 deletions docs/content/Overlay.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,13 @@ See the W3C accessibility recommendations for modals [here](https://www.w3.org/T
## Positioning
`Overlay` renders its `children` within a div positioned absolutely within a portal within the default portal root. The overlay will not update its positioning if the portal root's positioning changes (e.g., if the portal root is statically positioned after some DOM element that dynamically resizes). You may consider [customizing the portal or specifying a different portal root](/Portal#customizing-the-portal-root) to achieve different positioning behavior.
`Overlay` renders its `children` within a div positioned absolutely within a portal within the default portal root. The overlay will not update its positioning if the portal root's positioning changes (e.g., if the portal root is statically positioned after some DOM element that dynamically resizes). You may consider using the [AnchoredOverlay](/AnchoredOverlay) component or [customizing the portal root](/Portal#customizing-the-portal-root) to achieve different positioning behavior.
## Props
### Overlay
<PropsTable>
<PropsTableRow
required
name="anchorRef"
type="React.RefObject<HTMLElement>"
description={
<>
Element the <InlineCode>Overlay</InlineCode> should be anchored to.
</>
}
/>
<PropsTableRow
required
name="returnFocusRef"
Expand Down Expand Up @@ -182,6 +172,23 @@ See the W3C accessibility recommendations for modals [here](https://www.w3.org/T
</>
}
/>
<PropsTableRow
name="maxHeight"
type={`| 'xsmall'
| 'small'
| 'medium'
| 'large'
| 'xlarge'`}
description={
<>
Sets the maximum height of the <InlineCode>Overlay</InlineCode>, pick from our set list of heights.
<InlineCode>xsmall</InlineCode> corresponds to <InlineCode>192px</InlineCode>, <InlineCode>small</InlineCode> corresponds
to <InlineCode>256px</InlineCode>, <InlineCode>medium</InlineCode> corresponds to <InlineCode>320px</InlineCode>,{' '}
<InlineCode>large</InlineCode> corresponds to <InlineCode>432px</InlineCode>, <InlineCode>xlarge</InlineCode> corresponds
to <InlineCode>600px</InlineCode>.
</>
}
/>
<PropsTableRow
name="visibility"
type={`| 'visible'
Expand Down
2 changes: 2 additions & 0 deletions docs/src/@primer/gatsby-theme-doctocat/nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
url: /ActionList
- title: ActionMenu
url: /ActionMenu
- title: AnchoredOverlay
url: /AnchoredOverlay
- title: Autocomplete
url: /Autocomplete
- title: Avatar
Expand Down

0 comments on commit 9ce6493

Please sign in to comment.