From 28a5100e6fdb138eda4a43ce50f142eb0918dd7e Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Tue, 31 Dec 2019 14:54:37 -0800 Subject: [PATCH] refactor(tooltip): rename showIcon prop Remove triggerClass prop. --- src/components/Tooltip/Tooltip.Story.svelte | 2 +- src/components/Tooltip/Tooltip.stories.js | 3 +- src/components/Tooltip/Tooltip.svelte | 37 ++++++++++----------- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/components/Tooltip/Tooltip.Story.svelte b/src/components/Tooltip/Tooltip.Story.svelte index ec9a1869..a45e68d6 100644 --- a/src/components/Tooltip/Tooltip.Story.svelte +++ b/src/components/Tooltip/Tooltip.Story.svelte @@ -58,7 +58,7 @@ Show
- +
My text wrapped with tooltip
Tooltip content
diff --git a/src/components/Tooltip/Tooltip.stories.js b/src/components/Tooltip/Tooltip.stories.js index 6beec04e..268d8f7b 100644 --- a/src/components/Tooltip/Tooltip.stories.js +++ b/src/components/Tooltip/Tooltip.stories.js @@ -23,7 +23,7 @@ export const NoIcon = () => ({ Component, props: { story: 'no icon', - showIcon: false, + hideIcon: true, direction: select('Tooltip direction (direction)', directions, 'bottom'), triggerText: text('Trigger text (triggerText)', 'Tooltip label'), tabindex: text('Tab index (tabindex in )', '0') @@ -45,7 +45,6 @@ export const CustomIconOnly = () => ({ Component, props: { story: 'custom icon only', - showIcon: true, direction: select('Tooltip direction (direction)', directions, 'bottom'), iconDescription: 'Helpful Information', tabindex: text('Tab index (tabindex in )', '0') diff --git a/src/components/Tooltip/Tooltip.svelte b/src/components/Tooltip/Tooltip.svelte index c1ecd323..0bc838c7 100644 --- a/src/components/Tooltip/Tooltip.svelte +++ b/src/components/Tooltip/Tooltip.svelte @@ -1,22 +1,21 @@ @@ -129,9 +128,9 @@ } }} /> -
- {#if showIcon} -
+
+ {#if !hideIcon} +
{triggerText}