-
Notifications
You must be signed in to change notification settings - Fork 2
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: Add extra to tabs #136
Conversation
JackyxCS
commented
Jun 20, 2023
•
edited
Loading
edited
- adds an extra action(s) option to tabs
- required for cluster summarization:
- referenced: https://ant.design/components/tabs
size-limit report 📦
|
src/tabs/Tabs.tsx
Outdated
@@ -33,14 +33,14 @@ const tabListCSS = css` | |||
--tab-hover-color: ${transparentize(0.2, theme.colors.arizeBlue)}; | |||
--tab-selected-border-color: ${theme.colors.arizeBlue}; | |||
|
|||
button { | |||
button[role='tab'] { |
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.
it might be worth figuring out a way to keep a specificity of 1 here. Having a specificity higher makes customization a bit harder
src/tabs/Tabs.tsx
Outdated
@@ -66,11 +66,17 @@ const tabListCSS = css` | |||
border-color: var(--tab-selected-border-color); | |||
} | |||
} | |||
.ac-tabs__extra-content { |
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.
this is the extra wrap right? probably worth not naming it content.
ui-components/src/field/FieldLabel.tsx
Line 91 in 3153c3d
className="ac-field-label__label-extra" |
src/tabs/Tabs.tsx
Outdated
@@ -154,6 +168,7 @@ export function Tabs({ | |||
</button> | |||
); | |||
})} | |||
{extra && <div className="ac-tabs__extra-content">{extra}</div>} |
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.
{extra && <div className="ac-tabs__extra-content">{extra}</div>} | |
{extra && <div className="ac-tabs__extra">{extra}</div>} |
src/tabs/Tabs.tsx
Outdated
display: flex; | ||
align-items: center; | ||
justify-content: flex-end; | ||
flex-grow: 1; |
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.
this means the extra takes up the entire width on the right-hand side - I think it's probably worth just having the content aligned left and let it form it's own layout rather than forcing flex.