@@ -19,8 +19,28 @@ import type { Meta, StoryObj } from '@storybook/react'
19
19
20
20
import { ActionMenu , ActionMenuProps , Button , Icon } from '@devtron-labs/devtron-fe-common-lib'
21
21
22
+ const Component = ( props : ActionMenuProps ) => (
23
+ < div className = "flex w-100 h-500" >
24
+ < ActionMenu { ...props } />
25
+ </ div >
26
+ )
27
+
22
28
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
+ } ,
24
44
} satisfies Meta < ActionMenuProps >
25
45
26
46
export default meta
@@ -31,15 +51,21 @@ const options: ActionMenuProps['options'] = [
31
51
{
32
52
label : 'Label 1' ,
33
53
value : 'value-1' ,
34
- startIcon : < Icon name = "ic-cube" color = "N800" /> ,
54
+ startIcon : {
55
+ name : 'ic-cube' ,
56
+ color : 'N800' ,
57
+ } ,
35
58
} ,
36
59
{
37
60
label : 'Group label 1' ,
38
61
options : [
39
62
{
40
63
label : 'Group Label 1' ,
41
64
value : 'group-value-1' ,
42
- startIcon : < Icon name = "ic-cube" color = "N800" /> ,
65
+ startIcon : {
66
+ name : 'ic-cube' ,
67
+ color : 'N800' ,
68
+ } ,
43
69
isDisabled : true ,
44
70
} ,
45
71
{
@@ -60,8 +86,14 @@ const options: ActionMenuProps['options'] = [
60
86
value : 'group-value-4' ,
61
87
} ,
62
88
{
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
+ } ,
65
97
value : 'group-value-5' ,
66
98
tooltipProps : {
67
99
content : 'Tooltip content for value 5' ,
@@ -89,8 +121,14 @@ const options: ActionMenuProps['options'] = [
89
121
value : 'value-4' ,
90
122
} ,
91
123
{
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
+ } ,
94
132
value : 'value-5' ,
95
133
tooltipProps : {
96
134
content : 'Tooltip content for value 5' ,
@@ -104,6 +142,8 @@ const options: ActionMenuProps['options'] = [
104
142
export const WithButtonElement : Story = {
105
143
args : {
106
144
options,
145
+ position : 'bottom' ,
146
+ alignment : 'start' ,
107
147
disableDescriptionEllipsis : false ,
108
148
children : < Button text = "Open Action Menu" dataTestId = "action-menu" /> ,
109
149
onClick : action ( 'option clicked' ) ,
@@ -113,6 +153,8 @@ export const WithButtonElement: Story = {
113
153
export const WithIconButtonElement : Story = {
114
154
args : {
115
155
options,
156
+ position : 'bottom' ,
157
+ alignment : 'start' ,
116
158
disableDescriptionEllipsis : false ,
117
159
children : (
118
160
< Button
0 commit comments