feat: add dashboard shell and shared components

This commit is contained in:
2026-06-05 23:25:30 +01:00
parent 7bb19e1be3
commit 930e83344c
7 changed files with 473 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
<script lang="ts">
/* eslint-disable @typescript-eslint/no-explicit-any */
import { Field as FormField, Control, FieldErrors } from 'formsnap';
import * as Field from '$lib/components/ui/field/index.js';
import * as InputGroup from '$lib/components/ui/input-group/index.js';
let {
form,
data,
name,
label,
id
}: {
form: any;
data: any;
name: string;
label: string;
id: string;
} = $props();
</script>
<FormField {form} {name}>
<Field.Field>
<Control {id}>
{#snippet children({ props })}
<Field.Label>{label}</Field.Label>
<InputGroup.Root>
<InputGroup.Addon>
<InputGroup.Text>£</InputGroup.Text>
</InputGroup.Addon>
<InputGroup.Input
{...props}
type="number"
min="0"
step="0.01"
inputmode="decimal"
placeholder="0.00"
bind:value={$data[name]}
/>
</InputGroup.Root>
{/snippet}
</Control>
<Field.Error><FieldErrors /></Field.Error>
</Field.Field>
</FormField>