@@ -40,6 +40,18 @@ import {
4040 Icon ,
4141} from '@carbon/icons-react' ;
4242
43+ const containedTabsSizeArgType = {
44+ size : {
45+ control : { type : 'select' } ,
46+ options : [ 'sm' , 'md' , 'lg' ] ,
47+ description : 'Specify the size of the contained tabs' ,
48+ } ,
49+ } ;
50+
51+ const containedTabsSizeArgs = {
52+ size : 'lg' ,
53+ } ;
54+
4355export default {
4456 title : 'Components/Tabs' ,
4557 component : Tabs ,
@@ -199,7 +211,7 @@ export const Dismissable = () => {
199211 </ >
200212 ) ;
201213} ;
202- export const DismissableContained = ( ) => {
214+ export const DismissableContained = ( args ) => {
203215 const tabs = [
204216 {
205217 label : 'Dashboard' ,
@@ -257,7 +269,7 @@ export const DismissableContained = () => {
257269 onChange = { handleTabChange }
258270 dismissable
259271 onTabCloseRequest = { handleCloseTabRequest } >
260- < TabList contained >
272+ < TabList contained size = { args . size } >
261273 { renderedTabs . map ( ( tab , index ) => (
262274 < Tab key = { index } disabled = { tab . disabled } >
263275 { tab . label }
@@ -270,6 +282,9 @@ export const DismissableContained = () => {
270282 ) ;
271283} ;
272284
285+ DismissableContained . argTypes = containedTabsSizeArgType ;
286+ DismissableContained . args = containedTabsSizeArgs ;
287+
273288export const DismissableWithIcons = ( { contained } ) => {
274289 const tabs = [
275290 {
@@ -491,10 +506,10 @@ IconOnly.argTypes = {
491506 } ,
492507} ;
493508
494- export const Contained = ( ) => {
509+ export const Contained = ( args ) => {
495510 return (
496511 < Tabs >
497- < TabList contained >
512+ < TabList contained size = { args . size } >
498513 < Tab > Dashboard</ Tab >
499514 < Tab > Monitoring</ Tab >
500515 < Tab > Activity</ Tab >
@@ -529,10 +544,13 @@ export const Contained = () => {
529544 ) ;
530545} ;
531546
532- export const ContainedWithIcons = ( ) => {
547+ Contained . argTypes = containedTabsSizeArgType ;
548+ Contained . args = containedTabsSizeArgs ;
549+
550+ export const ContainedWithIcons = ( args ) => {
533551 return (
534552 < Tabs >
535- < TabList contained >
553+ < TabList contained size = { args . size } >
536554 < Tab renderIcon = { Dashboard } > Dashboard</ Tab >
537555 < Tab renderIcon = { CloudMonitoring } > Monitoring</ Tab >
538556 < Tab renderIcon = { Activity } > Activity</ Tab >
@@ -569,6 +587,9 @@ export const ContainedWithIcons = () => {
569587 ) ;
570588} ;
571589
590+ ContainedWithIcons . argTypes = containedTabsSizeArgType ;
591+ ContainedWithIcons . args = containedTabsSizeArgs ;
592+
572593export const ContainedWithSecondaryLabels = ( ) => {
573594 return (
574595 < Tabs >
@@ -613,7 +634,7 @@ export const ContainedWithSecondaryLabelsAndIcons = () => {
613634 return (
614635 < Tabs >
615636 < TabList contained >
616- < Tab renderIcon = { Task } secondaryLabel = "(21/25" >
637+ < Tab renderIcon = { Task } secondaryLabel = "(21/25) " >
617638 Engage
618639 </ Tab >
619640 < Tab renderIcon = { IbmWatsonDiscovery } secondaryLabel = "(12/16)" >
@@ -657,12 +678,12 @@ export const ContainedWithSecondaryLabelsAndIcons = () => {
657678 ) ;
658679} ;
659680
660- export const ContainedFullWidth = ( ) => {
681+ export const ContainedFullWidth = ( args ) => {
661682 return (
662683 < Grid condensed >
663684 < Column lg = { 16 } md = { 8 } sm = { 4 } >
664685 < Tabs >
665- < TabList contained fullWidth >
686+ < TabList contained fullWidth size = { args . size } >
666687 < Tab > TLS</ Tab >
667688 < Tab > Origin</ Tab >
668689 < Tab disabled > Rate limiting</ Tab >
@@ -875,3 +896,6 @@ IconOnlyVisualSnapshots.play = async ({ userEvent }) => {
875896} ;
876897
877898IconOnlyVisualSnapshots . tags = [ '!dev' , '!autodocs' ] ;
899+
900+ ContainedFullWidth . argTypes = containedTabsSizeArgType ;
901+ ContainedFullWidth . args = containedTabsSizeArgs ;
0 commit comments