my-animated-components
Version:
A comprehensive React component library with built-in animations and customization options.  
370 lines (317 loc) • 12.3 kB
TypeScript
import React$1 from 'react';
import { Variants } from 'framer-motion';
declare const motionVariants: Record<string, Variants>;
interface BaseProps {
className?: string;
}
interface WithChildren {
children: React.ReactNode;
}
type Color$e = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
interface ColorProps {
color?: Color$e;
}
interface SizeProps {
size?: Size;
}
type Color$d = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
interface ButtonProps extends BaseProps, WithChildren, SizeProps {
onClick?: () => void;
disabled?: boolean;
variant?: 'solid' | 'outline' | 'ghost';
color?: Color$d;
motionVariant?: keyof typeof motionVariants;
}
declare const Button: React$1.FC<ButtonProps>;
type Color$c = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
interface IconButtonProps extends BaseProps, SizeProps {
icon: React$1.ReactNode;
onClick?: () => void;
disabled?: boolean;
variant?: 'solid' | 'outline' | 'ghost';
color?: Color$c;
motionVariant?: keyof typeof motionVariants;
}
declare const IconButton: React$1.FC<IconButtonProps>;
type Color$b = 'primary' | 'secondary' | 'danger' | 'success' | 'info' | 'warning';
type Variant = 'solid' | 'outline' | 'ghost';
interface AccordionProps extends BaseProps, WithChildren {
items: {
title: string;
content: React$1.ReactNode;
}[];
color?: Color$b;
variant?: Variant;
motionVariant?: keyof typeof motionVariants;
}
declare const Accordion: React$1.FC<AccordionProps>;
interface AlertProps extends BaseProps, WithChildren, ColorProps {
onClose?: () => void;
motionVariant?: keyof typeof motionVariants;
}
declare const Alert: React$1.FC<AlertProps>;
interface AvatarProps extends BaseProps, SizeProps {
src?: string;
alt?: string;
initials?: string;
}
declare const Avatar: React$1.FC<AvatarProps>;
interface BadgeProps extends BaseProps, WithChildren, ColorProps, SizeProps {
motionVariant?: keyof typeof motionVariants;
}
declare const Badge: React$1.FC<BadgeProps>;
type Color$a = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
interface BreadcrumbProps extends BaseProps {
items: {
label: string;
href: string;
}[];
motionVariant?: keyof typeof motionVariants;
color?: Color$a;
}
declare const Breadcrumb: React$1.FC<BreadcrumbProps>;
interface CardProps extends BaseProps, WithChildren {
motionVariant?: keyof typeof motionVariants;
}
declare const Card: React$1.FC<CardProps>;
interface CardBodyProps extends BaseProps, WithChildren {
motionVariant?: keyof typeof motionVariants;
}
declare const CardBody: React$1.FC<CardBodyProps>;
interface CardFooterProps extends BaseProps, WithChildren {
motionVariant?: keyof typeof motionVariants;
}
declare const CardFooter: React$1.FC<CardFooterProps>;
interface CardHeaderProps extends BaseProps, WithChildren {
motionVariant?: keyof typeof motionVariants;
}
declare const CardHeader: React$1.FC<CardHeaderProps>;
interface DropdownProps extends BaseProps, WithChildren {
trigger: React$1.ReactNode;
motionVariant?: keyof typeof motionVariants;
}
declare const Dropdown: React$1.FC<DropdownProps>;
declare const DropdownItem: React$1.FC<BaseProps & WithChildren>;
type CheckboxColor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
interface CheckboxProps extends BaseProps {
label: string;
checked?: boolean;
onChange?: (e: React$1.ChangeEvent<HTMLInputElement>) => void;
color?: CheckboxColor;
motionVariant?: keyof typeof motionVariants;
}
declare const Checkbox: React$1.FC<CheckboxProps>;
type ButtonColor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
interface FileUploadProps extends BaseProps {
onChange: (file: File | null) => void;
accept?: string;
multiple?: boolean;
buttonColor?: ButtonColor;
motionVariant?: keyof typeof motionVariants;
}
declare const FileUpload: React$1.FC<FileUploadProps>;
type InputColor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
type TextColor = 'black' | 'gray' | 'white' | 'blue' | 'green' | 'red';
interface InputProps extends BaseProps, SizeProps {
type?: 'text' | 'password' | 'email' | 'number';
placeholder?: string;
value?: string;
onChange?: (e: React$1.ChangeEvent<HTMLInputElement>) => void;
color?: InputColor;
textColor?: TextColor;
}
declare const Input: React$1.FC<InputProps>;
type Color$9 = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
interface RadioProps extends BaseProps, SizeProps {
label: string;
name: string;
value: string;
checked?: boolean;
onChange?: (e: React$1.ChangeEvent<HTMLInputElement>) => void;
color?: Color$9;
motionVariant?: keyof typeof motionVariants;
}
declare const Radio: React$1.FC<RadioProps>;
type Color$8 = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
interface SelectProps extends BaseProps, SizeProps {
options: {
value: string;
label: string;
}[];
value?: string;
onChange?: (e: React$1.ChangeEvent<HTMLSelectElement>) => void;
color?: Color$8;
motionVariant?: keyof typeof motionVariants;
}
declare const Select: React$1.FC<SelectProps>;
type Color$7 = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
interface SwitchProps extends BaseProps {
checked: boolean;
onChange: (checked: boolean) => void;
label?: string;
color?: Color$7;
motionVariant?: keyof typeof motionVariants;
}
declare const Switch: React$1.FC<SwitchProps>;
type Color$6 = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
interface TextareaProps extends BaseProps, SizeProps {
placeholder?: string;
value?: string;
onChange?: (e: React$1.ChangeEvent<HTMLTextAreaElement>) => void;
rows?: number;
color?: Color$6;
motionVariant?: keyof typeof motionVariants;
}
declare const Textarea: React$1.FC<TextareaProps>;
interface ContainerProps extends BaseProps, WithChildren {
fluid?: boolean;
motionVariant?: keyof typeof motionVariants;
}
declare const Container: React$1.FC<ContainerProps>;
interface FlexProps extends BaseProps, WithChildren {
direction?: 'row' | 'col';
justify?: 'start' | 'center' | 'end' | 'between' | 'around';
align?: 'start' | 'center' | 'end' | 'stretch';
wrap?: boolean;
}
declare const Flex: React$1.FC<FlexProps>;
interface GridProps extends BaseProps, WithChildren {
cols?: number;
gap?: number;
}
declare const Grid: React$1.FC<GridProps>;
interface ListProps extends BaseProps, WithChildren {
as?: 'ul' | 'ol';
}
declare const List: React$1.FC<ListProps>;
declare const ListItem: React$1.FC<BaseProps & WithChildren>;
interface ModalProps extends BaseProps, WithChildren {
isOpen: boolean;
onClose: () => void;
motionVariant?: keyof typeof motionVariants;
}
declare const Modal: React$1.FC<ModalProps>;
declare const ModalBody: React$1.FC<BaseProps & WithChildren>;
declare const ModalFooter: React$1.FC<BaseProps & WithChildren>;
declare const ModalHeader: React$1.FC<BaseProps & WithChildren>;
interface NavItemProps extends BaseProps, WithChildren {
href: string;
active?: boolean;
size?: 'sm' | 'md' | 'lg';
motionVariant?: keyof typeof motionVariants;
}
declare const NavItem: React$1.FC<NavItemProps>;
interface NavbarProps extends BaseProps, WithChildren {
brand?: React$1.ReactNode;
}
declare const Navbar: React$1.FC<NavbarProps>;
interface OffcanvasProps extends BaseProps, WithChildren {
isOpen: boolean;
onClose: () => void;
position?: 'left' | 'right' | 'top' | 'bottom';
}
declare const Offcanvas: React$1.FC<OffcanvasProps>;
declare const OffcanvasBody: React$1.FC<BaseProps & WithChildren>;
interface OffcanvasHeaderProps extends BaseProps, WithChildren {
onClose: () => void;
}
declare const OffcanvasHeader: React$1.FC<OffcanvasHeaderProps>;
type Color$5 = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
interface PaginationProps extends BaseProps {
currentPage: number;
totalPages: number;
onPageChange: (page: number) => void;
color?: Color$5;
motionVariant?: keyof typeof motionVariants;
}
declare const Pagination: React$1.FC<PaginationProps>;
type Color$4 = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
interface ProgressBarProps extends BaseProps, ColorProps {
value: number;
max?: number;
color?: Color$4;
motionVariant?: keyof typeof motionVariants;
}
declare const ProgressBar: React$1.FC<ProgressBarProps>;
type Color$3 = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
interface SkeletonProps extends BaseProps {
width?: string;
height?: string;
color?: Color$3;
motionVariant?: keyof typeof motionVariants;
}
declare const Skeleton: React$1.FC<SkeletonProps>;
interface SliderProps extends BaseProps {
min: number;
max: number;
value: number;
onChange: (value: number) => void;
step?: number;
color?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
motionVariant?: keyof typeof motionVariants;
}
declare const Slider: React$1.FC<SliderProps>;
interface RangeSliderProps extends BaseProps {
min: number;
max: number;
values: [number, number];
onChange: (values: [number, number]) => void;
step?: number;
color?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
motionVariant?: keyof typeof motionVariants;
}
declare const RangeSlider: React$1.FC<RangeSliderProps>;
type Color$2 = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
interface StepperProps extends BaseProps {
steps: string[];
currentStep: number;
color?: {
active?: Color$2;
inactive?: Color$2;
connector?: Color$2;
};
size?: 'sm' | 'md' | 'lg' | 'xs' | 'xl';
orientation?: 'horizontal' | 'vertical';
}
declare const Stepper: React$1.FC<StepperProps>;
type Color$1 = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
interface TableProps extends BaseProps, WithChildren, SizeProps {
motionVariant?: keyof typeof motionVariants;
color?: Color$1;
}
declare const Table: React$1.FC<TableProps>;
declare const TableBody: React$1.FC<BaseProps & WithChildren>;
interface TableCellProps extends BaseProps, WithChildren {
as?: 'td' | 'th';
}
declare const TableCell: React$1.FC<TableCellProps>;
declare const TableHead: React$1.FC<BaseProps & WithChildren>;
declare const TableRow: React$1.FC<BaseProps & WithChildren>;
type Color = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
interface TabsProps extends BaseProps, WithChildren {
tabs: {
label: string;
content: React$1.ReactNode;
}[];
motionVariant?: keyof typeof motionVariants;
color?: Color;
}
declare const Tabs: React$1.FC<TabsProps>;
type TooltipColor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
interface TooltipProps extends BaseProps, WithChildren {
content: string;
position?: 'top' | 'right' | 'bottom' | 'left';
color?: TooltipColor;
motionVariant?: keyof typeof motionVariants;
}
declare const Tooltip: React$1.FC<TooltipProps>;
interface HeadingProps extends BaseProps, WithChildren, SizeProps {
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
}
declare const Heading: React$1.FC<HeadingProps>;
interface TextProps extends BaseProps, WithChildren, SizeProps {
weight?: 'normal' | 'medium' | 'semibold' | 'bold';
}
declare const Text: React$1.FC<TextProps>;
export { Accordion, Alert, Avatar, Badge, Breadcrumb, Button, Card, CardBody, CardFooter, CardHeader, Checkbox, Container, Dropdown, DropdownItem, FileUpload, Flex, Grid, Heading, IconButton, Input, List, ListItem, Modal, ModalBody, ModalFooter, ModalHeader, NavItem, Navbar, Offcanvas, OffcanvasBody, OffcanvasHeader, Pagination, ProgressBar, Radio, RangeSlider, Select, Skeleton, Slider, Stepper, Switch, Table, TableBody, TableCell, TableHead, TableRow, Tabs, Text, Textarea, Tooltip, motionVariants };