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(Tabs): Dismissable tabs #13529

Conversation

francinelucca
Copy link
Collaborator

@francinelucca francinelucca commented Apr 14, 2023

Closes #12813

This adds dismissable functionality to tabs

  • Adds new dismissable & onTabCloseRequest props to Tabs
  • Adds new Dismissable Tabs story
  • Adds Dismissable tabs docs guidance to Tabs story
  • Adds VRT & RTL tests for dismissable tabs

TODO:

  • Confirm disabled state
  • Confirm hover state

Changelog

New

  • dismissable & onTabCloseRequest props in Tabs, also passed through the TabsContext
  • dismissable VRT story
  • RTL tests for dismissable tabs
  • Tabs docs guidance for dismissable tabs
  • Dismissable tab story
  • close button styling rule for dismissable tab
  • Dismissable control in Tabs Playground story

Changed

  • Refactored Tabs scroll buttons visibility logic to account for deletable tabs
  • Datatable docs package import correction (use @carbon/react instead of carbon-components-react)
  • Overrider renderIcon with Dismiss(close) Icon on Tab when TabsContext's value has dismissable
  • onKeyDown handle in Tab to call onTabCloseRequest when delete is pressed on dismissable tab

Testing / Reviewing

  1. https://deploy-preview-13529--carbon-components-react.netlify.app/?path=/story/components-tabs--dismissable
  • Verify styling matches spec
    image
  • Verify dismissable behavior
  • Verify reset behavior
  • Verify keyboard functionality
  1. Verify other tab stories still work/behave as expected and no visual/behavioral regressions
  2. Verify Dismissable docs are coherent and readable https://deploy-preview-13529--carbon-components-react.netlify.app/?path=/docs/components-tabs--dismissable#dismissable-tabs

@netlify
Copy link

netlify bot commented Apr 14, 2023

Deploy Preview for carbon-components-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 0b7c769
🔍 Latest deploy log https://app.netlify.com/sites/carbon-components-react/deploys/64661d2e4390d90008b1dee2
😎 Deploy Preview https://deploy-preview-13529--carbon-components-react.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 settings.

@netlify
Copy link

netlify bot commented Apr 14, 2023

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 0b7c769
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/64661d2e9355b2000898ebcd
😎 Deploy Preview https://deploy-preview-13529--carbon-elements.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 settings.

@francinelucca francinelucca changed the title feat(DismissableTab): intiial functionality feat(DismissableTab): initial functionality Apr 14, 2023
@francinelucca francinelucca changed the title feat(DismissableTab): initial functionality feat(Tabs): Dismissable tabs Apr 20, 2023
@francinelucca francinelucca marked this pull request as ready for review April 20, 2023 03:45
@francinelucca francinelucca requested a review from a team as a code owner April 20, 2023 03:45
@francinelucca
Copy link
Collaborator Author

Not sure why icons-vue is failing in the e2e testing with ReferenceError: Cannot access 'WatsonHealth3DCursor32' before initialization, any insight would be greatly appreciated 🙏🏻

@francinelucca
Copy link
Collaborator Author

francinelucca commented May 11, 2023

This should be ready for another visual review @kingtraceyj @laurenmrice
Line tabs: https://deploy-preview-13529--carbon-components-react.netlify.app/?path=/docs/components-tabs--dismissable#dismissable-tabs
Contained tabs: https://deploy-preview-13529--carbon-components-react.netlify.app/?path=/story/components-tabs--playground&args=dismissable:true;contained:true

Attaching some videos as well

Screen.Recording.2023-05-11.at.7.32.47.PM.mov
Screen.Recording.2023-05-11.at.7.32.13.PM.mov

Still wondering if the disabled dismiss button should have an active color or not since disabled tabs are dismissable?
image

Copy link
Member

@kingtraceyj kingtraceyj left a comment

Choose a reason for hiding this comment

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

hover color on 'x' should be $layer-hover-accent

current:
image

intended:
image

Copy link
Member

@kingtraceyj kingtraceyj left a comment

Choose a reason for hiding this comment

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

looks go to good! 💥

Copy link
Contributor

@andreancardona andreancardona left a comment

Choose a reason for hiding this comment

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

🔥 looks amazing!

Copy link
Contributor

@andreancardona andreancardona left a comment

Choose a reason for hiding this comment

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

🔥 looks amazing!

…813-tabs-add-dismissable-functionality-to-tab
@guidari guidari self-requested a review May 17, 2023 18:20
Copy link
Contributor

@guidari guidari left a comment

Choose a reason for hiding this comment

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

Awesome! LGTM!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tabs: add dismissable functionality to tab
4 participants