-
Notifications
You must be signed in to change notification settings - Fork 565
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link: Add inline prop to tag links inside a text block (#3946)
* wip * cleanup code, add story and test * add muted to story * update snapshots * Create selfish-beans-cheat.md * split inline story into feature and dev * add inline to docs.json * Add Link e2e snapshots * oops, left a debug! * omg, remove debug statement * use dev story for tests * update snapshots for dev tests * can't have hover state with multiple links * oops duplicate * remove outdated snapshots
- Loading branch information
1 parent
7fa8b89
commit e08432d
Showing
19 changed files
with
316 additions
and
109 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/react": patch | ||
--- | ||
|
||
Link: Add `inline` prop to tag links inside a text block, underlined with accessibility setting `[data-a11y-link-underlines]` |
Binary file added
BIN
+71.8 KB
...apshots/components/Link.test.ts-snapshots/Link-Inline-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 added
BIN
+71.2 KB
...t/snapshots/components/Link.test.ts-snapshots/Link-Inline-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 added
BIN
+71.4 KB
...hots/components/Link.test.ts-snapshots/Link-Inline-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 added
BIN
+70.2 KB
.playwright/snapshots/components/Link.test.ts-snapshots/Link-Inline-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 added
BIN
+71.8 KB
...apshots/components/Link.test.ts-snapshots/Link-Inline-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 added
BIN
+69.3 KB
...pshots/components/Link.test.ts-snapshots/Link-Inline-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 added
BIN
+70.1 KB
...ots/components/Link.test.ts-snapshots/Link-Inline-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 added
BIN
+69.3 KB
...ywright/snapshots/components/Link.test.ts-snapshots/Link-Inline-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 added
BIN
+69.3 KB
...pshots/components/Link.test.ts-snapshots/Link-Inline-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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import Link from '.' | ||
import {Meta} from '@storybook/react' | ||
import React from 'react' | ||
import {ComponentProps} from '../utils/types' | ||
|
||
export default { | ||
title: 'Components/Link/DevOnly', | ||
component: Link, | ||
} as Meta<ComponentProps<typeof Link>> | ||
|
||
export const Inline = () => ( | ||
<div> | ||
<div style={{display: 'flex', flexDirection: 'column'}} data-a11y-link-underlines="true"> | ||
[data-a11y-link-underlines=true] (inline always underlines) | ||
<Link href="#">inline: undefined, underline: undefined</Link> | ||
<Link underline={true} href="#"> | ||
inline: undefined, underline: true | ||
</Link> | ||
<Link underline={false} href="#"> | ||
inline: undefined, underline: false | ||
</Link> | ||
<br /> | ||
<Link inline={true} href="#"> | ||
inline: true, underline: undefined | ||
</Link> | ||
<Link inline={false} href="#"> | ||
inline: false, underline: undefined | ||
</Link> | ||
<br /> | ||
<Link inline={true} underline={true} href="#"> | ||
inline: true, underline: true | ||
</Link> | ||
<Link inline={true} underline={false} href="#"> | ||
inline: true, underline: false | ||
</Link> | ||
<Link inline={false} underline={true} href="#"> | ||
inline: false, underline: true | ||
</Link> | ||
<Link inline={false} underline={false} href="#"> | ||
inline: false, underline: false | ||
</Link> | ||
<br /> | ||
<Link muted={true} inline={true} href="#"> | ||
inline: true, muted: true | ||
</Link> | ||
</div> | ||
<br /> | ||
<div style={{display: 'flex', flexDirection: 'column'}} data-a11y-link-underlines="false"> | ||
[data-a11y-link-underlines=false] (inline does nothing) | ||
<Link href="#">inline: undefined, underline: undefined</Link> | ||
<Link underline={true} href="#"> | ||
inline: undefined, underline: true | ||
</Link> | ||
<Link underline={false} href="#"> | ||
inline: undefined, underline: false | ||
</Link> | ||
<br /> | ||
<Link inline={true} href="#"> | ||
inline: true, underline: undefined | ||
</Link> | ||
<Link inline={false} href="#"> | ||
inline: false, underline: undefined | ||
</Link> | ||
<br /> | ||
<Link inline={true} underline={true} href="#"> | ||
inline: true, underline: true | ||
</Link> | ||
<Link inline={true} underline={false} href="#"> | ||
inline: true, underline: false | ||
</Link> | ||
<Link inline={false} underline={true} href="#"> | ||
inline: false, underline: true | ||
</Link> | ||
<Link inline={false} underline={false} href="#"> | ||
inline: false, underline: false | ||
</Link> | ||
<br /> | ||
<Link muted={true} inline={true} href="#"> | ||
inline: true, muted: true | ||
</Link> | ||
</div> | ||
</div> | ||
) |
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.