Skip to content

Commit 6e68826

Browse files
committed
feat: ActionMenuStories - update story with search functionality and updated options
1 parent 8c443b0 commit 6e68826

File tree

1 file changed

+49
-40
lines changed

1 file changed

+49
-40
lines changed

src/stories/ActionMenu.stories.tsx

Lines changed: 49 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import type { Meta, StoryObj } from '@storybook/react'
2020
import { ActionMenu, ActionMenuProps, Button, Icon } from '@devtron-labs/devtron-fe-common-lib'
2121

2222
const Component = (props: ActionMenuProps) => (
23-
<div className="flex w-100 h-500">
23+
<div className="flex w-100" style={{ height: '90vh' }}>
2424
<ActionMenu {...props} />
2525
</div>
2626
)
@@ -49,16 +49,20 @@ type Story = StoryObj<typeof meta>
4949

5050
const options: ActionMenuProps['options'] = [
5151
{
52-
label: 'Label 1',
53-
value: 'value-1',
54-
startIcon: {
55-
name: 'ic-cube',
56-
color: 'N800',
57-
},
52+
items: [
53+
{
54+
label: 'Label 1',
55+
value: 'value-1',
56+
startIcon: {
57+
name: 'ic-cube',
58+
color: 'N800',
59+
},
60+
},
61+
],
5862
},
5963
{
60-
label: 'Group label 1',
61-
options: [
64+
groupLabel: 'Group 1',
65+
items: [
6266
{
6367
label: 'Group Label 1',
6468
value: 'group-value-1',
@@ -105,37 +109,41 @@ const options: ActionMenuProps['options'] = [
105109
],
106110
},
107111
{
108-
label: 'Label 2',
109-
value: 'value-2',
110-
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
111-
tooltipProps: {
112-
content: 'There is an error',
113-
},
114-
},
115-
{
116-
label: 'Label 3',
117-
value: 'value-3',
118-
},
119-
{
120-
label: 'Label 4',
121-
value: 'value-4',
122-
},
123-
{
124-
startIcon: {
125-
name: 'ic-cube',
126-
color: 'N800',
127-
},
128-
endIcon: {
129-
name: 'ic-cube',
130-
color: 'N800',
131-
},
132-
value: 'value-5',
133-
tooltipProps: {
134-
content: 'Tooltip content for value 5',
135-
},
136-
label: 'Label 5',
137-
description:
138-
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Fuga enim perspiciatis non praesentium itaque magni, animi doloremque ad beatae voluptas quasi repellat eveniet eaque culpa nemo dolorem, pariatur earum illo.',
112+
items: [
113+
{
114+
label: 'Label 2',
115+
value: 'value-2',
116+
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
117+
tooltipProps: {
118+
content: 'There is an error',
119+
},
120+
},
121+
{
122+
label: 'Label 3',
123+
value: 'value-3',
124+
},
125+
{
126+
label: 'Label 4',
127+
value: 'value-4',
128+
},
129+
{
130+
startIcon: {
131+
name: 'ic-cube',
132+
color: 'N800',
133+
},
134+
endIcon: {
135+
name: 'ic-cube',
136+
color: 'N800',
137+
},
138+
value: 'value-5',
139+
tooltipProps: {
140+
content: 'Tooltip content for value 5',
141+
},
142+
label: 'Label 5',
143+
description:
144+
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Fuga enim perspiciatis non praesentium itaque magni, animi doloremque ad beatae voluptas quasi repellat eveniet eaque culpa nemo dolorem, pariatur earum illo.',
145+
},
146+
],
139147
},
140148
]
141149

@@ -147,6 +155,7 @@ export const WithButtonElement: Story = {
147155
disableDescriptionEllipsis: false,
148156
children: <Button text="Open Action Menu" dataTestId="action-menu" />,
149157
onClick: action('option clicked'),
158+
isSearchable: true,
150159
},
151160
}
152161

0 commit comments

Comments
 (0)