diff --git a/src/components/forms/Form.stories.jsx b/src/components/forms/Form.stories.jsx index f974674..46f0213 100644 --- a/src/components/forms/Form.stories.jsx +++ b/src/components/forms/Form.stories.jsx @@ -12,7 +12,7 @@ import { FormCheckboxGroup } from "./FormCheckboxGroup" import { FormRow } from "./FormRow" import { Button } from "../inputs/Button" import { Parenthesis } from "../panels/Parenthesis" -import { useFormState } from "../../hooks/useValidatedState" +import { useFormState } from "../../hooks/useFormState" export default { diff --git a/src/hooks/useValidatedState.ts b/src/hooks/useFormState.ts similarity index 100% rename from src/hooks/useValidatedState.ts rename to src/hooks/useFormState.ts diff --git a/src/index.ts b/src/index.ts index 64cab0b..40804b6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,5 @@ +import {BluelibHTMLProps, BluelibProps, ClassNames, State, Validator, Validity} from "./types"; + export {Ruby} from "./components/annotations/Ruby" export {Chapter} from "./components/chapters/Chapter" @@ -51,3 +53,6 @@ export {Table} from "./components/tables/Table" export {Bluelib} from "./components/Bluelib" export {Bluelib as default} from "./components/Bluelib" + +export {usePromise} from "./hooks/usePromise" +export {useFormState} from "./hooks/useFormState" diff --git a/src/types.ts b/src/types.ts index 664ea02..27d7a71 100644 --- a/src/types.ts +++ b/src/types.ts @@ -7,7 +7,6 @@ export type ClassNames = ClassNamesArgument export type State = [Value, React.Dispatch>] -export type StateContext = React.Context | undefined> export interface BluelibProps { @@ -20,9 +19,6 @@ export interface BluelibProps { export interface BluelibHTMLProps extends BluelibProps, React.HTMLProps {} -export type InputValue = readonly string[] | string | number | undefined - - /** * An optionally async function that checks if a value is acceptable for a certain form field or not. * @@ -41,4 +37,3 @@ export type Validator = (value: T, abort: AbortSignal) => Promise | * - `null` means that the value is in progress of being checked. */ export type Validity = boolean | null | undefined -