diff --git a/packages/react/src/AnchoredOverlay/AnchoredOverlay.features.stories.tsx b/packages/react/src/AnchoredOverlay/AnchoredOverlay.features.stories.tsx index db336516af6..3f914def820 100644 --- a/packages/react/src/AnchoredOverlay/AnchoredOverlay.features.stories.tsx +++ b/packages/react/src/AnchoredOverlay/AnchoredOverlay.features.stories.tsx @@ -2,7 +2,7 @@ import React, {useEffect, useRef, useState} from 'react' import type {Args, Meta} from '@storybook/react' import {FocusKeys} from '@primer/behaviors' -import {Avatar, Box, Text} from '..' +import {Avatar, Box, Link, Text} from '..' import {AnchoredOverlay} from '../AnchoredOverlay' import Heading from '../Heading' import Octicon from '../Octicon' @@ -26,7 +26,9 @@ const hoverCard = ( monalisa - Monalisa Octocat + + Monalisa Octocat + Former beach cat and champion swimmer. Now your friendly octapus with a normal face. @@ -101,6 +103,8 @@ export const CustomAnchorId = () => { onClose={() => setOpen(false)} renderAnchor={props => } anchorId="my-custom-anchor-id" + overlayProps={{role: 'dialog', 'aria-modal': true, 'aria-label': 'User Card Overlay'}} + focusZoneSettings={{disabled: true}} > {hoverCard} @@ -117,6 +121,8 @@ export const Height = () => { onClose={() => setOpen(false)} renderAnchor={props => } height="large" + overlayProps={{role: 'dialog', 'aria-modal': true, 'aria-label': 'User Card Overlay'}} + focusZoneSettings={{disabled: true}} > {hoverCard} @@ -133,8 +139,19 @@ export const Width = () => { onClose={() => setOpen(false)} renderAnchor={props => } width="large" + overlayProps={{role: 'dialog', 'aria-modal': true, 'aria-label': 'User Card Overlay'}} + focusZoneSettings={{disabled: true}} > - {hoverCard} + + {hoverCard} + ) } @@ -153,6 +170,8 @@ export const AnchorAlignment = () => { )} align="center" + overlayProps={{role: 'dialog', 'aria-modal': true, 'aria-label': 'User Card Overlay'}} + focusZoneSettings={{disabled: true}} > {hoverCard} @@ -169,6 +188,8 @@ export const AnchorSide = () => { onClose={() => setOpen(false)} renderAnchor={props => } side="outside-right" + overlayProps={{role: 'dialog', 'aria-modal': true, 'aria-label': 'User Card Overlay'}} + focusZoneSettings={{disabled: true}} > {hoverCard} @@ -185,6 +206,8 @@ export const OffsetPositionFromAnchor = () => { onClose={() => setOpen(false)} renderAnchor={props => } anchorOffset={100} + overlayProps={{role: 'dialog', 'aria-modal': true, 'aria-label': 'User Card Overlay'}} + focusZoneSettings={{disabled: true}} > {hoverCard} @@ -201,6 +224,8 @@ export const OffsetAlignmentFromAnchor = () => { onClose={() => setOpen(false)} renderAnchor={props => } alignmentOffset={100} + overlayProps={{role: 'dialog', 'aria-modal': true, 'aria-label': 'User Card Overlay'}} + focusZoneSettings={{disabled: true}} > {hoverCard} @@ -218,6 +243,8 @@ export const FocusTrapOverrides = () => { onClose={() => setOpen(false)} renderAnchor={props => } focusTrapSettings={{initialFocusRef}} + overlayProps={{role: 'dialog', 'aria-modal': true, 'aria-label': 'Focus Trap Demo Overlay'}} + focusZoneSettings={{disabled: true}} > @@ -235,6 +262,7 @@ export const FocusZoneOverrides = () => { onClose={() => setOpen(false)} renderAnchor={props => } focusZoneSettings={{bindKeys: FocusKeys.JK}} + overlayProps={{role: 'dialog', 'aria-modal': true, 'aria-label': 'Focus Zone Demo Overlay'}} >

Use J and K keys to move focus. @@ -258,7 +286,11 @@ export const OverlayPropsOverrides = () => { overlayProps={{ overflow: 'auto', maxHeight: 'xsmall', + role: 'dialog', + 'aria-modal': true, + 'aria-label': 'User Card Overlay', }} + focusZoneSettings={{disabled: true}} >

Overlay props have been overridden to set:
diff --git a/packages/react/src/AnchoredOverlay/AnchoredOverlay.stories.tsx b/packages/react/src/AnchoredOverlay/AnchoredOverlay.stories.tsx
index 5a7dcbf50da..84ec0727c24 100644
--- a/packages/react/src/AnchoredOverlay/AnchoredOverlay.stories.tsx
+++ b/packages/react/src/AnchoredOverlay/AnchoredOverlay.stories.tsx
@@ -2,7 +2,7 @@ import React, {useState} from 'react'
 import type {Args, Meta} from '@storybook/react'
 import {LocationIcon, RepoIcon} from '@primer/octicons-react'
 
-import {Avatar, Text} from '..'
+import {Avatar, Link, Text} from '..'
 import {AnchoredOverlay} from '../AnchoredOverlay'
 import {Button} from '../Button'
 import Octicon from '../Octicon'
@@ -23,7 +23,9 @@ const hoverCard = (
     
       monalisa
       
-        Monalisa Octocat
+        
+          Monalisa Octocat
+        
       
     
     Former beach cat and champion swimmer. Now your friendly octapus with a normal face.
@@ -51,6 +53,8 @@ export const Default = () => {
       onOpen={() => setOpen(true)}
       onClose={() => setOpen(false)}
       renderAnchor={props => }
+      overlayProps={{role: 'dialog', 'aria-modal': true, 'aria-label': 'User Card Overlay'}}
+      focusZoneSettings={{disabled: true}}
     >
       {hoverCard}
     
@@ -74,8 +78,14 @@ export const Playground = (args: Args) => {
       width={args.width}
       height={args.height}
       renderAnchor={props => }
-      overlayProps={args.portalContainerName}
+      overlayProps={{
+        ...args.portalContainerName,
+        role: 'dialog',
+        'aria-modal': true,
+        'aria-label': 'User Card Overlay',
+      }}
       side={args.side}
+      focusZoneSettings={{disabled: true}}
     >
       {hoverCard}