Skip to content

Commit

Permalink
Update Link inline prop description and deprecate underline (#4135)
Browse files Browse the repository at this point in the history
* Update Link inline prop description

* Add changeset

* Additional deprecation notice

* Update src/Link/Link.tsx

Co-authored-by: Josh Black <joshblack@github.com>

* Add deprecation notice to type

---------

Co-authored-by: Josh Black <joshblack@github.com>
  • Loading branch information
dipree and joshblack authored Jan 12, 2024
1 parent dc97a9b commit c2b069c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/nice-seals-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': minor
---

Deprecate the `underline` property of the Link component in favor of the new `inline` property to better handle link visibility and accessibility when adjacent to text.
9 changes: 5 additions & 4 deletions src/Link/Link.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,26 @@
"name": "muted",
"type": "boolean",
"defaultValue": "false",
"description": "Uses a less prominent shade for Link color, and the default link shade on hover"
"description": "Uses a less prominent shade for Link color, and the default link shade on hover."
},
{
"name": "inline",
"type": "boolean",
"defaultValue": "false",
"description": "Tag link inside a text block"
"description": "Set to true for links adjacent to text, underlining them for clear visibility and improved accessibility."
},
{
"name": "underline",
"type": "boolean",
"defaultValue": "false",
"description": "Adds underline to the Link"
"description": "Use `inline` instead.",
"deprecated": true
},
{
"name": "hoverColor",
"type": "string",
"defaultValue": "",
"description": "Color used when hovering over link"
"description": "Color used when hovering over the link."
},
{
"name": "ref",
Expand Down
1 change: 1 addition & 0 deletions src/Link/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {ForwardRefComponent as PolymorphicForwardRefComponent} from '../utils/po
type StyledLinkProps = {
hoverColor?: string
muted?: boolean
/** @deprecated use `inline` to specify the type of link instead */
underline?: boolean
// Link inside a text block
inline?: boolean
Expand Down

0 comments on commit c2b069c

Please sign in to comment.