import React from "react"; import { Meta, StoryObj } from "@storybook/react"; import { InputControls } from "@sb/helpers"; import { MultiSelect } from "."; import { Item } from "../../Collection"; import { getCssProps } from "@sb/cssprops"; export default { title: "Dropdowns/Selection/MultiSelect", component: MultiSelect, parameters: { layout: "centered", cssprops: getCssProps("Dropdown", "Listbox"), }, argTypes: { ...InputControls, selectedKeys: { control: "multi-select", description: "Control the value of the selected keys in a controlled component", options: ["val1", "val2", "val3"], }, defaultSelectedKeys: { control: false, description: "Control the value of the selected keys in an uncontrolled component", }, children: { control: false, }, isOpen: { control: "boolean", description: "Control the open state of the menu", }, defaultOpen: { control: "boolean", description: "Control the inital state of the menu", }, onOpenChange: { control: false, action: "onOpenChange", description: "Callback for when the menu is opened or closed", table: { category: "Events", }, }, onSelectionChange: { action: "onSelectionChange", control: false, description: "Callback for when the selection changes", table: { category: "Events", }, }, }, } as Meta; type Story = StoryObj; export const Default: Story = { args: { label: "Multiselect Label", children: [ Option 1, Option 2, Option 3, ], }, }; export const Floating: Story = { args: { ...Default.args, variant: "floating", }, };