@invopop/popui 0.0.74 → 0.0.76

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,8 +1,10 @@
1
- <script>import InputRadio from "./InputRadio.svelte";
1
+ <script>import { Icon } from "@steeze-ui/svelte-icon";
2
+ import InputRadio from "./InputRadio.svelte";
2
3
  export let id;
3
4
  export let title = "";
4
5
  export let description = "";
5
6
  export let checked = false;
7
+ export let icon = void 0;
6
8
  </script>
7
9
 
8
10
  <label
@@ -12,14 +14,20 @@ export let checked = false;
12
14
  : 'border-neutral-200'} border rounded-lg w-full text-left cursor-pointer block"
13
15
  >
14
16
  <div class="py-2 pr-2 pl-3 flex items-start justify-between">
15
- <div class="flex flex-col space-y-0.5">
16
- <span class="text-base text-neutral-800 font-medium">{title}</span>
17
- {#if description}
18
- <span class="text-sm text-neutral-500">{description}</span>
19
- {:else}
20
- <span class="text-sm text-neutral-300">No description</span>
17
+ <div class="flex space-x-2">
18
+ {#if icon}
19
+ <Icon src={icon} class="h-5 w-5 mt-0.5 text-neutral-800 flex-shrink-0" />
21
20
  {/if}
21
+ <div class="flex flex-col space-y-0.5">
22
+ <span class="text-base text-neutral-800 font-medium">{title}</span>
23
+ {#if description}
24
+ <span class="text-sm text-neutral-500">{description}</span>
25
+ {:else}
26
+ <span class="text-sm text-neutral-300">No description</span>
27
+ {/if}
28
+ </div>
22
29
  </div>
30
+
23
31
  <InputRadio {id} {checked} on:change />
24
32
  </div>
25
33
  {#if !!$$slots.footer}
@@ -1,10 +1,12 @@
1
1
  import { SvelteComponent } from "svelte";
2
+ import { type IconSource } from '@steeze-ui/svelte-icon';
2
3
  declare const __propDef: {
3
4
  props: {
4
5
  id: any;
5
6
  title?: string | undefined;
6
7
  description?: string | undefined;
7
8
  checked?: boolean | undefined;
9
+ icon?: IconSource | undefined;
8
10
  };
9
11
  events: {
10
12
  change: CustomEvent<any>;
@@ -32,6 +32,8 @@ $:
32
32
  selectedItems = items.filter((i) => i.selected);
33
33
  $:
34
34
  selectedColor = !multiple && items.find((i) => i.selected)?.color;
35
+ $:
36
+ selectedIcon = !multiple && items.find((i) => i.selected)?.icon;
35
37
  $:
36
38
  selectedLabel = `${selectedItems[0]?.label || ""}${selectedItems.length > 1 ? " and more..." : ""}` || placeholder;
37
39
  $:
@@ -59,12 +61,14 @@ function handleSelected(e) {
59
61
  class="{styles} dropdown-select max-w-[420px] flex items-center border hover:border-neutral-300 rounded-md py-1.25 pl-2 gap-1 bg-white whitespace-nowrap"
60
62
  slot="trigger"
61
63
  >
62
- {#if resolvedIcon && !selectedColor}
63
- <Icon src={resolvedIcon} {iconTheme} class="h-4 w-4 text-neutral-500 flex-shrink-0" />
64
- {/if}
65
64
  {#if selectedColor}
66
65
  <TagStatus dot status={selectedColor} />
66
+ {:else if selectedIcon}
67
+ <Icon src={selectedIcon} {iconTheme} class="h-4 w-4 text-neutral-500 flex-shrink-0" />
68
+ {:else if resolvedIcon}
69
+ <Icon src={resolvedIcon} {iconTheme} class="h-4 w-4 text-neutral-500 flex-shrink-0" />
67
70
  {/if}
71
+
68
72
  <span class="w-full pr-8 text-neutral-800 placeholder-neutral-800 text-base truncate">
69
73
  {selectedLabel}
70
74
  </span>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@invopop/popui",
3
3
  "license": "MIT",
4
- "version": "0.0.74",
4
+ "version": "0.0.76",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run package",