ADDED: A few types for convenience

FIXED: Fixed generic types, where used type "any"
This commit is contained in:
doryan04 2024-02-01 16:23:29 +04:00
parent 26584d5482
commit dc4b8baaf8
13 changed files with 82 additions and 37 deletions

View File

@ -1,5 +1,6 @@
import { PropsWithChildren } from 'react';
import { SVGProps } from 'react';
export interface BadgeProps extends PropsWithChildren<any> {
export interface BadgeProps extends SVGProps<SVGSVGElement> {
children?: string | undefined;
disableValue?: boolean;
}

View File

@ -0,0 +1,6 @@
import { ButtonHTMLAttributes } from 'react';
import { IRippleProps } from '../ripple/ripple.types';
export interface ButtonLayoutProps
extends IRippleProps,
ButtonHTMLAttributes<HTMLButtonElement> {}

View File

@ -1,25 +0,0 @@
import { PropsWithChildren } from 'react';
type ToggleButtonType = {
selected: string;
unselected: string;
};
export interface ButtonMainProps extends PropsWithChildren<any> {
disabled?: boolean;
variant?: 'filled' | 'outlined' | 'elevated' | 'tonal' | 'text';
}
export interface FABMainProps extends PropsWithChildren<any> {
icon: string;
disabled?: boolean;
size?: 'small' | 'default' | 'large' | 'extended';
variant?: 'surface' | 'primary' | 'secondary' | 'tertiary';
}
export interface IconButtonMainProps extends PropsWithChildren<any> {
icon: string;
toggled?: false | ToggleButtonType;
disabled?: boolean;
variant?: 'default' | 'filled' | 'tonal' | 'outlined';
}

View File

@ -0,0 +1,10 @@
import { ButtonHTMLAttributes } from 'react';
import { IRippleProps } from '../ripple/ripple.types';
export interface ButtonMainProps
extends ButtonHTMLAttributes<HTMLButtonElement> {
disabled?: boolean;
variant?: 'filled' | 'outlined' | 'elevated' | 'tonal' | 'text';
}
export interface ButtonProps extends IRippleProps, ButtonMainProps {}

View File

@ -1,6 +1,7 @@
import { PropsWithChildren } from 'react';
import { InputHTMLAttributes } from 'react';
export interface CheckboxLayoutProps extends PropsWithChildren<any> {
export interface CheckboxLayoutProps
extends InputHTMLAttributes<HTMLInputElement> {
indeterminate?: boolean;
typeInput?: string;
type?: string;

View File

@ -0,0 +1,6 @@
import { InputHTMLAttributes } from 'react';
import { IRippleProps } from '../ripple/ripple.types';
export interface CheckboxProps
extends InputHTMLAttributes<HTMLInputElement>,
IRippleProps {}

View File

@ -0,0 +1,6 @@
import { HTMLAttributes } from 'react';
export interface DividerProps extends HTMLAttributes<HTMLHRElement> {
orientation?: 'vertical' | 'horizontal';
variant?: 'full-width' | 'inset' | 'middle-inset';
}

View File

@ -0,0 +1,12 @@
import React from 'react';
import { IRippleProps } from '../ripple/ripple.types';
export interface FABMainProps
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
icon: string;
disabled?: boolean;
size?: 'small' | 'default' | 'large' | 'extended';
variant?: 'surface' | 'primary' | 'secondary' | 'tertiary';
}
export interface FABProps extends FABMainProps, IRippleProps {}

View File

@ -1,4 +1,22 @@
export type toggleIconType = {
import React from 'react';
import { IRippleProps } from '../ripple/ripple.types';
export type StateToggleIconType = {
state: string;
icon: string;
};
export type ToggleButtonType = {
selected: string;
unselected: string;
};
export interface IconButtonMainProps
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
icon: string;
toggled?: false | ToggleButtonType;
disabled?: boolean;
variant?: 'default' | 'filled' | 'tonal' | 'outlined';
}
export interface IconButtonProps extends IconButtonMainProps, IRippleProps {}

View File

@ -1,11 +1,12 @@
import { PropsWithChildren } from 'react';
import { SVGProps } from 'react';
export interface IconProps extends PropsWithChildren<any> {
fill?: boolean;
export interface IconProps extends SVGProps<SVGSVGElement> {
grade?: number;
svgSize?: number;
fillIcon?: 0 | 1;
iconSize?: number;
opticalSize?: number;
children?: string | undefined;
type?: 'outlined' | 'rounded' | 'sharp';
weight?: 100 | 200 | 300 | 400 | 500 | 600 | 700;
}

View File

@ -0,0 +1,8 @@
import { InputHTMLAttributes } from 'react';
import { IRippleProps } from '../ripple/ripple.types';
export interface RadioProps
extends InputHTMLAttributes<HTMLInputElement>,
IRippleProps {
centralRipple?: boolean;
}

View File

@ -1,6 +1,6 @@
import { PropsWithChildren } from 'react';
import { InputHTMLAttributes } from 'react';
export interface SwitchMainProps extends PropsWithChildren<any> {
export interface SwitchMainProps extends InputHTMLAttributes<HTMLInputElement> {
disabled?: boolean;
icon?: boolean;
selected?: boolean;

View File

@ -1,6 +1,7 @@
import { PropsWithChildren } from 'react';
import { InputHTMLAttributes } from 'react';
export interface TextFieldInterface extends PropsWithChildren<any> {
export interface TextFieldInterface
extends InputHTMLAttributes<HTMLInputElement> {
variant: 'filled' | 'outlined';
withAfterIcon?: boolean;
withBeforeIcon?: boolean;