Skip to content

Commit cbff156

Browse files
committed
Merge branch 'feature/mkt-159-text-field-prefix-suffix' into custom-inputs
2 parents 6329095 + 4060182 commit cbff156

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

packages/components/src/ui/text-field.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ export const TextField = React.forwardRef<HTMLDivElement, TextInputProps>(
7272
return (
7373
<FormItem className={className} ref={ref}>
7474
{label && <FormLabel Component={components?.FormLabel}>{label}</FormLabel>}
75-
<FormControl Component={components?.FormControl}>
76-
<div
77-
className={cn('flex group transition-all duration-200 rounded-md', {
78-
'field__input--with-prefix': prefix,
79-
'field__input--with-suffix': suffix,
80-
'focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 focus-within:ring-offset-background': true,
81-
})}
82-
>
83-
{prefix && <FieldPrefix>{prefix}</FieldPrefix>}
75+
<div
76+
className={cn('flex group transition-all duration-200 rounded-md', {
77+
'field__input--with-prefix': prefix,
78+
'field__input--with-suffix': suffix,
79+
'focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 focus-within:ring-offset-background': true,
80+
})}
81+
>
82+
{prefix && <FieldPrefix>{prefix}</FieldPrefix>}
83+
<FormControl Component={components?.FormControl}>
8484
<TextInput
8585
{...field}
8686
{...props}
@@ -90,9 +90,9 @@ export const TextField = React.forwardRef<HTMLDivElement, TextInputProps>(
9090
'rounded-r-none border-r-0': suffix,
9191
})}
9292
/>
93-
{suffix && <FieldSuffix>{suffix}</FieldSuffix>}
94-
</div>
95-
</FormControl>
93+
</FormControl>
94+
{suffix && <FieldSuffix>{suffix}</FieldSuffix>}
95+
</div>
9696
{description && <FormDescription Component={components?.FormDescription}>{description}</FormDescription>}
9797
{fieldState.error && (
9898
<FormMessage Component={components?.FormMessage}>{fieldState.error.message}</FormMessage>

0 commit comments

Comments
 (0)