@open-condo/ui
Version:
A set of React UI components for developing applications inside the condo ecosystem
84 lines • 2.61 kB
TypeScript
import React from 'react';
import { Dropdown } from '../Dropdown';
type RenderType = 'default' | 'inline';
type RichTextAreaToolbarLabels = {
undo: string;
redo: string;
link: string;
bold: string;
italic: string;
strikethrough: string;
unorderedList: string;
orderedList: string;
taskList: string;
removeFormatting: string;
table: string;
blockquote: string;
image: string;
heading: string;
};
type RichTextAreaBottomPanelLabels = {
emoji: string;
};
type RichTextAreaLinkModalLabels = {
urlLabel: string;
textLabel: string;
submitLabel: string;
};
type RichTextAreaImageModalLabels = {
urlLabel: string;
submitLabel: string;
};
type RichTextAreaEmojiDropdownLabels = {
categories: {
activity: string;
flags: string;
foods: string;
frequent: string;
nature: string;
objects: string;
people: string;
places: string;
symbols: string;
};
};
export type RichTextAreaCustomLabels = {
toolbar?: Partial<RichTextAreaToolbarLabels>;
bottomPanelLabels?: Partial<RichTextAreaBottomPanelLabels>;
linkModal?: Partial<RichTextAreaLinkModalLabels>;
imageModal?: Partial<RichTextAreaImageModalLabels>;
emojiDropdown?: Partial<RichTextAreaEmojiDropdownLabels>;
};
type BottomPanelBuiltinKey = 'emoji';
type BottomPanelBuiltinUtilConfig = {
key: 'emoji';
dropdownProps?: Pick<React.ComponentProps<typeof Dropdown>, 'placement'>;
};
type BottomPanelReactUtilElement = React.ReactElement<{
disabled?: boolean;
}>;
type BottomPanelUtilsItem = BottomPanelBuiltinKey | BottomPanelBuiltinUtilConfig | BottomPanelReactUtilElement;
type ToolbarButtonKey = 'undo' | 'redo' | 'bold' | 'italic' | 'strikethrough' | 'link' | 'unorderedList' | 'orderedList' | 'taskList' | 'removeFormatting' | 'table' | 'blockquote' | 'image' | 'heading';
export type ToolbarGroup = ToolbarButtonKey[];
export type RichTextAreaProps = {
value?: string;
onChange?: (value: string) => void;
onSubmit?: (value: string) => void;
isSubmitDisabled?: boolean;
disabled?: boolean;
maxLength?: number;
showCount?: boolean;
placeholder?: string;
autoSize?: boolean | {
minRows?: number;
maxRows?: number;
};
overflowPolicy?: 'crop' | 'show';
toolbarGroups?: ToolbarGroup[];
customLabels?: RichTextAreaCustomLabels;
bottomPanelUtils?: BottomPanelUtilsItem[];
type?: RenderType;
};
export declare const RichTextArea: React.FC<RichTextAreaProps>;
export {};
//# sourceMappingURL=richTextArea.d.ts.map