ConceptPortal-public/rsconcept/frontend/src/components/props.d.ts

49 lines
1.4 KiB
TypeScript
Raw Normal View History

// =========== Module contains interfaces for common UI elements. ==========
import { HTMLMotionProps } from 'framer-motion';
export namespace CProps {
2024-03-09 16:40:10 +03:00
export type Titled = {
2023-12-28 14:04:44 +03:00
title?: string;
2024-03-09 16:40:10 +03:00
titleHtml?: string;
hideTitle?: boolean;
};
export type Control = Titled & {
2023-12-28 14:04:44 +03:00
disabled?: boolean;
noBorder?: boolean;
noOutline?: boolean;
};
export type Styling = {
style?: React.CSSProperties;
className?: string;
};
export type Editor = Control & {
label?: string;
};
export type Colors = {
colors?: string;
};
export type Div = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
2024-03-09 16:40:10 +03:00
export type Button = Titled &
Omit<
React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>,
'children' | 'type'
>;
2023-12-28 14:04:44 +03:00
export type Label = Omit<
React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>,
'children'
>;
2024-03-09 16:40:10 +03:00
export type TextArea = Titled &
React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
export type Input = Titled & React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
2023-12-28 14:04:44 +03:00
2024-03-09 16:40:10 +03:00
export type AnimatedButton = Titled & Omit<HTMLMotionProps<'button'>, 'type'>;
export type AnimatedDiv = HTMLMotionProps<'div'>;
export type EventMouse = React.MouseEvent<Element, MouseEvent>;
}