reverie-ui
Version:
A React UI library based on Tailwind CSS
55 lines (54 loc) • 1.89 kB
TypeScript
import { CSSProperties, ReactNode } from "react";
export interface CommonProps<E extends HTMLElement> {
id?: string;
title?: string;
className?: string;
style?: CSSProperties;
children?: ReactNode;
onClick?: React.MouseEventHandler<E>;
onDoubleClick?: React.MouseEventHandler<E>;
onContextMenu?: React.MouseEventHandler<E>;
onMouseDown?: React.MouseEventHandler<E>;
onMouseEnter?: React.MouseEventHandler<E>;
onMouseLeave?: React.MouseEventHandler<E>;
onMouseMove?: React.MouseEventHandler<E>;
onMouseOut?: React.MouseEventHandler<E>;
onMouseOver?: React.MouseEventHandler<E>;
onMouseUp?: React.MouseEventHandler<E>;
onScroll?: React.UIEventHandler<E>;
onSelect?: React.ReactEventHandler<E>;
onWheel?: React.WheelEventHandler<E>;
onCopy?: React.ClipboardEventHandler<E>;
onCut?: React.ClipboardEventHandler<E>;
onPaste?: React.ClipboardEventHandler<E>;
onBlur?: React.FocusEventHandler<E>;
onFocus?: React.FocusEventHandler<E>;
onKeyDown?: React.KeyboardEventHandler<E>;
onKeyUp?: React.KeyboardEventHandler<E>;
onKeyPress?: React.KeyboardEventHandler<E>;
onTouchCancel?: React.TouchEventHandler<E>;
onTouchEnd?: React.TouchEventHandler<E>;
onTouchMove?: React.TouchEventHandler<E>;
onTouchStart?: React.TouchEventHandler<E>;
}
export interface CommonControlProps<E extends HTMLElement> extends CommonProps<E> {
name?: string;
disabled?: boolean;
}
export interface SelectOption {
value: string;
text: string;
tooltip?: string;
render?: () => ReactNode;
}
export interface DropdownOption {
text: string;
tooltip?: string;
onClick?: () => void;
render?: () => ReactNode;
}
export interface CheckOption {
value: string;
content: ReactNode;
disabled?: boolean;
}