From 47bdc9e60bd5b18163f47c5a1c07985343f2c380 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 25 Apr 2022 12:46:45 +0100 Subject: [PATCH] Add tooltip prop to icon component --- packages/bbui/src/Icon/Icon.svelte | 64 +++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 15 deletions(-) diff --git a/packages/bbui/src/Icon/Icon.svelte b/packages/bbui/src/Icon/Icon.svelte index ac0ddb1249..eee1d7fbae 100644 --- a/packages/bbui/src/Icon/Icon.svelte +++ b/packages/bbui/src/Icon/Icon.svelte @@ -3,6 +3,9 @@ - (showTooltip = true)} + on:focus={() => (showTooltip = true)} + on:mouseleave={() => (showTooltip = false)} + on:click={() => (showTooltip = false)} > - - + + + + {#if tooltip && showTooltip} +
+ +
+ {/if} +