@@ -28,6 +28,10 @@ export default {
2828 table : {
2929 disable : true
3030 }
31+ } ,
32+ ariaPressed : {
33+ control : 'select' ,
34+ options : [ 'none' , 'true' , 'false' ]
3135 }
3236 }
3337} as Meta ;
@@ -46,6 +50,7 @@ const Template: StoryFn = (args, context): HTMLElement => {
4650 ${ args . isDisabled ? 'disabled' : '' }
4751 ${ args . isAutoFocused ? 'autofocus' : '' }
4852 ${ args . isMinimal ? 'minimal' : '' }
53+ ${ args . ariaPressed !== 'none' ? `aria-pressed=${ args . ariaPressed } ` : '' }
4954 >${ args . startIcon ? getFaIcon ( 'plus' , args . label ? 'start' : null ) : '' } ${
5055 args . label ?? ''
5156 } </jp-button
@@ -58,56 +63,64 @@ const Template: StoryFn = (args, context): HTMLElement => {
5863 return container . firstChild as HTMLElement ;
5964} ;
6065
61- export const Default : StoryObj = { render : Template . bind ( { } ) } ;
62- Default . args = {
66+ export const Accent : StoryObj = { render : Template . bind ( { } ) } ;
67+ Accent . args = {
6368 label : 'Button Text' ,
6469 appearance : 'Accent' ,
6570 isDisabled : false ,
6671 isAutoFocused : false ,
6772 isMinimal : false ,
6873 startIcon : false ,
74+ ariaPressed : 'none' ,
6975 onClick : action ( 'button-clicked' )
7076} ;
7177
7278export const Error : StoryObj = { render : Template . bind ( { } ) } ;
7379Error . args = {
74- ...Default . args ,
80+ ...Accent . args ,
7581 appearance : 'Error'
7682} ;
7783
7884export const Neutral : StoryObj = { render : Template . bind ( { } ) } ;
7985Neutral . args = {
80- ...Default . args ,
86+ ...Accent . args ,
8187 appearance : 'Neutral'
8288} ;
8389
8490export const Lightweight : StoryObj = { render : Template . bind ( { } ) } ;
8591Lightweight . args = {
86- ...Default . args ,
92+ ...Accent . args ,
8793 appearance : 'Lightweight'
8894} ;
8995
9096export const WithAutofocus : StoryObj = { render : Template . bind ( { } ) } ;
9197WithAutofocus . args = {
92- ...Default . args ,
98+ ...Accent . args ,
9399 isAutoFocused : true
94100} ;
95101
96102export const WithDisabled : StoryObj = { render : Template . bind ( { } ) } ;
97103WithDisabled . args = {
98- ...Default . args ,
104+ ...Accent . args ,
99105 isDisabled : true
100106} ;
101107
102108export const WithStartIcon : StoryObj = { render : Template . bind ( { } ) } ;
103109WithStartIcon . args = {
104- ...Default . args ,
110+ ...Accent . args ,
105111 startIcon : true
106112} ;
107113
108114export const IconOnly : StoryObj = { render : Template . bind ( { } ) } ;
109115IconOnly . args = {
110- ...Default . args ,
116+ ...Accent . args ,
111117 label : null ,
112118 startIcon : true
113119} ;
120+
121+ export const Toggle : StoryObj = { render : Template . bind ( { } ) } ;
122+ Toggle . storyName = 'Toggle button' ;
123+ Toggle . args = {
124+ ...Accent . args ,
125+ ariaPressed : 'true'
126+ } ;
0 commit comments