Skip to content

Commit 8c443b0

Browse files
committed
feat: ActionMenuStories - update story wrt component updates
1 parent d68e7cc commit 8c443b0

File tree

1 file changed

+49
-7
lines changed

1 file changed

+49
-7
lines changed

src/stories/ActionMenu.stories.tsx

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,28 @@ import type { Meta, StoryObj } from '@storybook/react'
1919

2020
import { ActionMenu, ActionMenuProps, Button, Icon } from '@devtron-labs/devtron-fe-common-lib'
2121

22+
const Component = (props: ActionMenuProps) => (
23+
<div className="flex w-100 h-500">
24+
<ActionMenu {...props} />
25+
</div>
26+
)
27+
2228
const meta = {
23-
component: ActionMenu,
29+
component: Component,
30+
argTypes: {
31+
position: {
32+
control: 'radio',
33+
options: ['bottom', 'top', 'left', 'right'],
34+
},
35+
alignment: {
36+
control: 'radio',
37+
options: ['start', 'middle', 'end'],
38+
},
39+
disableDescriptionEllipsis: {
40+
control: 'boolean',
41+
type: 'boolean',
42+
},
43+
},
2444
} satisfies Meta<ActionMenuProps>
2545

2646
export default meta
@@ -31,15 +51,21 @@ const options: ActionMenuProps['options'] = [
3151
{
3252
label: 'Label 1',
3353
value: 'value-1',
34-
startIcon: <Icon name="ic-cube" color="N800" />,
54+
startIcon: {
55+
name: 'ic-cube',
56+
color: 'N800',
57+
},
3558
},
3659
{
3760
label: 'Group label 1',
3861
options: [
3962
{
4063
label: 'Group Label 1',
4164
value: 'group-value-1',
42-
startIcon: <Icon name="ic-cube" color="N800" />,
65+
startIcon: {
66+
name: 'ic-cube',
67+
color: 'N800',
68+
},
4369
isDisabled: true,
4470
},
4571
{
@@ -60,8 +86,14 @@ const options: ActionMenuProps['options'] = [
6086
value: 'group-value-4',
6187
},
6288
{
63-
startIcon: <Icon name="ic-cube" color="N800" />,
64-
endIcon: <Icon name="ic-cube" color="N800" />,
89+
startIcon: {
90+
name: 'ic-cube',
91+
color: 'N800',
92+
},
93+
endIcon: {
94+
name: 'ic-cube',
95+
color: 'N800',
96+
},
6597
value: 'group-value-5',
6698
tooltipProps: {
6799
content: 'Tooltip content for value 5',
@@ -89,8 +121,14 @@ const options: ActionMenuProps['options'] = [
89121
value: 'value-4',
90122
},
91123
{
92-
startIcon: <Icon name="ic-cube" color="N800" />,
93-
endIcon: <Icon name="ic-cube" color="N800" />,
124+
startIcon: {
125+
name: 'ic-cube',
126+
color: 'N800',
127+
},
128+
endIcon: {
129+
name: 'ic-cube',
130+
color: 'N800',
131+
},
94132
value: 'value-5',
95133
tooltipProps: {
96134
content: 'Tooltip content for value 5',
@@ -104,6 +142,8 @@ const options: ActionMenuProps['options'] = [
104142
export const WithButtonElement: Story = {
105143
args: {
106144
options,
145+
position: 'bottom',
146+
alignment: 'start',
107147
disableDescriptionEllipsis: false,
108148
children: <Button text="Open Action Menu" dataTestId="action-menu" />,
109149
onClick: action('option clicked'),
@@ -113,6 +153,8 @@ export const WithButtonElement: Story = {
113153
export const WithIconButtonElement: Story = {
114154
args: {
115155
options,
156+
position: 'bottom',
157+
alignment: 'start',
116158
disableDescriptionEllipsis: false,
117159
children: (
118160
<Button

0 commit comments

Comments
 (0)