@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.
@@ -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
- <span class={i < breadcrumbs.length - 1 ? 'text-neutral-400' : 'font-medium'}>
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
- </span>
25
+ </button>
18
26
  {/if}
19
27
  {#if breadcrumb.country}
20
28
  <BaseFlag country={breadcrumb.country} width={14} />
@@ -5,6 +5,8 @@ declare const __propDef: {
5
5
  breadcrumbs?: Breadcrumb[] | undefined;
6
6
  };
7
7
  events: {
8
+ copied: CustomEvent<any>;
9
+ } & {
8
10
  [evt: string]: CustomEvent<any>;
9
11
  };
10
12
  slots: {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@invopop/popui",
3
3
  "license": "MIT",
4
- "version": "0.0.95",
4
+ "version": "0.0.96",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run package",