@@ -52,25 +52,10 @@ const rootClasses = computed(() =>
5252 },
5353 inline: {
5454 true: ' grid md:grid-cols-2 items-start px-4.5 py-4 gap-y-3 md:gap-y-0 md:gap-x-5!' ,
55+ false: ' flex flex-col gap-2' ,
5556 },
5657 fullWidthSetting: {
57- true: ' md:grid-cols-1' ,
58- },
59- },
60- })({
61- ... props,
62- })),
63- );
64-
65- const descriptionClasses = computed (() =>
66- twMerge (cva ({
67- base: [' mb-2 -mt-0.5' ],
68- variants: {
69- inline: {
70- true: ' mb-0' ,
71- },
72- fullWidthSetting: {
73- true: ' mb-3' ,
58+ true: ' md:grid-cols-1 md:gap-y-3' ,
7459 },
7560 },
7661 })({
@@ -96,35 +81,30 @@ const hasErrors = computed(() => {
9681
9782<template >
9883 <div :class =" [rootClasses, $attrs.class]" data-ui-input-group :data-ui-field-has-errors =" hasErrors ? '' : null" >
99- <div v-if =" label || (instructions && !instructionsBelow) || $slots.label || $slots.actions" >
84+ <div
85+ v-if =" label || $slots.label || $slots.actions || (instructions && !instructionsBelow)"
86+ class =" flex flex-col gap-1.5"
87+ data-ui-field-header
88+ >
10089 <div
10190 v-if =" $slots.actions"
102- :class =" [
103- 'flex items-center gap-x-1 mb-0',
104- props.label || $slots.label ? 'justify-between' : 'justify-end',
105- ]"
106- data-ui-field-header
91+ class =" flex items-center gap-x-1"
92+ :class =" label || $slots.label ? 'justify-between' : 'justify-end'"
10793 >
10894 <slot name =" label" >
10995 <Label v-if =" label " v-bind =" labelProps " class="flex-1" />
11096 </slot >
11197 <slot name =" actions" />
11298 </div >
113- <div
114- v-if =" (!$slots.actions && (label || (instructions && !instructionsBelow) || $slots.label)) || ($slots.actions && instructions && !instructionsBelow)"
115- data-ui-field-text
116- :class =" inline ? 'mb-0' : 'mb-2'"
117- >
118- <slot v-if =" !$slots.actions" name =" label" >
119- <Label v-if =" label " v-bind =" labelProps " class="flex-1" />
120- </slot >
121- <Description :text =" instructions " v-if =" instructions && ! instructionsBelow " :class =" descriptionClasses " />
122- </div >
99+ <slot v-else name =" label" >
100+ <Label v-if =" label " v-bind =" labelProps " />
101+ </slot >
102+ <Description :text =" instructions " v-if =" instructions && ! instructionsBelow " />
123103 </div >
124104 <slot />
125- <div v-if =" (instructions && instructionsBelow) || hasErrors" >
126- <Description :text =" instructions " v-if =" instructions && instructionsBelow " class="mt-2" />
127- <ErrorMessage v-if =" errors " v-for =" (error , i ) in errors " :key =" i " :text =" error " class="mt-2" />
105+ <div v-if =" (instructions && instructionsBelow) || hasErrors" class = " flex flex-col gap-2 " >
106+ <Description :text =" instructions " v-if =" instructions && instructionsBelow " />
107+ <ErrorMessage v-if =" errors " v-for =" (error , i ) in errors " :key =" i " :text =" error " />
128108 </div >
129109 </div >
130110</template >
0 commit comments