@@ -21,6 +21,16 @@ export interface ShortcutProps {
2121 drag ?: boolean ;
2222 /** Show drag and drop in the shortcut */
2323 dragAndDrop ?: boolean ;
24+ /** Custom label for the "Hover" mouse action. Defaults to "Hover" */
25+ hoverLabel ?: string ;
26+ /** Custom label for the "Click" mouse action. Defaults to "Click" */
27+ clickLabel ?: string ;
28+ /** Custom label for the "Right click" mouse action. Defaults to "Right click" */
29+ rightClickLabel ?: string ;
30+ /** Custom label for the "Drag" mouse action. Defaults to "Drag" */
31+ dragLabel ?: string ;
32+ /** Custom label for the "Drag + Drop" mouse action. Defaults to "Drag + Drop" */
33+ dragAndDropLabel ?: string ;
2434 /** Shortcut className */
2535 className ?: string ;
2636 /** Custom OUIA ID */
@@ -54,6 +64,11 @@ const Shortcut: FunctionComponent<ShortcutProps> = ({
5464 drag,
5565 rightClick,
5666 dragAndDrop,
67+ hoverLabel = 'Hover' ,
68+ clickLabel = 'Click' ,
69+ rightClickLabel = 'Right click' ,
70+ dragLabel = 'Drag' ,
71+ dragAndDropLabel = 'Drag + Drop' ,
5772 className,
5873 ouiaId = 'Shortcut' ,
5974 ...props
@@ -62,7 +77,7 @@ const Shortcut: FunctionComponent<ShortcutProps> = ({
6277 const badges = [
6378 ...( hover ? [
6479 < Label variant = "outline" key = "hover" data-test-id = "hover" >
65- < MouseIcon /> Hover
80+ < MouseIcon /> { ` ${ hoverLabel } ` }
6681 </ Label >
6782 ] : [ ] ) ,
6883 ...keys . map ( ( key ) => {
@@ -75,22 +90,22 @@ const Shortcut: FunctionComponent<ShortcutProps> = ({
7590 ) } ) ,
7691 ...( click ? [
7792 < Label variant = "outline" key = "click" data-test-id = "click" >
78- < MouseIcon /> Click
93+ < MouseIcon /> { ` ${ clickLabel } ` }
7994 </ Label >
8095 ] : [ ] ) ,
8196 ...( rightClick ? [
8297 < Label variant = "outline" key = "right-click" data-test-id = "right-click" >
83- < MouseIcon /> Right click
98+ < MouseIcon /> { ` ${ rightClickLabel } ` }
8499 </ Label >
85100 ] : [ ] ) ,
86101 ...( drag ? [
87102 < Label variant = "outline" key = "drag" data-test-id = "drag" >
88- < MouseIcon /> Drag
103+ < MouseIcon /> { ` ${ dragLabel } ` }
89104 </ Label >
90105 ] : [ ] ) ,
91106 ...( dragAndDrop ? [
92107 < Label variant = "outline" key = "drag-and-drop" data-test-id = "drag-and-drop" >
93- < MouseIcon /> Drag + Drop
108+ < MouseIcon /> { ` ${ dragAndDropLabel } ` }
94109 </ Label >
95110 ] : [ ] )
96111 ]
0 commit comments