@ishtar-sink/vega 0.0.0-stage → 0.1.0

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.
Files changed (55) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +99 -2
  3. package/dist/autocomplete/autocomplete.d.ts +37 -0
  4. package/dist/badge/badge.d.ts +8 -0
  5. package/dist/brand-logo/brand-logo.d.ts +9 -0
  6. package/dist/button/button.d.ts +11 -0
  7. package/dist/calendar/calendar.d.ts +28 -0
  8. package/dist/card/card.d.ts +9 -0
  9. package/dist/checkbox/checkbox.d.ts +6 -0
  10. package/dist/color-field/color-field.d.ts +20 -0
  11. package/dist/color-field/color-picker.d.ts +42 -0
  12. package/dist/color-field/color.d.ts +11 -0
  13. package/dist/confirm-dialog/confirm-dialog.d.ts +15 -0
  14. package/dist/date-field/date-field.d.ts +38 -0
  15. package/dist/date-time-field/date-time-field.d.ts +33 -0
  16. package/dist/dialog/dialog.d.ts +21 -0
  17. package/dist/empty-state/empty-state.d.ts +10 -0
  18. package/dist/error-state/error-state.d.ts +12 -0
  19. package/dist/form-layout/form-layout.d.ts +17 -0
  20. package/dist/icon-button/icon-button.d.ts +10 -0
  21. package/dist/icons/index.d.ts +2 -0
  22. package/dist/icons/view-icons.d.ts +17 -0
  23. package/dist/index.d.ts +75 -0
  24. package/dist/index.js +2917 -0
  25. package/dist/item-swatch/item-swatch.d.ts +10 -0
  26. package/dist/item-swatch/palette.d.ts +6 -0
  27. package/dist/loading-state/loading-state.d.ts +13 -0
  28. package/dist/menu-button/menu-button.d.ts +26 -0
  29. package/dist/money-field/money-field.d.ts +13 -0
  30. package/dist/money-field/money-mask.d.ts +6 -0
  31. package/dist/page-header/page-header.d.ts +20 -0
  32. package/dist/period-field/period-field.d.ts +47 -0
  33. package/dist/period-field/period.d.ts +31 -0
  34. package/dist/progress-bar/progress-bar.d.ts +10 -0
  35. package/dist/segmented-field/segmented-field.d.ts +24 -0
  36. package/dist/select-field/select-field.d.ts +24 -0
  37. package/dist/style.css +2 -0
  38. package/dist/tabs/tabs.d.ts +19 -0
  39. package/dist/tag-field/tag-field.d.ts +20 -0
  40. package/dist/text-field/text-field.d.ts +10 -0
  41. package/dist/theme/contrast.d.ts +16 -0
  42. package/dist/theme/index.d.ts +5 -0
  43. package/dist/theme/theme.d.ts +15 -0
  44. package/dist/theme/tokens.d.ts +138 -0
  45. package/dist/time-field/parse-time.d.ts +4 -0
  46. package/dist/time-field/time-field.d.ts +20 -0
  47. package/dist/toast/toast.d.ts +11 -0
  48. package/dist/tokens.css +166 -0
  49. package/dist/toolbar/toolbar.d.ts +16 -0
  50. package/dist/view-switcher/view-switcher.d.ts +19 -0
  51. package/fonts/OFL-Inter.txt +92 -0
  52. package/fonts/OFL-Outfit.txt +93 -0
  53. package/fonts/inter-variable.woff2 +0 -0
  54. package/fonts/outfit-variable.ttf +0 -0
  55. package/package.json +65 -4
package/README.md CHANGED
@@ -1,3 +1,100 @@
1
- # Temporary Holding Version
1
+ # Vega
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Biblioteca de componentes React e temas do ecossistema [Ishtar Sink](https://github.com/Ishtar-Sink). Todo produto da organização monta a interface com as mesmas peças (botões, campos, diálogos, avisos, abas, cartões) e recebe daqui o tema. O tema do Ishtar Sink é o padrão: quando ele muda aqui, todos os produtos que o usam acompanham na próxima atualização. Quem precisar pode trocar a paleta pela sua.
4
+
5
+ Código aberto (AGPL-3.0) e aberto a qualquer projeto, dentro ou fora do ecossistema.
6
+
7
+ A Vega nasce da extração do `@atria/ui` e do `@atria/theme`, a biblioteca e o tema que o [Atria](https://github.com/Ishtar-Sink/Atria) construiu para a própria interface, e é publicada como `@ishtar-sink/vega`. As mudanças de cada versão estão no [CHANGELOG](CHANGELOG.md).
8
+
9
+ ## Temas
10
+
11
+ - **Tema Ishtar Sink, padrão.** É a paleta das [diretrizes do ecossistema](https://github.com/Ishtar-Sink/.github/blob/main/docs/identidade-ecossistema.md), nos temas claro e escuro, junto com a tipografia (Outfit e Inter), os raios, o espaço e o movimento.
12
+ - **Paleta própria.** Uma aplicação cria o próprio tema com a API de tema da Vega, preenchendo os mesmos tokens (`bg`, `surface`, `primary`, `success`, os `*Soft`…) nos dois temas, e passa esse tema para os componentes. Nenhum componente tem cor fixa.
13
+ - **Contraste verificado.** A Vega traz as verificações de contraste que o tema padrão usa (AA para texto), para que um tema próprio passe pelas mesmas regras nos testes da aplicação.
14
+ - **Troca em tempo de execução.** A camada de marca pode ser sobrescrita sem rebuild, o que permite o white label por instância nos produtos que o oferecem.
15
+
16
+ ## Componentes
17
+
18
+ | Grupo | Componentes e funções |
19
+ |---|---|
20
+ | Ações | `Button`, `IconButton`, `MenuButton` |
21
+ | Campos | `TextField`, `SelectField`, `Checkbox`, `SegmentedField`, `Autocomplete`, `TagField`, `ColorField`, `ColorPicker`, `DEFAULT_COLOR_FIELD_LABELS`, `hexToRgb`, `rgbToHex`, `hslToRgb`, `rgbToHsl` |
22
+ | Data e hora | `Calendar`, `DateField`, `TimeField`, `DateTimeField`, `PeriodField`, `parseTime`, `maskTime`, `resolvePeriod` |
23
+ | Dinheiro | `MoneyField`, `maskMoneyInput`, `parseMoneyInput`, `formatCents` |
24
+ | Estrutura | `Card`, `PageHeader`, `Toolbar`, `Tabs`, `ViewSwitcher`, `FormGrid`, `FormActions` |
25
+ | Diálogos e avisos | `Dialog`, `ConfirmDialog`, `Toast`, `ToastRegion` |
26
+ | Estados | `EmptyState`, `LoadingState`, `Skeleton`, `ErrorState`, `ProgressBar` |
27
+ | Marca e itens | `BrandLogo`, `Badge`, `ItemSwatch`, `ListIcon`, `GridIcon`, `ShelfIcon`, `TableIcon`, `DayIcon`, `TimelineIcon` |
28
+
29
+ Todos os componentes da tabela estão na 0.1.0.
30
+
31
+ ## Princípios
32
+
33
+ - **Uma fonte para a identidade.** Os componentes leem os tokens do tema e não declaram cor, raio, espaço nem fonte próprios.
34
+ - **Acessível por padrão.** Cada componente é testado com axe e com navegação por teclado, e o contraste dos tokens é verificado em AA.
35
+ - **Tema claro e escuro.** Os dois funcionam sem configuração, com o claro como padrão.
36
+ - **Sem dependência de serviço externo.** Fontes e ícones vêm junto com o pacote, nunca de um CDN em tempo de execução.
37
+ - **Nenhum produto do ecossistema recria um componente que já existe aqui.** Se faltar algo, o componente entra na Vega, não no produto.
38
+
39
+ ## Instalação
40
+
41
+ ```bash
42
+ pnpm add @ishtar-sink/vega react react-dom
43
+ ```
44
+
45
+ `react` e `react-dom` `^19.3.1` são peer dependencies.
46
+
47
+ ## Estilos
48
+
49
+ ```ts
50
+ import '@ishtar-sink/vega/tokens.css';
51
+ import '@ishtar-sink/vega/styles.css';
52
+ ```
53
+
54
+ O `tokens.css` traz as variáveis dos dois temas e as fontes; o `styles.css`, o CSS dos componentes. Importe os dois uma vez, na entrada da aplicação, nessa ordem.
55
+
56
+ O tema claro é o padrão. Para o escuro, use `data-theme="dark"` num elemento ancestral, como o `<html>`. A marca pode ser sobrescrita por variáveis como `--primary` num contêiner, sem rebuild.
57
+
58
+ ## Uso
59
+
60
+ ```tsx
61
+ import { Button, Card } from '@ishtar-sink/vega';
62
+
63
+ export function Exemplo() {
64
+ return (
65
+ <Card>
66
+ <Button variant="primary">Salvar</Button>
67
+ </Card>
68
+ );
69
+ }
70
+ ```
71
+
72
+ ## Tema próprio
73
+
74
+ ```ts
75
+ import { dark, defineTheme, light } from '@ishtar-sink/vega';
76
+
77
+ export const meuTema = defineTheme({
78
+ light: { ...light, primary: '#115e59' },
79
+ dark: { ...dark, primary: '#5eead4' },
80
+ });
81
+ ```
82
+
83
+ Um teste da aplicação confere que o tema passa nas mesmas regras de contraste do tema padrão:
84
+
85
+ ```ts
86
+ import { checkThemeContrast } from '@ishtar-sink/vega';
87
+ import { meuTema } from './tema';
88
+
89
+ it('o tema próprio passa no contraste AA', () => {
90
+ expect(checkThemeContrast(meuTema)).toEqual([]);
91
+ });
92
+ ```
93
+
94
+ ## Sobre o nome
95
+
96
+ Vega, a estrela mais brilhante da Lira, é a referência de brilho da astronomia: por séculos, o brilho de todas as outras estrelas foi medido em relação a ela, que é o ponto zero da escala de magnitude. A biblioteca é a referência visual contra a qual todos os produtos do Ishtar Sink se medem, mesmo os que escolhem uma cor própria.
97
+
98
+ ## Licença
99
+
100
+ [AGPL-3.0](LICENSE).
@@ -0,0 +1,37 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export interface AutocompleteOption<T extends string | number> {
3
+ value: T;
4
+ label: string;
5
+ }
6
+ interface AutocompleteBaseProps<T extends string | number> extends Omit<ComponentPropsWithRef<'input'>, 'value' | 'defaultValue' | 'onChange' | 'onBlur' | 'multiple' | 'type' | 'role' | 'children'> {
7
+ /** Rótulo visível do campo. */
8
+ label: string;
9
+ /** Opções da lista. */
10
+ options: readonly AutocompleteOption<T>[];
11
+ /** Texto de ajuda abaixo do campo. */
12
+ help?: string;
13
+ /** Mensagem de erro; aparece com `role="alert"` e marca o campo como inválido. */
14
+ error?: string;
15
+ /** Chamada quando o campo perde o foco com a lista fechada. */
16
+ onBlur?: () => void;
17
+ /** Texto mostrado quando nenhuma opção combina com o que foi digitado; padrão `Nenhuma opção encontrada`. */
18
+ emptyText?: string;
19
+ /** Nome da lista de pílulas, só no modo múltiplo; padrão `{label} escolhidas`. */
20
+ listLabel?: string;
21
+ /** Nome do "×" de cada pílula, só no modo múltiplo; padrão `Remover {opção}`. */
22
+ removeLabel?: (label: string) => string;
23
+ }
24
+ export interface AutocompleteSingleProps<T extends string | number> extends AutocompleteBaseProps<T> {
25
+ multiple?: false;
26
+ value: T | null;
27
+ onChange: (value: T | null) => void;
28
+ }
29
+ export interface AutocompleteMultipleProps<T extends string | number> extends AutocompleteBaseProps<T> {
30
+ multiple: true;
31
+ value: readonly T[];
32
+ onChange: (value: T[]) => void;
33
+ }
34
+ export type AutocompleteProps<T extends string | number> = AutocompleteSingleProps<T> | AutocompleteMultipleProps<T>;
35
+ export declare function Autocomplete<T extends string | number>(props: AutocompleteSingleProps<T>): React.JSX.Element;
36
+ export declare function Autocomplete<T extends string | number>(props: AutocompleteMultipleProps<T>): React.JSX.Element;
37
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export type BadgeTone = 'neutral' | 'primary' | 'accent' | 'success' | 'warning' | 'danger' | 'info';
3
+ export interface BadgeProps extends ComponentPropsWithRef<'span'> {
4
+ /** Tom do selo; o fundo é sempre o *Soft do tom e o texto diz o estado, sem depender só da cor. Padrão: primary. */
5
+ tone?: BadgeTone;
6
+ }
7
+ /** Selo curto de estado ou categoria. */
8
+ export declare function Badge({ tone, className, ...rest }: BadgeProps): import('react').JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ export interface BrandLogoProps extends ComponentPropsWithRef<'div'> {
3
+ /** Nome do produto ao lado da marca, já traduzido por quem usa. */
4
+ name: string;
5
+ /** Desenho da marca (SVG ou imagem), mostrado no quadrado em gradiente; é decorativo, o nome é o texto acessível. */
6
+ mark: ReactNode;
7
+ }
8
+ /** Marca de um produto: quadrado em gradiente com o desenho recebido e o nome em texto com gradiente. */
9
+ export declare function BrandLogo({ name, mark, className, ...rest }: BrandLogoProps): import('react').JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'muted' | 'success';
3
+ export interface ButtonProps extends ComponentPropsWithRef<'button'> {
4
+ /** Variação visual. Padrão: `secondary`. */
5
+ variant?: ButtonVariant;
6
+ /** Mostra o indicador, anuncia `aria-busy` e bloqueia o clique. */
7
+ loading?: boolean;
8
+ /** Cor CSS usada pela variação `muted` (ex.: a cor de uma categoria). */
9
+ tint?: string;
10
+ }
11
+ export declare function Button({ variant, loading, tint, type, disabled, className, style, children, ...rest }: ButtonProps): import('react').JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export interface CalendarValue {
3
+ /** `YYYY-MM-DD` ou `''`. */
4
+ from: string;
5
+ to?: string;
6
+ }
7
+ export interface CalendarLabels {
8
+ previous: string;
9
+ next: string;
10
+ /** Sufixo do dia atual no nome acessível ("hoje"). */
11
+ today: string;
12
+ }
13
+ export interface CalendarProps extends Omit<ComponentPropsWithRef<'div'>, 'onChange' | 'defaultValue'> {
14
+ /** `single` escolhe um dia; `range` escolhe um intervalo com dois cliques. */
15
+ mode: 'single' | 'range';
16
+ /** Mês exibido, `YYYY-MM`. */
17
+ month: string;
18
+ onMonthChange: (month: string) => void;
19
+ value: CalendarValue;
20
+ onChange: (value: CalendarValue) => void;
21
+ /** Dia atual, `YYYY-MM-DD`. */
22
+ today: string;
23
+ /** Locale das datas e dos nomes de mês e dia. Padrão: `pt-BR`. */
24
+ locale?: string;
25
+ /** Textos do calendário; o que faltar usa o padrão em pt-br, qualquer que seja o `locale`. */
26
+ labels?: Partial<CalendarLabels>;
27
+ }
28
+ export declare function Calendar({ mode, month, onMonthChange, value, onChange, today, locale, labels, className, ref, ...rest }: CalendarProps): import('react').JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export type CardTone = 'default' | 'primary' | 'accent' | 'success' | 'warning' | 'danger' | 'info';
3
+ export interface CardProps extends ComponentPropsWithRef<'div'> {
4
+ /** Elemento HTML da raiz. Padrão: `div`. */
5
+ as?: 'div' | 'section' | 'article';
6
+ /** Tom do fundo e da borda. Padrão: `default`. */
7
+ tone?: CardTone;
8
+ }
9
+ export declare function Card({ as: Tag, tone, className, ...rest }: CardProps): import('react').JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export interface CheckboxProps extends Omit<ComponentPropsWithRef<'input'>, 'type'> {
3
+ /** Rótulo visível ao lado da caixa. */
4
+ label: string;
5
+ }
6
+ export declare function Checkbox({ label, id, className, style, ...rest }: CheckboxProps): import('react').JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ import { ColorFieldLabels } from './color-picker';
3
+ export type { ColorFieldLabels } from './color-picker';
4
+ export interface ColorFieldProps extends Omit<ComponentPropsWithRef<'button'>, 'value' | 'defaultValue' | 'onChange' | 'onBlur' | 'children' | 'type'> {
5
+ /** Rótulo visível do campo. */
6
+ label: string;
7
+ /** HEX atual. */
8
+ value: string;
9
+ /** Chamado com o HEX `#RRGGBB` ao aplicar. */
10
+ onChange: (hex: string) => void;
11
+ /** Chamado quando o diálogo fecha. */
12
+ onBlur?: () => void;
13
+ /** Textos do campo e do seletor; os que faltarem usam o padrão em pt-br. */
14
+ labels?: Partial<ColorFieldLabels>;
15
+ /** Mensagem de erro, anunciada com `role="alert"`. */
16
+ error?: string;
17
+ /** Texto de ajuda sob o campo. */
18
+ help?: string;
19
+ }
20
+ export declare function ColorField({ label, value, onChange, onBlur, labels, error, help, id, className, style, ref, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, ...rest }: ColorFieldProps): import('react').JSX.Element;
@@ -0,0 +1,42 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ /** Textos do campo de cor e do seletor. */
3
+ export interface ColorFieldLabels {
4
+ /** Título do diálogo. */
5
+ title: string;
6
+ /** Rótulo do controle de luminosidade. */
7
+ lightness: string;
8
+ /** Rótulo do campo HEX. */
9
+ hex: string;
10
+ /** Legenda do grupo RGB. */
11
+ rgb: string;
12
+ /** Rótulo do canal vermelho. */
13
+ red: string;
14
+ /** Rótulo do canal verde. */
15
+ green: string;
16
+ /** Rótulo do canal azul. */
17
+ blue: string;
18
+ /** Legenda do grupo HSL. */
19
+ hsl: string;
20
+ /** Rótulo do matiz. */
21
+ hue: string;
22
+ /** Rótulo da saturação. */
23
+ saturation: string;
24
+ /** Texto do botão que cancela. */
25
+ cancel: string;
26
+ /** Texto do botão que aplica. */
27
+ apply: string;
28
+ /** Nome da roda de matiz e saturação. */
29
+ wheel: string;
30
+ /** Texto do valor da roda para leitores de tela. */
31
+ wheelValue: (hue: number, saturation: number) => string;
32
+ }
33
+ export declare const DEFAULT_COLOR_FIELD_LABELS: ColorFieldLabels;
34
+ export interface ColorPickerProps extends Omit<ComponentPropsWithRef<'div'>, 'onChange' | 'children' | 'defaultValue'> {
35
+ /** Cor inicial (HEX); o seletor guarda o próprio estado depois disso. */
36
+ value: string;
37
+ /** Chamado com o HEX `#RRGGBB` a cada mudança. */
38
+ onChange: (hex: string) => void;
39
+ /** Textos do seletor; os que faltarem usam o padrão em pt-br. */
40
+ labels?: Partial<ColorFieldLabels>;
41
+ }
42
+ export declare function ColorPicker({ value, onChange, labels, className, style, ...rest }: ColorPickerProps): import('react').JSX.Element;
@@ -0,0 +1,11 @@
1
+ export type Rgb = [number, number, number];
2
+ /** Limita `value` ao intervalo de `min` a `max`. */
3
+ export declare function clamp(value: number, min: number, max: number): number;
4
+ /** Converte HSL (matiz, saturação e luminosidade) em RGB (0 a 255 por canal). */
5
+ export declare function hslToRgb(h: number, s: number, l: number): Rgb;
6
+ /** Converte RGB (0 a 255 por canal) em HSL (matiz, saturação e luminosidade). */
7
+ export declare function rgbToHsl(r: number, g: number, b: number): Rgb;
8
+ /** Converte os canais RGB em `#RRGGBB` maiúsculo. */
9
+ export declare function rgbToHex(rgb: readonly number[]): string;
10
+ /** Aceita 3 ou 6 dígitos, com ou sem `#`; `null` se inválido. */
11
+ export declare function hexToRgb(hex: string): Rgb | null;
@@ -0,0 +1,15 @@
1
+ import { DialogProps } from '../dialog/dialog';
2
+ export interface ConfirmDialogProps extends Omit<DialogProps, 'children' | 'actions' | 'role' | 'onClose'> {
3
+ /** Texto explicativo do corpo, lido como descrição do diálogo. */
4
+ description: string;
5
+ /** Rótulo do botão de confirmar. Padrão: `Confirmar`. */
6
+ confirmLabel?: string;
7
+ /** Rótulo do botão de cancelar. Padrão: `Cancelar`. */
8
+ cancelLabel?: string;
9
+ /** Chamado ao confirmar. */
10
+ onConfirm: () => void;
11
+ /** Chamado ao cancelar ou ao apertar Esc. */
12
+ onCancel: () => void;
13
+ }
14
+ /** Confirmação simples, montada sobre o `Dialog`. */
15
+ export declare function ConfirmDialog({ description, confirmLabel, cancelLabel, onConfirm, onCancel, ...rest }: ConfirmDialogProps): import('react').JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export interface DateFieldLabels {
3
+ /** Texto do gatilho sem data. */
4
+ placeholder: string;
5
+ /** Botão que escolhe o dia atual. */
6
+ today: string;
7
+ /** Botão que limpa a data. */
8
+ clear: string;
9
+ /** Nome do botão do mês anterior. */
10
+ previous: string;
11
+ /** Nome do botão do próximo mês. */
12
+ next: string;
13
+ /** Sufixo do dia atual no nome acessível. */
14
+ todayMarker: string;
15
+ }
16
+ export interface DateFieldProps extends Omit<ComponentPropsWithRef<'button'>, 'onChange' | 'onBlur' | 'value' | 'defaultValue' | 'children' | 'type'> {
17
+ /** Rótulo visível do campo. */
18
+ label: string;
19
+ /** Data no formato `YYYY-MM-DD`, ou `''` quando vazia. */
20
+ value: string;
21
+ /** Chamado com a data escolhida (`YYYY-MM-DD`) ou `''` ao limpar. */
22
+ onChange: (value: string) => void;
23
+ /** Chamado quando o calendário fecha por clique fora, sem escolher. */
24
+ onBlur?: () => void;
25
+ /** Locale das datas. Padrão: `pt-BR`. */
26
+ locale?: string;
27
+ /** Textos do campo; o que faltar usa o padrão em pt-br, qualquer que seja o `locale`. */
28
+ labels?: Partial<DateFieldLabels>;
29
+ /** Dia atual (`YYYY-MM-DD`); padrão: a data do navegador, lida só quando a prop falta. */
30
+ today?: string;
31
+ /** Esconde o rótulo visualmente, mantendo-o para leitores de tela. */
32
+ hideLabel?: boolean;
33
+ /** Texto de ajuda abaixo do campo. */
34
+ help?: string;
35
+ /** Mensagem de erro; aparece com `role="alert"` e marca o campo como inválido. */
36
+ error?: string;
37
+ }
38
+ export declare function DateField({ label, value, onChange, onBlur, locale, labels, today, hideLabel, help, error, id, className, style, ref, ...rest }: DateFieldProps): import('react').JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ import { DateFieldLabels } from '../date-field/date-field';
3
+ export interface DateTimeFieldLabels extends DateFieldLabels {
4
+ /** Nome do campo de data. Padrão: `"<label>: data"`. */
5
+ date: string;
6
+ /** Nome do campo de hora. Padrão: `"<label>: hora (24 horas)"`. */
7
+ time: string;
8
+ /** Texto de exemplo do campo de hora. Padrão: `hh:mm`. */
9
+ timePlaceholder: string;
10
+ }
11
+ export interface DateTimeFieldProps extends Omit<ComponentPropsWithRef<'fieldset'>, 'onChange' | 'onBlur' | 'defaultValue' | 'disabled'> {
12
+ /** Título do grupo; também deriva os nomes das duas partes. */
13
+ label: string;
14
+ /** Data e hora no formato `YYYY-MM-DDTHH:mm`, ou `''` quando vazia. */
15
+ value: string;
16
+ /** Chamado com `YYYY-MM-DDTHH:mm`, ou `''` enquanto falta uma das partes. */
17
+ onChange: (value: string) => void;
18
+ /** Chamado quando uma das partes perde o foco. */
19
+ onBlur?: () => void;
20
+ /** Locale das datas. Padrão: `pt-BR`. */
21
+ locale?: string;
22
+ /** Textos do campo; o que faltar usa o padrão em pt-br, qualquer que seja o `locale`. */
23
+ labels?: Partial<DateTimeFieldLabels>;
24
+ /** Dia atual (`YYYY-MM-DD`); padrão: a data do navegador. */
25
+ today?: string;
26
+ /** Desabilita as duas partes. */
27
+ disabled?: boolean;
28
+ /** Texto de ajuda abaixo do campo. */
29
+ help?: string;
30
+ /** Mensagem de erro; aparece com `role="alert"` no campo de data. */
31
+ error?: string;
32
+ }
33
+ export declare function DateTimeField({ label, value, onChange, onBlur, locale, labels, today, disabled, help, error, className, ...rest }: DateTimeFieldProps): import('react').JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ export interface DialogProps extends Omit<ComponentPropsWithRef<'dialog'>, 'title' | 'open' | 'onClose' | 'role' | 'children'> {
3
+ /** Abre o diálogo como modal (`showModal()`); ao ficar `false`, fecha e devolve o foco. */
4
+ open: boolean;
5
+ /** Título do diálogo, lido como nome acessível. */
6
+ title: string;
7
+ /** Chamado no Esc, no `cancel` nativo e no clique no fundo (se `closeOnBackdrop`). */
8
+ onClose: () => void;
9
+ /** Conteúdo do corpo. */
10
+ children: ReactNode;
11
+ /** Ações do rodapé. */
12
+ actions: ReactNode;
13
+ /** Papel ARIA. Padrão: `dialog`. */
14
+ role?: 'dialog' | 'alertdialog';
15
+ /** Largura máxima. Padrão: `default`. */
16
+ size?: 'default' | 'wide';
17
+ /** Chama `onClose` ao clicar no fundo. Padrão: `false`. */
18
+ closeOnBackdrop?: boolean;
19
+ }
20
+ /** Diálogo modal genérico: corpo, ações no rodapé, foco preso e Esc entregue ao `onClose`. */
21
+ export declare function Dialog({ open, title, onClose, children, actions, role, size, closeOnBackdrop, 'aria-describedby': describedBy, className, ref, ...rest }: DialogProps): import('react').JSX.Element | null;
@@ -0,0 +1,10 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ export interface EmptyStateProps extends Omit<ComponentPropsWithRef<'div'>, 'title'> {
3
+ /** Título do estado vazio. */
4
+ title: string;
5
+ /** Explicação do que fazer ou do porquê de estar vazio. */
6
+ description: string;
7
+ /** Ação principal, como um botão ou link para criar o primeiro item. */
8
+ action?: ReactNode;
9
+ }
10
+ export declare function EmptyState({ title, description, action, className, style, ...rest }: EmptyStateProps): import('react').JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export interface ErrorStateProps extends Omit<ComponentPropsWithRef<'div'>, 'title'> {
3
+ /** Título do erro. */
4
+ title?: string;
5
+ /** Explicação opcional do que aconteceu. */
6
+ description?: string;
7
+ /** Texto do botão de nova tentativa. */
8
+ retryLabel?: string;
9
+ /** Ação de nova tentativa; o botão só aparece quando ela existe. */
10
+ onRetry?: () => void;
11
+ }
12
+ export declare function ErrorState({ title, description, retryLabel, onRetry, className, style, ...rest }: ErrorStateProps): import('react').JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export type FormGridProps = ComponentPropsWithRef<'div'>;
3
+ /** Grade do formulário; um filho com `data-span="full"` ocupa a linha inteira. */
4
+ export declare function FormGrid({ className, ...rest }: FormGridProps): import('react').JSX.Element;
5
+ export interface FormActionsProps extends ComponentPropsWithRef<'div'> {
6
+ /** Texto do botão de cancelar. Padrão: `Cancelar`. */
7
+ cancelLabel?: string;
8
+ /** Texto do botão de enviar. Padrão: `Salvar`. */
9
+ submitLabel?: string;
10
+ /** Chamado ao cancelar. */
11
+ onCancel: () => void;
12
+ /** Mostra o carregamento no botão de enviar e bloqueia o clique. */
13
+ loading?: boolean;
14
+ /** Desabilita o botão de enviar. */
15
+ submitDisabled?: boolean;
16
+ }
17
+ export declare function FormActions({ cancelLabel, submitLabel, onCancel, loading, submitDisabled, className, ...rest }: FormActionsProps): import('react').JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ export interface IconButtonProps extends Omit<ComponentPropsWithRef<'button'>, 'children' | 'aria-label'> {
3
+ /** Nome acessível: obrigatório, porque o botão não tem texto. */
4
+ 'aria-label': string;
5
+ /** Ícone em SVG inline; fica dentro de um `<span aria-hidden="true">`. */
6
+ icon: ReactNode;
7
+ /** Padrão: `ghost`. */
8
+ variant?: 'ghost' | 'secondary';
9
+ }
10
+ export declare function IconButton({ icon, variant, type, className, ...rest }: IconButtonProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { ListIcon, GridIcon, ShelfIcon, TableIcon, DayIcon, TimelineIcon } from './view-icons';
2
+ export type { ViewIconProps } from './view-icons';
@@ -0,0 +1,17 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export interface ViewIconProps extends Omit<ComponentPropsWithRef<'svg'>, 'children'> {
3
+ /** Lado do ícone em pixels. Padrão: 18. */
4
+ size?: number;
5
+ }
6
+ /** Visualização em lista. */
7
+ export declare function ListIcon(props: ViewIconProps): import('react').JSX.Element;
8
+ /** Visualização em grade. */
9
+ export declare function GridIcon(props: ViewIconProps): import('react').JSX.Element;
10
+ /** Visualização em estante. */
11
+ export declare function ShelfIcon(props: ViewIconProps): import('react').JSX.Element;
12
+ /** Visualização em tabela. */
13
+ export declare function TableIcon(props: ViewIconProps): import('react').JSX.Element;
14
+ /** Visualização por dia. */
15
+ export declare function DayIcon(props: ViewIconProps): import('react').JSX.Element;
16
+ /** Visualização em linha do tempo. */
17
+ export declare function TimelineIcon(props: ViewIconProps): import('react').JSX.Element;
@@ -0,0 +1,75 @@
1
+ export { Button } from './button/button';
2
+ export type { ButtonProps, ButtonVariant } from './button/button';
3
+ export { IconButton } from './icon-button/icon-button';
4
+ export type { IconButtonProps } from './icon-button/icon-button';
5
+ export { MenuButton } from './menu-button/menu-button';
6
+ export type { MenuButtonProps, MenuItem } from './menu-button/menu-button';
7
+ export { TextField } from './text-field/text-field';
8
+ export type { TextFieldProps } from './text-field/text-field';
9
+ export { SelectField } from './select-field/select-field';
10
+ export type { SelectFieldProps } from './select-field/select-field';
11
+ export { Checkbox } from './checkbox/checkbox';
12
+ export type { CheckboxProps } from './checkbox/checkbox';
13
+ export { SegmentedField } from './segmented-field/segmented-field';
14
+ export type { SegmentedFieldProps, SegmentedOption } from './segmented-field/segmented-field';
15
+ export { Autocomplete } from './autocomplete/autocomplete';
16
+ export type { AutocompleteProps, AutocompleteOption, AutocompleteSingleProps, AutocompleteMultipleProps, } from './autocomplete/autocomplete';
17
+ export { TagField } from './tag-field/tag-field';
18
+ export type { TagFieldProps } from './tag-field/tag-field';
19
+ export { ColorField } from './color-field/color-field';
20
+ export type { ColorFieldProps } from './color-field/color-field';
21
+ export { ColorPicker, DEFAULT_COLOR_FIELD_LABELS } from './color-field/color-picker';
22
+ export type { ColorFieldLabels, ColorPickerProps } from './color-field/color-picker';
23
+ export { hexToRgb, rgbToHex, hslToRgb, rgbToHsl } from './color-field/color';
24
+ export { Calendar } from './calendar/calendar';
25
+ export type { CalendarProps, CalendarValue, CalendarLabels } from './calendar/calendar';
26
+ export { DateField } from './date-field/date-field';
27
+ export type { DateFieldProps, DateFieldLabels } from './date-field/date-field';
28
+ export { TimeField } from './time-field/time-field';
29
+ export type { TimeFieldProps } from './time-field/time-field';
30
+ export { DateTimeField } from './date-time-field/date-time-field';
31
+ export type { DateTimeFieldProps, DateTimeFieldLabels } from './date-time-field/date-time-field';
32
+ export { PeriodField } from './period-field/period-field';
33
+ export type { PeriodFieldProps, PeriodFieldLabels } from './period-field/period-field';
34
+ export { parseTime, maskTime } from './time-field/parse-time';
35
+ export { resolvePeriod } from './period-field/period';
36
+ export type { PeriodPreset, PeriodRule, PeriodValue, PeriodRange } from './period-field/period';
37
+ export { MoneyField } from './money-field/money-field';
38
+ export type { MoneyFieldProps } from './money-field/money-field';
39
+ export { maskMoneyInput, parseMoneyInput, formatCents } from './money-field/money-mask';
40
+ export { Card } from './card/card';
41
+ export type { CardProps, CardTone } from './card/card';
42
+ export { PageHeader } from './page-header/page-header';
43
+ export type { PageHeaderProps } from './page-header/page-header';
44
+ export { Toolbar } from './toolbar/toolbar';
45
+ export type { ToolbarProps } from './toolbar/toolbar';
46
+ export { Tabs } from './tabs/tabs';
47
+ export type { TabItem, TabsProps } from './tabs/tabs';
48
+ export { ViewSwitcher } from './view-switcher/view-switcher';
49
+ export type { ViewOption, ViewSwitcherProps } from './view-switcher/view-switcher';
50
+ export { FormGrid, FormActions } from './form-layout/form-layout';
51
+ export type { FormGridProps, FormActionsProps } from './form-layout/form-layout';
52
+ export { Dialog } from './dialog/dialog';
53
+ export type { DialogProps } from './dialog/dialog';
54
+ export { ConfirmDialog } from './confirm-dialog/confirm-dialog';
55
+ export type { ConfirmDialogProps } from './confirm-dialog/confirm-dialog';
56
+ export { Toast, ToastRegion } from './toast/toast';
57
+ export type { ToastProps, ToastTone } from './toast/toast';
58
+ export { EmptyState } from './empty-state/empty-state';
59
+ export type { EmptyStateProps } from './empty-state/empty-state';
60
+ export { LoadingState, Skeleton } from './loading-state/loading-state';
61
+ export type { LoadingStateProps, SkeletonProps } from './loading-state/loading-state';
62
+ export { ErrorState } from './error-state/error-state';
63
+ export type { ErrorStateProps } from './error-state/error-state';
64
+ export { ProgressBar } from './progress-bar/progress-bar';
65
+ export type { ProgressBarProps } from './progress-bar/progress-bar';
66
+ export { BrandLogo } from './brand-logo/brand-logo';
67
+ export type { BrandLogoProps } from './brand-logo/brand-logo';
68
+ export { Badge } from './badge/badge';
69
+ export type { BadgeProps, BadgeTone } from './badge/badge';
70
+ export { ItemSwatch } from './item-swatch/item-swatch';
71
+ export type { ItemSwatchProps } from './item-swatch/item-swatch';
72
+ export { ListIcon, GridIcon, ShelfIcon, TableIcon, DayIcon, TimelineIcon } from './icons';
73
+ export type { ViewIconProps } from './icons';
74
+ export { light, dark, radii, space, spacing, fontSizes, fontWeights, lineHeights, zIndices, motion, gradients, fonts, breakpoints, itemPalette, defineTheme, ishtarSinkTheme, contrastRatio, checkThemeContrast, CONTRAST_REQUIREMENTS, } from './theme';
75
+ export type { Theme, ThemeName, ThemeTokens, ContrastRequirement, ContrastViolation, } from './theme';