@feelback/react
Version:
Use Feelback service within your React website
42 lines (41 loc) • 1.68 kB
TypeScript
import { ReactElement } from "react";
import { TargetContent } from "@feelback/js";
import { FormHandlerProps } from "../parts";
import { FeelbackValueDefinition } from "../types";
import type { OneOrMany } from "../utils";
export type FeelbackTaggedMessageProps = Readonly<TargetContent & {
layout?: "button-switch" | "button-dialog" | "inline" | "radio-group" | "radio-group-dialog" | "reveal-message";
style?: OneOrMany<"bordered" | `width-${"sm" | "md"}` | `align-center`>;
label?: string;
revokable?: boolean;
textAnswer?: string;
preset?: readonly FeelbackValueDefinition[];
onSuccess?: (feelback: TargetContent & {
value: {
tag?: string;
message?: string;
};
}) => void;
}> & Partial<Pick<TaggedMessageFormProps, "title" | "tags" | "active" | "maxLength" | "minLength" | "placeholder" | "showLabels" | "withEmail" | "placeholderEmail" | "onCancel" | "slots">>;
export declare function FeelbackTaggedMessage(props: FeelbackTaggedMessageProps): import("react/jsx-runtime").JSX.Element | null;
type TaggedMessageFormProps = FormHandlerProps<{
tag: string;
message?: string;
}> & Readonly<{
layout: "form" | "radio-group" | "reveal-message";
tags: readonly FeelbackValueDefinition[];
active?: "$auto" | (string & {});
showLabels?: boolean;
title?: string;
minLength?: number;
maxLength?: number;
placeholder?: string | false;
withEmail?: boolean | "optional" | "required";
placeholderEmail?: string | false;
slots?: {
BeforeMessage?: ReactElement;
BeforeEmail?: ReactElement;
BeforeFormButtons?: ReactElement;
};
}>;
export {};