From 4e3c22c1e06539c4e4366a3b60286484b604a20d Mon Sep 17 00:00:00 2001 From: Blesilda Ramirez Date: Sun, 16 Jun 2024 22:30:15 +0800 Subject: [PATCH] i10033 Add DropdownMenu component --- src/components/DropdownMenu/DropdownMenu.mdx | 16 +++ .../DropdownMenu/DropdownMenu.stories.js | 124 ++++++++++++++++++ src/components/DropdownMenu/DropdownMenu.vue | 95 ++++++++++++++ 3 files changed, 235 insertions(+) create mode 100644 src/components/DropdownMenu/DropdownMenu.mdx create mode 100644 src/components/DropdownMenu/DropdownMenu.stories.js create mode 100644 src/components/DropdownMenu/DropdownMenu.vue diff --git a/src/components/DropdownMenu/DropdownMenu.mdx b/src/components/DropdownMenu/DropdownMenu.mdx new file mode 100644 index 000000000..77ea2a255 --- /dev/null +++ b/src/components/DropdownMenu/DropdownMenu.mdx @@ -0,0 +1,16 @@ +import {Primary, Controls, Stories, Meta, Story} from '@storybook/blocks'; +import DropdownMenu from './DropdownMenu.vue'; + +import * as DropdownMenuStories from './DropdownMenu.stories.js'; + + + +# Dropdown Menu + +## Usage + +This component renders a dropdown menu that can display a list of actions. If the `name` prop is supplied, it is used as the button's label; otherwise, an ellipsis (`...`) is used. + + + + diff --git a/src/components/DropdownMenu/DropdownMenu.stories.js b/src/components/DropdownMenu/DropdownMenu.stories.js new file mode 100644 index 000000000..14b1b5b60 --- /dev/null +++ b/src/components/DropdownMenu/DropdownMenu.stories.js @@ -0,0 +1,124 @@ +import DropdownMenu from './DropdownMenu.vue'; + +export default { + title: 'Components/DropdownMenu', + component: DropdownMenu, + render: (args) => ({ + components: {DropdownMenu}, + setup() { + return {args}; + }, + template: '', + }), + argTypes: { + actions: { + description: + 'An array of action objects. Each object should contain `label` (string), `url` (string), an optional `icon` (string) and `isWarnable` (boolean) if the button needs the "warning" button styling from `