-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link, Dropdown: fix A11y (opens new tab logic) (#3600)
- Loading branch information
1 parent
b51cfe4
commit f4d4ebd
Showing
8 changed files
with
64 additions
and
88 deletions.
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
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
23 changes: 23 additions & 0 deletions
23
packages/gestalt/src/accessibility/AccessibilityOpenNewTab.tsx
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,23 @@ | ||
import { ComponentProps } from 'react'; | ||
import classnames from 'classnames'; | ||
import { useDefaultLabelContext } from '../contexts/DefaultLabelProvider'; | ||
import Icon from '../Icon'; | ||
import styles from '../Icon.css'; | ||
import icons from '../icons/index'; | ||
|
||
type Props = { | ||
color: ComponentProps<typeof Icon>['color']; | ||
size: ComponentProps<typeof Icon>['size']; | ||
}; | ||
|
||
export default function AccessibilityOpenNewTab({ size, color }: Props) { | ||
const cs = classnames(styles.rtlSupport, styles[color ?? 'default'], styles.icon); | ||
const { accessibilityNewTabLabel } = useDefaultLabelContext('Link'); | ||
|
||
return ( | ||
<svg className={cs} height={size} role="img" viewBox="0 0 24 24" width={size}> | ||
<title>, {accessibilityNewTabLabel}</title> | ||
<path d={icons.visit} /> | ||
</svg> | ||
); | ||
} |