digitinary-ui
Version:
Digitinary UI Library
260 lines (259 loc) • 7.51 kB
TypeScript
/// <reference types="react" />
import { Country } from 'react-phone-number-input';
export type RadioOption = {
value: string;
label: string;
disabled?: boolean;
};
export type ButtonType = 'button' | 'submit' | 'reset';
export type InputType = 'text' | 'email' | 'number' | 'password' | 'search';
export type BaseColorType = 'default' | 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning' | 'action' | 'natural';
export type SwitchColorType = Exclude<BaseColorType, 'default' | 'inherit' | 'info' | 'action' | 'natural'>;
export type ButtonColorType = Exclude<BaseColorType, 'default' | 'natural'>;
export type ChipColorType = Exclude<BaseColorType, 'inherit' | 'action' | 'natural'>;
export type RadioColorType = Exclude<BaseColorType, 'inherit' | 'action' | 'info' | 'natural'>;
export type AlertColorType = Exclude<BaseColorType, 'default' | 'inherit' | 'primary' | 'secondary' | 'action' | 'natural'>;
export type HelperTextColorType = Exclude<BaseColorType, 'inherit' | 'primary' | 'secondary' | 'success' | 'warning' | 'action' | 'natural'>;
export type BaseVariantType = 'default' | 'filled' | 'outlined' | 'contained' | 'text' | 'link';
export type AlertVariantType = Exclude<BaseVariantType, 'contained' | 'text' | 'link'>;
export type ButtonVariantType = Exclude<BaseVariantType, 'default' | 'filled'>;
export type ChipVariantType = Exclude<BaseVariantType, 'default' | 'contained' | 'text' | 'link'>;
export type SizeType = 'small' | 'medium' | 'large';
export type PlacementType = 'left' | 'right' | 'top' | 'bottom';
export type HtmlElementsWithDisabledProp = HTMLButtonElement | HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
export type DurationType = 'days' | 'weeks' | 'months' | 'hours';
export type PositionType = 'end' | 'start' | 'top' | 'bottom';
export type periodType = {
years?: number;
months?: number;
days?: number;
};
export interface IconProps {
height?: string | number;
width?: string | number;
[key: string]: any;
}
export type DataItem = {
name: string;
value: number;
color: string;
};
export type BarChartProps = {
data: DataItem[];
className?: string;
barSize: number;
width: number;
height: number;
selectedItem?: string;
yAxisFontSize?: string;
xAxisFontSize?: string;
yAxisOffset?: number;
};
export type CarouselProps = {
items: JSX.Element[];
title: string;
move?: boolean;
setMove?: (move: boolean) => void;
className?: string;
};
export type DonutChartProps = {
data: {
name: string;
value: number;
fill: string;
}[] | undefined;
height?: number;
width?: string;
innerRadius?: number;
outerRadius?: number;
withPercentage?: boolean;
dataId?: string;
fontSize?: string;
withLegend?: boolean;
withMoreDetails?: boolean;
valueFontSize?: string;
nameFontSize?: string;
noDataState?: boolean;
endAngle?: number;
startAngle?: number;
dy?: number;
className?: string;
innerShapeRadius?: number;
outerShapeRadius?: number;
withTooltip?: boolean;
};
export type DropDownProps = {
label?: string;
placeholder?: string;
options?: {
value: string;
view: React.ReactNode;
}[];
value?: {
item: Object;
[key: string]: any;
};
size?: string;
setValue?: React.Dispatch<React.SetStateAction<string>>;
clearable?: boolean;
errorMessage?: string;
required?: boolean;
disabled?: boolean;
defaultIconTitle?: string;
showDefaultIcon?: boolean;
defaultIcon?: React.ReactNode;
className?: string;
};
export type GaugeChartProps = {
percentage: number;
charTtitle?: string;
label?: string;
diameter?: number;
color?: string;
backColor?: string;
};
type LineData = {
name: string;
[key: string]: string | number;
fill: string | number;
};
type LineItem = {
name: string;
key: string;
color: string;
dotColor: string;
};
export type LineChartProps = {
data: LineData[];
lines: LineItem[];
height?: number;
width?: number;
className?: string;
isViewXAxis?: boolean;
isViewYAxis?: boolean;
xAxisLabel?: Record<string, string | number>;
yAxisLabel?: Record<string, string | number>;
};
type ButtonProps = {
text: string;
onClick: () => void;
};
type FooterProps = {
closeButton?: ButtonProps;
submitButton?: ButtonProps;
customFooter?: React.ReactNode;
};
export type SideDrawerV2Props = {
open: boolean;
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
children: React.ReactNode;
className?: string;
onClickOutSide?: () => void;
onClose?: () => void;
width?: string;
anchor?: 'left' | 'right';
title?: string;
footer?: FooterProps;
showCloseIcon?: boolean;
};
export type SimpleCollapseSectionProps = {
title: string;
label: string;
child: React.ReactNode;
defaultOpen?: boolean;
className?: string;
};
export type SimpleLabelValueProps = {
label?: string | JSX.Element;
value?: string | number | JSX.Element | JSX.Element[];
color?: string;
className?: string;
dataId?: string;
};
export type StackedBarChartProps = {
data: {
name: string;
[key: string]: number | string | undefined;
}[];
className?: string;
barSize: number;
width: string;
height: number;
stackKeys: string[];
colors: string[];
yAxisFontSize?: string;
xAxisFontSize?: string;
yAxisOffset?: number;
CustomTooltip?: React.FC;
formatterLegendFunction?: React.FC;
withHorizontalGrid?: boolean;
withVerticalGrid?: boolean;
withLegend?: boolean;
tickCount?: number;
};
type StepInfo = {
title: string;
};
export type StepperProps = {
stepperInfo: StepInfo[];
completedSteps: number[];
currentStep?: number;
setCurrentStep: React.Dispatch<React.SetStateAction<number>>;
className?: string;
direction?: 'horizontal' | 'vertical';
stepsGap?: string;
};
export type { TaskTableProps } from '../components/TableV2/types';
export type { TooltipPropsTypes } from '../components/Tooltip/Tooltip';
type singleTimeRecord = {
status?: string;
date?: any;
userName?: string;
comment?: string;
isHighlighted?: boolean;
details?: JSX.Element | string;
files?: Blob[];
};
export interface TimeTrackerProps {
data: singleTimeRecord[];
className?: string;
title?: string;
statusTypes?: {
[key: string]: string;
};
}
export interface ViewDocumentsProps {
files: File[];
}
export type ArenaLabelProps = {
label: string;
type: 'required' | 'optional';
};
export interface PhoneChangeData {
fullNumber: string;
countryCode: string;
nationalNumber: string;
country: string;
isValid: boolean;
}
export interface PhoneNumberProps {
value?: string;
onChange?: (data: PhoneChangeData) => void;
label?: string;
placeholder?: string;
required?: boolean;
disabled?: boolean;
className?: string;
errorMsg?: string;
defaultCountry?: Country;
countries?: Country[];
excludedCountries?: Country[];
international?: boolean;
withCountryCallingCode?: boolean;
size?: 'small' | 'medium' | 'large';
rtl?: boolean;
validate?: boolean;
countrySelectProps?: Record<string, any>;
inputProps?: Record<string, any>;
showDefaultValidation?: boolean;
}