ADDED: A few types for convenience
FIXED: Fixed generic types, where used type "any"
This commit is contained in:
parent
26584d5482
commit
dc4b8baaf8
|
@ -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;
|
disableValue?: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
import { ButtonHTMLAttributes } from 'react';
|
||||||
|
import { IRippleProps } from '../ripple/ripple.types';
|
||||||
|
|
||||||
|
export interface ButtonLayoutProps
|
||||||
|
extends IRippleProps,
|
||||||
|
ButtonHTMLAttributes<HTMLButtonElement> {}
|
|
@ -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';
|
|
||||||
}
|
|
|
@ -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 {}
|
|
@ -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;
|
indeterminate?: boolean;
|
||||||
typeInput?: string;
|
typeInput?: string;
|
||||||
type?: string;
|
type?: string;
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
import { InputHTMLAttributes } from 'react';
|
||||||
|
import { IRippleProps } from '../ripple/ripple.types';
|
||||||
|
|
||||||
|
export interface CheckboxProps
|
||||||
|
extends InputHTMLAttributes<HTMLInputElement>,
|
||||||
|
IRippleProps {}
|
|
@ -0,0 +1,6 @@
|
||||||
|
import { HTMLAttributes } from 'react';
|
||||||
|
|
||||||
|
export interface DividerProps extends HTMLAttributes<HTMLHRElement> {
|
||||||
|
orientation?: 'vertical' | 'horizontal';
|
||||||
|
variant?: 'full-width' | 'inset' | 'middle-inset';
|
||||||
|
}
|
|
@ -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 {}
|
|
@ -1,4 +1,22 @@
|
||||||
export type toggleIconType = {
|
import React from 'react';
|
||||||
|
import { IRippleProps } from '../ripple/ripple.types';
|
||||||
|
|
||||||
|
export type StateToggleIconType = {
|
||||||
state: string;
|
state: string;
|
||||||
icon: 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 {}
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
import { PropsWithChildren } from 'react';
|
import { SVGProps } from 'react';
|
||||||
|
|
||||||
export interface IconProps extends PropsWithChildren<any> {
|
export interface IconProps extends SVGProps<SVGSVGElement> {
|
||||||
fill?: boolean;
|
|
||||||
grade?: number;
|
grade?: number;
|
||||||
svgSize?: number;
|
svgSize?: number;
|
||||||
|
fillIcon?: 0 | 1;
|
||||||
iconSize?: number;
|
iconSize?: number;
|
||||||
opticalSize?: number;
|
opticalSize?: number;
|
||||||
|
children?: string | undefined;
|
||||||
type?: 'outlined' | 'rounded' | 'sharp';
|
type?: 'outlined' | 'rounded' | 'sharp';
|
||||||
weight?: 100 | 200 | 300 | 400 | 500 | 600 | 700;
|
weight?: 100 | 200 | 300 | 400 | 500 | 600 | 700;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
import { InputHTMLAttributes } from 'react';
|
||||||
|
import { IRippleProps } from '../ripple/ripple.types';
|
||||||
|
|
||||||
|
export interface RadioProps
|
||||||
|
extends InputHTMLAttributes<HTMLInputElement>,
|
||||||
|
IRippleProps {
|
||||||
|
centralRipple?: boolean;
|
||||||
|
}
|
|
@ -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;
|
disabled?: boolean;
|
||||||
icon?: boolean;
|
icon?: boolean;
|
||||||
selected?: boolean;
|
selected?: boolean;
|
||||||
|
|
|
@ -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';
|
variant: 'filled' | 'outlined';
|
||||||
withAfterIcon?: boolean;
|
withAfterIcon?: boolean;
|
||||||
withBeforeIcon?: boolean;
|
withBeforeIcon?: boolean;
|
||||||
|
|
Loading…
Reference in New Issue