@invopop/popui 0.0.95 → 0.0.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Breadcrumbs.svelte
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script>import { Slash } from "@invopop/ui-icons";
|
|
2
2
|
import BaseFlag from "./BaseFlag.svelte";
|
|
3
3
|
import { Icon } from "@steeze-ui/svelte-icon";
|
|
4
|
+
import { createEventDispatcher } from "svelte";
|
|
4
5
|
export let breadcrumbs = [];
|
|
6
|
+
const dispatch = createEventDispatcher();
|
|
5
7
|
</script>
|
|
6
8
|
|
|
7
9
|
<ul class="flex items-center justify-start text-neutral-800">
|
|
@@ -12,9 +14,15 @@ export let breadcrumbs = [];
|
|
|
12
14
|
<span class:text-neutral-400={i < breadcrumbs.length - 1}>{breadcrumb.label}</span>
|
|
13
15
|
</a>
|
|
14
16
|
{:else}
|
|
15
|
-
<
|
|
17
|
+
<button
|
|
18
|
+
class={i < breadcrumbs.length - 1 ? 'text-neutral-400' : 'font-medium'}
|
|
19
|
+
on:click|stopPropagation={async () => {
|
|
20
|
+
await navigator.clipboard.writeText(breadcrumb.label)
|
|
21
|
+
dispatch('copied', breadcrumb.label)
|
|
22
|
+
}}
|
|
23
|
+
>
|
|
16
24
|
{breadcrumb.label}
|
|
17
|
-
</
|
|
25
|
+
</button>
|
|
18
26
|
{/if}
|
|
19
27
|
{#if breadcrumb.country}
|
|
20
28
|
<BaseFlag country={breadcrumb.country} width={14} />
|