@@ -8,11 +8,6 @@ import { useState } from '@wordpress/element';
8
8
*/
9
9
import ComboboxControl from '../' ;
10
10
11
- /**
12
- * External dependencies
13
- */
14
- import { boolean } from '@storybook/addon-knobs' ;
15
-
16
11
const countries = [
17
12
{ name : 'Afghanistan' , code : 'AF' } ,
18
13
{ name : 'Åland Islands' , code : 'AX' } ,
@@ -262,9 +257,6 @@ const countries = [
262
257
export default {
263
258
title : 'Components/ComboboxControl' ,
264
259
component : ComboboxControl ,
265
- parameters : {
266
- knobs : { disable : false } ,
267
- } ,
268
260
} ;
269
261
270
262
const mapCountryOption = ( country ) => ( {
@@ -274,7 +266,7 @@ const mapCountryOption = ( country ) => ( {
274
266
275
267
const countryOptions = countries . map ( mapCountryOption ) ;
276
268
277
- function CountryCodeComboboxControl ( ) {
269
+ function CountryCodeComboboxControl ( { allowReset } ) {
278
270
const [ value , setValue ] = useState ( null ) ;
279
271
280
272
return (
@@ -284,10 +276,13 @@ function CountryCodeComboboxControl() {
284
276
onChange = { setValue }
285
277
label = "Select a country"
286
278
options = { countryOptions }
287
- allowReset = { boolean ( ' allowReset' , false ) }
279
+ allowReset = { allowReset }
288
280
/>
289
281
< p > Value: { value } </ p >
290
282
</ >
291
283
) ;
292
284
}
293
- export const _default = ( ) => < CountryCodeComboboxControl /> ;
285
+ export const _default = CountryCodeComboboxControl . bind ( { } ) ;
286
+ _default . args = {
287
+ allowReset : false ,
288
+ } ;
0 commit comments