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

[Joy] Add Link component #31175

Merged
merged 16 commits into from Mar 3, 2022
Merged

[Joy] Add Link component #31175

merged 16 commits into from Mar 3, 2022

Conversation

hbjORbj
Copy link
Member

@hbjORbj hbjORbj commented Feb 22, 2022

  • I have followed (at least) the PR section of the contributing guide.

  • variant: 'text' | 'outlined' | 'light' | 'contained' (undefined by default)

  • color: 'danger' | 'info' | 'neutral' | 'primary' | 'success' | 'warning' (primary by default)

  • level: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body1' | 'body2' | 'body3' (body1 by default)

  • underline: 'none' | 'hover' | 'always' (always by default)

Preview: https://deploy-preview-31175--material-ui.netlify.app/experiments/joy/link/

@hbjORbj hbjORbj added component: link This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy PR: needs test The pull request can't be merged labels Feb 22, 2022
@mui-bot
Copy link

mui-bot commented Feb 22, 2022

Details of bundle changes

@mui/joy: parsed: +2.47% , gzip: +1.74%

Generated by 🚫 dangerJS against 403e1c5

@hbjORbj hbjORbj removed the PR: needs test The pull request can't be merged label Feb 22, 2022
@hbjORbj hbjORbj changed the title Draft: [Joy] Add Link component [Joy] Add Link component Feb 22, 2022
@siriwatknp
Copy link
Member

@hbjORbj Please reexport the component from mui-joy/src/index.

Comment on lines 66 to 69
margin: 0, // Remove the margin in Safari
borderRadius: 0,
padding: 0, // Remove the padding in Firefox
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
margin: 0, // Remove the margin in Safari
borderRadius: 0,
padding: 0, // Remove the padding in Firefox
margin: 0, // Remove the margin in Safari
borderRadius: 0,
padding: 0, // Remove the padding in Firefox
...(!!ownerState.variant && {
paddingInline: '0.25em', // better than left, right because it also works with writing mode.
marginInline: '-0.25em',
}),

I think this is worth trying because the current variant looks so tight which I think anyone will customize it anyway.

image

Adding paddingInline gives this result (hover on text variant):

image

Negative marginInline is for making the content align with others by default (hover on text variant):

image

Copy link
Member

Choose a reason for hiding this comment

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

From what I tested, 0.25em works best.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree. Resolved.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 24, 2022
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 28, 2022
Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

👍 Other than my suggestion, the rest looks really good.

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

@hbjORbj The focus style & cursor pointer in the preview does not work, can you check?

Copy link
Contributor

@danilo-leal danilo-leal left a comment

Choose a reason for hiding this comment

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

Not sure why but the color prop doesn't seem to be working?! At least in the preview demo.

@hbjORbj
Copy link
Member Author

hbjORbj commented Mar 1, 2022

@danilo-leal You are right. I just fixed it!
@siriwatknp Thanks for comments! Just addressed them.

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

Please check the button condition again.

@hbjORbj hbjORbj requested a review from siriwatknp March 2, 2022 21:05
Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

👍 Looks great!

@hbjORbj hbjORbj merged commit 51ebd13 into mui:master Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: link This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants