octopusthink / nautilus

Inclusive, open-source design system and React component library.
https://nautilus.octopusthink.com
MIT License
2 stars 0 forks source link

feat: Tag component #151

Closed sarahmonster closed 5 years ago

sarahmonster commented 5 years ago

This is a draft; there are a few things I think we'll need to add once we have the docs ironed out, but I'm unclear on a few things.

Here's the draft doc: https://www.notion.so/octopusthink/Tag-1bf7e10623104926a6560ba1b1b43d06

Once that's stable, I'll move them into our README here and see about adding other props as needed. Here's what I think we'll need (marked my name next to ones I should be able to handle pretty easily.)

sarahmonster commented 5 years ago

Quick question: right now, we ask for two props to make a Tag dismissable:

If a Tag is dismissable, it can be passed an onDismiss event that will be called with the tag's "dismiss" button is activated.

<Tag color="hotpink" dismissable onDismiss={onDismiss}>Hot pink</Tag>

Seems like it would make more sense to have just the one—if you pass an onDismiss event, the Tag will automatically inherit the dismissable styling. I'm not sure there's a sensible use case where you'd want to use one without the other.... unless I'm not thinking about something in particular?

sarahmonster commented 5 years ago

Okay! So everything on my list above is more or less done now, except for the theme variables, but I'm thinking it probably makes sense to implement those at a slightly later phase where we're more focussed on the themeing, since there's going to be a wee bit of complexity to consider there, but if we think it's worth doing now I can look at it tomorrow.

Here's what I need help with:

🙌

sarahmonster commented 5 years ago

Per discussion, let's implement the following changes here:

<Tags label="Date">
    <Tags.Tag>12 September 2019</Tags.Tag>
  </Tags>

There's some potentially-helpful information to peruse/steal/borrow from here: https://a11y-guidelines.orange.com/web_EN/exemples/tag/index.html

Also: http://microformats.org/wiki/rel-tag

@tofumatt, when you've a moment, could you look into the above for me? I'm not exactly sure how best to handle those changes myself, which means I'm probably wandering out of my depth now.