UNPKG

@ralorotech/duino-ui

Version:
378 lines (365 loc) 13.2 kB
import React$1, { ReactNode } from 'react'; import * as react_jsx_runtime from 'react/jsx-runtime'; type ButtonVariant = "primary" | "secondary" | "ghost" | "danger" | "text"; type ButtonSize = "sm" | "md" | "lg"; type ButtonShape = "default" | "round" | "circle"; interface ButtonProps { variant?: ButtonVariant; size?: ButtonSize; shape?: ButtonShape; block?: boolean; loading?: boolean; icon?: React$1.ReactNode; iconPosition?: "start" | "end"; /** Etiqueta accesible para el spinner de loading */ loadingText?: string; /** Hace el botón peligroso (confirmación requerida) */ danger?: boolean; /** URL para convertir el botón en un enlace */ href?: string; /** Target para enlaces */ target?: string; /** Props adicionales para el botón */ className?: string; children?: React$1.ReactNode; disabled?: boolean; onClick?: React$1.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>; /** Props HTML adicionales */ [key: string]: any; } declare const Button: React$1.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React$1.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>; type CollapseSize = 'sm' | 'md' | 'lg'; type CollapseVariant = 'default' | 'ghost' | 'bordered'; interface CollapseItem { key: string | number; label: ReactNode; children: ReactNode; disabled?: boolean; extra?: ReactNode; showArrow?: boolean; className?: string; } interface CollapseProps { items?: CollapseItem[]; children?: ReactNode; activeKey?: string | number | (string | number)[]; defaultActiveKey?: string | number | (string | number)[]; accordion?: boolean; collapsible?: 'header' | 'icon' | 'disabled'; destroyInactivePanel?: boolean; size?: CollapseSize; variant?: CollapseVariant; bordered?: boolean; ghost?: boolean; className?: string; onChange?: (key: string | number | (string | number)[]) => void; expandIcon?: (props: { isActive: boolean; disabled: boolean; }) => ReactNode; expandIconPosition?: 'start' | 'end'; } interface CollapsePanelProps { header: ReactNode; children: ReactNode; key?: string | number; disabled?: boolean; extra?: ReactNode; showArrow?: boolean; className?: string; isActive?: boolean; onToggle?: () => void; size?: CollapseSize; variant?: CollapseVariant; expandIcon?: (props: { isActive: boolean; disabled: boolean; }) => ReactNode; expandIconPosition?: 'start' | 'end'; collapsible?: 'header' | 'icon' | 'disabled'; } declare const CollapsePanel: React$1.FC<CollapsePanelProps>; declare const Collapse: React$1.FC<CollapseProps>; type ImageFit = 'fill' | 'contain' | 'cover' | 'none' | 'scale-down'; type ImageShape = 'square' | 'circle' | 'rounded'; interface ImageProps extends Omit<React$1.ImgHTMLAttributes<HTMLImageElement>, 'onLoad' | 'onError' | 'loading'> { src: string; alt: string; width?: number | string; height?: number | string; lazy?: boolean; preview?: boolean; fallback?: ReactNode; placeholder?: ReactNode; fit?: ImageFit; shape?: ImageShape; bordered?: boolean; shadow?: boolean; loading?: ReactNode; error?: ReactNode; onLoad?: (event: React$1.SyntheticEvent<HTMLImageElement>) => void; onError?: (event: React$1.SyntheticEvent<HTMLImageElement>) => void; onPreview?: () => void; rootMargin?: string; threshold?: number; caption?: ReactNode; } declare const Image: React$1.FC<ImageProps>; type ModalProps = { open: boolean; title?: React$1.ReactNode; children?: React$1.ReactNode; onOk?: () => void; onCancel?: () => void; okText?: string; cancelText?: string; maskClosable?: boolean; centered?: boolean; width?: number | string; destroyOnClose?: boolean; footer?: React$1.ReactNode | null; className?: string; }; declare const Modal: React$1.FC<ModalProps>; type MessageType = "info" | "success" | "warning" | "error" | "loading"; type MessagePlacement = "top-left" | "top-right" | "bottom-left" | "bottom-right"; type MessageOptions = { type?: MessageType; content: React$1.ReactNode; duration?: number; closable?: boolean; }; type OpenMessage = MessageOptions & { id: string; }; type UseMessageApi = { open: (opts: MessageOptions) => { close: () => void; id: string; }; info: (content: React$1.ReactNode, opts?: Omit<MessageOptions, "type" | "content">) => { close: () => void; id: string; }; success: (content: React$1.ReactNode, opts?: Omit<MessageOptions, "type" | "content">) => { close: () => void; id: string; }; warning: (content: React$1.ReactNode, opts?: Omit<MessageOptions, "type" | "content">) => { close: () => void; id: string; }; error: (content: React$1.ReactNode, opts?: Omit<MessageOptions, "type" | "content">) => { close: () => void; id: string; }; loading: (content: React$1.ReactNode, opts?: Omit<MessageOptions, "type" | "content">) => { close: () => void; id: string; }; }; type ProviderProps = { children: React$1.ReactNode; placement?: MessagePlacement; maxCount?: number; }; declare function MessageProvider({ children, placement, maxCount, }: ProviderProps): react_jsx_runtime.JSX.Element; declare function useMessage(): UseMessageApi; type PopoverPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; type PopoverTrigger = 'hover' | 'click' | 'focus' | 'contextmenu' | 'manual'; interface PopoverProps { content: ReactNode; title?: ReactNode; children: ReactNode; trigger?: PopoverTrigger | PopoverTrigger[]; placement?: PopoverPlacement; visible?: boolean; defaultVisible?: boolean; disabled?: boolean; className?: string; overlayClassName?: string; arrowPointAtCenter?: boolean; mouseEnterDelay?: number; mouseLeaveDelay?: number; onVisibleChange?: (visible: boolean) => void; getPopupContainer?: () => HTMLElement; destroyTooltipOnHide?: boolean; autoAdjustOverflow?: boolean; 'aria-label'?: string; id?: string; } declare const Popover: React$1.FC<PopoverProps>; type SelectSize = 'sm' | 'md' | 'lg'; type SelectVariant = 'default' | 'filled' | 'borderless'; interface SelectOption { value: string | number; label: ReactNode; disabled?: boolean; group?: string; icon?: ReactNode; description?: string; } interface SelectProps { value?: string | number | (string | number)[]; defaultValue?: string | number | (string | number)[]; placeholder?: string; disabled?: boolean; loading?: boolean; clearable?: boolean; options: SelectOption[]; multiple?: boolean; maxTagCount?: number; maxTagPlaceholder?: (omittedValues: (string | number)[]) => ReactNode; searchable?: boolean; searchPlaceholder?: string; notFoundContent?: ReactNode; filterOption?: (input: string, option: SelectOption) => boolean; size?: SelectSize; variant?: SelectVariant; className?: string; dropdownClassName?: string; error?: boolean; success?: boolean; onChange?: (value: string | number | (string | number)[], option: SelectOption | SelectOption[]) => void; onSearch?: (value: string) => void; onFocus?: () => void; onBlur?: () => void; onDropdownVisibleChange?: (visible: boolean) => void; dropdownMaxHeight?: number; dropdownMatchSelectWidth?: boolean; getPopupContainer?: () => HTMLElement; 'aria-label'?: string; 'aria-labelledby'?: string; id?: string; } declare const Select: React$1.FC<SelectProps>; interface SenderProps extends React.InputHTMLAttributes<HTMLInputElement> { } declare const Sender: ({ ...props }: SenderProps) => react_jsx_runtime.JSX.Element; type SpinSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'; type SpinType = 'circle' | 'dots' | 'pulse' | 'bars' | 'ring' | 'wave'; interface SpinProps { spinning?: boolean; size?: SpinSize; type?: SpinType; children?: ReactNode; tip?: ReactNode; className?: string; style?: React$1.CSSProperties; wrapperClassName?: string; indicator?: ReactNode; delay?: number; 'aria-label'?: string; id?: string; } declare const Spin: React$1.FC<SpinProps>; type TableSize = 'sm' | 'md' | 'lg'; type SortDirection = 'asc' | 'desc' | null; type TableVariant = 'default' | 'striped' | 'bordered' | 'minimal'; interface TableColumn<T = any> { key: string; title: ReactNode; dataIndex?: keyof T; render?: (value: any, record: T, index: number) => ReactNode; sortable?: boolean; width?: number | string; align?: 'left' | 'center' | 'right'; fixed?: 'left' | 'right'; className?: string; } interface TableProps<T = any> { columns: TableColumn<T>[]; data: T[]; loading?: boolean; size?: TableSize; variant?: TableVariant; bordered?: boolean; striped?: boolean; hoverable?: boolean; sticky?: boolean; rowSelection?: { selectedRowKeys?: React$1.Key[]; onChange?: (selectedRowKeys: React$1.Key[], selectedRows: T[]) => void; getCheckboxProps?: (record: T) => { disabled?: boolean; }; }; sortable?: boolean; defaultSortOrder?: { key: string; direction: SortDirection; }; onSort?: (key: string, direction: SortDirection) => void; pagination?: { current?: number; pageSize?: number; total?: number; showSizeChanger?: boolean; showQuickJumper?: boolean; onChange?: (page: number, pageSize: number) => void; } | false; rowKey?: string | ((record: T) => React$1.Key); onRow?: (record: T, index: number) => React$1.HTMLAttributes<HTMLTableRowElement>; emptyText?: ReactNode; className?: string; scroll?: { x?: number | string; y?: number | string; }; } declare const Table: { <T extends Record<string, any>>({ columns, data, loading, size, variant, bordered, striped, hoverable, sticky, rowSelection, sortable, defaultSortOrder, onSort, pagination, rowKey, onRow, emptyText, className, scroll, }: TableProps<T>): react_jsx_runtime.JSX.Element; displayName: string; }; type UploadType = 'select' | 'drag' | 'avatar'; type UploadListType = 'text' | 'picture' | 'picture-card'; interface UploadFile { uid: string; name: string; status: 'uploading' | 'done' | 'error' | 'removed'; size?: number; type?: string; url?: string; thumbUrl?: string; response?: any; error?: any; percent?: number; originFileObj?: File; } interface UploadProps { accept?: string; multiple?: boolean; disabled?: boolean; directory?: boolean; action?: string | ((file: File) => string | Promise<string>); method?: 'POST' | 'PUT' | 'PATCH'; data?: Record<string, any> | ((file: File) => Record<string, any>); headers?: Record<string, string>; withCredentials?: boolean; fileList?: UploadFile[]; defaultFileList?: UploadFile[]; maxCount?: number; maxSize?: number; type?: UploadType; listType?: UploadListType; showUploadList?: boolean; previewFile?: (file: File) => Promise<string>; children?: ReactNode; className?: string; beforeUpload?: (file: File, fileList: File[]) => boolean | Promise<boolean>; onChange?: (info: { file: UploadFile; fileList: UploadFile[]; }) => void; onPreview?: (file: UploadFile) => void; onRemove?: (file: UploadFile) => boolean | Promise<boolean>; onDrop?: (e: React$1.DragEvent<HTMLDivElement>) => void; customRequest?: (options: { file: File; onProgress: (percent: number) => void; onSuccess: (response: any) => void; onError: (error: any) => void; }) => void; } declare const Upload: React$1.FC<UploadProps>; export { type SelectSize as A, Button as B, Collapse as C, type SelectVariant as D, type SenderProps as E, type SpinProps as F, type SpinSize as G, type SpinType as H, Image as I, type TableProps as J, type TableColumn as K, type TableSize as L, Modal as M, type SortDirection as N, type TableVariant as O, Popover as P, type UploadProps as Q, type UploadFile as R, Select as S, Table as T, Upload as U, type UploadType as V, type UploadListType as W, type CollapsePanelProps as X, type OpenMessage as Y, CollapsePanel as a, MessageProvider as b, Sender as c, Spin as d, type ButtonProps as e, type ButtonVariant as f, type ButtonSize as g, type ButtonShape as h, type CollapseProps as i, type CollapseItem as j, type CollapseSize as k, type CollapseVariant as l, type ImageProps as m, type ImageFit as n, type ImageShape as o, type ModalProps as p, type MessageOptions as q, type MessageType as r, type MessagePlacement as s, type UseMessageApi as t, useMessage as u, type PopoverProps as v, type PopoverPlacement as w, type PopoverTrigger as x, type SelectProps as y, type SelectOption as z };