Skip to content

Commit

Permalink
FEAT: replaced Utrecht TextBox with Utrecht FormFieldTextBox
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeriRoijenga committed Oct 18, 2024
1 parent a951bea commit 34a6c07
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions packages/components-react/src/FormFieldTextbox.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import {
FormField,
FormFieldDescription,
FormFieldTextboxProps,
FormLabel,
Textbox,
} from '@utrecht/component-library-react';
import { FormField, FormFieldTextboxProps, FormFieldTextbox as TextBox } from '@utrecht/component-library-react';
import { type TextboxTypes } from '@utrecht/component-library-react/dist/Textbox';
import clsx from 'clsx';
import { ForwardedRef, forwardRef, PropsWithChildren, useId } from 'react';
import { FormFieldErrorMessage } from './FormFieldErrorMessage';

export const FormFieldTextbox = forwardRef(
(
Expand Down Expand Up @@ -54,28 +47,18 @@ export const FormFieldTextbox = forwardRef(

return (
<FormField invalid={invalid} ref={ref} {...props}>
<div className="utrecht-form-field__label">
<FormLabel htmlFor={inputId}>{label}</FormLabel>
</div>
{description && (
<FormFieldDescription className="utrecht-form-field__description" id={descriptionId}>
{description}
</FormFieldDescription>
)}
{invalid && errorMessage && (
<FormFieldErrorMessage className="utrecht-form-field__error-message" id={errorMessageId}>
{errorMessage}
</FormFieldErrorMessage>
)}
<div className="utrecht-form-field__input">
<Textbox
<TextBox
autoComplete={autoComplete}
defaultValue={defaultValue}
description={description}
dir={inputDir || 'auto'}
disabled={disabled}
errorMessage={errorMessage}
id={inputId}
inputRequired={inputRequired}
invalid={invalid}
label={label}
list={list}
max={max}
maxLength={maxLength}
Expand Down

0 comments on commit 34a6c07

Please sign in to comment.