R: use React.ComponentProps

This commit is contained in:
Ivan 2024-09-19 17:36:24 +03:00
parent ccf1818e20
commit 08634e396e

View File

@ -66,35 +66,27 @@ export namespace CProps {
/** /**
* Represents `div` component with all standard HTML attributes and React-specific properties. * Represents `div` component with all standard HTML attributes and React-specific properties.
*/ */
export type Div = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>; export type Div = React.ComponentProps<'div'>;
/** /**
* Represents `button` component with optional title and HTML attributes. * Represents `button` component with optional title and HTML attributes.
*/ */
export type Button = Titled & export type Button = Titled & Omit<React.ComponentProps<'button'>, 'children' | 'type'>;
Omit<
React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>,
'children' | 'type'
>;
/** /**
* Represents `label` component with HTML attributes. * Represents `label` component with HTML attributes.
*/ */
export type Label = Omit< export type Label = Omit<React.ComponentProps<'label'>, 'children'>;
React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>,
'children'
>;
/** /**
* Represents `textarea` component with optional title and HTML attributes. * Represents `textarea` component with optional title and HTML attributes.
*/ */
export type TextArea = Titled & export type TextArea = Titled & React.ComponentProps<'textarea'>;
React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
/** /**
* Represents `input` component with optional title and HTML attributes. * Represents `input` component with optional title and HTML attributes.
*/ */
export type Input = Titled & React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>; export type Input = Titled & React.ComponentProps<'input'>;
/** /**
* Represents `button` component with optional title and animation properties. * Represents `button` component with optional title and animation properties.