fix(ui): render polished SSR-safe component variants
This commit is contained in:
@@ -1,11 +1,29 @@
|
||||
component SignInLink {
|
||||
props {
|
||||
label = "Action"
|
||||
label = "Sign in with password"
|
||||
description = "Use your username or email and password"
|
||||
href = ""
|
||||
type = "button"
|
||||
variant = "primary"
|
||||
variant = "secondary"
|
||||
disabled = false
|
||||
icon = "icon-[lucide--lock-keyhole]"
|
||||
class = ""
|
||||
}
|
||||
view { <span class="wire-catalog-action {class}"><a data-show="href" href="{href}" class="wire-btn wire-btn--{variant}">{label}<slot /></a><button data-show="!href" type="{type}" disabled="{disabled}" class="wire-btn wire-btn--{variant}">{label}<slot /></button></span> }
|
||||
view {
|
||||
<span class="wire-catalog-action wire-auth-action {class}">
|
||||
{#if href}
|
||||
<a href="{href}" class="wire-btn wire-btn--{variant}">
|
||||
<span class="wire-auth-action__icon"><span class="{icon} size-5" aria-hidden="true"></span></span>
|
||||
<span class="wire-auth-action__copy"><span class="wire-auth-action__label">{label}</span>{#if description}<span class="wire-auth-action__description">{description}</span>{/if}</span>
|
||||
<span class="icon-[lucide--chevron-right] wire-auth-action__arrow" aria-hidden="true"></span>
|
||||
</a>
|
||||
{:else}
|
||||
<button type="{type}" disabled="{disabled}" class="wire-btn wire-btn--{variant}">
|
||||
<span class="wire-auth-action__icon"><span class="{icon} size-5" aria-hidden="true"></span></span>
|
||||
<span class="wire-auth-action__copy"><span class="wire-auth-action__label">{label}</span>{#if description}<span class="wire-auth-action__description">{description}</span>{/if}</span>
|
||||
<span class="icon-[lucide--chevron-right] wire-auth-action__arrow" aria-hidden="true"></span>
|
||||
</button>
|
||||
{/if}
|
||||
</span>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user