@aurea-uds/react 0.31.0 → 0.32.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.
- package/README.md +5 -3
- package/dist/actions.d.ts +33 -6
- package/dist/actions.js +38 -26
- package/dist/agents.js +1 -1
- package/dist/calendar.d.ts +38 -1
- package/dist/calendar.js +115 -2
- package/dist/code-client.d.ts +3 -1
- package/dist/code-client.js +23 -1
- package/dist/color.d.ts +92 -0
- package/dist/color.js +293 -0
- package/dist/disclosure.d.ts +19 -9
- package/dist/disclosure.js +8 -1
- package/dist/feedback-client.d.ts +11 -5
- package/dist/feedback-client.js +26 -15
- package/dist/graph-worker.d.ts +1 -0
- package/dist/graph-worker.js +17 -0
- package/dist/graph.d.ts +11 -1
- package/dist/graph.js +214 -19
- package/dist/icon-names.d.ts +7 -1
- package/dist/icon-names.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/inputs-client.d.ts +215 -2
- package/dist/inputs-client.js +504 -8
- package/dist/inputs.d.ts +1 -1
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +4 -0
- package/dist/layout-client.d.ts +14 -2
- package/dist/layout-client.js +2 -2
- package/dist/markup.d.ts +89 -9
- package/dist/markup.js +48 -11
- package/dist/navigation-client.d.ts +31 -7
- package/dist/navigation-client.js +60 -16
- package/dist/overlays.d.ts +20 -6
- package/dist/overlays.js +65 -10
- package/dist/pure.d.ts +20 -0
- package/dist/pure.js +2 -2
- package/dist/system.d.ts +5 -2
- package/dist/system.js +17 -9
- package/package.json +8 -2
package/dist/inputs-client.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { type ButtonHTMLAttributes, type HTMLAttributes, type InputHTMLAttributes, type RefAttributes, type ReactNode } from "react";
|
|
2
2
|
import { type Responsive } from "./pure.js";
|
|
3
|
-
import { type
|
|
3
|
+
import { type ColorChannel, type ColorSpace } from "./color.js";
|
|
4
|
+
import { type ColorSwatchOption, type FieldSize, type FieldVariant } from "./markup.js";
|
|
4
5
|
import { type IconName } from "./system.js";
|
|
5
6
|
export { FileInput, matchesAccept, type FileRejection, type UploadContext, type UploadFn } from "./file-input.js";
|
|
6
7
|
export type FieldOrientation = "vertical" | "horizontal";
|
|
@@ -18,8 +19,11 @@ export interface FieldProps extends HTMLAttributes<HTMLDivElement>, RefAttribute
|
|
|
18
19
|
name?: string;
|
|
19
20
|
orientation?: Responsive<FieldOrientation>;
|
|
20
21
|
labelWidth?: FieldLabelWidth;
|
|
22
|
+
/** 0.32.0, como o `isRequired` da referência: o asterisco vermelho depois do rótulo (escondido do
|
|
23
|
+
* leitor de tela) e o `required` no controle — é ele que anuncia "obrigatório". */
|
|
24
|
+
required?: boolean;
|
|
21
25
|
}
|
|
22
|
-
export declare function Field({ label, hint, description, error, children, className, id, name, orientation, labelWidth, style, ...props }: FieldProps): React.JSX.Element;
|
|
26
|
+
export declare function Field({ label, hint, description, error, children, className, id, name, orientation, labelWidth, style, required, ...props }: FieldProps): React.JSX.Element;
|
|
23
27
|
export declare function Form({ errors, onSubmit, children, className, ...props }: Omit<React.FormHTMLAttributes<HTMLFormElement>, "onSubmit"> & RefAttributes<HTMLFormElement> & {
|
|
24
28
|
errors?: Record<string, string | string[]>;
|
|
25
29
|
onSubmit?: (values: Record<string, unknown>) => void;
|
|
@@ -27,6 +31,8 @@ export declare function Form({ errors, onSubmit, children, className, ...props }
|
|
|
27
31
|
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size">, RefAttributes<HTMLInputElement> {
|
|
28
32
|
formatOnBlur?: (value: string) => string;
|
|
29
33
|
size?: Responsive<FieldSize>;
|
|
34
|
+
/** 0.32.0, a da referência: `secondary` é o fundo neutro, para o campo dentro de um cartão. */
|
|
35
|
+
variant?: FieldVariant;
|
|
30
36
|
}
|
|
31
37
|
export declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & RefAttributes<HTMLInputElement>>;
|
|
32
38
|
export interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "width">, RefAttributes<HTMLInputElement> {
|
|
@@ -56,6 +62,213 @@ export declare function NumberField({ value, defaultValue, onValueChange, min, m
|
|
|
56
62
|
scrubbable?: boolean;
|
|
57
63
|
scrubDirection?: "horizontal" | "vertical";
|
|
58
64
|
}): React.JSX.Element;
|
|
65
|
+
export interface CheckboxGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange">, RefAttributes<HTMLDivElement> {
|
|
66
|
+
label: ReactNode;
|
|
67
|
+
description?: ReactNode;
|
|
68
|
+
error?: ReactNode;
|
|
69
|
+
value?: readonly string[];
|
|
70
|
+
defaultValue?: readonly string[];
|
|
71
|
+
onValueChange?: (value: string[]) => void;
|
|
72
|
+
/** O `name` de todas as caixas, para o formulário. */
|
|
73
|
+
name?: string;
|
|
74
|
+
disabled?: boolean;
|
|
75
|
+
/** O asterisco no rótulo, como o `Field`. */
|
|
76
|
+
required?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export declare function CheckboxGroup({ label, description, error, value, defaultValue, onValueChange, name, disabled, required, children, className, ...props }: CheckboxGroupProps): React.JSX.Element;
|
|
79
|
+
export interface ListBoxItem {
|
|
80
|
+
id: string;
|
|
81
|
+
label: ReactNode;
|
|
82
|
+
/** O texto que a busca pela letra lê, quando o `label` não é texto. */
|
|
83
|
+
textValue?: string;
|
|
84
|
+
description?: ReactNode;
|
|
85
|
+
icon?: IconName;
|
|
86
|
+
disabled?: boolean;
|
|
87
|
+
/** O item de perigo ("Excluir"), na cor de perigo. */
|
|
88
|
+
danger?: boolean;
|
|
89
|
+
}
|
|
90
|
+
export interface ListBoxSection {
|
|
91
|
+
title: ReactNode;
|
|
92
|
+
items: readonly ListBoxItem[];
|
|
93
|
+
}
|
|
94
|
+
export type ListBoxSelectionMode = "none" | "single" | "multiple";
|
|
95
|
+
export interface ListBoxProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {
|
|
96
|
+
/** O nome da lista para o leitor de tela. */
|
|
97
|
+
label: string;
|
|
98
|
+
items: readonly (ListBoxItem | ListBoxSection)[];
|
|
99
|
+
selectionMode?: ListBoxSelectionMode;
|
|
100
|
+
value?: readonly string[];
|
|
101
|
+
defaultValue?: readonly string[];
|
|
102
|
+
onValueChange?: (value: string[]) => void;
|
|
103
|
+
/** Sem escolha: o item foi ativado (Enter, Espaço ou clique). */
|
|
104
|
+
onAction?: (id: string) => void;
|
|
105
|
+
}
|
|
106
|
+
export declare function ListBox({ label, items, selectionMode, value, defaultValue, onValueChange, onAction, className, ...props }: ListBoxProps): React.JSX.Element;
|
|
107
|
+
export type TagGroupSelectionMode = "none" | "single" | "multiple";
|
|
108
|
+
export type TagSize = "sm" | "md" | "lg";
|
|
109
|
+
export type TagVariant = "default" | "surface";
|
|
110
|
+
export interface TagItem {
|
|
111
|
+
id: string;
|
|
112
|
+
label: ReactNode;
|
|
113
|
+
/** O texto do nome do X ("Remover Design"), quando o `label` não é texto. */
|
|
114
|
+
textValue?: string;
|
|
115
|
+
icon?: IconName;
|
|
116
|
+
disabled?: boolean;
|
|
117
|
+
}
|
|
118
|
+
export interface TagGroupProps {
|
|
119
|
+
/** O nome do grupo. `labelHidden` o tira da tela e deixa para o leitor de tela. */
|
|
120
|
+
label: ReactNode;
|
|
121
|
+
labelHidden?: boolean;
|
|
122
|
+
description?: ReactNode;
|
|
123
|
+
errorMessage?: ReactNode;
|
|
124
|
+
items: readonly TagItem[];
|
|
125
|
+
selectionMode?: TagGroupSelectionMode;
|
|
126
|
+
selectedKeys?: readonly string[];
|
|
127
|
+
defaultSelectedKeys?: readonly string[];
|
|
128
|
+
onSelectionChange?: (keys: string[]) => void;
|
|
129
|
+
/** Com ele, cada etiqueta ganha o X, e Delete/Backspace tiram a ativa. */
|
|
130
|
+
onRemove?: (ids: string[]) => void;
|
|
131
|
+
size?: TagSize;
|
|
132
|
+
variant?: TagVariant;
|
|
133
|
+
className?: string;
|
|
134
|
+
id?: string;
|
|
135
|
+
}
|
|
136
|
+
export declare function TagGroup({ label, labelHidden, description, errorMessage, items, selectionMode, selectedKeys, defaultSelectedKeys, onSelectionChange, onRemove, size, variant, className, id }: TagGroupProps): React.JSX.Element;
|
|
137
|
+
export type SliderOrientation = "horizontal" | "vertical";
|
|
138
|
+
/** O que os dois modos do Slider têm em comum (o número e a cor). É a base que o leitor da API segue em
|
|
139
|
+
* `base & (a | b)` — com a união sozinha, ele não acha prop nenhuma (medido no `ColorSwatch`, 13/10/2026). */
|
|
140
|
+
export interface SliderBase {
|
|
141
|
+
/** O rótulo. Obrigatório: é o nome das alças. `labelHidden` o tira da tela e deixa para o leitor de tela. */
|
|
142
|
+
label: ReactNode;
|
|
143
|
+
labelHidden?: boolean;
|
|
144
|
+
orientation?: SliderOrientation;
|
|
145
|
+
disabled?: boolean;
|
|
146
|
+
name?: string;
|
|
147
|
+
/** Mostrar o valor ao lado do rótulo. Padrão: sim. */
|
|
148
|
+
showValue?: boolean;
|
|
149
|
+
className?: string;
|
|
150
|
+
id?: string;
|
|
151
|
+
}
|
|
152
|
+
export interface SliderProps<V extends number | readonly number[] = number | readonly number[]> extends SliderBase {
|
|
153
|
+
value?: V;
|
|
154
|
+
defaultValue?: V;
|
|
155
|
+
/** Chamado a cada passo, com o número (ou a lista, na faixa). */
|
|
156
|
+
onValueChange?: (value: V) => void;
|
|
157
|
+
/** Chamado ao soltar a alça — o momento de salvar. */
|
|
158
|
+
onValueCommitted?: (value: V) => void;
|
|
159
|
+
min?: number;
|
|
160
|
+
max?: number;
|
|
161
|
+
step?: number;
|
|
162
|
+
/** O passo do Page Up/Down e do Shift + seta. */
|
|
163
|
+
largeStep?: number;
|
|
164
|
+
format?: Intl.NumberFormatOptions;
|
|
165
|
+
locale?: string;
|
|
166
|
+
/** Com dois valores, o nome de cada alça, na ordem ("Mínimo", "Máximo"). */
|
|
167
|
+
thumbLabels?: readonly string[];
|
|
168
|
+
channel?: undefined;
|
|
169
|
+
}
|
|
170
|
+
/** A TRILHA DE COR (0.32.0, ADR-0069), variação deste mesmo Slider: com `channel`, ele anda num canal da cor — e o
|
|
171
|
+
* valor passa a ser a COR (hex), como na referência, para várias trilhas repartirem a mesma. */
|
|
172
|
+
export interface SliderColorProps extends SliderBase {
|
|
173
|
+
/** O canal: `hue`, `saturation`, `brightness`, `lightness`, `red`, `green`, `blue` ou `alpha`. */
|
|
174
|
+
channel: ColorChannel;
|
|
175
|
+
/** O espaço de `hue` e `saturation` (`hsb` ou `hsl`); os outros canais já dizem o deles. Padrão: `hsb`. */
|
|
176
|
+
colorSpace?: ColorSpace;
|
|
177
|
+
/** A cor, em hex ou `rgb()`/`hsl()`/`hsb()`. Controlado. */
|
|
178
|
+
value?: string;
|
|
179
|
+
defaultValue?: string;
|
|
180
|
+
/** Chamado a cada passo, com o hex (`#rrggbb`, ou `#rrggbbaa` com transparência). */
|
|
181
|
+
onValueChange?: (value: string) => void;
|
|
182
|
+
/** Chamado ao soltar — o momento de salvar. */
|
|
183
|
+
onValueCommitted?: (value: string) => void;
|
|
184
|
+
}
|
|
185
|
+
export declare function Slider<V extends number | readonly number[]>(props: SliderBase & (SliderProps<V> | SliderColorProps)): React.JSX.Element;
|
|
186
|
+
export interface ColorAreaProps {
|
|
187
|
+
/** A cor, em hex ou `rgb()`/`hsl()`/`hsb()`. Controlado. */
|
|
188
|
+
value?: string;
|
|
189
|
+
/** A cor de partida quando você não controla. Padrão: branco. */
|
|
190
|
+
defaultValue?: string;
|
|
191
|
+
/** Chamado a cada passo, com o hex (`#rrggbb`, ou `#rrggbbaa` com transparência). */
|
|
192
|
+
onValueChange?: (value: string) => void;
|
|
193
|
+
/** Chamado ao soltar o ponteiro e a cada tecla — o momento de salvar. */
|
|
194
|
+
onValueCommitted?: (value: string) => void;
|
|
195
|
+
/** O espaço de cor da área: `hsb` (o padrão), `hsl` ou `rgb`. */
|
|
196
|
+
colorSpace?: ColorSpace;
|
|
197
|
+
/** O canal do eixo de lado. Padrão: saturação (HSB e HSL) ou vermelho (RGB). A área não tem alfa. */
|
|
198
|
+
xChannel?: Exclude<ColorChannel, "alpha">;
|
|
199
|
+
/** O canal do eixo de cima. Padrão: brilho (HSB), luminosidade (HSL) ou verde (RGB). */
|
|
200
|
+
yChannel?: Exclude<ColorChannel, "alpha">;
|
|
201
|
+
/** Pontinhos por cima da área, como na referência — ajudam a ver a posição. */
|
|
202
|
+
showDots?: boolean;
|
|
203
|
+
disabled?: boolean;
|
|
204
|
+
/** Vai no formulário como hex. */
|
|
205
|
+
name?: string;
|
|
206
|
+
id?: string;
|
|
207
|
+
className?: string;
|
|
208
|
+
"aria-label"?: string;
|
|
209
|
+
"aria-labelledby"?: string;
|
|
210
|
+
"aria-describedby"?: string;
|
|
211
|
+
}
|
|
212
|
+
export declare function ColorArea({ value, defaultValue, onValueChange, onValueCommitted, colorSpace, xChannel, yChannel, ...resto }: ColorAreaProps): React.JSX.Element;
|
|
213
|
+
export interface ColorFieldProps {
|
|
214
|
+
/** A cor, em hex ou `rgb()`/`hsl()`/`hsb()`; `""` é o campo vazio. Controlado. */
|
|
215
|
+
value?: string;
|
|
216
|
+
/** A cor de partida quando você não controla. Sem ela, o campo começa vazio. */
|
|
217
|
+
defaultValue?: string;
|
|
218
|
+
/** Chamado ao confirmar (Enter ou sair do campo) e a cada tecla no canal, com o hex — ou `""`, ao limpar. */
|
|
219
|
+
onValueChange?: (value: string) => void;
|
|
220
|
+
/** Chamado junto do `onValueChange` — o momento de salvar. */
|
|
221
|
+
onValueCommitted?: (value: string) => void;
|
|
222
|
+
/** Um canal só, no lugar do código: `hue`, `saturation`, `brightness`, `lightness`, `red`, `green`, `blue`, `alpha`. */
|
|
223
|
+
channel?: ColorChannel;
|
|
224
|
+
/** O espaço de `hue` e `saturation` no modo canal (`hsb` ou `hsl`). Padrão: `hsb`. */
|
|
225
|
+
colorSpace?: ColorSpace;
|
|
226
|
+
/** A amostra na frente. Padrão: sim no código, não no canal. */
|
|
227
|
+
swatch?: boolean;
|
|
228
|
+
size?: Responsive<FieldSize>;
|
|
229
|
+
/** `secondary` é o fundo neutro, para o campo dentro de um cartão (o mesmo do `Input`). */
|
|
230
|
+
variant?: FieldVariant;
|
|
231
|
+
/** A largura do campo — `"20rem"` ou `"auto"`. Sem ela, 100% da linha, como os outros campos. */
|
|
232
|
+
width?: string;
|
|
233
|
+
disabled?: boolean;
|
|
234
|
+
readOnly?: boolean;
|
|
235
|
+
required?: boolean;
|
|
236
|
+
/** Vai no formulário como hex. */
|
|
237
|
+
name?: string;
|
|
238
|
+
placeholder?: string;
|
|
239
|
+
id?: string;
|
|
240
|
+
className?: string;
|
|
241
|
+
"aria-label"?: string;
|
|
242
|
+
"aria-labelledby"?: string;
|
|
243
|
+
"aria-describedby"?: string;
|
|
244
|
+
"aria-invalid"?: boolean | "true" | "false";
|
|
245
|
+
}
|
|
246
|
+
export declare function ColorField({ value, defaultValue, onValueChange, onValueCommitted, channel, colorSpace, swatch, size, variant, width, disabled, readOnly, required, name, placeholder, id, className, ...aria }: ColorFieldProps): React.JSX.Element;
|
|
247
|
+
export interface ColorPickerProps {
|
|
248
|
+
/** O nome, ao lado da amostra no gatilho ("Cor da marca"). Nomeia o gatilho e a janela. */
|
|
249
|
+
label: string;
|
|
250
|
+
/** A cor, em hex ou `rgb()`/`hsl()`/`hsb()`. Controlado. */
|
|
251
|
+
value?: string;
|
|
252
|
+
/** A cor de partida quando você não controla. Padrão: branco. */
|
|
253
|
+
defaultValue?: string;
|
|
254
|
+
/** Chamado a cada passo, com o hex (`#rrggbb`, ou `#rrggbbaa` com transparência). */
|
|
255
|
+
onValueChange?: (value: string) => void;
|
|
256
|
+
/** Chamado ao soltar, a cada tecla, ao escolher uma amostra e ao confirmar o código — o momento de salvar. */
|
|
257
|
+
onValueCommitted?: (value: string) => void;
|
|
258
|
+
/** Cores prontas, embaixo da trilha; com `variant="swatches"`, no lugar da área. Hex ou `{color, label}`. */
|
|
259
|
+
swatches?: readonly (string | ColorSwatchOption)[];
|
|
260
|
+
/** `"swatches"`: a paleta fechada — só as amostras e o campo do código. Padrão: `"full"`. */
|
|
261
|
+
variant?: "full" | "swatches";
|
|
262
|
+
/** O conteúdo da janela, montado por quem usa (no lugar do padrão): `ColorArea`, `Slider` com `channel`,
|
|
263
|
+
* `ColorField` e o que mais couber. As peças de cor sem valor próprio usam a cor do seletor. */
|
|
264
|
+
children?: ReactNode;
|
|
265
|
+
disabled?: boolean;
|
|
266
|
+
/** Vai no formulário como hex. */
|
|
267
|
+
name?: string;
|
|
268
|
+
id?: string;
|
|
269
|
+
className?: string;
|
|
270
|
+
}
|
|
271
|
+
export declare function ColorPicker({ label, value, defaultValue, onValueChange, onValueCommitted, swatches, variant, children, disabled, name, id, className }: ColorPickerProps): React.JSX.Element;
|
|
59
272
|
export declare function OTPField({ length, value, defaultValue, onValueChange, mask, disabled, required, label, id, className }: {
|
|
60
273
|
length: number;
|
|
61
274
|
value?: string;
|