Skip to content
This repository was archived by the owner on Sep 25, 2025. It is now read-only.

Commit 98f3afc

Browse files
committed
fix: add missing import in form field
fix #171
1 parent 9b9b50c commit 98f3afc

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

.vitepress/theme/components/AsideOutlineAfter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts" setup>
2+
import { withoutLeadingSlash, withoutTrailingSlash } from 'ufo'
23
import { useRoute } from 'vitepress'
34
import { computed } from 'vue'
4-
import { withoutLeadingSlash, withoutTrailingSlash } from 'ufo'
55
66
const route = useRoute()
77

src/components/FormField/FormField.vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
<script lang="ts">
22
import type { FormFieldInjectedOptions } from '@/ui/keys/form-field'
3-
import type { VariantProps } from 'tailwind-variants'
3+
import type { ComponentConfig } from '@/ui/types/utils'
44
import { formFieldInjectionKey, inputIdInjectionKey } from '@/ui/keys/form-field'
55
import theme from '@/ui/theme/form-field'
66
import { tv } from 'tailwind-variants'
77
import { computed, provide, ref, useId } from 'vue'
88
9-
const formField = tv(theme)
10-
11-
type FormFieldVariants = VariantProps<typeof formField>
9+
type FormField = ComponentConfig<typeof theme>
1210
1311
export interface FormFieldProps {
1412
as?: any
@@ -18,12 +16,12 @@ export interface FormFieldProps {
1816
help?: string
1917
error?: string | boolean
2018
hint?: string
21-
size?: FormFieldVariants['size']
19+
size?: FormField['variants']['size']
2220
required?: boolean
2321
eagerValidation?: boolean
2422
validateOnInputDelay?: number
2523
class?: any
26-
ui?: Partial<typeof formField.slots>
24+
ui?: FormField['slots']
2725
}
2826
2927
export interface FormFieldSlots {
@@ -40,7 +38,7 @@ export interface FormFieldSlots {
4038
const props = defineProps<FormFieldProps>()
4139
const slots = defineSlots<FormFieldSlots>()
4240
43-
const ui = computed(() => formField({
41+
const ui = computed(() => tv(theme)({
4442
size: props.size,
4543
required: props.required,
4644
}))
@@ -62,6 +60,7 @@ provide(formFieldInjectionKey, computed(() => ({
6260
validateOnInputDelay: props.validateOnInputDelay,
6361
hint: props.hint,
6462
description: props.description,
63+
help: props.help,
6564
ariaId,
6665
}) as FormFieldInjectedOptions<FormFieldProps>))
6766
</script>

src/theme/form-field.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ export default {
33
root: '',
44
wrapper: '',
55
labelWrapper: 'flex content-center items-center justify-between',
6-
label: 'block font-medium text-(--ui-text)',
6+
label: 'block font-medium text-default',
77
container: 'mt-1 relative',
8-
description: 'text-(--ui-text-muted)',
9-
error: 'mt-2 text-(--ui-error)',
10-
hint: 'text-(--ui-text-muted)',
11-
help: 'mt-2 text-(--ui-text-muted)',
8+
description: 'text-muted',
9+
error: 'mt-2 text-error',
10+
hint: 'text-muted',
11+
help: 'mt-2 text-muted',
1212
},
1313
variants: {
1414
size: {
@@ -20,7 +20,7 @@ export default {
2020
},
2121
required: {
2222
true: {
23-
label: `after:content-['*'] after:ms-0.5 after:text-(--ui-error)`,
23+
label: `after:content-['*'] after:ms-0.5 after:text-error`,
2424
},
2525
},
2626
},

0 commit comments

Comments
 (0)