Add Field component system and migrate UI

This commit is contained in:
Gregor Vostrak
2026-02-10 12:22:53 +01:00
parent 1ecb332458
commit fd012e7c69
71 changed files with 1023 additions and 741 deletions

View File

@@ -3,8 +3,7 @@ import { nextTick, ref } from 'vue';
import { Head, useForm } from '@inertiajs/vue3';
import AuthenticationCard from '@/Components/AuthenticationCard.vue';
import AuthenticationCardLogo from '@/Components/AuthenticationCardLogo.vue';
import InputError from '@/packages/ui/src/Input/InputError.vue';
import InputLabel from '@/packages/ui/src/Input/InputLabel.vue';
import { Field, FieldLabel, FieldError } from '@/packages/ui/src/field';
import PrimaryButton from '@/packages/ui/src/Buttons/PrimaryButton.vue';
import TextInput from '@/packages/ui/src/Input/TextInput.vue';
@@ -58,31 +57,33 @@ const submit = () => {
</div>
<form @submit.prevent="submit">
<div v-if="!recovery">
<InputLabel for="code" value="Code" />
<Field v-if="!recovery">
<FieldLabel for="code">Code</FieldLabel>
<TextInput
id="code"
ref="codeInput"
v-model="form.code"
type="text"
inputmode="numeric"
class="mt-1 block w-full"
class="block w-full"
autofocus
autocomplete="one-time-code" />
<InputError class="mt-2" :message="form.errors.code" />
</div>
<FieldError v-if="form.errors.code">{{ form.errors.code }}</FieldError>
</Field>
<div v-else>
<InputLabel for="recovery_code" value="Recovery Code" />
<Field v-else>
<FieldLabel for="recovery_code">Recovery Code</FieldLabel>
<TextInput
id="recovery_code"
ref="recoveryCodeInput"
v-model="form.recovery_code"
type="text"
class="mt-1 block w-full"
class="block w-full"
autocomplete="one-time-code" />
<InputError class="mt-2" :message="form.errors.recovery_code" />
</div>
<FieldError v-if="form.errors.recovery_code">{{
form.errors.recovery_code
}}</FieldError>
</Field>
<div class="flex items-center justify-end mt-4">
<button