-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
222 additions
and
1,052 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,51 @@ | ||
<script lang="ts"> | ||
import Icon from '@iconify/svelte'; | ||
import type { Snippet } from 'svelte'; | ||
import type { HTMLButtonAttributes } from 'svelte/elements'; | ||
let { | ||
class: classNames = '', | ||
children, | ||
buttonType = 'primary', | ||
loading = false, | ||
...rest | ||
}: { | ||
class?: string; | ||
/** | ||
* The type of button to render. | ||
* | ||
* @default 'primary' | ||
*/ | ||
buttonType?: 'primary' | 'secondary' | 'danger'; | ||
loading?: boolean; | ||
children: Snippet; | ||
} & HTMLButtonAttributes = $props(); | ||
if (buttonType === 'primary') { | ||
classNames += ` [&:not(:hover)]:text-dark-1 bg-shade1-dark hover:enabled:bg-shade2-dark`; | ||
} else if (buttonType === 'secondary') { | ||
classNames += ` border-solid border-2 bg-transparent`; | ||
} else if (buttonType === 'danger') { | ||
classNames += ` bg-red-700 text-white`; | ||
} | ||
let disabled = $derived(rest.disabled || loading); | ||
</script> | ||
|
||
<button | ||
class={classNames + ` min-h-1 cursor-pointer rounded p-2 transition duration-500`} | ||
{...rest} | ||
class="min-h-1 rounded p-2 transition duration-500 {buttonType} {rest.class}" | ||
class:cursor-not-allowed={disabled} | ||
{disabled} | ||
> | ||
{@render children()} | ||
{#if loading} | ||
<Icon class="m-auto h-auto w-8" icon="line-md:loading-loop" /> | ||
{:else} | ||
{@render children()} | ||
{/if} | ||
</button> | ||
|
||
<style> | ||
.primary { | ||
@apply bg-shade1-dark hover:enabled:bg-shade2-dark disabled:text-dark-1 [&:not(:hover)]:text-dark-1; | ||
} | ||
.secondary { | ||
@apply border-2 border-solid bg-transparent; | ||
} | ||
.danger { | ||
@apply bg-red-700 text-white; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<script lang="ts"> | ||
let { backendVersion, frontendVersion }: { backendVersion: string; frontendVersion: string } = | ||
$props(); | ||
</script> | ||
|
||
<footer class="w-full text-sm max-lg:mb-5 max-lg:text-center lg:fixed lg:bottom-3 lg:left-3"> | ||
<p> | ||
Backend version: {backendVersion} | ||
<br />Frontend version: {frontendVersion} | ||
</p> | ||
|
||
<span> | ||
Powered by | ||
<a target="_blank" href="https://github.com/kitsune-soc/kitsune">Kitsune</a> | ||
</span> | ||
</footer> |
Oops, something went wrong.