@invopop/popui 0.0.94 → 0.0.95

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,24 +1,26 @@
1
1
  <script>import clsx from "clsx";
2
2
  import { Icon } from "@steeze-ui/svelte-icon";
3
3
  import InputRadio from "./InputRadio.svelte";
4
- export let id;
4
+ export let id = Math.random().toString(36).slice(2, 7);
5
+ export let name = "";
5
6
  export let title = "";
6
7
  export let description = "";
7
8
  export let accentText = "";
8
9
  export let checked = false;
10
+ export let icon = void 0;
11
+ export let hideRadio = false;
9
12
  $:
10
13
  styles = clsx(
11
14
  { "border-workspace-accent shadow-active": checked },
12
15
  { "border-neutral-200 hover:border-neutral-300": !checked }
13
16
  );
14
- export let icon = void 0;
15
17
  </script>
16
18
 
17
19
  <label for={id} class="{styles} border rounded-lg w-full text-left cursor-pointer block">
18
20
  <div class="py-2 pr-2 pl-3 flex items-start justify-between">
19
21
  <div class="flex space-x-2">
20
22
  {#if icon}
21
- <Icon src={icon} class="h-5 w-5 mt-0.5 text-neutral-800 flex-shrink-0" />
23
+ <Icon src={icon} class="h-5 w-5 mt-0.5 text-neutral-500 flex-shrink-0" />
22
24
  {/if}
23
25
  <div class="flex flex-col space-y-0.5">
24
26
  <span class="text-base text-neutral-800 font-medium">{title}</span>
@@ -31,13 +33,13 @@ export let icon = void 0;
31
33
  {description}
32
34
  </p>
33
35
  </span>
34
- {:else}
35
- <span class="text-sm text-neutral-300">No description</span>
36
36
  {/if}
37
37
  </div>
38
38
  </div>
39
39
 
40
- <InputRadio {id} {checked} on:change />
40
+ <div class:hidden={hideRadio}>
41
+ <InputRadio {id} {name} {checked} on:change />
42
+ </div>
41
43
  </div>
42
44
  {#if !!$$slots.footer}
43
45
  <div class="bg-neutral-50 rounded-b-lg px-3 py-2.5 border-t border-neutral-100">
@@ -2,12 +2,14 @@ import { SvelteComponent } from "svelte";
2
2
  import { type IconSource } from '@steeze-ui/svelte-icon';
3
3
  declare const __propDef: {
4
4
  props: {
5
- id: any;
5
+ id?: string | undefined;
6
+ name?: string | undefined;
6
7
  title?: string | undefined;
7
8
  description?: string | undefined;
8
9
  accentText?: string | undefined;
9
10
  checked?: boolean | undefined;
10
11
  icon?: IconSource | undefined;
12
+ hideRadio?: boolean | undefined;
11
13
  };
12
14
  events: {
13
15
  change: CustomEvent<any>;
@@ -1,7 +1,8 @@
1
1
  <script>import { createEventDispatcher } from "svelte";
2
2
  import { dispatchWcEvent } from "./wcdispatch.js";
3
3
  export let checked = false;
4
- export let id = "";
4
+ export let id = Math.random().toString(36).slice(2, 7);
5
+ export let name = "";
5
6
  let el;
6
7
  const dispatch = createEventDispatcher();
7
8
  $:
@@ -21,6 +22,7 @@ function updateInput(event) {
21
22
  bind:this={el}
22
23
  type="radio"
23
24
  {id}
25
+ {name}
24
26
  {checked}
25
27
  class="form-radio h-5 w-5 border-neutral-200 text-workspace-accent focus:ring-0 focus:ring-offset-0 cursor-pointer"
26
28
  {...$$restProps}
@@ -4,6 +4,7 @@ declare const __propDef: {
4
4
  [x: string]: any;
5
5
  checked?: boolean | undefined;
6
6
  id?: string | undefined;
7
+ name?: string | undefined;
7
8
  };
8
9
  events: {
9
10
  change: CustomEvent<any>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@invopop/popui",
3
3
  "license": "MIT",
4
- "version": "0.0.94",
4
+ "version": "0.0.95",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run package",