refactor(tipos): centralizar tipagens em src/tipos

This commit is contained in:
Luiz Silva 2026-01-02 21:24:44 -03:00
parent eb4538f4ba
commit 7c274583ec
8 changed files with 138 additions and 99 deletions

9
src/tipos/botao.ts Normal file
View file

@ -0,0 +1,9 @@
/**
* Tipos do componente EliBotao.
* Mantidos separados do componente para facilitar reuso e padronização.
*/
export type BotaoVariante = "elevated" | "flat" | "outlined" | "text" | "tonal";
export type BotaoTamanho = "x-small" | "small" | "default" | "large";

52
src/tipos/campo.ts Normal file
View file

@ -0,0 +1,52 @@
/**
* Tipos do componente EliInput (campo).
*/
export type CampoValor = string | number | boolean | null;
export type CampoValorMultiplo = CampoValor[];
export type CampoOpcao<TValor extends CampoValor = CampoValor> = {
label: string;
value: TValor;
disabled?: boolean;
};
export type CampoOpcaoBruta<TValor extends CampoValor = CampoValor> =
| TValor
| {
label?: string;
value: TValor;
disabled?: boolean;
};
export type CampoVariante =
| "outlined"
| "filled"
| "plain"
| "solo"
| "solo-filled"
| "solo-inverted"
| "underlined";
export type CampoDensidade = "default" | "comfortable" | "compact";
export type CampoTipoNumerico =
| "numericoInteiro"
| "numericoDecimal"
| "numericoMoeda";
export type CampoTipo =
| "text"
| "password"
| "email"
| "search"
| "url"
| "textarea"
| "radio"
| "checkbox"
| "telefone"
| "cpfCnpj"
| "cep"
| "select"
| CampoTipoNumerico;

4
src/tipos/index.ts Normal file
View file

@ -0,0 +1,4 @@
export * from "./botao";
export * from "./campo";
export * from "./indicador";

29
src/tipos/indicador.ts Normal file
View file

@ -0,0 +1,29 @@
/**
* Tipos do componente EliBadge (indicador).
*/
export type IndicadorLocalizacao =
| "top right"
| "right center"
| "bottom right"
| "top center"
| "bottom center"
| "top left"
| "left center"
| "bottom left";
export type IndicadorOffset =
| "-20"
| "-15"
| "-10"
| "-5"
| "0"
| "20"
| "15"
| "10"
| "5";
export type IndicadorPresetRaio = "suave" | "pill";
export type CssLength = `${number}px` | `${number}rem` | `${number}%` | "0";