@hashrytech/quick-components-kit 0.13.2 → 0.13.3

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.13.3
4
+
5
+ ### Patch Changes
6
+
7
+ - patch: updating disabled state for button
8
+
3
9
  ## 0.13.2
4
10
 
5
11
  ### Patch Changes
@@ -3,8 +3,10 @@
3
3
  import type { ClassNameValue } from 'tailwind-merge';
4
4
 
5
5
  export type ButtonProps = {
6
+ disabled?: boolean;
6
7
  children?: Snippet;
7
8
  icon?: Snippet;
9
+ loadingIcon?: Snippet;
8
10
  onclick?: (event: MouseEvent) => void;
9
11
  class?: ClassNameValue;
10
12
  };
@@ -14,13 +16,15 @@
14
16
  <script lang="ts">
15
17
  import {twMerge} from 'tailwind-merge';
16
18
 
17
- let {children, icon, onclick, ...props}: ButtonProps = $props();
19
+ let { disabled=$bindable(), children, icon, loadingIcon, onclick, ...props }: ButtonProps = $props();
18
20
 
19
21
  </script>
20
22
 
21
- <button class={twMerge("flex flex-row items-center gap-2 px-4 py-2 bg-button-primary hover:bg-button-primary-hover rounded-primary w-fit cursor-pointer text-white focus:outline-focus-primary", props.class)}
23
+ <button {disabled} class={twMerge("flex flex-row items-center gap-2 px-4 py-2 bg-button-primary hover:bg-button-primary-hover rounded-primary w-fit cursor-pointer text-white focus:outline-focus-primary",
24
+ "disabled:bg-button-primary/60 disabled:cursor-default", props.class)}
22
25
  {onclick}>
23
26
  {#if icon}<span class="w-10">{@render icon()}</span>{/if}
27
+ {#if loadingIcon}<span class="w-10">{@render loadingIcon()}</span>{/if}
24
28
  {@render children?.()}
25
29
  </button>
26
30
 
@@ -1,11 +1,13 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  import type { ClassNameValue } from 'tailwind-merge';
3
3
  export type ButtonProps = {
4
+ disabled?: boolean;
4
5
  children?: Snippet;
5
6
  icon?: Snippet;
7
+ loadingIcon?: Snippet;
6
8
  onclick?: (event: MouseEvent) => void;
7
9
  class?: ClassNameValue;
8
10
  };
9
- declare const Button: import("svelte").Component<ButtonProps, {}, "">;
11
+ declare const Button: import("svelte").Component<ButtonProps, {}, "disabled">;
10
12
  type Button = ReturnType<typeof Button>;
11
13
  export default Button;
@@ -19,12 +19,12 @@
19
19
  </script>
20
20
 
21
21
  <script lang="ts">
22
- let { links, preload=true, reload=false, divClasses, ...props }: TabNavigationProps = $props();
22
+ let { links=$bindable(), preload=true, reload=false, divClasses, ...props }: TabNavigationProps = $props();
23
23
  </script>
24
24
 
25
25
  <div class={twMerge("flex flex-row flex-wrap gap-4 justify-start xxxs:justify-center items-start py-2 px-4 mt-8 font-semibold", divClasses)}>
26
26
  {#each links as link}
27
- <a class={twMerge("px-4 py-1 hover:border-primary-secondary-500 hover:border-b-2 text-gray-900 bg-transparent hover:bg-transparent rounded-none", link.active ? "border-primary-600 border-b-2": "", props.class)}
27
+ <a class={twMerge("px-4 py-1 hover:border-secondary-500 hover:border-b-2 text-gray-900 bg-transparent hover:bg-transparent rounded-none", link.active ? "border-primary-600 border-b-2": "", props.class)}
28
28
  data-sveltekit-reload={reload} data-sveltekit-preload-data={preload ? 'hover' : false}
29
29
  href={link.href}>
30
30
  {link.text}
@@ -11,6 +11,6 @@ export type TabNavigationProps = {
11
11
  divClasses?: ClassNameValue;
12
12
  class?: ClassNameValue;
13
13
  };
14
- declare const TabNavigation: import("svelte").Component<TabNavigationProps, {}, "">;
14
+ declare const TabNavigation: import("svelte").Component<TabNavigationProps, {}, "links">;
15
15
  type TabNavigation = ReturnType<typeof TabNavigation>;
16
16
  export default TabNavigation;
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.13.2",
8
+ "version": "0.13.3",
9
9
  "license": "MIT",
10
10
  "author": "Hashry Tech",
11
11
  "files": [