-
-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathbasic.stories.tsx
39 lines (34 loc) · 1.04 KB
/
basic.stories.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { boolean, text, withKnobs } from "@storybook/addon-knobs";
import React, { useState } from "react";
import MultiSelect from "../src/multi-select";
import { options } from "./constants";
export default {
title: "Basic",
decorators: [withKnobs],
};
export const ExampleDefault = () => {
const [selected, setSelected] = useState([]);
return (
<div>
<pre>{JSON.stringify(selected)}</pre>
<MultiSelect
options={options}
hasSelectAll={boolean("hasSelectAll", true)}
isLoading={boolean("isLoading", false)}
shouldToggleOnHover={boolean("shouldToggleOnHover", false)}
disableSearch={boolean("disableSearch", false)}
value={selected}
disabled={boolean("disabled", false)}
onChange={setSelected}
onMenuToggle={(s) => {
console.debug("Select Toggle: ", s);
}}
labelledBy={text("labelledBy", "Select Fruits")}
className={text("className", "multi-select")}
/>
</div>
);
};
ExampleDefault.story = {
name: "Basic",
};