0889ee9117
feat(hooks): add useLiveStream generic WebSocket hook - supports websocket/sse/polling transports - exponential backoff reconnect with jitter - circular buffer with configurable size - typed filter callback per use case - manual disconnect + reconnect + error state feat(hooks): add useLiveMetrics derived hook - sliding time-window cut - moving average (configurable window) - current / avg / min / max / ratePerSecond - zero allocations per tick (memoized) feat(charts): add LiveMetricChart molecule (Recharts) - line + area variants, grid + tooltip - moving-average overlay (dashed) - ConnectionStatus atom in header - status bar + compact mode - 100% responsive, GPU via SVG ViewBox feat(atoms): add ConnectionStatus indicator - 5 states: disconnected/connecting/connected/reconnecting/error - animated pulse, JetBrains Mono, pill style - exported helpers: formatLatency / formatBytes docs(pkg): bump v0.1.0 → v0.2.0, add recharts peerDep
47 lines
1.7 KiB
TypeScript
Executable File
47 lines
1.7 KiB
TypeScript
Executable File
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
export { cn } from '../utils/index.mjs';
|
|
|
|
/**
|
|
* Componentes atômicos — Receptor de className sempre no topo,
|
|
* spread de props SEMPRE por último.
|
|
*/
|
|
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger' | 'success';
|
|
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
variant?: ButtonVariant;
|
|
size?: ButtonSize;
|
|
loading?: boolean;
|
|
leftIcon?: React.ReactNode;
|
|
rightIcon?: React.ReactNode;
|
|
}
|
|
declare function Button({ className, variant, size, loading, leftIcon, rightIcon, children, disabled, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
label?: string;
|
|
error?: string;
|
|
hint?: string;
|
|
}
|
|
declare function Input({ className, label, error, hint, id, ...rest }: InputProps): react_jsx_runtime.JSX.Element;
|
|
type AlertVariant = 'info' | 'success' | 'warning' | 'error';
|
|
interface AlertProps {
|
|
variant?: AlertVariant;
|
|
title?: string;
|
|
children: React.ReactNode;
|
|
onClose?: () => void;
|
|
}
|
|
declare function Alert({ variant, title, children, onClose }: AlertProps): react_jsx_runtime.JSX.Element;
|
|
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
children: React.ReactNode;
|
|
}
|
|
declare const Card: React.FC<CardProps>;
|
|
declare const CardHeader: React.FC<CardProps>;
|
|
declare const CardTitle: React.FC<{
|
|
children: React.ReactNode;
|
|
}>;
|
|
declare const CardBody: React.FC<CardProps>;
|
|
declare function Spinner({ size, className }: {
|
|
size?: number;
|
|
className?: string;
|
|
}): react_jsx_runtime.JSX.Element;
|
|
|
|
export { Alert, Button, Card, CardBody, CardHeader, CardTitle, Input, Spinner };
|