-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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): vertical variation with inner grid #16738
feat(tabs): vertical variation with inner grid #16738
Conversation
✅ Deploy Preview for v11-carbon-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
This is looking good! Couple things
|
@ariellalgilmore looks good to go from design! 💥 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still reviewing, but linked to a recent PR that went in that removed all those css overrides in favor of importing the Layer component directly into Modal. Thinking we can do the same here with tabs?
@@ -0,0 +1,66 @@ | |||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this file? These styles were just removed here #16860 in favor of using the Layer component
I think we might be able to replace the div at line 1641
(tab panel) with <Layer>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks alison! I saw that PR and when swapping the div to layer
it ends up with a white background
Adding the layer
around the children works, but....
if it's not in a container Tabs then the text input background will blend with the tabs background
i ended up putting the Layer
in the story here since the TabPanel doesn't have access to knowing if it's inside a container
tabs or not. Since Tabs
doesn't have a parent element it would be hard to determine inside TabPanel
with javascript if the container
was being applied as a prop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh ok. Regardless where we add the Layer (in the actual component or in the story example) I think we can remove all of the css overrides.
The example for contained tabs breaks I think because we already have a Layer component in the story code. If we remove that and bake it in (as a child of the div) it should work.
I'm on the fence whether that is a fix or a breaking change. If someone is already nesting Layer for contained tabs then it will break. I'd rather is just "works" out of the box, but might be too late to change that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm i guess right now though if people are using the contained tabs with field elements then it could be displaying wrong... since that's whats currently in storybook right now, so I think it might be better to go the route of just having it work out of the box and overridding some layer styles for the non-contained tabs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, that might be the best option. Neither is ideal, but like you said TabPanel has no idea which variant of tabs its being used with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just pushed! I actually ended up just using css directly which seemed the cleanest code wise and possibly would be easier on the user side if they need to override for any reason
I tested locally inside some weird nested grids and it is working as expected. 🥳 *It does break if you try and place it inside a column that spans less than 5, which is probably fine. Could be fun to play with container queries to see we could fix that edge case 🤷♀️ |
@ariellalgilmore in Firefox, but I restarted my browser and its working now... 🙃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a problem that there isn't a way to invoke the truncation tooltip via mouse? I can only get it to pop via keyboard.
CleanShot.2024-06-28.at.14.03.20.mp4
@tay1orjones we followed the same guidance as operational tag, so on mouse click it shouldn't show the tooltip, but on hover it will eventually pop up with the browser's tooltip |
f406632
Hey there! v11.61.0 was just released that references this issue/PR. |
Uh oh, this broke the background coloring on all our tabs that use This CSS you added is pretty general, it affects any code using
|
Hi @wkeese, can you share a stackblitz example of what is breaking for you? and maybe some screenshots? Looking at storybook here: https://react.carbondesignsystem.com/?path=/story/components-tabs--contained and it is showing the expected results |
Yes, I started the discussion on Slack (https://ibm-analytics.slack.com/archives/C2K6RFJ1G/p1722510209140579) and posted an example link there. |
PS: Moved the discussion to ticket #17096. |
Closes #16305
Adds a new vertical variant to tabs
Changelog
New
TabListVertical
component<Tab>
into view on resize and when using mouse/keyboardvertical
andheight
props toTabs
Tabs
variant wraps aGrid
around the component except for atsm
breakpointTab
new update to add ellipsis withTooltip
only on vertical variantTabPanel
still needs to account for changing heights if the adopter doesn't give theTabs
a set heightChanged
overflow-x: hidden
to default Tabs ... fixed an issue where an unwanted horizontal scroll would appear if the length of the tabs is too longOther notes:
Testing / Reviewing
{{ Add descriptions, steps or a checklist for how reviewers can verify this PR works or not }}