@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
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
children?: Snippet;
|
|
8
8
|
icon?: Snippet;
|
|
9
|
-
|
|
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,
|
|
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
|
|
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
|
|
27
|
-
|
|
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
|
|