@hashrytech/quick-components-kit 0.20.5 → 0.20.6
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
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
children?: Snippet;
|
|
8
8
|
cssIcon?: string;
|
|
9
9
|
cssIconClass?: ClassNameValue;
|
|
10
|
+
cssLoadingIcon?: string;
|
|
10
11
|
icon?: Snippet;
|
|
11
12
|
loadingIcon?: Snippet;
|
|
12
13
|
loading?: boolean;
|
|
@@ -20,14 +21,14 @@
|
|
|
20
21
|
import {twMerge} from 'tailwind-merge';
|
|
21
22
|
import { Icon } from '../icon/index.js';
|
|
22
23
|
|
|
23
|
-
let { disabled=$bindable(), loading=$bindable(false), children, cssIcon, cssIconClass, icon, loadingIcon, onclick, ...props }: ButtonProps = $props();
|
|
24
|
+
let { disabled=$bindable(), loading=$bindable(false), children, cssIcon, cssIconClass, cssLoadingIcon, icon, loadingIcon, onclick, ...props }: ButtonProps = $props();
|
|
24
25
|
|
|
25
26
|
</script>
|
|
26
27
|
|
|
27
28
|
<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",
|
|
28
29
|
"disabled:bg-primary-button/60 disabled:cursor-default", props.class)}
|
|
29
30
|
{onclick}>
|
|
30
|
-
{#if cssIcon}<Icon icon={cssIcon} class={twMerge(loading ? "animate-spin" : "", cssIconClass)} />
|
|
31
|
+
{#if cssIcon}<Icon icon={loading ? cssLoadingIcon ? cssLoadingIcon : "" : cssIcon} class={twMerge(loading ? "animate-spin" : "", cssIconClass)} />
|
|
31
32
|
{:else if loadingIcon && loading}
|
|
32
33
|
<span class="shrink-0 animate-spin font-semibold">{@render loadingIcon()}</span>
|
|
33
34
|
{:else if icon}
|