refactor: pretty much the whole backend module hierarchy

This commit is contained in:
Aleksi Lassila
2025-02-11 02:40:41 +02:00
parent 6969525464
commit fa27f19975
96 changed files with 1786 additions and 2033 deletions

View File

@@ -0,0 +1,52 @@
<script lang="ts">
import classNames from 'classnames';
import Container from './Container.svelte';
export let disabled = false;
export let type: 'floating' | 'solid' = 'floating';
export let container = false;
// const getClass = (hasFocus?: boolean) => type === 'floating' ? classNames(
// 'text-zinc-300 hover:text-zinc-50 p-1 flex items-center justify-center rounded-sm flex-shrink-0 bg-transparent',
// {
// 'opacity-30 cursor-not-allowed pointer-events-none': disabled,
// 'cursor-pointer': !disabled
// },
// $$restProps.class
// ) : classNames(
// 'group-hover:bg-primary-500 group-hover:text-secondary-800 rounded-full p-3',
// {
// 'bg-primary-500 text-secondary-800': hasFocus
// },
// $$restProps.class
// )
</script>
{#if !container}
<button
class={classNames(
'text-secondary-400 hover:text-secondary-200 p-1 flex items-center justify-center rounded-sm flex-shrink-0 bg-transparent',
{
'opacity-30 cursor-not-allowed pointer-events-none': disabled,
'cursor-pointer': !disabled
},
$$restProps.class
)}
on:click
>
<slot />
</button>
{:else}
<Container on:clickOrSelect let:hasFocus class="cursor-pointer group">
<div
class={classNames(
'group-hover:bg-primary-500 group-hover:text-secondary-800 rounded-full p-3',
{
'bg-primary-500 text-secondary-800': hasFocus
}
)}
>
<slot />
</div>
</Container>
{/if}