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

feat(tag): New Tag component #179

Merged
merged 21 commits into from
Jun 13, 2024
Merged

Conversation

lily-peng
Copy link
Contributor

Closes #219

A tag component that is used to represent a data table.

Examples:
image

image

Features:

  • Customize inner text
  • Customize left border color
  • Displays Carbon Tooltip on hover
  • Customize tooltip position & text
  • Fires click event

Changelog

New

  • {{new thing}}

Changed

  • {{change thing}}

Removed

  • {{removed thing}}

Testing / Reviewing

{{ Add descriptions, steps or a checklist for how reviewers can verify this PR works or not }}

Copy link

netlify bot commented Jun 5, 2024

Deploy Preview for carbon-labs ready!

Name Link
🔨 Latest commit 8868b25
🔍 Latest deploy log https://app.netlify.com/sites/carbon-labs/deploys/666b1edf4fd5e20008f5698f
😎 Deploy Preview https://deploy-preview-179--carbon-labs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

*/
render: ({ text, color, tooltipPosition, tooltipText, onClick }) =>
html` <clabs-tag
.color=${color}
Copy link
Member

@annawen1 annawen1 Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're passing in a string to the attribute, you can pass it in normally

color=${color}
tooltip-position=${tooltipPosition}
tooltip-text=${tooltipText}

the . is only used when you are passing in an object to the attribute of a lit component

.gitignore Outdated Show resolved Hide resolved
packages/tag/package.json Outdated Show resolved Hide resolved
packages/tag/package.json Outdated Show resolved Hide resolved
@mjabbink
Copy link

— The colors need to be limited to be accessible.
— It needs light and dark theming. We would not want to encourage ALL CAPITAL LETTERING unless this is user-generated content, and we have no control or influence over that content.
— Size (height) and spacing specs. Font size and weight, etc.
— What do the colors mean?
— Would there be any other actions? Can you delete them?

@lily-peng
Copy link
Contributor Author

lily-peng commented Jun 13, 2024

The colors need to be limited to be accessible. What do the colors mean?

Hi @mjabbink, we kept the left side color open for the user to input whatever they want for flexibility. The current use case for the Watsonx Proof of Technology is for the Tag to represent a data table, with summary information in the tooltip on hover & when clicked. The left side color would be a way to differentiate different types of tables. I'm not sure about what the different types could be though, @daniel-karl would be better to answer these questions.

ALL CAPITAL LETTERING

The text are database table names, so I believe it's out of our control.

Would there be any other actions? Can you delete them?

No deleting as far as I know, and only actions are hover and click.

@lily-peng lily-peng requested a review from annawen1 June 13, 2024 17:02
@annawen1 annawen1 merged commit c44ff79 into carbon-design-system:main Jun 13, 2024
9 checks passed
annawen1 added a commit to annawen1/carbon-labs that referenced this pull request Jun 13, 2024
annawen1 added a commit that referenced this pull request Jun 13, 2024
* Revert "feat(tag): New Tag component (#179)"

This reverts commit c44ff79.

* chore(tag): revert and re-add tag component

* chore(tag): add index.ts file

* chore(tag): bump up cwc version
@mjabbink
Copy link

@lily-peng The colors alone are not accessible. e.g. a color blind person might see the difference between the colors, so they wold need another way to distinguish between the “types” of tags. If the name of the tag does that then ok, but if the name does not make it clear, not will the color help. The user wold also need to know what the color meant and if changing this cold also pose a problem.

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

Successfully merging this pull request may close these issues.

None yet

3 participants