@x33025/sveltely 0.0.46 → 0.0.47

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,15 +1,13 @@
1
1
  <script lang="ts">
2
2
  import type { Component } from 'svelte';
3
+ import type { HTMLButtonAttributes } from 'svelte/elements';
3
4
  import Spinner from './Spinner.svelte';
4
5
 
5
6
  type Props = {
6
7
  icon?: Component<{ class?: string }>;
7
8
  label: string;
8
9
  action: () => void | Promise<void>;
9
- disabled?: boolean;
10
- class?: string;
11
- type?: 'button' | 'submit' | 'reset';
12
- };
10
+ } & Omit<HTMLButtonAttributes, 'children' | 'onclick'>;
13
11
 
14
12
  let {
15
13
  icon,
@@ -19,7 +17,7 @@
19
17
  class: className = '',
20
18
  type = 'button',
21
19
  ...props
22
- }: Props & Record<string, unknown> = $props();
20
+ }: Props = $props();
23
21
 
24
22
  let pending = $state(false);
25
23
 
@@ -39,8 +37,8 @@
39
37
  class="inline-flex items-center gap-2 disabled:cursor-not-allowed disabled:opacity-50 {className}"
40
38
  disabled={disabled || pending}
41
39
  aria-busy={pending}
42
- onclick={handleClick}
43
40
  {...props}
41
+ onclick={handleClick}
44
42
  >
45
43
  {#if pending}
46
44
  <Spinner class="size-4" />
@@ -1,15 +1,12 @@
1
1
  import type { Component } from 'svelte';
2
+ import type { HTMLButtonAttributes } from 'svelte/elements';
2
3
  type Props = {
3
4
  icon?: Component<{
4
5
  class?: string;
5
6
  }>;
6
7
  label: string;
7
8
  action: () => void | Promise<void>;
8
- disabled?: boolean;
9
- class?: string;
10
- type?: 'button' | 'submit' | 'reset';
11
- };
12
- type $$ComponentProps = Props & Record<string, unknown>;
13
- declare const AsyncButton: Component<$$ComponentProps, {}, "">;
9
+ } & Omit<HTMLButtonAttributes, 'children' | 'onclick'>;
10
+ declare const AsyncButton: Component<Props, {}, "">;
14
11
  type AsyncButton = ReturnType<typeof AsyncButton>;
15
12
  export default AsyncButton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x33025/sveltely",
3
- "version": "0.0.46",
3
+ "version": "0.0.47",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",