release: WRNexusJS 0.3.3
This commit is contained in:
@@ -7,6 +7,8 @@ component Button {
|
||||
disabled = false
|
||||
loading = false
|
||||
icon = ""
|
||||
iconPosition = "start"
|
||||
fullWidth = false
|
||||
className = ""
|
||||
}
|
||||
|
||||
@@ -16,16 +18,23 @@ component Button {
|
||||
disabled="{disabled || loading}"
|
||||
aria-busy="{loading}"
|
||||
class="wire-btn wire-btn--{variant} wire-btn--{size} {className}"
|
||||
class:w-full='{fullWidth}'
|
||||
>
|
||||
{#if loading}
|
||||
<span class="wire-spinner" aria-hidden="true"></span>
|
||||
{/if}
|
||||
|
||||
{#if icon && !loading}
|
||||
<span class="{icon} size-4" aria-hidden="true"></span>
|
||||
{#if icon && !loading && iconPosition === "start"}
|
||||
<span class="{icon} size-4 shrink-0" aria-hidden="true"></span>
|
||||
{/if}
|
||||
|
||||
<span>{label}</span>
|
||||
|
||||
{#if icon && !loading && iconPosition === "end"}
|
||||
<span class="{icon} size-4 shrink-0" aria-hidden="true"></span>
|
||||
{/if}
|
||||
|
||||
<slot />
|
||||
</button>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user