Skip to content

Commit c52cebb

Browse files
committed
feat: ActionMenuStories - update story wrt component updates
1 parent 6e68826 commit c52cebb

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

src/stories/ActionMenu.stories.tsx

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import { action } from '@storybook/addon-actions'
1818
import type { Meta, StoryObj } from '@storybook/react'
1919

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

2222
const Component = (props: ActionMenuProps) => (
2323
<div className="flex w-100" style={{ height: '90vh' }}>
@@ -51,8 +51,8 @@ const options: ActionMenuProps['options'] = [
5151
{
5252
items: [
5353
{
54+
id: 'value-1',
5455
label: 'Label 1',
55-
value: 'value-1',
5656
startIcon: {
5757
name: 'ic-cube',
5858
color: 'N800',
@@ -64,32 +64,33 @@ const options: ActionMenuProps['options'] = [
6464
groupLabel: 'Group 1',
6565
items: [
6666
{
67+
id: 'group-value-1',
6768
label: 'Group Label 1',
68-
value: 'group-value-1',
6969
startIcon: {
7070
name: 'ic-cube',
7171
color: 'N800',
7272
},
7373
isDisabled: true,
7474
},
7575
{
76+
id: 'group-value-2',
7677
label: 'Lorem ipsum dolor sit amet, consectetur adipiscing elitLorem ipsum dolor sit amet, consectetur adipiscing elit',
77-
value: 'group-value-2',
7878
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
7979
tooltipProps: {
8080
content: 'There is an error',
8181
},
8282
type: 'negative',
8383
},
8484
{
85+
id: 'group-value-3',
8586
label: 'Lorem ipsum dolor sit amet, consectetur adipiscing elitLorem ipsum dolor sit amet, consectetur adipiscing elit',
86-
value: 'group-value-3',
8787
},
8888
{
89+
id: 'group-value-4',
8990
label: 'Group Label 4',
90-
value: 'group-value-4',
9191
},
9292
{
93+
id: 'group-value-5',
9394
startIcon: {
9495
name: 'ic-cube',
9596
color: 'N800',
@@ -98,7 +99,6 @@ const options: ActionMenuProps['options'] = [
9899
name: 'ic-cube',
99100
color: 'N800',
100101
},
101-
value: 'group-value-5',
102102
tooltipProps: {
103103
content: 'Tooltip content for value 5',
104104
},
@@ -111,22 +111,23 @@ const options: ActionMenuProps['options'] = [
111111
{
112112
items: [
113113
{
114+
id: 'value-2',
114115
label: 'Label 2',
115-
value: 'value-2',
116116
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
117117
tooltipProps: {
118118
content: 'There is an error',
119119
},
120120
},
121121
{
122+
id: 'value-3',
122123
label: 'Label 3',
123-
value: 'value-3',
124124
},
125125
{
126+
id: 'value-4',
126127
label: 'Label 4',
127-
value: 'value-4',
128128
},
129129
{
130+
id: 'value-5',
130131
startIcon: {
131132
name: 'ic-cube',
132133
color: 'N800',
@@ -135,7 +136,6 @@ const options: ActionMenuProps['options'] = [
135136
name: 'ic-cube',
136137
color: 'N800',
137138
},
138-
value: 'value-5',
139139
tooltipProps: {
140140
content: 'Tooltip content for value 5',
141141
},
@@ -149,30 +149,33 @@ const options: ActionMenuProps['options'] = [
149149

150150
export const WithButtonElement: Story = {
151151
args: {
152+
id: 'action-menu-with-button',
152153
options,
153154
position: 'bottom',
154155
alignment: 'start',
155156
disableDescriptionEllipsis: false,
156-
children: <Button text="Open Action Menu" dataTestId="action-menu" />,
157157
onClick: action('option clicked'),
158158
isSearchable: true,
159+
buttonProps: {
160+
text: 'Open Action Menu',
161+
dataTestId: 'action-menu',
162+
},
159163
},
160164
}
161165

162166
export const WithIconButtonElement: Story = {
163167
args: {
168+
id: 'action-menu-with-icon-button',
164169
options,
165170
position: 'bottom',
166171
alignment: 'start',
167172
disableDescriptionEllipsis: false,
168-
children: (
169-
<Button
170-
icon={<Icon name="ic-cube" color="N800" />}
171-
ariaLabel="action-menu"
172-
showAriaLabelInTippy={false}
173-
dataTestId="action-menu"
174-
/>
175-
),
176173
onClick: action('option clicked'),
174+
buttonProps: {
175+
icon: <Icon name="ic-cube" color="N800" />,
176+
ariaLabel: 'action-menu',
177+
showAriaLabelInTippy: false,
178+
dataTestId: 'action-menu',
179+
},
177180
},
178181
}

0 commit comments

Comments
 (0)