This repository was archived by the owner on Oct 19, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ export default class Tab extends React.Component {
37
37
*/
38
38
handleTabKeyDown : PropTypes . func ,
39
39
40
+ /**
41
+ * Whether your Tab is disabled.
42
+ */
43
+ disabled : PropTypes . bool ,
44
+
40
45
/**
41
46
* Provide a string that represents the `href` of the Tab
42
47
*/
@@ -114,6 +119,7 @@ export default class Tab extends React.Component {
114
119
handleTabClick,
115
120
handleTabAnchorFocus, // eslint-disable-line
116
121
handleTabKeyDown,
122
+ disabled,
117
123
href,
118
124
index,
119
125
label,
@@ -125,11 +131,10 @@ export default class Tab extends React.Component {
125
131
...other
126
132
} = this . props ;
127
133
128
- const classes = classNames (
129
- `${ prefix } --tabs__nav-item` ,
130
- { [ `${ prefix } --tabs__nav-item--selected` ] : selected } ,
131
- className
132
- ) ;
134
+ const classes = classNames ( className , `${ prefix } --tabs__nav-item` , {
135
+ [ `${ prefix } --tabs__nav-item--disabled` ] : disabled ,
136
+ [ `${ prefix } --tabs__nav-item--selected` ] : selected ,
137
+ } ) ;
133
138
134
139
const anchorProps = {
135
140
className : `${ prefix } --tabs__nav-link` ,
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import React from 'react';
9
9
import { storiesOf } from '@storybook/react' ;
10
10
import { action } from '@storybook/addon-actions' ;
11
11
12
- import { withKnobs , number , text } from '@storybook/addon-knobs' ;
12
+ import { withKnobs , boolean , number , text } from '@storybook/addon-knobs' ;
13
13
import Tabs from '../Tabs' ;
14
14
import Tab from '../Tab' ;
15
15
import TabsSkeleton from '../Tabs/Tabs.Skeleton' ;
@@ -36,6 +36,7 @@ const props = {
36
36
) ,
37
37
} ) ,
38
38
tab : ( ) => ( {
39
+ disabled : boolean ( 'Disabled (disabled in <Tab>)' , false ) ,
39
40
href : text ( 'The href for tab (href in <Tab>)' , '#' ) ,
40
41
role : text ( 'ARIA role (role in <Tab>)' , 'presentation' ) ,
41
42
tabIndex : number ( 'Tab index (tabIndex in <Tab>)' , 0 ) ,
You can’t perform that action at this time.
0 commit comments