@slashid/react
Version:
React SDK for the /id platform
50 lines • 1.78 kB
TypeScript
import { Factor } from "@slashid/slashid";
import { FormStatus } from "../../../context/form-context";
import { FactorNonOIDC, Handle, HandleType } from "../../../domain/types";
import { TextConfig, TextConfigKey } from "../../text/constants";
export declare const FACTOR_LABEL_MAP: Record<Exclude<Factor["method"], "webauthn_via_email" | "webauthn_via_sms">, TextConfigKey>;
export declare const TAB_NAME: {
email: string;
phone: string;
username: string;
};
export declare const tabIDByHandle: Record<HandleType, string>;
type ControlsProps = {
factors: FactorNonOIDC[];
handleTypes: Handle["type"][];
text: TextConfig;
handleSubmit: (factor: Factor, handle?: Handle) => void;
};
type Props = {
children?: React.ReactNode | (({ factors, handleTypes, text, handleSubmit, }: ControlsProps) => React.ReactNode);
};
/**
* Component responsible for rendering the form and the related controls.
* Sets up the form context and provides the submit handler.
*/
export declare const Controls: {
({ children }: Props): import("react/jsx-runtime").JSX.Element | null;
displayName: string;
Input: {
({ children }: FormInputProps): import("react/jsx-runtime").JSX.Element;
displayName: string;
};
Submit: {
({ children }: SubmitProps): import("react/jsx-runtime").JSX.Element;
displayName: string;
};
};
type FormInputProps = {
children?: React.ReactNode | (({ factors, handleTypes, }: {
factors: FactorNonOIDC[];
handleTypes: HandleType[];
}) => React.ReactNode);
};
type SubmitProps = {
children?: React.ReactNode | (({ text, status, }: {
text: TextConfig;
status: FormStatus;
}) => React.ReactNode);
};
export {};
//# sourceMappingURL=controls.d.ts.map