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

Interactive tag ☂️ #13145

Closed
10 tasks done
MaxHam opened this issue Feb 14, 2023 · 7 comments
Closed
10 tasks done

Interactive tag ☂️ #13145

MaxHam opened this issue Feb 14, 2023 · 7 comments
Labels
component: tags planning: umbrella Umbrella issues, surfaced in Projects views proposal: accepted This request has gone through triaging and we are accepting PR's against it. type: enhancement 💡

Comments

@MaxHam
Copy link

MaxHam commented Feb 14, 2023

The problem

I am from the IBM Cloud PAL team and reviewed differences between the Carbon Tag component and the Cloud Tag component. The only difference is that the Carbon Tag does not provide a "clickable" design. Meaning when you add an onClick handler to the component it is just rendered with default HTML button design.
Before overwriting the Tag component in the Cloud PAL repository, I want to propose adding a click state for the Carbon Tag component.
There are a few use cases for the click state for the tags in the Cloud context and I think a clickable state could be useful for other use cases as well.

The solution

A solution could be adding styles for the "clickable" Tag state.

As reference I can add the design of Cloud PALs Tag. This is just an example how it could look like.
I am open for feedback to this proposal and also about the design.

Examples

Screenshot 2023-02-14 at 13 43 48

Application/PAL

Cloud PAL

Business priority

Medium Priority = upcoming release but is not pressing

Code of Conduct

Tasks

  1. adopter: PAL component: tags proposal: accepted role: design ✏️ type: enhancement 💡
    laurenmrice
  2. adopter: PAL component: tags proposal: accepted role: design ✏️ type: enhancement 💡
    laurenmrice
  3. component: tags role: design ✏️ type: docs 📖 type: enhancement 💡
    laurenmrice
  4. kit: figma role: design ✏️ type: enhancement 💡 version: 11
    laurenmrice
  5. component: tags role: design ✏️ type: docs 📖
    laurenmrice skcele
  6. adopter: PAL component: tags proposal: accepted role: dev 🤖 type: enhancement 💡
    guidari
  7. adopter: PAL component: tags proposal: accepted role: dev 🤖 type: enhancement 💡
    guidari
  8. component: tags role: design ✏️ type: docs 📖 type: enhancement 💡
    laurenmrice
  9. component: tags role: visual 🎨 type: docs 📖 type: enhancement 💡
    laurenmrice
  10. component: tags role: dev 🤖 type: enhancement 💡
    guidari
@tay1orjones
Copy link
Member

Thanks for this suggestion! The last time this was proposed it seemed like there was interest in an "interactive" or "selectable" tag variant, #7592

On the technical side, this would have a few implications as it would essentially be a new type of button.

  • The element would need to change from div to button
  • All interactive states would need designed - hover, focus, active, etc.
  • Figure out how to handle the existing filter prop. Interactive elements can't be nested because screen readers ignore them. So at first glance these two may be incompatible unless we change the x button to be a sibling element and use styling to place it properly overlaid the tag.
  • As you mentioned, an onClick prop would need to be added to proptypes
  • It may need an href prop added as well?
  • Based on the above changes significantly deviating from the existing component, we would need to consider making this it's own component. Perhaps TagButton or something.

@sstrubberg sstrubberg added proposal: open This request has gone through triaging. We're determining whether we take this on or not. component: tags and removed status: needs triage 🕵️‍♀️ labels Feb 15, 2023
@MaxHam
Copy link
Author

MaxHam commented Feb 20, 2023

Hi,

  • looking at the code the component already switches from a div to a button element when adding an onChange prop.
  • I think it should not be possible to have a filter and selectable state at the same time. Since it would nest two buttons when you add onChange and filter I think it should not be allowed to add both.
  • Here you can find a quick summary how the clickable tag is used in the Cloud environment at the moment. It also shows the interactive states. Invision Board

I hope that helps understanding the use cases we had in mind.

@sstrubberg
Copy link
Member

sstrubberg commented Feb 20, 2023

We need to define the "click" behavior. The tags in the Freehand are different than the tags in the issue. Recommend ya'll head to Design Office Hours and chat with our designer about this.

Also there's a lot of undocumented implementation in this component that we could revisit once the designs the hardened.

Thanks for bringing this to our attention and we looking forward to working with you!

@aagonzales
Copy link
Member

aagonzales commented Mar 1, 2023

@sstrubberg we talked to them in office hours and this is something we want to take on in the core library. There is additional design exploration and spec-ing that will need to happen. We want to collaborate with the cloud pal team to get this done and they have said they are also willing to contribute.

From @laurenmrice

My understanding is we have three different kinds of tags:
1 Our normal tag (read-only and filterable)
2 Clickable tag (navigational)
3 Selectable tag (on or off, like we have on platform)
And all of them need to have their distinct visual differences for their states.

The full work stream would include:

  • Design spec for variations
  • Website docs
  • Code (contributed?)
  • Kit work

Do we want to take this issue to refinement? Or set up a workstream kick-off with Max and team


Related discussion from Gower.
We have also previously talked about clickable tags with Zak Crapo

@skcele
Copy link

skcele commented Mar 1, 2023

Thanks Anna! Looking forward to hearing how we can best collaborate with y'all. :)

Some additional notes from @mbgower on a possible interactive state I wanted to capture in GH:

  • stroke around interactive
  • offset focus indicator (not abutted directly against tile border OR thicker 2px)
  • when/why is the tag interactive vs read-only? Need to define use cases (visually distinct forms of link, toggle button, etc)
  • differentiation from a tag which is ONLY deletable (in which case, only the X needs to be interactive, and I don’t think it needs the stroke?)

Exploration from the call:
image (22)

@sstrubberg
Copy link
Member

@sstrubberg we talked to them in office hours and this is something we want to take on in the core library. There is additional design exploration and spec-ing that will need to happen. We want to collaborate with the cloud pal team to get this done and they have said they are also willing to contribute.

From @laurenmrice

My understanding is we have three different kinds of tags:
1 Our normal tag (read-only and filterable)
2 Clickable tag (navigational)
3 Selectable tag (on or off, like we have on platform)
And all of them need to have their distinct visual differences for their states.

The full work stream would include:

  • Design spec for variations
  • Website docs
  • Code (contributed?)
  • Kit work

Do we want to take this issue to refinement? Or set up a workstream kick-off with Max and team

Related discussion from Gower. We have also previously talked about clickable tags with Zak Crapo

Let's do a little of both. Maybe a kick-off call where we refine and scope out the work. It'll be good for everyone to get on the same page.

@sstrubberg sstrubberg added this to the 2023 Q2 milestone Mar 7, 2023
@sstrubberg sstrubberg added planning: umbrella Umbrella issues, surfaced in Projects views proposal: accepted This request has gone through triaging and we are accepting PR's against it. and removed status: waiting for maintainer response 💬 proposal: open This request has gone through triaging. We're determining whether we take this on or not. labels Mar 7, 2023
@sstrubberg sstrubberg changed the title [Feature Request]: Clickable Tag Design [Feature Request]: Clickable & Selectable Tag Design Mar 13, 2023
@sstrubberg sstrubberg changed the title [Feature Request]: Clickable & Selectable Tag Design Tag: Clickable & Selectable ☂️ Apr 12, 2023
@tay1orjones tay1orjones modified the milestones: 2023 Q2, 2023 Q3 Jul 10, 2023
@tay1orjones tay1orjones modified the milestones: 2023 Q3, 2023 Q4 Oct 2, 2023
@aagonzales
Copy link
Member

Figma file

@laurenmrice laurenmrice changed the title Tag: Clickable & Selectable ☂️ Interactive tag ☂️ Nov 17, 2023
@sstrubberg sstrubberg removed this from the 2023 Q4 milestone Jan 9, 2024
@sstrubberg sstrubberg added this to the 2024 Q1 milestone Jan 9, 2024
@tay1orjones tay1orjones modified the milestones: 2024 Q1, 2024 Q2 Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tags planning: umbrella Umbrella issues, surfaced in Projects views proposal: accepted This request has gone through triaging and we are accepting PR's against it. type: enhancement 💡
Projects
Archived in project
Archived in project
Development

No branches or pull requests

6 participants