liferay / clay

A web implementation of the Lexicon Experience Language
http://clayui.com
Other
208 stars 467 forks source link

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

Closed veroglez closed 2 months ago

veroglez commented 3 months ago

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:

https://github.com/liferay/clay/assets/9701095/b414ad66-bb10-4c40-9684-cfe88b0cda4a

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 :smile:.

Thanks in advance!

cc @marcoscv-work

veroglez commented 2 months ago

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! :smile:

matuzalemsteles commented 2 months ago

@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

veroglez commented 2 months ago

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!