import { storiesOf } from "@storybook/react"; import React from "react"; import Form from "@saleor/components/Form"; import SingleAutocompleteSelectField from "@saleor/components/SingleAutocompleteSelectField"; import CardDecorator from "../../CardDecorator"; import Decorator from "../../Decorator"; import { ChoiceProvider } from "../../mock"; const suggestions = [ "Afghanistan", "Burundi", "Comoros", "Egypt", "Equatorial Guinea", "Greenland", "Isle of Man", "Israel", "Italy", "United States", "Wallis and Futuna", "Zimbabwe" ].map(c => ({ label: c, value: c.toLocaleLowerCase().replace(/\s+/, "_") })); const props = { label: "Country", loading: false, name: "country", placeholder: "Select country" }; storiesOf("Generics / SingleAutocompleteSelectField", module) .addDecorator(CardDecorator) .addDecorator(Decorator) .add("with loading data", () => (
)) .add("with loaded data", () => ( )) .add("with custom option", () => ( ));