Skip to content

Commit

Permalink
use icons form the icon library we're switching to
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesscottbrown committed Nov 13, 2023
1 parent e69182a commit a565fa6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
15 changes: 12 additions & 3 deletions packages/ui/src/lib/tooltip/Tooltip.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<script lang="ts">
import { ExclamationIcon } from '@rgossiaux/svelte-heroicons/solid';
import { ExclamationCircle } from '@steeze-ui/heroicons';
import { Icon } from '@steeze-ui/svelte-icon';
import { Meta, Story } from '@storybook/addon-svelte-csf';
import Tooltip from '../tooltip/Tooltip.svelte';
</script>
Expand All @@ -11,12 +13,19 @@
</Story>

<Story name="Custom hint label">
<Tooltip hintLabel="Hover over me!" >This is some text</Tooltip>
<Tooltip hintLabel="Hover over me!">This is some text</Tooltip>
</Story>

<Story name="Custom hint icon">
<Tooltip>
<svelte:fragment slot="hint">I have a diffent icon <ExclamationIcon class="w-[18px] h-[18px] ml-0.5" aria-hidden="true" /></svelte:fragment>
<svelte:fragment slot="hint"
>I have a diffent icon <Icon
src={ExclamationCircle}
theme="solid"
class="w-[18px] h-[18px] ml-0.5"
aria-hidden="true"
/></svelte:fragment
>
But I still work the same
</Tooltip>
</Story>
11 changes: 9 additions & 2 deletions packages/ui/src/lib/tooltip/Tooltip.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import { writable, type Writable } from 'svelte/store';
import { floatingContent } from './tooltip';
import { InformationCircleIcon } from '@rgossiaux/svelte-heroicons/solid';
import { InformationCircle } from '@steeze-ui/heroicons';
import { Icon } from '@steeze-ui/svelte-icon';
import { floatingRef } from '../tooltip/tooltip.js';
export let hintLabel = 'what is this?';
Expand Down Expand Up @@ -50,7 +52,12 @@
>
<slot name="hint">
{hintLabel}
<InformationCircleIcon class="w-[18px] h-[18px] ml-0.5" aria-hidden="true" />
<Icon
src={InformationCircle}
theme="solid"
class="w-[18px] h-[18px] ml-0.5"
aria-hidden="true"
/>
</slot>
</span>

Expand Down

0 comments on commit a565fa6

Please sign in to comment.