@@ -14,6 +14,7 @@ import compStyles from "./styles.module.scss";
14
14
* @param {Object } props component properties
15
15
* @param {'primary'|'error'|'warning' } [props.handleColor] menu handle color
16
16
* @param {'small'|'medium' } [props.handleSize] menu handle size
17
+ * @param {string } [props.handleText] text to show inside menu handle
17
18
* @param {Array } props.items menu items
18
19
* @param {'absolute'|'fixed' } [props.popupStrategy] popup positioning strategy
19
20
* @param {boolean } [props.stopClickPropagation] whether to stop click event propagation
@@ -22,6 +23,7 @@ import compStyles from "./styles.module.scss";
22
23
const ActionsMenu = ( {
23
24
handleColor = "primary" ,
24
25
handleSize = "small" ,
26
+ handleText,
25
27
items = [ ] ,
26
28
popupStrategy = "absolute" ,
27
29
stopClickPropagation = false ,
@@ -89,14 +91,16 @@ const ActionsMenu = ({
89
91
< Button
90
92
color = { handleColor }
91
93
size = { handleSize }
94
+ style = { handleText ? "rounded" : "circle" }
92
95
variant = "contained"
93
96
onClick = { isOpen ? null : toggleMenu }
94
97
className = { cn ( compStyles . handle , {
95
98
[ compStyles . handleMenuOpen ] : isOpen ,
96
99
} ) }
97
100
innerRef = { setReferenceElement }
98
101
>
99
- Actions < IconArrowDown className = { compStyles . iconArrowDown } />
102
+ { handleText ? < span > { handleText } </ span > : null }
103
+ < IconArrowDown className = { compStyles . iconArrowDown } />
100
104
</ Button >
101
105
{ isOpen && (
102
106
< Menu
@@ -113,6 +117,7 @@ const ActionsMenu = ({
113
117
ActionsMenu . propTypes = {
114
118
handleColor : PT . oneOf ( [ "primary" , "error" , "warning" ] ) ,
115
119
handleSize : PT . oneOf ( [ "small" , "medium" ] ) ,
120
+ handleText : PT . string ,
116
121
items : PT . arrayOf (
117
122
PT . shape ( {
118
123
label : PT . string ,
0 commit comments