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

Component: Radio Group #5

Closed
patrickarlt opened this issue May 9, 2019 · 17 comments
Closed

Component: Radio Group #5

patrickarlt opened this issue May 9, 2019 · 17 comments
Assignees

Comments

@patrickarlt
Copy link
Contributor

Esri/calcite-web#1030

Also See: https://ionicframework.com/docs/api/radio-group, https://ionicframework.com/docs/api/radio

@jcfranco jcfranco self-assigned this May 21, 2019
@jcfranco
Copy link
Member

@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>

@julio8a
Copy link

julio8a commented May 28, 2019

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

image

@patrickarlt
Copy link
Contributor Author

@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 #24 (comment). 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>

@jcfranco
Copy link
Member

jcfranco commented Jun 4, 2019

@julio8a Per our discussion, I will hold off on this until I get a more detailed spec.

@jcfranco
Copy link
Member

Very belated update: Spoke w/ @julio8a and this will follow Calcite Web's radio group implementation.

@jcfranco
Copy link
Member

@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.

Screen Shot 2019-06-13 at 10 43 05 AM

@julio8a
Copy link

julio8a commented Jun 13, 2019

@jcfranco, there's a conversation about that here: #20

For now, you can use the default browser default?
image

@jcfranco
Copy link
Member

@julio8a 👌

@patrickarlt
Copy link
Contributor Author

@julio8a @jcfranco There seems to be quite a bit of difference between the designs in #5 (comment) and the designs in #5 (comment). 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:

Screenshot 2019-06-20 08 41 01

@jcfranco
Copy link
Member

@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?

@paulcpederson
Copy link
Member

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

@julio8a
Copy link

julio8a commented Jun 20, 2019

Yes, I mean radio button, not radio group. 😊

@asangma
Copy link
Contributor

asangma commented Jul 3, 2019

📻

@julio8a
Copy link

julio8a commented Jul 22, 2019

Some styling updates to the radio-group:

image

@jcfranco
Copy link
Member

@julio8a Awesome! Can you share which colors variables/values are being used?

@julio8a
Copy link

julio8a commented Jul 23, 2019

The active color is now: $blue
hover color is: $off-white

jcfranco added a commit that referenced this issue Jul 23, 2019
* Fix cursor not showing up on item label.
* Tweak colors.
* Rename vars.
jcfranco added a commit that referenced this issue Jul 23, 2019
@paulcpederson
Copy link
Member

Closing for now, any further work can be opened as new issues. Nice work @jcfranco 👍

kumarGayu added a commit that referenced this issue Aug 4, 2019
* master: (32 commits)
  v1.0.0-beta.2
  cleanup build process
  v1.0.0-beta.1
  minor cleanup to test master push
  #86 - remove calcite-fonts (#89)
  Update focus style
  Button style updates
  Fixes typos, adds css vars, sets element dir
  add modals to stencil config
  Prep for beta 1 release (#85)
  calcite-colors: 1.3.1
  #9 - 🔲 integration of calcite-buttons into modals
  #9 - 🔲 modals
  Ensures alerts are full width on medium viewports
  Bumps stencil version
  Updates to alerts
  Adds dir and conditional styling for icons
  Updates to address PR feedback
  Adds calcite button component
  Issue #5: Rename group event.
  ...

# Conflicts:
#	src/index.html
#	stencil.config.ts
kumarGayu added a commit that referenced this issue Aug 4, 2019
* master: (32 commits)
  v1.0.0-beta.2
  cleanup build process
  v1.0.0-beta.1
  minor cleanup to test master push
  #86 - remove calcite-fonts (#89)
  Update focus style
  Button style updates
  Fixes typos, adds css vars, sets element dir
  add modals to stencil config
  Prep for beta 1 release (#85)
  calcite-colors: 1.3.1
  #9 - 🔲 integration of calcite-buttons into modals
  #9 - 🔲 modals
  Ensures alerts are full width on medium viewports
  Bumps stencil version
  Updates to alerts
  Adds dir and conditional styling for icons
  Updates to address PR feedback
  Adds calcite button component
  Issue #5: Rename group event.
  ...

# Conflicts:
#	package-lock.json
#	package.json
#	src/index.html
@julio8a julio8a mentioned this issue Aug 20, 2019
10 tasks
jcfranco added a commit that referenced this issue May 13, 2024
…e empty with a start/end icon (#9300)

*Related Issue:** #6413

## Summary

This updates `segmented-control-item` to display a centered icon when
specified and the item is empty.

**Note:** this removes using `value` as a fallback label as non-breaking
for the following reasons:

* this behavior is
[intentional](https://github.com/Esri/calcite-design-system/blob/main/packages/calcite-components/src/components/segmented-control-item/segmented-control-item.e2e.ts#L38-L46),
but there is no explicit spec for it in the [original
issue](#5),
[PR](#72) nor
[documentation](https://developers.arcgis.com/calcite-design-system/components/segmented-control/)
* it is inconsistent with how other components expect text to be
provided
* it [breaks if there's any
whitespace](https://codepen.io/jcfranco/pen/XWwWGEy?editors=1000)
* the current behavior will lead to label that might not be
user-friendly in most cases (e.g., casing, localization)
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

No branches or pull requests

5 participants