@invopop/popui 0.0.95 → 0.0.97

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">
@@ -11,6 +13,16 @@ export let breadcrumbs = [];
11
13
  <a href={breadcrumb.url}>
12
14
  <span class:text-neutral-400={i < breadcrumbs.length - 1}>{breadcrumb.label}</span>
13
15
  </a>
16
+ {:else if breadcrumb.copiable}
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
+ >
24
+ {breadcrumb.label}
25
+ </button>
14
26
  {:else}
15
27
  <span class={i < breadcrumbs.length - 1 ? 'text-neutral-400' : 'font-medium'}>
16
28
  {breadcrumb.label}
@@ -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/dist/types.d.ts CHANGED
@@ -134,6 +134,7 @@ export type Breadcrumb = {
134
134
  label: string;
135
135
  url?: string;
136
136
  country?: string;
137
+ copiable?: boolean;
137
138
  };
138
139
  export type StepIcon = {
139
140
  name: string;
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.97",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run package",