Skip to content

chore: add link component #16156

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 2 commits into from
Jan 15, 2025
Merged

chore: add link component #16156

merged 2 commits into from
Jan 15, 2025

Conversation

BrunoQuaresma
Copy link
Collaborator

Component based on Link design

Copy link
Contributor

@jaaydenh jaaydenh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

({ className, text, size, ...props }, ref) => {
return (
<a className={cn(linkVariants({ size }), className)} ref={ref} {...props}>
{text}&nbsp;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a non-breaking space here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc.: @jaaydenh

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing that we're adding spacing between the text and icon, but I feel like flexbox would give better control over that and have fewer edge cases around work wrapping at smaller screen sizes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There needs to be some way to put a space between the text and the icon. It there a better alternative to add a space?

{
variants: {
size: {
lg: "text-sm mb-px",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want a link to exert margins on nearby elements?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc.: @jaaydenh

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the margin bottom was leftover from some experimentation and cane be removed

@BrunoQuaresma
Copy link
Collaborator Author

@Parkreiner @jaaydenh I made some minor refactors and style tweaks. Additionally, I added a story to test the link within inline text.

@BrunoQuaresma
Copy link
Collaborator Author

Hey folks, since the tests and stories are all good, I'll go ahead and merge this to unblock my work on another feature. If there's any improvement we absolutely need, please let me know, and I'll address it in my next PR.

@BrunoQuaresma BrunoQuaresma merged commit 2052b55 into main Jan 15, 2025
30 checks passed
@BrunoQuaresma BrunoQuaresma deleted the bq/add-link-component branch January 15, 2025 19:43
@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2025
variants: {
size: {
lg: "text-sm gap-[2px] [&_svg]:size-icon-sm [&_svg]:p-[2px] leading-6",
sm: "text-xs gap-1 [&_svg]:size-icon-xs [&_svg]:p-[1px] leading-[18px]",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why use p-[1px] instead of p-px?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know p-px was a thing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants