@@ -10,7 +10,7 @@ import { ClipboardCopyToggle } from './ClipboardCopyToggle';
10
10
import { ClipboardCopyExpanded } from './ClipboardCopyExpanded' ;
11
11
import { getOUIAProps , OUIAProps } from '../../helpers' ;
12
12
13
- export const clipboardCopyFunc = ( event : React . ClipboardEvent < HTMLDivElement > , text ?: string ) => {
13
+ export const clipboardCopyFunc = ( event : React . ClipboardEvent < HTMLDivElement > , text ?: React . ReactNode ) => {
14
14
navigator . clipboard . writeText ( text . toString ( ) ) ;
15
15
} ;
16
16
@@ -27,7 +27,7 @@ export interface ClipboardCopyState {
27
27
textWhenExpanded : string ;
28
28
}
29
29
30
- export interface ClipboardCopyProps extends Omit < React . HTMLProps < HTMLDivElement > , 'onChange' | 'children' > , OUIAProps {
30
+ export interface ClipboardCopyProps extends Omit < React . HTMLProps < HTMLDivElement > , 'onChange' > , OUIAProps {
31
31
/** Additional classes added to the clipboard copy container. */
32
32
className ?: string ;
33
33
/** Tooltip message to display when hover the copy button */
@@ -71,12 +71,12 @@ export interface ClipboardCopyProps extends Omit<React.HTMLProps<HTMLDivElement>
71
71
/** Delay in ms before the tooltip appears. */
72
72
entryDelay ?: number ;
73
73
/** A function that is triggered on clicking the copy button. */
74
- onCopy ?: ( event : React . ClipboardEvent < HTMLDivElement > , text ?: string ) => void ;
74
+ onCopy ?: ( event : React . ClipboardEvent < HTMLDivElement > , text ?: React . ReactNode ) => void ;
75
75
/** A function that is triggered on changing the text. */
76
76
onChange ?: ( event : React . FormEvent , text ?: string ) => void ;
77
77
/** The text which is copied. */
78
- children : string ;
79
- /** Additional actions for inline clipboard copy. Should be wrapped with ClipboardCopyAction. */
78
+ children : React . ReactNode ;
79
+ /** Additional actions for inline-compact clipboard copy. Should be wrapped with ClipboardCopyAction. */
80
80
additionalActions ?: React . ReactNode ;
81
81
/** Value to overwrite the randomly generated data-ouia-component-id.*/
82
82
ouiaId ?: number | string ;
0 commit comments