@hashrytech/quick-components-kit 0.17.4 → 0.17.5

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @hashrytech/quick-components-kit
2
2
 
3
+ ## 0.17.5
4
+
5
+ ### Patch Changes
6
+
7
+ - patch: refactoring button
8
+
3
9
  ## 0.17.4
4
10
 
5
11
  ### Patch Changes
@@ -6,7 +6,7 @@
6
6
  disabled?: boolean;
7
7
  children?: Snippet;
8
8
  icon?: Snippet;
9
- loadingIcon?: Snippet;
9
+ activeIcon?: Snippet;
10
10
  onclick?: (event: MouseEvent) => void;
11
11
  class?: ClassNameValue;
12
12
  };
@@ -16,15 +16,18 @@
16
16
  <script lang="ts">
17
17
  import {twMerge} from 'tailwind-merge';
18
18
 
19
- let { disabled=$bindable(), children, icon, loadingIcon, onclick, ...props }: ButtonProps = $props();
19
+ let { disabled=$bindable(), children, icon, activeIcon, onclick, ...props }: ButtonProps = $props();
20
20
 
21
21
  </script>
22
22
 
23
- <button {disabled} class={twMerge("flex flex-row items-center gap-2 px-4 py-2 focus:outline-primary-focus bg-primary-button hover:bg-primary-button-hover rounded-primary w-fit cursor-pointer text-white focus:ring-primary-focus focus:ring",
23
+ <button {disabled} class={twMerge("flex flex-row items-center gap-2 px-4 py-2 focus:outline-primary-focus bg-primary-button hover:bg-primary-button-hover rounded-primary cursor-pointer focus:ring-primary-focus focus:ring",
24
24
  "disabled:bg-primary-button/60 disabled:cursor-default", props.class)}
25
25
  {onclick}>
26
- {#if icon}<span class="w-10">{@render icon()}</span>{/if}
27
- {#if loadingIcon}<span class="w-10">{@render loadingIcon()}</span>{/if}
26
+ {#if activeIcon}
27
+ <span>{@render activeIcon()}</span>
28
+ {:else if icon}
29
+ <span>{@render icon()}</span>
30
+ {/if}
28
31
  {@render children?.()}
29
32
  </button>
30
33
 
@@ -4,7 +4,7 @@ export type ButtonProps = {
4
4
  disabled?: boolean;
5
5
  children?: Snippet;
6
6
  icon?: Snippet;
7
- loadingIcon?: Snippet;
7
+ activeIcon?: Snippet;
8
8
  onclick?: (event: MouseEvent) => void;
9
9
  class?: ClassNameValue;
10
10
  };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/hashrytech/quick-components-kit.git"
7
7
  },
8
- "version": "0.17.4",
8
+ "version": "0.17.5",
9
9
  "license": "MIT",
10
10
  "author": "Hashry Tech",
11
11
  "files": [