Skip to content
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

[FX-5954] Add pointer cursor to Link when onClick is provided #4565

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/red-wasps-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@toptal/picasso-link': patch
'@toptal/picasso': patch
---

- add pointer cursor to Link when only onClick is provided
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ exports[`AccountSelect renders 1`] = `
class="flex items-center"
>
<a
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline !no-underline flex-1"
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline !no-underline cursor-pointer flex-1"
>
<div
class="p-6 items-center justify-between flex"
Expand Down Expand Up @@ -103,7 +103,7 @@ exports[`AccountSelect renders 1`] = `
class="flex items-center"
>
<a
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline !no-underline flex-1"
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline !no-underline cursor-pointer flex-1"
href="#"
>
<div
Expand Down Expand Up @@ -181,7 +181,7 @@ exports[`AccountSelect renders 1`] = `
class="flex items-center"
>
<a
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline !no-underline flex-1"
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline !no-underline cursor-pointer flex-1"
href="#"
>
<div
Expand Down
1 change: 1 addition & 0 deletions packages/base/Link/src/Link/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export const Link: OverridableComponent<Props> = forwardRef<
? 'visited text-purple-500'
: 'visited text-gray-500'
: '',
onClick || href ? 'cursor-pointer' : '',
className
)}
style={style}
Expand Down
4 changes: 2 additions & 2 deletions packages/base/Link/src/Link/__snapshots__/test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ exports[`Link renders disabled link 1`] = `
>
<a
aria-disabled="true"
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-gray underline cursor-not"
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-gray underline cursor-pointer"
download="filename"
rel="noopener"
>
Expand All @@ -54,7 +54,7 @@ exports[`Link renders native attributes 1`] = `
class="Picasso-root"
>
<a
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline"
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline cursor-pointer"
download="filename"
href="https://toptal.com/filename.txt"
rel="noopener"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ exports[`Page.TopBar render with link 1`] = `
</div>
</div>
<a
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline"
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline cursor-pointer"
href="https://www.toptal.com"
>
<svg
Expand Down
Loading