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

feat(@clayui/card): Radio Card component variant #5797

Merged
merged 15 commits into from
Apr 11, 2024

Conversation

veroglez
Copy link
Member

@veroglez veroglez commented Apr 4, 2024

Hi guys!

According to this issue https://liferay.atlassian.net/browse/LPD-1261, on the Echo team we need a new variant of cards that have radio buttons, so here I'm sending a solution for this.

A new prop has been added, which is selectableType. This prop defines whether the selectable element will have a checkbox or a radio button. In addition, A radioProps prop is also added to be able to pass the necessary props to the radio input. Along with all this, a new case in storybook has been added with two radio cards, to see the behavior of these cards:

radioCard.mov

Finally, to give the user the option of not truncating the text (it's another requirement in our design and in general accessibility), a new truncate prop has been added to CardWithInfo, which is a flag that determines if the text is truncate or not.

Let me know what you think about the solution, any feedback is welcome 😄.

Thanks in advance!

cc @marcoscv-work

Copy link
Member

@matuzalemsteles matuzalemsteles left a comment

Choose a reason for hiding this comment

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

Thanks @veroglez for this! Would this perhaps be interesting for other cards as well?

packages/clay-card/src/CardWithInfo.tsx Outdated Show resolved Hide resolved
@veroglez veroglez force-pushed the LPD-1261 branch 3 times, most recently from b706bb7 to a6078bb Compare April 10, 2024 14:26
@veroglez
Copy link
Member Author

Hi @matuzalemsteles! I've updated the PR by adding the radio selectable type and truncate props for CardWithUser and CardWithHorizontal. Could you take a look?

On the other hand, the CI/stats has failed but I'm not sure what it refers to. Do I have to update something?

Thanks in advance! 😄

@matuzalemsteles
Copy link
Member

@veroglez thanks for the work on this!

On the other hand, the CI/stats has failed but I'm not sure what it refers to. Do I have to update something?

Ah, the failure is because the package size limit has been exceeded, you can increase this to 151kb without problems in package.json in the root of the repository.

https://github.com/liferay/clay/blob/master/package.json#L10

Copy link
Member

@matuzalemsteles matuzalemsteles left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks again @veroglez for working on this!

@veroglez
Copy link
Member Author

Ah, the failure is because the package size limit has been exceeded, you can increase this to 151kb without problems in package.json in the root of the repository.

https://github.com/liferay/clay/blob/master/package.json#L10

Perfect! It seems that all checks have passed. Thank you very much for your help and your feedback!

@matuzalemsteles matuzalemsteles merged commit 74c1599 into liferay:master Apr 11, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants