diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap index 17a2861679ad..f2be17fd003e 100644 --- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -801,6 +801,9 @@ Map { "type": "string", }, "ariaLabel": [Function], + "autoAlign": Object { + "type": "bool", + }, "children": Object { "type": "node", }, @@ -1799,6 +1802,9 @@ Map { ], "type": "oneOf", }, + "autoAlign": Object { + "type": "bool", + }, "children": Object { "type": "node", }, @@ -1836,6 +1842,9 @@ Map { ], "type": "oneOf", }, + "autoAlign": Object { + "type": "bool", + }, "className": Object { "type": "string", }, @@ -4227,6 +4236,9 @@ Map { ], "type": "oneOf", }, + "autoAlign": Object { + "type": "bool", + }, "children": Object { "type": "node", }, diff --git a/packages/react/src/components/CodeSnippet/CodeSnippet.tsx b/packages/react/src/components/CodeSnippet/CodeSnippet.tsx index 39ae6c3309c0..680c0909b08a 100644 --- a/packages/react/src/components/CodeSnippet/CodeSnippet.tsx +++ b/packages/react/src/components/CodeSnippet/CodeSnippet.tsx @@ -44,6 +44,11 @@ export interface CodeSnippetProps { | 'left' | 'right'; + /** + * **Experimental**: Will attempt to automatically align the tooltip + */ + autoAlign?: boolean; + /** * Specify a label to be read by screen readers on the containing textbox * node @@ -150,6 +155,7 @@ export interface CodeSnippetProps { function CodeSnippet({ align = 'bottom', + autoAlign = false, className, type = 'single', children, @@ -304,6 +310,7 @@ function CodeSnippet({ { | 'left' | 'right'; + /** + * **Experimental**: Will attempt to automatically align the tooltip + */ + autoAlign?: boolean; + /** * Specify an optional className to be applied to the underlying `