Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added exports to form-component props #4089

Merged
merged 2 commits into from
Jan 10, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 8 additions & 7 deletions packages/forms/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ interface ServerErrorsContextProps {

const ServerErrorsContext = React.createContext({} as ServerErrorsContextProps)

interface FormProps
export interface FormProps
extends Omit<React.ComponentPropsWithRef<'form'>, 'onSubmit'> {
error?: any
/**
Expand Down Expand Up @@ -365,7 +365,7 @@ const Form = forwardRef<HTMLFormElement, FormProps>(
}
)

interface LabelProps
export interface LabelProps
extends Pick<FieldProps, 'errorClassName' | 'errorStyle'>,
React.ComponentPropsWithoutRef<'label'> {
name: string
Expand Down Expand Up @@ -399,7 +399,8 @@ const Label = ({
)
}

interface FieldErrorProps extends React.ComponentPropsWithoutRef<'span'> {
export interface FieldErrorProps
extends React.ComponentPropsWithoutRef<'span'> {
/**
* The name of the field the `<FieldError>`'s associated with.
*/
Expand Down Expand Up @@ -467,7 +468,7 @@ const FieldError = ({ name, ...rest }: FieldErrorProps) => {
return validationError ? <span {...rest}>{errorMessage}</span> : null
}

interface TextAreaFieldProps
export interface TextAreaFieldProps
extends FieldProps<HTMLTextAreaElement>,
Omit<React.ComponentPropsWithRef<'textarea'>, 'name'> {}

Expand Down Expand Up @@ -516,7 +517,7 @@ const TextAreaField = forwardRef<HTMLTextAreaElement, TextAreaFieldProps>(
}
)

interface SelectFieldProps
export interface SelectFieldProps
extends FieldProps<HTMLSelectElement>,
Omit<React.ComponentPropsWithRef<'select'>, 'name'> {}

Expand Down Expand Up @@ -565,7 +566,7 @@ const SelectField = forwardRef<HTMLSelectElement, SelectFieldProps>(
}
)

interface CheckboxFieldProps
export interface CheckboxFieldProps
extends FieldProps<HTMLInputElement>,
Omit<React.ComponentPropsWithRef<'input'>, 'name' | 'type'> {}

Expand Down Expand Up @@ -672,7 +673,7 @@ const INPUT_TYPES = [

type InputType = typeof INPUT_TYPES[number]

interface InputFieldProps
export interface InputFieldProps
extends FieldProps<HTMLInputElement>,
Omit<React.ComponentPropsWithRef<'input'>, 'name' | 'type'> {
/**
Expand Down