bbdb68a6de
Esta commit conteudo a estrutura atomica completa:
- types: Result<T,E>, AsyncState<T>, Paginated<T>, SortConfig<T>
- utils: date, str, num, cn, debounce, throttle, storage, arr, obj
- validators: Zod schemas — email, password, uuid, url, phone, CPF/CNPJ, sanitizedStr, safeParse
- hooks: useToggle, useAsync, useDebounce, useLocalStorage, useMedia, useInterval, useOnClickOutside, useClipboard, useFetch
- components: Button, Input, Alert, Card, Spinner (atomic design pattern)
- build: tsup v8 ESM+CJS + DTS + sourcemaps — 0 erros
- tests: 57 testes 100% usuarios
- docker: multi-stage Dockerfile (node 20-alpine)
- config: vitest, tsup, tsconfig strict, .npmignore
Filosofia atomica:/utils ← /types ← /validators ← /hooks ← /components
Build: npm run build | Test: npm test | Publish: npm publish
🤖 Generated with Pulse (openclaw + nova-self-improver)
47 lines
1.7 KiB
TypeScript
47 lines
1.7 KiB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
export { cn } from '../utils/index.js';
|
|
|
|
/**
|
|
* 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 };
|