-
Notifications
You must be signed in to change notification settings - Fork 638
Link: Add inline prop to tag links inside a text block #3946
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
17 commits
Select commit
Hold shift + click to select a range
69c8d46
wip
siddharthkp 7b2f601
cleanup code, add story and test
siddharthkp 3fd90ac
add muted to story
siddharthkp cf57561
update snapshots
siddharthkp c472465
Create selfish-beans-cheat.md
siddharthkp b3a78ea
split inline story into feature and dev
siddharthkp 97951e8
add inline to docs.json
siddharthkp e2996e6
Add Link e2e snapshots
siddharthkp 324a0a3
oops, left a debug!
siddharthkp 7fc5c26
Merge branch 'main' into inline-link
siddharthkp 42bc84c
omg, remove debug statement
siddharthkp 99da01e
use dev story for tests
siddharthkp 21e5b08
Merge branch 'inline-link' of github.com:primer/react into inline-link
siddharthkp f764e12
update snapshots for dev tests
siddharthkp a1b8c3b
can't have hover state with multiple links
siddharthkp 45f6a4e
oops duplicate
siddharthkp 8bb69b7
remove outdated snapshots
siddharthkp 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 | ||
--- | ||
|
||
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 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
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 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
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.
This seems like a good candidate for a dev story, similar to what we have for button (I think?). What would you think of having the example in the feature here be a link in a text block and this would be its own dev story?
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.
Good idea, done!