@nextelco/common-ui 2.1.89 → 2.1.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +1 -1
- package/dist/style.css +1 -1
- package/dist/style.layered.css +1 -1
- package/dist/types/components/atoms/Button/variants/IconButton.d.ts +3 -2
- package/dist/types/components/atoms/Button/variants/MainButton.d.ts +3 -2
- package/dist/types/components/atoms/Icone/Icone.d.ts +29 -0
- package/dist/types/components/atoms/InputData/InputData.d.ts +31 -0
- package/dist/types/components/molecules/BarraValor/BarraValor.d.ts +25 -0
- package/dist/types/components/molecules/SeletorPesquisa/SeletorPesquisa.d.ts +45 -0
- package/dist/types/exports/atoms.d.ts +4 -0
- package/dist/types/exports/molecules.d.ts +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Lista de barras horizontais — a forma mais legível de comparar poucas
|
|
4
|
+
* dezenas de valores (horas por pessoa, por plano, por etiqueta).
|
|
5
|
+
*
|
|
6
|
+
* Não é um gráfico: não traz eixos, escalas nem biblioteca de charts. A barra é
|
|
7
|
+
* proporcional ao maior valor da lista, que é o que se quer para comparar
|
|
8
|
+
* grandezas entre linhas.
|
|
9
|
+
*/
|
|
10
|
+
export interface LinhaBarra {
|
|
11
|
+
chave: string;
|
|
12
|
+
rotulo: string;
|
|
13
|
+
valor: number;
|
|
14
|
+
/** O que aparece à direita (ex: "3h20"). Sem isto mostra o número cru. */
|
|
15
|
+
texto?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface BarraValorProps {
|
|
18
|
+
linhas: LinhaBarra[];
|
|
19
|
+
/** Máximo da escala. Sem isto usa o maior valor da lista. */
|
|
20
|
+
maximo?: number;
|
|
21
|
+
/** Classe de cor da barra. */
|
|
22
|
+
cor?: string;
|
|
23
|
+
vazio?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export default function BarraValor({ linhas, maximo, cor, vazio, }: BarraValorProps): React.JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Seletor com pesquisa, para listas grandes vindas de outro sistema.
|
|
4
|
+
*
|
|
5
|
+
* Difere do `SearchSelect` em três coisas que o tornavam inutilizável nesses
|
|
6
|
+
* casos: cada opção pode ter uma **segunda linha** (contexto — projeto, cliente,
|
|
7
|
+
* plano), a pesquisa corre sobre esse contexto e não só sobre o título, e pode
|
|
8
|
+
* aceitar **texto livre** quando o que a pessoa quer não está na lista.
|
|
9
|
+
*
|
|
10
|
+
* Fecha ao clicar fora e com Escape. Parece detalhe, mas dentro de um modal uma
|
|
11
|
+
* lista que não fecha tapa o resto do formulário.
|
|
12
|
+
*/
|
|
13
|
+
export interface OpcaoPesquisa {
|
|
14
|
+
valor: string;
|
|
15
|
+
titulo: string;
|
|
16
|
+
/** Segunda linha: contexto que distingue homónimos. Também é pesquisável. */
|
|
17
|
+
contexto?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface SeletorPesquisaProps {
|
|
20
|
+
opcoes: OpcaoPesquisa[];
|
|
21
|
+
/** Opção escolhida (`valor`), ou null. */
|
|
22
|
+
valor: string | null;
|
|
23
|
+
onChange: (valor: string | null) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Permite escolher o que foi escrito, mesmo sem estar na lista. Recebe o
|
|
26
|
+
* texto; quem usa decide o que fazer com ele.
|
|
27
|
+
*/
|
|
28
|
+
onTextoLivre?: (texto: string) => void;
|
|
29
|
+
aCarregar?: boolean;
|
|
30
|
+
erro?: boolean;
|
|
31
|
+
/** Máximo de opções mostradas — listas longas tornam o painel inútil. */
|
|
32
|
+
maximo?: number;
|
|
33
|
+
labels: {
|
|
34
|
+
placeholder: string;
|
|
35
|
+
semResultados: string;
|
|
36
|
+
aCarregar: string;
|
|
37
|
+
erro: string;
|
|
38
|
+
limpar: string;
|
|
39
|
+
/** Recebe o texto escrito, ex: `Registar sem tarefa: "{texto}"`. */
|
|
40
|
+
textoLivre?: (texto: string) => string;
|
|
41
|
+
};
|
|
42
|
+
/** Ícone opcional à esquerda do campo. */
|
|
43
|
+
icone?: ReactNode;
|
|
44
|
+
}
|
|
45
|
+
export default function SeletorPesquisa({ opcoes, valor, onChange, onTextoLivre, aCarregar, erro, maximo, labels, icone, }: SeletorPesquisaProps): React.JSX.Element;
|
|
@@ -13,3 +13,7 @@ export { default as MainButton } from '../components/atoms/Button/variants/MainB
|
|
|
13
13
|
export { default as Stack } from '../components/atoms/Stack/Stack';
|
|
14
14
|
export { default as Tooltip } from '../components/atoms/Tooltip/Tooltip';
|
|
15
15
|
export { default as Input } from '../components/atoms/Input/Input';
|
|
16
|
+
export { default as Icone } from '../components/atoms/Icone/Icone';
|
|
17
|
+
export type { IconeQualquer } from '../components/atoms/Icone/Icone';
|
|
18
|
+
export { InputData, InputHora } from '../components/atoms/InputData/InputData';
|
|
19
|
+
export type { InputDataProps, InputHoraProps } from '../components/atoms/InputData/InputData';
|
|
@@ -14,3 +14,7 @@ export { default as FileDropzone } from '../components/molecules/FileDropzone/Fi
|
|
|
14
14
|
export type { FileDropzoneProps, FileDropzoneLabels } from '../components/molecules/FileDropzone/FileDropzone';
|
|
15
15
|
export { default as LanguageSwitcher } from '../components/molecules/LanguageSwitcher/LanguageSwitcher';
|
|
16
16
|
export type { LanguageSwitcherProps, Idioma } from '../components/molecules/LanguageSwitcher/LanguageSwitcher';
|
|
17
|
+
export { default as SeletorPesquisa } from '../components/molecules/SeletorPesquisa/SeletorPesquisa';
|
|
18
|
+
export type { SeletorPesquisaProps, OpcaoPesquisa } from '../components/molecules/SeletorPesquisa/SeletorPesquisa';
|
|
19
|
+
export { default as BarraValor } from '../components/molecules/BarraValor/BarraValor';
|
|
20
|
+
export type { BarraValorProps, LinhaBarra } from '../components/molecules/BarraValor/BarraValor';
|