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

Radio Input Component #135

Closed
Tracked by #64
muratcorlu opened this issue Jun 27, 2022 · 10 comments · Fixed by #301
Closed
Tracked by #64

Radio Input Component #135

muratcorlu opened this issue Jun 27, 2022 · 10 comments · Fixed by #301
Assignees
Labels
component Component development related issues released on @beta released
Milestone

Comments

@muratcorlu
Copy link
Contributor

muratcorlu commented Jun 27, 2022

Design

Figma Design Document

Implementation

General usage example:

<bl-radio-group label="Payment Type" name="payment-type" value="cc">
    <bl-radio value="cc">Credit Card</bl-radio>
    <bl-radio value="ideal">iDeal</bl-radio>    
</bl-radio-group>

API Reference:

bl-radio-group component

This component is the wrapper component of the radio options. Field value will be set/red via this component.

Attributes

Attribute Description Default Value
label (string) Label of the form field. This is needed for accessibility needs. -
name (string) Name of the form field -
value (string) Default value of the input -
required (boolean) Sets form field required false

Events

Event Description Event Data
bl-radio-change Will be triggered once radio selection changed new value as string

CSS Custom Properties

Property Description Default Value
--bl-radio-direction Can be used for showing radio options as columns instead of rows. Options are row or column row

bl-radio component

This component defines options for the radio input.

Attributes

Attribute Description Default Value
value (string) Value of the option -
disabled (boolean) Sets option disabled false

Slots

Name Description Default Content
default slot Label of the option -

Events

Event Description Event Data
bl-checked Will be triggered once this option is selected -
bl-focus Will be triggered once this option is focused -
bl-blur Will be triggered once this option is blurred -
@muratcorlu muratcorlu mentioned this issue Jun 27, 2022
64 tasks
@muratcorlu muratcorlu added this to the v2.0 milestone Jun 28, 2022
@muratcorlu muratcorlu added the needs clarification Issues that needs more complete description label Jul 26, 2022
@buseselvi
Copy link
Contributor

We have completed the design of the radio input component. You can reach it from the link 🥳 https://www.figma.com/file/RrcLH0mWpIUy4vwuTlDeKN/Baklava-Design-Guide?node-id=1510%3A6857

@muratcorlu muratcorlu self-assigned this Sep 29, 2022
@leventozen
Copy link
Member

I think we will use the label at bl-radio, not bl-radio-option. Therefore, no need to add slot at bl-radio-option 🤔

@muratcorlu
Copy link
Contributor Author

@leventozen That label is for the option. <bl-radio-option>Credit Card</bl-radio-option> Label in this example is "Credit Card". Currently I don't define a label for whole input as it's not indicated in the design. I think it'll up to the user how and where to put a label for it.

@leventozen
Copy link
Member

@muratcorlu I misdirected myself as thinking bl-radio is kind of a group and option is a kind of radio itself. Also, in public Figma under the usage part seems like we have a labeling option for our option "wrapper".

@muratcorlu
Copy link
Contributor Author

@leventozen You understood correct. bl-radio is the wrapper and bl-radio-option is for the options. I couldn't see a use case to use bl-radio-option by itself, since it doesn't make sense to use a radio button without another option.

@buseselvi Are those "List Of Items" titles the label of the Radio Input field? If so I missed them. Maybe we can specifically mention them in a section. Is it optional, rules for letter-casing, location of it etc.

image

@buseselvi
Copy link
Contributor

@muratcorlu I added label as an example, but we may not include it, it is not used this way everywhere.

@muratcorlu
Copy link
Contributor Author

I'll add a label property for the wrapper for accessibility reasons anyway. So screen readers can read it to give information to the end user about what they are selecting in this field. Maybe we can also consider showing this label in some "suggested ways" as an optional feature.

@leventozen
Copy link
Member

leventozen commented Oct 11, 2022

Seems done, good job! 👍

@muratcorlu muratcorlu linked a pull request Oct 20, 2022 that will close this issue
@github-actions
Copy link

🎉 This issue has been resolved in version 2.0.0-beta.43 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Apr 6, 2023

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component Component development related issues released on @beta released
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants