11import * as React from 'react' ;
22import styles from '@patternfly/react-styles/css/components/Tabs/tabs' ;
3- import buttonStyles from '@patternfly/react-styles/css/components/Button/button' ;
43import { css } from '@patternfly/react-styles' ;
54import { PickOptional } from '../../helpers/typeUtils' ;
65import AngleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-left-icon' ;
@@ -38,7 +37,7 @@ export interface TabsProps extends Omit<React.HTMLProps<HTMLElement | HTMLDivEle
3837 /** Additional classes added to the tabs */
3938 className ?: string ;
4039 /** Tabs background color variant */
41- variant ?: 'default' ;
40+ variant ?: 'default' | 'secondary' ;
4241 /** The index of the active tab */
4342 activeKey ?: number | string ;
4443 /** The index of the default active tab. Set this for uncontrolled Tabs */
@@ -55,8 +54,8 @@ export interface TabsProps extends Omit<React.HTMLProps<HTMLElement | HTMLDivEle
5554 id ?: string ;
5655 /** Enables the filled tab list layout */
5756 isFilled ?: boolean ;
58- /** Enables secondary tab styling */
59- isSecondary ?: boolean ;
57+ /** Enables subtab tab styling */
58+ isSubtab ?: boolean ;
6059 /** Enables box styling to the tab component */
6160 isBox ?: boolean ;
6261 /** Enables vertical tab styling */
@@ -119,7 +118,7 @@ export interface TabsProps extends Omit<React.HTMLProps<HTMLElement | HTMLDivEle
119118
120119const variantStyle = {
121120 default : '' ,
122- light300 : styles . modifiers . colorSchemeLight_300
121+ secondary : styles . modifiers . secondary
123122} ;
124123
125124interface TabsState {
@@ -177,7 +176,7 @@ class Tabs extends React.Component<TabsProps, TabsState> {
177176 activeKey : 0 ,
178177 onSelect : ( ) => undefined as any ,
179178 isFilled : false ,
180- isSecondary : false ,
179+ isSubtab : false ,
181180 isVertical : false ,
182181 isBox : false ,
183182 hasNoBorderBottom : false ,
@@ -247,7 +246,6 @@ class Tabs extends React.Component<TabsProps, TabsState> {
247246 if ( container && ! this . props . isVertical && ! isOverflowHorizontal ) {
248247 // get first element and check if it is in view
249248 const overflowOnLeft = ! isElementInView ( container , container . firstChild as HTMLElement , false ) ;
250-
251249 // get last element and check if it is in view
252250 const overflowOnRight = ! isElementInView ( container , container . lastChild as HTMLElement , false ) ;
253251
@@ -392,7 +390,7 @@ class Tabs extends React.Component<TabsProps, TabsState> {
392390 defaultActiveKey,
393391 id,
394392 isFilled,
395- isSecondary ,
393+ isSubtab ,
396394 isVertical,
397395 isBox,
398396 hasNoBorderBottom,
@@ -473,7 +471,7 @@ class Tabs extends React.Component<TabsProps, TabsState> {
473471 className = { css (
474472 styles . tabs ,
475473 isFilled && styles . modifiers . fill ,
476- isSecondary && styles . modifiers . secondary ,
474+ isSubtab && styles . modifiers . subtab ,
477475 isVertical && styles . modifiers . vertical ,
478476 isVertical && expandable && formatBreakpointMods ( expandable , styles ) ,
479477 isVertical && expandable && isExpandedLocal && styles . modifiers . expanded ,
@@ -518,33 +516,35 @@ class Tabs extends React.Component<TabsProps, TabsState> {
518516 </ GenerateId >
519517 ) }
520518 { renderScrollButtons && (
521- < button
522- type = "button"
523- className = { css ( styles . tabsScrollButton , isSecondary && buttonStyles . modifiers . secondary ) }
524- aria-label = { backScrollAriaLabel || leftScrollAriaLabel }
525- onClick = { this . scrollBack }
526- disabled = { disableBackScrollButton }
527- aria-hidden = { disableBackScrollButton }
528- ref = { this . leftScrollButtonRef }
529- >
530- < AngleLeftIcon />
531- </ button >
519+ < div className = { css ( styles . tabsScrollButton ) } >
520+ < Button
521+ aria-label = { backScrollAriaLabel || leftScrollAriaLabel }
522+ onClick = { this . scrollBack }
523+ isDisabled = { disableBackScrollButton }
524+ aria-hidden = { disableBackScrollButton }
525+ ref = { this . leftScrollButtonRef }
526+ variant = "plain"
527+ >
528+ < AngleLeftIcon />
529+ </ Button >
530+ </ div >
532531 ) }
533532 < ul className = { css ( styles . tabsList ) } ref = { this . tabList } onScroll = { this . handleScrollButtons } role = "tablist" >
534533 { isOverflowHorizontal ? filteredChildrenWithoutOverflow : filteredChildren }
535534 { hasOverflowTab && < OverflowTab overflowingTabs = { overflowingTabProps } { ...overflowObjectProps } /> }
536535 </ ul >
537536 { renderScrollButtons && (
538- < button
539- type = "button"
540- className = { css ( styles . tabsScrollButton , isSecondary && buttonStyles . modifiers . secondary ) }
541- aria-label = { forwardScrollAriaLabel || rightScrollAriaLabel }
542- onClick = { this . scrollForward }
543- disabled = { disableForwardScrollButton }
544- aria-hidden = { disableForwardScrollButton }
545- >
546- < AngleRightIcon />
547- </ button >
537+ < div className = { css ( styles . tabsScrollButton ) } >
538+ < Button
539+ aria-label = { forwardScrollAriaLabel || rightScrollAriaLabel }
540+ onClick = { this . scrollForward }
541+ isDisabled = { disableForwardScrollButton }
542+ aria-hidden = { disableForwardScrollButton }
543+ variant = "plain"
544+ >
545+ < AngleRightIcon />
546+ </ Button >
547+ </ div >
548548 ) }
549549 { onAdd !== undefined && (
550550 < span className = { css ( styles . tabsAdd ) } >
0 commit comments