import { Meta, StoryObj } from "@storybook/react";
import { Menu } from ".";
import { Item, Section } from "@components/Collection";
export default {
title: "Dropdowns/Menu/Menu",
component: Menu,
decorators: [
(Story) => (
),
],
parameters: {
layout: "centered",
},
argTypes: {
onClose: {
description: "Callback for when the menu is closed.",
table: {
category: "Events",
},
},
disabledKeys: {
control: "multi-select",
options: ["1", "2", "3"],
description: "Keys of items that should be disabled.",
},
shouldFocusWrap: {
control: "boolean",
description:
"Whether focus should wrap around the menu when using the keyboard.",
},
},
} as Meta;
type Story = StoryObj;
export const Primary: Story = {
args: {
children: [
- alert("Item 1")}>
Item 1
,
- alert("Item 2")}>
Item 2
,
- alert("Item 3")}>
Item 3
,
],
},
};
export const WithSections: Story = {
...Primary,
args: {
children: [
- alert("Item 1")}>
First Item in Section 1
- alert("Item 2")}>
Second Item in Section 1
,
- alert("Item 3")}>
First Item in Section 2
- alert("Item 4")}>
Second Item in Section 2
,
],
},
};