From 99a7eb496dcd70d6b743d9557d3df66707af6d41 Mon Sep 17 00:00:00 2001 From: Hardeep Asrani Date: Thu, 11 Jul 2019 07:37:17 +0530 Subject: [PATCH] Expose position prop in DotTip component (#14972) * Add position prop to DotTip Added `position` prop to DotTip component. Closes https://github.com/WordPress/gutenberg/issues/14923 * Update index.js --- packages/nux/src/components/dot-tip/README.md | 8 ++++++++ packages/nux/src/components/dot-tip/index.js | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/nux/src/components/dot-tip/README.md b/packages/nux/src/components/dot-tip/README.md index 5cde47c52293d8..a5328fc5a7f0f6 100644 --- a/packages/nux/src/components/dot-tip/README.md +++ b/packages/nux/src/components/dot-tip/README.md @@ -26,6 +26,14 @@ A string that uniquely identifies the tip. Identifiers should be prefixed with t - Type: `string` - Required: Yes +### position + +The direction in which the popover should open relative to its parent node. Specify y- and x-axis as a space-separated string. Supports `"top"`, `"middle"`, `"bottom"` y axis, and `"left"`, `"center"`, `"right"` x axis. + +- Type: `String` +- Required: No +- Default: `"middle right"` + ### children Any React element or elements can be passed as children. They will be rendered within the tip bubble. diff --git a/packages/nux/src/components/dot-tip/index.js b/packages/nux/src/components/dot-tip/index.js index cd2356f8026690..55479ce6b9efaf 100644 --- a/packages/nux/src/components/dot-tip/index.js +++ b/packages/nux/src/components/dot-tip/index.js @@ -20,6 +20,7 @@ function onClick( event ) { } export function DotTip( { + position = 'middle right', children, isVisible, hasNextTip, @@ -33,7 +34,7 @@ export function DotTip( { return (