Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
BjoernRave committed Jun 18, 2024
1 parent 2ed8808 commit 97c05b8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rave-ui",
"version": "0.16.2",
"version": "0.16.9",
"license": "MIT",
"author": "BjoernRave",
"main": "dist/src/index.js",
Expand Down
8 changes: 4 additions & 4 deletions src/FormItems/Basic/Form.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import styled from "@emotion/styled"
import { zodResolver } from "@hookform/resolvers/zod"
import { FC, PropsWithChildren, useEffect } from "react"
import { useEffect, type FC, type PropsWithChildren } from "react"
import {
FieldErrorsImpl,
FormProvider,
UseFormSetError,
useForm,
type FieldErrorsImpl,
type UseFormSetError,
} from "react-hook-form"
import { SchemaContext } from "./SchemaContext"
import SubmitButton from "./SubmitButton"
Expand Down Expand Up @@ -85,7 +85,7 @@ const Form: FC<PropsWithChildren<Props>> = ({
})
}}
>
{children}
<div className="space-y-4 w-full">{children}</div>
{submitButton && <SubmitButton>{submitText}</SubmitButton>}
</StyledForm>
</SchemaContext.Provider>
Expand Down
8 changes: 4 additions & 4 deletions src/FormModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
DialogTitle,
IconButton,
} from "@mui/material"
import { Breakpoint, styled } from "@mui/material/styles"
import { FC, PropsWithChildren, ReactNode, useId } from "react"
import { FieldErrorsImpl, UseFormSetError } from "react-hook-form"
import { styled, type Breakpoint } from "@mui/material/styles"
import { useId, type FC, type PropsWithChildren, type ReactNode } from "react"
import type { FieldErrorsImpl, UseFormSetError } from "react-hook-form"
import Form from "./FormItems/Basic/Form"
import SubmitButton from "./FormItems/Basic/SubmitButton"
import { useLocale } from "./lib/theme"
Expand Down Expand Up @@ -102,7 +102,7 @@ const FormModal: FC<PropsWithChildren<Props>> = ({
>
<DialogContent className="w-full" id={`${id}-content`}>
{description && <DialogContentText>{description}</DialogContentText>}
{children}
<div className="space-y-4 w-full">{children}</div>
</DialogContent>
{!hideActions && (
<DialogActions>
Expand Down
15 changes: 14 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
export * from "react-hook-form"
export {
FormProvider,
useController,
useFieldArray,
useForm,
useFormContext,
useFormState,
useWatch,
} from "react-hook-form"
export type {
ControllerRenderProps,
FieldValues,
UseFormSetError,
} from "react-hook-form"
export { default as AppWrapper } from "./AppWrapper"
export { default as BooleanIcon } from "./BooleanIcon"
export { default as ButtonGroup } from "./ButtonGroup"
Expand Down

0 comments on commit 97c05b8

Please sign in to comment.