@webamoki/web-svelte 0.4.0 → 0.4.1

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.
@@ -36,6 +36,8 @@
36
36
  WithElementRef<HTMLAnchorAttributes> & {
37
37
  variant?: ButtonVariant;
38
38
  size?: ButtonSize;
39
+ } & {
40
+ loading?: boolean;
39
41
  };
40
42
  </script>
41
43
 
@@ -51,15 +53,16 @@
51
53
  children,
52
54
  ...restProps
53
55
  }: ButtonProps = $props();
56
+
57
+ let pointer = disabled ? '' : 'cursor-pointer';
54
58
  </script>
55
59
 
56
60
  <!-- eslint-disable svelte/no-navigation-without-resolve -->
57
-
58
61
  {#if href}
59
62
  <a
60
63
  bind:this={ref}
61
64
  data-slot="button"
62
- class={cn(buttonVariants({ variant, size }), className)}
65
+ class={cn(buttonVariants({ variant, size }), className, pointer)}
63
66
  href={disabled ? undefined : href}
64
67
  aria-disabled={disabled}
65
68
  role={disabled ? 'link' : undefined}
@@ -72,7 +75,7 @@
72
75
  <button
73
76
  bind:this={ref}
74
77
  data-slot="button"
75
- class={cn(buttonVariants({ variant, size }), className)}
78
+ class={cn(buttonVariants({ variant, size }), className, pointer)}
76
79
  {type}
77
80
  {disabled}
78
81
  {...restProps}
@@ -52,6 +52,8 @@ export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
52
52
  export type ButtonProps = WithElementRef<HTMLButtonAttributes> & WithElementRef<HTMLAnchorAttributes> & {
53
53
  variant?: ButtonVariant;
54
54
  size?: ButtonSize;
55
+ } & {
56
+ loading?: boolean;
55
57
  };
56
58
  declare const Button: import("svelte").Component<ButtonProps, {}, "ref">;
57
59
  type Button = ReturnType<typeof Button>;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.4.0",
6
+ "version": "0.4.1",
7
7
  "license": "MIT",
8
8
  "files": [
9
9
  "dist",