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

fix(Tag): New variants, Icon only, docs update, improvements #1011

Merged
merged 14 commits into from
Feb 23, 2024

Conversation

marcinsawicki
Copy link
Contributor

@marcinsawicki marcinsawicki commented Feb 20, 2024

Resolves: #885

Description

Improving Tag component with:

  • Doc page update with an explanation of how some variants work
  • "Icon only" variant with iconOnly flag (check docs how to use it correctly)
  • New kind variants
  • dismissibleOnHover flag to show the close button on component hover
  • dismissible flag is now deprecated (but still supported), as passing onRemove will be responsible for showing the close button (in the old implementation you had to pass onRemove and dismissible to display the close button)

Additionally, I cleaned up the styles and some component code in our current target direction.

Storybook

https://feature-885--613a8e945a5665003a05113b.chromatic.com/?path=/docs/components-tag--docs

Checklist

Obligatory:

  • Self review (use this as your final check for proposed changes before requesting the review)
  • Add reviewers (livechat/design-system)
  • Add correct label
  • Assign pull request with the correct issue

@marcinsawicki marcinsawicki changed the title fix(Tag): styles and stories refactor fix(Tag): New variants, Icon only, docs update, improvements Feb 22, 2024
@marcinsawicki marcinsawicki self-assigned this Feb 22, 2024
@marcinsawicki marcinsawicki added the feature New feature or request label Feb 22, 2024
@marcinsawicki marcinsawicki added this to the v1.0 milestone Feb 22, 2024
@marcinsawicki marcinsawicki marked this pull request as ready for review February 22, 2024 12:35
Copy link
Contributor

@VadymBezpalko VadymBezpalko left a comment

Choose a reason for hiding this comment

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

Great styles refactor! 🔥 Good job with docs as well 💪

Comment on lines 24 to 44
const kinds: Array<TagKind> = [
'default',
'info',
'warning',
'success',
'error',
'purple',
'black',
'gray',
'gradient01',
'gradient02',
'gradient03',
'gradient04',
'gradient05',
'gradient06',
'gradient07',
'gradient08',
'gradient09',
'gradient10',
'gradient11',
];
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can move it to constants and then, based on this, we can generate our type TagKind. Thanks to this we will always have the stories synchronized automatically.

@@ -10,14 +13,90 @@ import * as Stories from './Tag.stories';

## Intro <a id="Intro" />

<Canvas of={Stories.Default} sourceState="none" />
#### Basic implementation example
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can make the headings with h3

Suggested change
#### Basic implementation example
### Basic implementation example

<Tag>Example tag</Tag>
```

#### Using tag with icons
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#### Using tag with icons
### Using tag with icons

</Tag>
```

#### Using tag with close button
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#### Using tag with close button
### Using tag with close button

</Tag>
```

#### Using tag with icon only <a id="IconOnly" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#### Using tag with icon only <a id="IconOnly" />
### Using tag with icon only <a id="IconOnly" />

Copy link

@vladko-uxds vladko-uxds left a comment

Choose a reason for hiding this comment

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

🤘

@marcinsawicki marcinsawicki merged commit dc4d5d7 into main Feb 23, 2024
5 checks passed
@marcinsawicki marcinsawicki deleted the feature/885 branch February 23, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Tag] - Add Icon only property, token surface and border
3 participants