Skip to content

Commit

Permalink
fix(form): type definitions not properly exported
Browse files Browse the repository at this point in the history
fix type definitions export
fix incorrect "buttonAlignment" type definition from required to optional
sort type definitions

Fixes #3690
  • Loading branch information
grabkowski committed May 11, 2021
1 parent 088183e commit 01c07ed
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/components/form/form-summary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ export interface FormSummaryProps {
/** Child elements */
children?: React.ReactNode;
/** The total number of errors present in the form */
errorCount?: number;
errors?: number;
/** The total number of warnings present in the form */
warningCount?: number;
warnings?: number;
}

declare function FormSummary(props: FormSummaryProps): JSX.Element;
Expand Down
36 changes: 13 additions & 23 deletions src/components/form/form.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,27 @@ import { FormFieldSpacing } from "../../utils/helpers/options-helper/options-hel

export interface FormProps {
/** Alignment of buttons */
buttonAlignment: "left" | "right";

/** Enables the sticky footer. */
stickyFooter?: boolean;

/** Additional buttons rendered on the left side of the save button */
leftSideButtons?: React.ReactNode;

/** Additional buttons rendered on the right side of the save button */
rightSideButtons?: React.ReactNode;

/** Callback passed to the form element */
onSubmit?: (event: React.FormEvent<HTMLFormElement>) => any;

buttonAlignment?: "left" | "right";
/** Child elements */
children?: React.ReactNode;

/** Save button to be rendered */
saveButton?: React.ReactNode;

/** The total number of errors present in the form */
errorCount?: number;

/** The total number of warnings present in the form */
warningCount?: number;

/** Spacing between form fields, given number will be multiplied by base spacing unit (8) */
fieldSpacing?: FormFieldSpacing;

/** Additional buttons rendered on the left side of the save button */
leftSideButtons?: React.ReactNode;
/** Disable HTML5 validation */
noValidate?: boolean;
/** Callback passed to the form element */
onSubmit?: (event: React.FormEvent<HTMLFormElement>) => any;
/** Additional buttons rendered on the right side of the save button */
rightSideButtons?: React.ReactNode;
/** Save button to be rendered */
saveButton?: React.ReactNode;
/** Enables the sticky footer. */
stickyFooter?: boolean;
/** The total number of warnings present in the form */
warningCount?: number;
}

declare function Form(props: FormProps): JSX.Element;
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default as Form } from "./form";
export { default } from "./form";

0 comments on commit 01c07ed

Please sign in to comment.