From 5dc9656b509bf583f8eae892faaec5a7ba4b686d Mon Sep 17 00:00:00 2001 From: Hardeep Asrani Date: Thu, 11 Apr 2019 16:34:58 +0530 Subject: [PATCH 1/2] Add position prop to DotTip Added `position` prop to DotTip component. Closes https://github.com/WordPress/gutenberg/issues/14923 --- 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..72e8224a171ff2 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, children, isVisible, hasNextTip, @@ -33,7 +34,7 @@ export function DotTip( { return ( Date: Wed, 10 Jul 2019 19:48:52 +0530 Subject: [PATCH 2/2] Update index.js --- packages/nux/src/components/dot-tip/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nux/src/components/dot-tip/index.js b/packages/nux/src/components/dot-tip/index.js index 72e8224a171ff2..55479ce6b9efaf 100644 --- a/packages/nux/src/components/dot-tip/index.js +++ b/packages/nux/src/components/dot-tip/index.js @@ -20,7 +20,7 @@ function onClick( event ) { } export function DotTip( { - position, + position = 'middle right', children, isVisible, hasNextTip, @@ -34,7 +34,7 @@ export function DotTip( { return (