Closed patrickarlt closed 5 years ago
@julio8a @patrickarlt I started looking into this and wanted to ask if you had additional comps or examples of how this component would be used? Ionic's radio-group
implementation depends on a user providing items where each item has a label and a radio component:
<ion-radio-group>
<ion-item>
<ion-label>Cord</ion-label>
<ion-radio value="cord"></ion-radio>
</ion-item>
<ion-item>
<ion-label>Duesenberg</ion-label>
<ion-radio value="duesenberg"></ion-radio>
</ion-item>
<ion-item>
<ion-label>Hudson</ion-label>
<ion-radio value="hudson"></ion-radio>
</ion-item>
<ion-item>
<ion-label>Packard</ion-label>
<ion-radio value="packard"></ion-radio>
</ion-item>
<ion-item>
<ion-label>Studebaker</ion-label>
<ion-radio value="studebaker"></ion-radio>
</ion-item>
</ion-radio-group>
Not sure if we wanted something similar or something a little more simple like:
<calcite-radio-group>
<calcite-radio-group-item value="cord">Cord</calcite-radio-group-item>
<calcite-radio-group-item value="duesenberg">Duesenberg</calcite-radio-group-item>
<calcite-radio-group-item value="hudson">Hudson</calcite-radio-group-item>
<calcite-radio-group-item value="packard">Packard</calcite-radio-group-item>
<calcite-radio-group-item value="studebaker">Studebaker</calcite-radio-group-item>
</calcite-radio-group>
the calcite-radio-group
definitely seems a lot simpler. Here are some comps of the Radio visual design (along with checkboxes #1 @paulcpederson is working on.):
@jcfranco it might be good to follow what @kumarGayu did for <calcite-switch>
for this. The big thing would be to wrap an existing form element for the reasons I gave in https://github.com/ArcGIS/calcite-components/pull/24#issuecomment-495786705. We have to have some way for this to hook into default browser <form>
behaviors and for frameworks to work with the input in a standardized way. This would probally look like:
<calcite-radio-group>
<calcite-radio-group-item value="cord">
Cord <!-- Optional Label-->
<input slot="input" type="radio" name="foo"> <!-- Hidden element for <form> and frameworks to interact with. Can be hidden by the calcite component. -->
</calcite-radio-group-item>
<calcite-radio-group-item value="cord">
Duesenberg <!-- Optional Label-->
<input slot="input" type="radio" name="foo"> <!-- Hidden element for <form> and frameworks to interact with. Can be hidden by the calcite component. -->
</calcite-radio-group-item>
</calcite-radio-group>
@julio8a Per our discussion, I will hold off on this until I get a more detailed spec.
Very belated update: Spoke w/ @julio8a and this will follow Calcite Web's radio group implementation.
@julio8a Could you help provide focus states? Currently, Calcite Web radio group styling does not have any, so there is no indicator on which is one is active when you tab between groups.
@jcfranco, there's a conversation about that here: https://github.com/ArcGIS/calcite-components/issues/20
For now, you can use the default browser default?
@julio8a 👌
@julio8a @jcfranco There seems to be quite a bit of difference between the designs in https://github.com/ArcGIS/calcite-components/issues/5#issuecomment-501809327 and the designs in https://github.com/ArcGIS/calcite-components/issues/5#issuecomment-496720647. Do we need to reconcile those? I do really like the "pillbox" style design from @jcfranco. We use similar stuff all over Vector Tile Style Editor:
@patrickarlt @julio8a I'll leave it up to you. 😉
@patrickarlt On a related note, how are you labeling your radio groups? Wrapping in <label>
s?
I think @julio8a was showing the designs from radio button, not radio group. The pills-type UI is what we need/use in Online as well: http://esri.github.io/calcite-web/documentation/components/#radio-group
Yes, I mean radio button, not radio group. 😊
📻
Some styling updates to the radio-group:
@julio8a Awesome! Can you share which colors variables/values are being used?
The active color is now: $blue
hover color is: $off-white
Closing for now, any further work can be opened as new issues. Nice work @jcfranco :+1:
https://github.com/Esri/calcite-web/issues/1030
Also See: https://ionicframework.com/docs/api/radio-group, https://ionicframework.com/docs/api/radio