@valerius_petrini/corekit-ui 0.1.80 → 0.1.81

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.
@@ -9,26 +9,13 @@
9
9
  let {
10
10
  children = undefined,
11
11
  class: className = "",
12
- element = $bindable<HTMLDialogElement>(),
13
- open = $bindable(false),
12
+ element = $bindable(),
13
+ open = $bindable(),
14
14
  position = "center",
15
15
  size = "md",
16
16
  ...restProps
17
17
  }: ModalProps = $props();
18
18
 
19
- $effect(() => {
20
- if (!element) return;
21
- if (open) {
22
- (element as HTMLDialogElement).showModal();
23
- } else {
24
- (element as HTMLDialogElement).close();
25
- }
26
- });
27
-
28
- function onclose() {
29
- open = false;
30
- }
31
-
32
19
  const outerClass = $derived(twMerge(
33
20
  "inset-0 flex flex-col w-[calc(100%-1rem)] h-[calc(100%-1rem)] p-4",
34
21
  modalPositionParts[position]
@@ -41,19 +28,20 @@
41
28
  ));
42
29
  </script>
43
30
 
44
- <dialog
45
- bind:this={element}
46
- class="w-full h-screen bg-black/50 z-300 fixed top-0 left-0 p-0 m-0 max-w-none max-h-none"
47
- transition:fade={{ duration: 200 }}
48
- onclick={() => open = false}
49
- onclose={onclose}
50
- {...restProps}
51
- >
52
- {#if open}
53
- <div class={outerClass} transition:fly={{ y: -20, duration: 200 }}>
54
- <Card class={cardClass} onclick={(e: MouseEvent) => e.stopPropagation()}>
55
- {@render children?.()}
31
+ {#if open}
32
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
33
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
34
+ <div
35
+ class="w-full h-screen bg-black/50 z-300 fixed top-0 left-0"
36
+ transition:fade={{ duration: 200 }}
37
+ onclick={() => open = false}
38
+ bind:this={element}>
39
+ <div
40
+ class={outerClass}
41
+ transition:fly={{ y: -20, duration: 200 }}>
42
+ <Card class={cardClass} {...restProps} onclick={(e: MouseEvent) => e.stopPropagation()}>
43
+ {@render children()}
56
44
  </Card>
57
45
  </div>
58
- {/if}
59
- </dialog>
46
+ </div>
47
+ {/if}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valerius_petrini/corekit-ui",
3
- "version": "0.1.80",
3
+ "version": "0.1.81",
4
4
  "description": "Component Library used across all my projects",
5
5
  "author": "Valerius Petrini Jr.",
6
6
  "license": "MIT",