From 980c20e1cd38a906f8e8021b2ae3ed850d98f0f1 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Sun, 22 Dec 2024 15:18:54 +0100 Subject: [PATCH] Use `args.children` when possible --- .../src/menu/stories/index.story.tsx | 203 +++++++++--------- 1 file changed, 104 insertions(+), 99 deletions(-) diff --git a/packages/components/src/menu/stories/index.story.tsx b/packages/components/src/menu/stories/index.story.tsx index 5fb2f34d9122da..37ebb6f905dc84 100644 --- a/packages/components/src/menu/stories/index.story.tsx +++ b/packages/components/src/menu/stories/index.story.tsx @@ -68,112 +68,117 @@ const meta: Meta< typeof Menu > = { export default meta; export const Default: StoryObj< typeof Menu > = { - render: ( props: MenuProps ) => ( - - } - > - Open menu - - - - Label - - - Label - Help text - - - Label - - The menu item help text is automatically truncated when - there are more than two lines of text - - - - Label - - This item doesn't close the menu on click - - - Disabled item - - - Group label - } - > - With prefix + args: { + children: ( + <> + + } + > + Open menu + + + + Label - With suffix - - } - suffix="⌥⌘T" - > - - Disabled with prefix and suffix - - And help text + + Label + Help text - - - - ), - - args: {}, -}; - -export const WithSubmenu: StoryObj< typeof Menu > = { - render: ( props: MenuProps ) => ( - - } - > - Open menu - - - Level 1 item - - - - Submenu trigger item with a long label - - - - - Level 2 item + + Label + + The menu item help text is automatically truncated + when there are more than two lines of text + + + + Label + + This item doesn't close the menu on click + + + Disabled item + + + Group label + } + > + With prefix - - Level 2 item + With suffix + + } + suffix="⌥⌘T" + > + + Disabled with prefix and suffix + + And help text - - - Submenu trigger - - - - - Level 3 item - - - - - Level 3 item - - - - - - - - - ), + + + + ), + }, +}; +export const WithSubmenu: StoryObj< typeof Menu > = { args: { ...Default.args, + children: ( + <> + + } + > + Open menu + + + Level 1 item + + + + Submenu trigger item with a long label + + + + + Level 2 item + + + Level 2 item + + + + + Submenu trigger + + + + + + Level 3 item + + + + + Level 3 item + + + + + + + + + ), }, };