@hashrytech/quick-components-kit 0.3.3 → 0.4.0

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.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - feat: adding link button
8
+
3
9
  ## 0.3.3
4
10
 
5
11
  ### Patch Changes
@@ -5,6 +5,7 @@
5
5
  export type ButtonProps = {
6
6
  children?: Snippet;
7
7
  icon?: Snippet;
8
+ onclick?: (event: MouseEvent) => void;
8
9
  class?: ClassNameValue;
9
10
  };
10
11
 
@@ -13,11 +14,12 @@
13
14
  <script lang="ts">
14
15
  import {twMerge} from 'tailwind-merge';
15
16
 
16
- let {children, icon, ...props}: ButtonProps = $props();
17
+ let {children, icon, onclick, ...props}: ButtonProps = $props();
17
18
 
18
19
  </script>
19
20
 
20
- <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", props.class)}>
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)}
22
+ {onclick}>
21
23
  {#if icon}<span class="w-10">{@render icon()}</span>{/if}
22
24
  {@render children?.()}
23
25
  </button>
@@ -3,6 +3,7 @@ import type { ClassNameValue } from 'tailwind-merge';
3
3
  export type ButtonProps = {
4
4
  children?: Snippet;
5
5
  icon?: Snippet;
6
+ onclick?: (event: MouseEvent) => void;
6
7
  class?: ClassNameValue;
7
8
  };
8
9
  declare const Button: import("svelte").Component<ButtonProps, {}, "">;
@@ -0,0 +1,25 @@
1
+ <script lang="ts" module>
2
+ import type { Snippet } from 'svelte';
3
+ import type { ClassNameValue } from 'tailwind-merge';
4
+
5
+ export type ButtonProps = {
6
+ href: string;
7
+ children?: Snippet;
8
+ icon?: Snippet;
9
+ class?: ClassNameValue;
10
+ };
11
+
12
+ </script>
13
+
14
+ <script lang="ts">
15
+ import {twMerge} from 'tailwind-merge';
16
+
17
+ let {href, children, icon, ...props}: ButtonProps = $props();
18
+
19
+ </script>
20
+
21
+ <a {href} 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)}>
22
+ {#if icon}<span class="w-10">{@render icon()}</span>{/if}
23
+ {@render children?.()}
24
+ </a>
25
+
@@ -0,0 +1,11 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { ClassNameValue } from 'tailwind-merge';
3
+ export type ButtonProps = {
4
+ href: string;
5
+ children?: Snippet;
6
+ icon?: Snippet;
7
+ class?: ClassNameValue;
8
+ };
9
+ declare const LinkButton: import("svelte").Component<ButtonProps, {}, "">;
10
+ type LinkButton = ReturnType<typeof LinkButton>;
11
+ export default LinkButton;
@@ -0,0 +1 @@
1
+ export { default as LinkButton } from './LinkButton.svelte';
@@ -0,0 +1 @@
1
+ export { default as LinkButton } from './LinkButton.svelte';
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.3.3",
8
+ "version": "0.4.0",
9
9
  "license": "MIT",
10
10
  "author": "Hashry Tech",
11
11
  "files": [