@dodobrat/react-ui-kit
Version:
Simple React Component Library
203 lines (202 loc) • 8.93 kB
TypeScript
import React from "react";
import { AlertAnimation } from "../components/Alert/Alert.types";
import { CollapseAnimation } from "../components/Collapse/CollapseSubComponents.types";
import { PortalAnimation, VerticalAlign } from "../components/Portal/Portal.types";
export declare type BreakpointOptions = "base" | "xs" | "sm" | "md" | "lg" | "xl";
export declare type PigmentOptions = "none" | "default" | "primary" | "secondary" | "success" | "warning" | "info" | "danger" | null;
export declare type PigmentResponsiveOptions = {
[bp in BreakpointOptions]?: PigmentOptions;
};
export declare type AllPigmentOptions = PigmentResponsiveOptions | PigmentOptions;
export declare type ElevationOptions = "none" | "subtle" | "light" | "medium" | "strong" | "interstellar";
export declare type ElevationResponsiveOptions = {
[bp in BreakpointOptions]?: ElevationOptions;
};
export declare type AllElevationOptions = ElevationResponsiveOptions | ElevationOptions;
export declare type FlavorOptions = "default" | "flat" | "rounded";
export declare type FlavorResponsiveOptions = {
[bp in BreakpointOptions]?: FlavorOptions;
};
export declare type AllFlavorOptions = FlavorResponsiveOptions | FlavorOptions;
export declare type SizeOptions = "xs" | "sm" | "md" | "lg" | "xl";
export declare type SizeResponsiveOptions = {
[bp in BreakpointOptions]?: SizeOptions;
};
export declare type AllSizeOptions = SizeResponsiveOptions | SizeOptions;
export declare type ContainerSizeOptions = "xs" | "sm" | "md" | "lg" | "xl" | "fhd" | "fluid";
export declare type ContainerSizeResponsiveOptions = {
[bp in BreakpointOptions]?: ContainerSizeOptions;
};
export declare type AllContainerSizeOptions = ContainerSizeResponsiveOptions | ContainerSizeOptions;
export declare type PortalSizeOptions = "xs" | "sm" | "md" | "lg" | "xl" | "fullscreen";
export declare type PortalSizeResponsiveOptions = {
[bp in BreakpointOptions]?: PortalSizeOptions;
};
export declare type AllPortalSizeOptions = PortalSizeResponsiveOptions | PortalSizeOptions;
export declare type FlexAlignOptions = "stretch" | "flex-start" | "flex-end" | "center" | "baseline";
export declare type FlexAlignResponsiveOptions = {
[bp in BreakpointOptions]?: FlexAlignOptions;
};
export declare type AllFlexAlignOptions = FlexAlignResponsiveOptions | FlexAlignOptions;
export declare type FlexJustifyOptions = "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly";
export declare type FlexJustifyResponsiveOptions = {
[bp in BreakpointOptions]?: FlexJustifyOptions;
};
export declare type AllFlexJustifyOptions = FlexJustifyResponsiveOptions | FlexJustifyOptions;
export declare type FlexDirectionOptions = "row" | "row-reverse" | "column" | "column-reverse";
export declare type FlexDirectionResponsiveOptions = {
[bp in BreakpointOptions]?: FlexDirectionOptions;
};
export declare type AllFlexDirectionOptions = FlexDirectionResponsiveOptions | FlexDirectionOptions;
export declare type FlexWrapOptions = "nowrap" | "wrap" | "wrap-reverse";
export declare type FlexWrapResponsiveOptions = {
[bp in BreakpointOptions]?: FlexWrapOptions;
};
export declare type AllFlexWrapOptions = FlexWrapResponsiveOptions | FlexWrapOptions;
export declare type FlexGridColOptions = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "auto" | "reset";
export declare type FlexGridColResponsiveOptions = {
[bp in BreakpointOptions]?: FlexGridColOptions;
};
export declare type AllFlexGridColOptions = FlexGridColResponsiveOptions | FlexGridColOptions;
export declare type Positions = "top" | "bottom" | "left" | "right";
export declare type SidebarPositions = "left" | "right";
export declare type AllPositions = "top-left" | "top-center" | "top-right" | "right-top" | "right-center" | "right-bottom" | "bottom-left" | "bottom-center" | "bottom-right" | "left-top" | "left-center" | "left-bottom";
export declare type PopUpAnimation = "fade" | "zoom" | null;
export declare type ProgressLabelValue = "%" | "count" | "count + %";
export declare type GlobalOptions = {
flavor?: AllFlavorOptions;
pigment?: AllPigmentOptions;
pigmentColor?: AllPigmentOptions;
sizing?: AllSizeOptions;
elevation?: AllElevationOptions;
withRipple?: boolean;
alertElevation?: AllElevationOptions;
alertPigment?: AllPigmentOptions;
alertPigmentColor?: AllPigmentOptions;
alertAnimation?: AlertAnimation;
alertWithIcon?: boolean;
alertIsDismissible?: boolean;
alertIsDismissibleOnClick?: boolean;
alertDismissibleComponent?: React.ReactNode;
badgePigment?: AllPigmentOptions;
badgePigmentColor?: AllPigmentOptions;
badgeElevation?: AllElevationOptions;
breadcrumbsContained?: boolean;
breadcrumbsElevation?: AllElevationOptions;
breadcrumbsPigment?: AllPigmentOptions;
breadcrumbsSeparator?: React.ReactNode;
btnKeyboardOnlyFocusRing?: boolean;
btnSpongy?: boolean;
btnElevation?: AllElevationOptions;
btnGroupSpongy?: boolean;
cardImgPosition?: Positions;
collapseScrollIntoViewOnToggle?: boolean;
collapseIndicator?: boolean;
collapseIndicatorComponent?: React.ReactNode;
collapseAnimation?: CollapseAnimation;
containerSize?: AllContainerSizeOptions;
drawerElevation?: AllElevationOptions;
drawerKeyboard?: boolean;
drawerPosition?: Positions;
drawerBodyScrollDisable?: boolean;
dropdownElevation?: AllElevationOptions;
dropdownPigment?: AllPigmentOptions;
dropdownSize?: AllSizeOptions;
dropdownFlavor?: AllFlavorOptions;
dropdownSeamless?: boolean;
dropdownSpacing?: number;
dropdownShowOnFocus?: boolean;
dropdownAnimation?: PopUpAnimation;
flexSpacingX?: AllSizeOptions;
flexSpacingY?: AllSizeOptions;
headingAs?: React.ElementType;
listGroupCollapseIndicator?: boolean;
listGroupCollapseIndicatorComponent?: React.ReactNode;
listGroupAnimation?: CollapseAnimation;
listGroupNestedCollapseIndent?: boolean;
portalKeyboard?: boolean;
portalSafeZoneSize?: AllSizeOptions;
portalVerticalAlign?: VerticalAlign;
portalAnimation?: PortalAnimation;
portalBodyScrollDisable?: boolean;
tooltipPosition?: AllPositions;
tooltipShowOnFocus?: boolean;
tooltipShowOnClick?: boolean;
tooltipShowOnHover?: boolean;
tooltipElevation?: AllElevationOptions;
tooltipPigment?: AllPigmentOptions;
tooltipSize?: AllSizeOptions;
tooltipFlavor?: AllFlavorOptions;
tooltipSeamless?: boolean;
tooltipSpacing?: number;
tooltipAnimation?: PopUpAnimation;
progressBarLabeled?: boolean;
progressBarLabelValue?: ProgressLabelValue;
progressBarLabelPosition?: Positions;
progressRingLabeled?: boolean;
progressRingLabelValue?: ProgressLabelValue;
progressRingCounterClockWise?: boolean;
skeletonPigment?: AllPigmentOptions;
textAs?: React.ElementType;
adminLayoutSidebarPosition?: SidebarPositions;
};
export interface ElemType {
as?: React.ElementType;
}
export interface CnCh {
className?: string;
children?: React.ReactNode;
}
export interface AllEssentialCustomizationProps {
pigment?: AllPigmentOptions;
elevation?: AllElevationOptions;
flavor?: AllFlavorOptions;
}
export interface AllCustomizationProps extends AllEssentialCustomizationProps {
sizing?: AllSizeOptions;
}
export interface PigmentColorProps {
pigmentColor?: AllPigmentOptions;
}
export interface RippleEffect {
withRipple?: boolean;
onPointerDown?: React.PointerEventHandler;
}
export declare type EssentialInputPropsExtensions = AllCustomizationProps & CnCh;
export interface EssentialInputProps extends EssentialInputPropsExtensions {
seamless?: boolean;
scrollOnFocus?: boolean;
}
export interface EssentialLoadingProps {
disableWhileLoading?: boolean;
isLoading?: boolean;
}
export interface LoadingProps extends EssentialLoadingProps {
loadingComponent?: boolean | JSX.Element | React.ReactNode;
}
export interface SyntheticKeyboardControls {
onKeyDown?: React.KeyboardEventHandler<unknown>;
}
export interface Progress {
className?: string;
min?: number;
max?: number;
value?: number;
labeled?: boolean;
labelValue?: ProgressLabelValue;
labelAlwaysVisible?: boolean;
decimals?: number;
flavor?: AllFlavorOptions;
pigment?: PigmentOptions;
withTrack?: boolean;
}
export interface PortalComponent extends CnCh {
onClose: (e: any) => void | (() => void);
isOpen: boolean;
onOutsideClick?: () => void;
innerClassName?: string;
withFocusLock?: boolean;
keyboard?: boolean;
backdrop?: boolean | "static";
bodyScrollDisable?: boolean;
}