@aurea-uds/native 0.69.0 → 0.71.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/dist/actions.js +23 -10
- package/dist/contraste.js +5 -1
- package/dist/feedback.d.ts +2 -1
- package/dist/feedback.js +6 -4
- package/dist/inputs.d.ts +20 -3
- package/dist/inputs.js +12 -7
- package/dist/layout.js +31 -12
- package/dist/menu.js +5 -4
- package/dist/navigation.d.ts +3 -1
- package/dist/navigation.js +56 -19
- package/dist/rolagem.d.ts +4 -1
- package/dist/rolagem.js +2 -2
- package/dist/text.js +5 -2
- package/dist/theme.d.ts +13 -1
- package/dist/theme.js +36 -5
- package/dist/toast.d.ts +1 -1
- package/package.json +2 -2
package/dist/actions.js
CHANGED
|
@@ -22,10 +22,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
22
22
|
// do Lote 3. Aparência sem consumidor é a ADR-0034 ("ter a variante não é usar").
|
|
23
23
|
import * as React from "react";
|
|
24
24
|
import { AccessibilityInfo, Platform, Pressable, Share, View } from "react-native";
|
|
25
|
-
import { brilhoDoBotao, canto, comOpacidade, criarFolha, fioDoAcabamento, misturaOpaca, preenchimento, REACAO_AO_TOQUE, estadoAcessivel } from "./estilos.js";
|
|
25
|
+
import { aroDoEstilo, brilhoDoBotao, canto, comOpacidade, criarFolha, fioDoAcabamento, misturaOpaca, preenchimento, REACAO_AO_TOQUE, estadoAcessivel } from "./estilos.js";
|
|
26
26
|
import { Icon } from "./icon.js";
|
|
27
27
|
import { Text } from "./text.js";
|
|
28
|
-
import { AvisosContext, useAureaStrings, useAureaTheme, useAureaTokens, useSobreAMarca } from "./theme.js";
|
|
28
|
+
import { AvisosContext, useAltoContraste, useAureaStrings, useAureaTheme, useAureaTokens, useSobreAMarca } from "./theme.js";
|
|
29
29
|
const MEDIDA = {
|
|
30
30
|
xs: (s) => ({ altura: s.controlHSm, recheio: s.space3, vao: s.space1 + s.space05 }),
|
|
31
31
|
sm: (s) => ({ altura: s.touchControlHSm, recheio: s.space3 + s.space05, vao: s.space1 + s.space05 }),
|
|
@@ -220,19 +220,30 @@ export function Button(props) {
|
|
|
220
220
|
}
|
|
221
221
|
/** Os acabamentos (ADR-0086) do `Button` e do `IconButton`: o brilho só no principal, o fio só no de fundo suave. A marca
|
|
222
222
|
* no navegador (`dataSet`) é a mesma da web (`data-glow`, `data-ring`), e a varredura do site reconhece o fio. */
|
|
223
|
-
function acabamentoDoBotao(t, glow, ring, appearance, tone, disabled, corDoTexto) {
|
|
223
|
+
function acabamentoDoBotao(t, glow, ring, appearance, tone, disabled, corDoTexto, alto = false) {
|
|
224
224
|
const comBrilho = !!glow && appearance === "solid" && tone === "brand" && !disabled;
|
|
225
225
|
const comFio = !!ring && appearance === "outline";
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
// O ALTO CONTRASTE do app (0-D, ADR-0090, a forma "C"): o contorno do botão POR DENTRO (o aro, nunca borda) — o
|
|
227
|
+
// `primaryForeground` no principal, o `inputStrong` nos outros, como a web (`[data-contrast="high"] .btn`).
|
|
228
|
+
const anel = alto ? aroDoEstilo(t, appearance === "solid" && tone === "brand" ? t.color.primaryForeground : t.color.inputStrong, 1) : null;
|
|
229
|
+
const acabamento = comBrilho || comFio || anel
|
|
230
|
+
? { boxShadow: [...(comBrilho ? [brilhoDoBotao(t)] : []), ...(comFio ? [fioDoAcabamento(t, tone, corDoTexto)] : []), ...(anel ? [anel] : [])] }
|
|
228
231
|
: null;
|
|
229
|
-
|
|
230
|
-
|
|
232
|
+
// `aureaContrast`: a marca do aro do alto contraste no navegador, que a varredura do site reconhece (0.70.0).
|
|
233
|
+
const marcaDoAcabamento = glow !== undefined || ring !== undefined || anel
|
|
234
|
+
? { dataSet: { ...(glow !== undefined ? { glow: String(glow) } : null), ...(ring !== undefined ? { ring: String(ring) } : null),
|
|
235
|
+
...(anel ? { aureaContrast: "high" } : null) } }
|
|
231
236
|
: {};
|
|
232
237
|
return { acabamento, marcaDoAcabamento };
|
|
233
238
|
}
|
|
234
239
|
/** O corpo do `Button`. `semRecuo` é só do `LinkButton`: sem recuo, sem borda e sem altura. */
|
|
235
|
-
function CorpoDoBotao({ children, appearance
|
|
240
|
+
function CorpoDoBotao({ children, appearance: aparenciaPedida, tone: tomPedido, size = "md", leadingIcon, trailingIcon, leading, trailing, icons, fullWidth = false, pressed, disabled, accessibilityLabel, semRecuo = false, share, glow, ring, onPress, ...rest }) {
|
|
241
|
+
// 0.71.0 (o D3, como a web e a referência): sem `appearance` nem `tone`, o botão é o principal (cheio, na marca). Quem
|
|
242
|
+
// pede um dos eixos continua com o outro no de antes (cheio, neutro) — `appearance="ghost"` sozinho não vira amarelo.
|
|
243
|
+
const appearance = aparenciaPedida ?? "solid";
|
|
244
|
+
// O botão de ligar (`pressed`) sem tom continua neutro, como na web: o estado não pinta o botão aqui, e o principal
|
|
245
|
+
// ligado e desligado seriam iguais.
|
|
246
|
+
const tone = tomPedido ?? (aparenciaPedida === undefined && pressed === undefined ? "brand" : "neutral");
|
|
236
247
|
const t = useAureaTokens();
|
|
237
248
|
const aoTocar = useToqueComShare(share, onPress);
|
|
238
249
|
const s = folha(t);
|
|
@@ -260,7 +271,8 @@ function CorpoDoBotao({ children, appearance = "solid", tone = "neutral", size =
|
|
|
260
271
|
...(semRecuo ? { height: undefined, paddingHorizontal: 0, borderWidth: 0 } : null),
|
|
261
272
|
}), [medida.altura, medida.recheio, medida.vao, appearance, cor.solido, cor.contorno, corDaBorda, semRecuo, marca, tone, t]);
|
|
262
273
|
const corDoTexto = appearance === "solid" ? cor.texto : corDaLetra(t, tone, appearance, marca, cor.sobre);
|
|
263
|
-
const
|
|
274
|
+
const alto = useAltoContraste();
|
|
275
|
+
const { acabamento, marcaDoAcabamento } = acabamentoDoBotao(t, glow, ring, appearance, tone, disabled, corDoTexto, alto && !semRecuo);
|
|
264
276
|
return (_jsx(Pressable, { disabled: disabled, onPress: aoTocar, accessibilityRole: "button", accessibilityLabel: accessibilityLabel, ...estadoAcessivel({ disabled: !!disabled, pressed }), style: ({ pressed: tocando }) => [
|
|
265
277
|
s.alvo, fullWidth && s.alvoLargura,
|
|
266
278
|
tocando && s.pressionado, disabled && s.inerte,
|
|
@@ -320,7 +332,8 @@ function BotaoDeIcone({ name, label, appearance = "ghost", tone = "neutral", siz
|
|
|
320
332
|
// O círculo tem a altura do botão do mesmo tamanho (o só-ícone da referência: `aspect-ratio: 1`).
|
|
321
333
|
const lado = MEDIDA[size](t.size).altura;
|
|
322
334
|
const corDaLetraDoIcone = corDoIcone && !marca ? corDoIcone : appearance === "solid" ? cor.texto : corDaLetra(t, tone, appearance, marca, cor.sobre);
|
|
323
|
-
const
|
|
335
|
+
const alto = useAltoContraste();
|
|
336
|
+
const { acabamento, marcaDoAcabamento } = acabamentoDoBotao(t, glow, ring, appearance, tone, disabled, corDaLetraDoIcone, alto);
|
|
324
337
|
const caixa = React.useMemo(() => ({
|
|
325
338
|
height: lado, width: lado, paddingHorizontal: 0,
|
|
326
339
|
...canto(t.size.radiusControl),
|
package/dist/contraste.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
// O pacote aceita o React Native desde a 0.76: se a função não existir na versão do app, a resposta é "não", sem erro.
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { AccessibilityInfo, Platform } from "react-native";
|
|
15
|
+
import { useAltoContraste } from "./theme.js";
|
|
15
16
|
const midia = () => globalThis.matchMedia;
|
|
16
17
|
/**
|
|
17
18
|
* `true` quando a pessoa pediu mais contraste ao sistema. Começa em `false` e muda quando o sistema responde (a pergunta
|
|
@@ -44,5 +45,8 @@ export function useMaisContraste() {
|
|
|
44
45
|
const inscricao = AccessibilityInfo.addEventListener(evento, setMais);
|
|
45
46
|
return () => { vivo = false; inscricao?.remove?.(); };
|
|
46
47
|
}, []);
|
|
47
|
-
|
|
48
|
+
// O alto contraste do APP (`highContrast` no `AureaProvider`, 0-D, 14/11/2026) faz tudo o que o do sistema faz (a
|
|
49
|
+
// forma "C" da ADR-0090 começa pelo "aumentar contraste"): o contorno dos campos, as marcas na tinta, o foco no grafite.
|
|
50
|
+
const doApp = useAltoContraste();
|
|
51
|
+
return mais || doApp;
|
|
48
52
|
}
|
package/dist/feedback.d.ts
CHANGED
|
@@ -115,7 +115,8 @@ export interface ProgressProps {
|
|
|
115
115
|
* ele não corre: a barra inteira, apagada, e nunca um pedaço parado, que leria como 40% feito.
|
|
116
116
|
*/
|
|
117
117
|
export declare function Progress({ value, label, detail, tone, style, testID }: ProgressProps): React.JSX.Element;
|
|
118
|
-
|
|
118
|
+
/** `neutral` (0.71.0, o D3, como a web e a referência): o ícone na cor do texto. É o padrão sem `variant` nem `state`. */
|
|
119
|
+
export type AureaAlertVariant = "neutral" | "info" | "success" | "warning" | "danger";
|
|
119
120
|
/** Mesmos quatro glifos do `feedback-client.tsx:43`. */
|
|
120
121
|
export declare const ICONE_DA_VARIANTE: Readonly<Record<AureaAlertVariant, IconName>>;
|
|
121
122
|
export interface AlertProps extends ViewProps {
|
package/dist/feedback.js
CHANGED
|
@@ -279,6 +279,7 @@ export function Progress({ value, label, detail, tone = "brand", style, testID }
|
|
|
279
279
|
}
|
|
280
280
|
/** Mesmos quatro glifos do `feedback-client.tsx:43`. */
|
|
281
281
|
export const ICONE_DA_VARIANTE = {
|
|
282
|
+
neutral: "info",
|
|
282
283
|
info: "info",
|
|
283
284
|
success: "check-circle",
|
|
284
285
|
warning: "warning",
|
|
@@ -307,18 +308,19 @@ accessibilityLabel, accessibilityHint, ...rest }) {
|
|
|
307
308
|
const t = useAureaTokens();
|
|
308
309
|
const s = folha(t);
|
|
309
310
|
const strings = useAureaStrings();
|
|
310
|
-
const v = variant ?? (state ? gravidadeDoEstado(state) : "
|
|
311
|
+
const v = variant ?? (state ? gravidadeDoEstado(state) : "neutral");
|
|
311
312
|
const corDoIcone = v === "success" ? (t.color.success400 ?? t.color.success)
|
|
312
313
|
: v === "warning" ? (t.color.warning400 ?? t.color.warning)
|
|
313
314
|
: v === "danger" ? (t.color.danger400 ?? t.color.destructive)
|
|
314
|
-
:
|
|
315
|
+
: v === "neutral" ? t.color.foreground
|
|
316
|
+
: (t.color.info400 ?? t.color.info);
|
|
315
317
|
return (_jsxs(View
|
|
316
318
|
// Android: a região viva é o que faz o leitor falar sem foco, e ela cobre a moldura
|
|
317
319
|
// inteira de propósito — o que muda é o conteúdo, e o "X" some junto quando o aviso fecha.
|
|
318
320
|
, {
|
|
319
321
|
// Android: a região viva é o que faz o leitor falar sem foco, e ela cobre a moldura
|
|
320
322
|
// inteira de propósito — o que muda é o conteúdo, e o "X" some junto quando o aviso fecha.
|
|
321
|
-
accessibilityLiveRegion: v === "danger" ? "assertive" : "polite", style: [s.alerta, style], ...rest, children: [_jsxs(View, { accessible: true, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, ...(v === "danger" ? { accessibilityRole: "alert" } : null), style: s.grupoDoAlerta, children: [_jsx(Icon, { name: icon ?? ICONE_DA_VARIANTE[v], size: "md", color: corDoIcone, weight: icon ? undefined : "fill" }), _jsxs(View, { style: s.corpoDoAlerta, children: [title != null && _jsx(Text, { size: "base", weight: 500, tone: v, children: title }), children != null
|
|
323
|
+
accessibilityLiveRegion: v === "danger" ? "assertive" : "polite", style: [s.alerta, style], ...rest, children: [_jsxs(View, { accessible: true, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, ...(v === "danger" ? { accessibilityRole: "alert" } : null), style: s.grupoDoAlerta, children: [_jsx(Icon, { name: icon ?? ICONE_DA_VARIANTE[v], size: "md", color: corDoIcone, weight: icon ? undefined : "fill" }), _jsxs(View, { style: s.corpoDoAlerta, children: [title != null && _jsx(Text, { size: "base", weight: 500, tone: v === "neutral" ? undefined : v, children: title }), children != null
|
|
322
324
|
? (typeof children === "string" ? _jsx(Text, { size: "xs", tone: "muted", children: children }) : children)
|
|
323
325
|
: state ? _jsx(Text, { size: "xs", tone: "muted", children: strings.universalState[state] }) : null] })] }), onDismiss ? _jsx(CloseButton, { label: strings.close, onPress: onDismiss }) : null] }));
|
|
324
326
|
}
|
|
@@ -366,7 +368,7 @@ export function DataState({ catchErrors, onCatch, ...props }) {
|
|
|
366
368
|
const strings = useAureaStrings();
|
|
367
369
|
if (!catchErrors)
|
|
368
370
|
return _jsx(CorpoDoDataState, { ...props });
|
|
369
|
-
return (_jsx(BarreiraDeErro, { onCatch: onCatch, falha: (tentar) => (_jsxs(View, { style: [s.regiao, props.style], children: [_jsx(Alert, { variant: "danger", children: props.message ?? strings.dataCrashed }), _jsx(View, { style: { alignSelf: "flex-start" }, children: _jsx(Button, { size: "sm", onPress: tentar, children: strings.dataRetry }) })] })), children: _jsx(CorpoDoDataState, { ...props }) }));
|
|
371
|
+
return (_jsx(BarreiraDeErro, { onCatch: onCatch, falha: (tentar) => (_jsxs(View, { style: [s.regiao, props.style], children: [_jsx(Alert, { variant: "danger", children: props.message ?? strings.dataCrashed }), _jsx(View, { style: { alignSelf: "flex-start" }, children: _jsx(Button, { tone: "neutral", size: "sm", onPress: tentar, children: strings.dataRetry }) })] })), children: _jsx(CorpoDoDataState, { ...props }) }));
|
|
370
372
|
}
|
|
371
373
|
function CorpoDoDataState({ state, message, skeleton, emptyTitle, emptyIcon, action, children, style, ...rest }) {
|
|
372
374
|
const t = useAureaTokens();
|
package/dist/inputs.d.ts
CHANGED
|
@@ -31,6 +31,12 @@ export interface FieldProps extends ViewProps {
|
|
|
31
31
|
error?: React.ReactNode;
|
|
32
32
|
disabled?: boolean;
|
|
33
33
|
size?: AureaFieldSize;
|
|
34
|
+
/**
|
|
35
|
+
* Obrigatório (14/11/2026, o "Input do nativo (b)" — a web já tinha): o asterisco no rótulo, na cor da frase de erro,
|
|
36
|
+
* como na web. ⚠ O asterisco é desenho: no aparelho não existe o estado "obrigatório" para o leitor de tela (o
|
|
37
|
+
* React Native não tem o `aria-required` nem um `accessibilityState` para isso), como na referência do celular.
|
|
38
|
+
*/
|
|
39
|
+
required?: boolean;
|
|
34
40
|
children?: React.ReactNode;
|
|
35
41
|
}
|
|
36
42
|
/**
|
|
@@ -50,7 +56,7 @@ export interface FieldProps extends ViewProps {
|
|
|
50
56
|
* grade de `12rem`; num telefone de 360dp isso deixa o controle com menos de metade da largura.
|
|
51
57
|
* Volta quando houver alvo de tela larga — tablet é outro lote.
|
|
52
58
|
*/
|
|
53
|
-
export declare function Field({ label, hint, error, disabled, size, children, style, ...rest }: FieldProps): React.JSX.Element;
|
|
59
|
+
export declare function Field({ label, hint, error, disabled, size, required, children, style, ...rest }: FieldProps): React.JSX.Element;
|
|
54
60
|
export interface LabelProps extends ViewProps {
|
|
55
61
|
children?: React.ReactNode;
|
|
56
62
|
/** O que vai à direita — contagem de caracteres, "opcional". */
|
|
@@ -129,6 +135,17 @@ export interface InputProps extends Omit<TextInputProps, "style" | "editable" |
|
|
|
129
135
|
onFocus?: () => void;
|
|
130
136
|
/** Várias linhas. É o que o `Textarea` liga — raramente se põe à mão. */
|
|
131
137
|
multiline?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* O jeito do campo (14/11/2026, o "Input do nativo (a)" — o mesmo nome e os mesmos valores da web): `secondary` é o
|
|
140
|
+
* campo no cinza do `secondary`, sem a sombra, para pôr sobre um cartão. O padrão, `primary`, não muda (e continua
|
|
141
|
+
* escolhendo sozinho o fundo pela superfície, ADR-0078).
|
|
142
|
+
*/
|
|
143
|
+
variant?: "primary" | "secondary";
|
|
144
|
+
/**
|
|
145
|
+
* Inválido no próprio campo (14/11/2026, o "Input do nativo (c)"): `false` desmente o `Field` com erro em volta (o
|
|
146
|
+
* campo que está certo dentro de um grupo com erro); `true` marca sem `Field`. Sem a prop, vale o do `Field`.
|
|
147
|
+
*/
|
|
148
|
+
invalid?: boolean;
|
|
132
149
|
style?: StyleProp<TextStyle>;
|
|
133
150
|
testID?: string;
|
|
134
151
|
}
|
|
@@ -139,7 +156,7 @@ export interface InputProps extends Omit<TextInputProps, "style" | "editable" |
|
|
|
139
156
|
* (`aurea.css:686`); **não há ponteiro no telefone**. O foco continua existindo e é o que marca o
|
|
140
157
|
* campo ativo.
|
|
141
158
|
*/
|
|
142
|
-
export declare function Input({ value, defaultValue, onChangeText, placeholder, disabled, size, keyboardType, secureTextEntry, autoCapitalize, formatOnBlur, onBlur, onFocus, multiline, style, testID, ...rest }: InputProps): React.JSX.Element;
|
|
159
|
+
export declare function Input({ value, defaultValue, onChangeText, placeholder, disabled, size, keyboardType, secureTextEntry, autoCapitalize, formatOnBlur, onBlur, onFocus, multiline, variant, invalid, style, testID, ...rest }: InputProps): React.JSX.Element;
|
|
143
160
|
export interface TextareaProps extends InputProps {
|
|
144
161
|
/** Linhas visíveis. Vira altura mínima, porque no RN não há `rows`. */
|
|
145
162
|
rows?: number;
|
|
@@ -212,7 +229,7 @@ export declare function InputGroupAddon({ children, style, testID, ...rest }: In
|
|
|
212
229
|
* padrão, e numa senha isso é o erro de digitação mais caro que existe: o campo está escondido,
|
|
213
230
|
* então ninguém vê o que deu errado.
|
|
214
231
|
*/
|
|
215
|
-
export interface PasswordFieldProps extends Omit<InputProps, "secureTextEntry" | "multiline" | "keyboardType"> {
|
|
232
|
+
export interface PasswordFieldProps extends Omit<InputProps, "secureTextEntry" | "multiline" | "keyboardType" | "variant" | "invalid"> {
|
|
216
233
|
/** Começa visível. Padrão: escondida. */
|
|
217
234
|
defaultVisible?: boolean;
|
|
218
235
|
/**
|
package/dist/inputs.js
CHANGED
|
@@ -196,7 +196,7 @@ export function useGrupoDeCampo() {
|
|
|
196
196
|
* grade de `12rem`; num telefone de 360dp isso deixa o controle com menos de metade da largura.
|
|
197
197
|
* Volta quando houver alvo de tela larga — tablet é outro lote.
|
|
198
198
|
*/
|
|
199
|
-
export function Field({ label, hint, error, disabled, size = "md", children, style, ...rest }) {
|
|
199
|
+
export function Field({ label, hint, error, disabled, size = "md", required, children, style, ...rest }) {
|
|
200
200
|
const t = useAureaTokens();
|
|
201
201
|
const s = folha(t);
|
|
202
202
|
const invalido = error != null && error !== false;
|
|
@@ -207,7 +207,7 @@ export function Field({ label, hint, error, disabled, size = "md", children, sty
|
|
|
207
207
|
hint: invalido && typeof error === "string" ? error : typeof hint === "string" ? hint : undefined,
|
|
208
208
|
invalido, disabled, size,
|
|
209
209
|
}), [label, hint, error, invalido, disabled, size]);
|
|
210
|
-
return (_jsx(CampoCtx.Provider, { value: ctx, children: _jsxs(View, { style: [s.campo, style], ...rest, children: [label != null && _jsx(Label, { children: invalido && typeof label === "string" && !(React.isValidElement(children) && children.type === Switch)
|
|
210
|
+
return (_jsx(CampoCtx.Provider, { value: ctx, children: _jsxs(View, { style: [s.campo, style], ...rest, children: [label != null && _jsx(Label, { trailing: required ? (_jsx(Text, { size: "sm", weight: 500, tone: "danger", style: { marginStart: t.size.space05 }, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", children: "*" })) : undefined, children: invalido && typeof label === "string" && !(React.isValidElement(children) && children.type === Switch)
|
|
211
211
|
? _jsx(Text, { size: "sm", weight: 500, tone: "danger", children: label }) : label }), children, hint != null && !invalido && (typeof hint === "string"
|
|
212
212
|
? _jsx(Text, { size: "xs", tone: "muted", children: hint }) : hint), invalido && (typeof error === "string"
|
|
213
213
|
? _jsx(Text, { size: "xs", tone: "danger", children: error }) : error)] }) }));
|
|
@@ -231,7 +231,7 @@ export function Label({ children, trailing, style, ...rest }) {
|
|
|
231
231
|
* (`aurea.css:686`); **não há ponteiro no telefone**. O foco continua existindo e é o que marca o
|
|
232
232
|
* campo ativo.
|
|
233
233
|
*/
|
|
234
|
-
export function Input({ value, defaultValue, onChangeText, placeholder, disabled, size, keyboardType, secureTextEntry, autoCapitalize, formatOnBlur, onBlur, onFocus, multiline, style, testID,
|
|
234
|
+
export function Input({ value, defaultValue, onChangeText, placeholder, disabled, size, keyboardType, secureTextEntry, autoCapitalize, formatOnBlur, onBlur, onFocus, multiline, variant, invalid, style, testID,
|
|
235
235
|
// ⚠ O `...rest` NÃO é enfeite: sem ele, toda prop do `TextInput` que a lista acima não nomeia
|
|
236
236
|
// era descartada em silêncio — `autoComplete`, `textContentType`, `autoCorrect`,
|
|
237
237
|
// `returnKeyType`, `onSubmitEditing`, `maxLength`. Defeito publicado na `0.8.2`.
|
|
@@ -246,6 +246,7 @@ export function Input({ value, defaultValue, onChangeText, placeholder, disabled
|
|
|
246
246
|
const grupo = useGrupoDeCampo();
|
|
247
247
|
const tam = size ?? grupo?.size ?? campo?.size ?? "md";
|
|
248
248
|
const inativo = disabled ?? grupo?.disabled ?? campo?.disabled;
|
|
249
|
+
const invalido = invalid ?? campo?.invalido;
|
|
249
250
|
const [focado, setFocado] = React.useState(false);
|
|
250
251
|
return (_jsx(TextInput
|
|
251
252
|
// O resto vem PRIMEIRO de propósito: o que a Aurea calcula (respiro, cor, nome do `Field`,
|
|
@@ -266,13 +267,17 @@ export function Input({ value, defaultValue, onChangeText, placeholder, disabled
|
|
|
266
267
|
},
|
|
267
268
|
// O nome e a dica vêm do `Field` — ver o bloco acima sobre por que a ligação da web não
|
|
268
269
|
// atravessa. Sem isto, o campo é um nó anônimo para o leitor de tela.
|
|
269
|
-
accessibilityLabel: campo?.label, accessibilityHint: campo?.hint, ...estadoAcessivel({ disabled: !!inativo }), "aria-invalid":
|
|
270
|
+
accessibilityLabel: campo?.label, accessibilityHint: campo?.hint, ...estadoAcessivel({ disabled: !!inativo }), "aria-invalid": invalido,
|
|
271
|
+
// A cor do texto escolhido (14/11/2026, o "Input do nativo (d)"): a mesma do `::selection` da web.
|
|
272
|
+
selectionColor: t.color.selection, style: [
|
|
270
273
|
// DENTRO DE UM GRUPO o campo não desenha caixa nenhuma: borda, fundo, altura, respiro,
|
|
271
274
|
// inválido, foco e desabilitado passam a ser do grupo. Manter qualquer um dos dois
|
|
272
275
|
// desenhando daria borda dentro de borda — que é exatamente o defeito que o `.input-group
|
|
273
276
|
// > .input` da web zera à mão (`aurea.css:751`).
|
|
274
277
|
grupo ? s.campoNoGrupo : s.caixa,
|
|
275
278
|
!grupo && fundoDeCampo(t, naSuperficie, maisContraste),
|
|
279
|
+
// `secondary`: o cinza do `.input-secondary` da web, sem a sombra do campo branco.
|
|
280
|
+
!grupo && variant === "secondary" && { backgroundColor: t.color.secondary, boxShadow: [] },
|
|
276
281
|
grupo
|
|
277
282
|
? { fontSize: fonteDoTamanho(t, tam), fontFamily: t.font.ui[400], color: t.color.foreground }
|
|
278
283
|
: { height: alturaDoTamanho(t, tam), paddingHorizontal: respiroDoTamanho(t, tam),
|
|
@@ -293,12 +298,12 @@ export function Input({ value, defaultValue, onChangeText, placeholder, disabled
|
|
|
293
298
|
// deixa o `EditText` no topo. `center` é o que reproduz a web — e o `Textarea` o
|
|
294
299
|
// sobrescreve para `top`, que é o que uma caixa alta faz nos dois lados.
|
|
295
300
|
paddingVertical: 0, textAlignVertical: "center" },
|
|
296
|
-
!grupo &&
|
|
301
|
+
!grupo && invalido && s.invalido,
|
|
297
302
|
// O foco é o único estado que sobra do trio da web (hover/focus/active), e ele importa
|
|
298
303
|
// mais aqui: no telefone é a única pista de qual campo o teclado está alimentando.
|
|
299
304
|
// Com 2 de espessura, como o anel da web (0.55.0); o recheio desconta o pixel a mais — `bordaDeFoco`.
|
|
300
305
|
!grupo && focado && bordaDeFoco(t, maisContraste, respiroDoTamanho(t, tam)),
|
|
301
|
-
!grupo && focado &&
|
|
306
|
+
!grupo && focado && invalido && s.invalido, // ADR-0094: focado, o erro continua vermelho (como o anel vermelho da web).
|
|
302
307
|
// 🔴 DENTRO DO CARTÃO DA MARCA A TINTA VENCE TUDO — inclusive inválido e foco, e isso é
|
|
303
308
|
// medição, não preferência (os números estão no `usePeleSobreAMarca`): sobre o amarelo a
|
|
304
309
|
// borda de inválido mede **1,86** e o `focusStrong` do tema ESCURO mede **1,00**, porque
|
|
@@ -652,7 +657,7 @@ export function SegmentedControl({ items, value, onChange, label, disabled, just
|
|
|
652
657
|
* arquivo, não do pacote — e é função, não componente, para não contar como peça nova. ⚠ Pede o
|
|
653
658
|
* `check` no registro de ícones do app; sem ele, o aviso de desenvolvimento do `Icon` diz o import.
|
|
654
659
|
*/
|
|
655
|
-
export const indicadorDaEscolhida = (t) => (_jsx(View, { style: folha(t).indicador, children: _jsx(Icon, { name: "check", size: "sm", color: t.color.
|
|
660
|
+
export const indicadorDaEscolhida = (t) => (_jsx(View, { style: folha(t).indicador, children: _jsx(Icon, { name: "check", size: "sm", color: t.color.mutedForeground }) }));
|
|
656
661
|
/**
|
|
657
662
|
* A escolha de um de muitos.
|
|
658
663
|
*
|
package/dist/layout.js
CHANGED
|
@@ -20,7 +20,7 @@ import { Pressable, StyleSheet, View } from "react-native";
|
|
|
20
20
|
import { canto, comOpacidade, criarFolha, peleDoCartao, peleDoCartaoEscolhido, REACAO_AO_TOQUE, estadoAcessivel } from "./estilos.js";
|
|
21
21
|
import { NaSuperficie } from "./superficie.js";
|
|
22
22
|
import { Text } from "./text.js";
|
|
23
|
-
import { useAureaTheme, useAureaTokens, SobreAMarca, TemaDentro } from "./theme.js";
|
|
23
|
+
import { useAltoContraste, useAureaTheme, useAureaTokens, SobreAMarca, TemaDentro } from "./theme.js";
|
|
24
24
|
const folha = criarFolha((t) => ({
|
|
25
25
|
// A LINHA DO SISTEMA, e os números são os mesmos do `.separator` da web (`aurea.css`): cor de
|
|
26
26
|
// `border` e espessura de UM pixel. ⚠ Um pixel não sai de `--space-*` de propósito — a linha
|
|
@@ -63,17 +63,27 @@ const folha = criarFolha((t) => ({
|
|
|
63
63
|
contrasteNoEscuro: { borderColor: "transparent" },
|
|
64
64
|
// MT-02 (ADR-0063): o traço no topo. Uma borda mais grossa só em cima, com o canto 22, desenha
|
|
65
65
|
// errado no Android (react-native#51926, fechada sem conserto em 24/03/2026: a borda sai do
|
|
66
|
-
// contorno e deixa vão). Então o traço
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
//
|
|
66
|
+
// contorno e deixa vão). Então o traço mora numa camada que se recorta no canto do cartão, por cima
|
|
67
|
+
// da borda de 1. A camada cobre a CAIXA DA BORDA (deslocada de `borderWidth` para fora), e o recheio
|
|
68
|
+
// de cima cresce o que o traço come, para o conteúdo ficar onde fica na web.
|
|
69
|
+
// PV-12 (o Victor, 14/11/2026, *"A, nativo igual à web"*): o traço é o ARCO da web — a sombra por dentro
|
|
70
|
+
// (`box-shadow: inset 0 4px`) desce pela curva do canto e afina até sumir nos lados. Antes, aqui, era
|
|
71
|
+
// uma faixa reta cortada pela curva. O arco sai de um ARO de borda UNIFORME (o Android desenha certo
|
|
72
|
+
// a borda de largura igual; o defeito é só a de larguras diferentes): a borda de dentro do aro é o
|
|
73
|
+
// contorno do próprio cartão deslocado `accentWidth` para baixo (canto de dentro = canto de fora −
|
|
74
|
+
// largura = `radiusCard`), e a camada recorta o resto. Não depende do fundo do cartão — vale no
|
|
75
|
+
// `outline`, que é transparente.
|
|
70
76
|
comTraco: { paddingTop: t.size.cardPad + t.size.accentWidth - t.size.borderWidth },
|
|
71
77
|
tracoCamada: {
|
|
72
78
|
position: "absolute", top: -t.size.borderWidth, left: -t.size.borderWidth,
|
|
73
79
|
right: -t.size.borderWidth, bottom: -t.size.borderWidth,
|
|
74
80
|
...canto(t.size.radiusCard), overflow: "hidden",
|
|
75
81
|
},
|
|
76
|
-
traco: {
|
|
82
|
+
traco: {
|
|
83
|
+
position: "absolute", top: t.size.accentWidth - t.size.radiusCard, left: -t.size.radiusCard,
|
|
84
|
+
right: -t.size.radiusCard, bottom: -t.size.radiusCard * 2,
|
|
85
|
+
borderWidth: t.size.radiusCard, ...canto(t.size.radiusCard * 2),
|
|
86
|
+
},
|
|
77
87
|
// A ação fica embaixo, separada pelo mesmo respiro que o resto da casa usa entre blocos.
|
|
78
88
|
acaoDaMarca: { marginTop: t.size.space3 },
|
|
79
89
|
}));
|
|
@@ -238,8 +248,15 @@ const COR_DO_TRACO = {
|
|
|
238
248
|
};
|
|
239
249
|
// O cartão de contorno é a ÚNICA peça com linha (ADR-0072). No navegador (`react-native-web`), a marca `data-aurea-card`
|
|
240
250
|
// diz isso à varredura "nenhuma peça desenha linha" do site, como a classe `.card-outline` diz na web; no aparelho a prop
|
|
241
|
-
// `dataSet` não existe e é ignorada (bloco 1, 23/10/2026).
|
|
242
|
-
|
|
251
|
+
// `dataSet` não existe e é ignorada (bloco 1, 23/10/2026). A marca sai de `marcaDoCartao`, abaixo.
|
|
252
|
+
// As duas linhas do cartão que a 0.70.0 trouxe, aprovadas pelo Victor (14/11/2026), com a marca do navegador que a
|
|
253
|
+
// varredura do site reconhece: o traço do `accent` (um aro na curva do canto) e o contorno do alto contraste.
|
|
254
|
+
const MARCA_DO_TRACO = { dataSet: { aureaAccent: "true" } };
|
|
255
|
+
function marcaDoCartao(outline, alto) {
|
|
256
|
+
if (!outline && !alto)
|
|
257
|
+
return null;
|
|
258
|
+
return { dataSet: { ...(outline ? { aureaCard: "outline" } : null), ...(alto ? { aureaContrast: "high" } : null) } };
|
|
259
|
+
}
|
|
243
260
|
function CorpoDoCartao({ variant, accent, style, ...rest }) {
|
|
244
261
|
const t = useAureaTokens();
|
|
245
262
|
const { theme: temaDoApp } = useAureaTheme();
|
|
@@ -247,17 +264,19 @@ function CorpoDoCartao({ variant, accent, style, ...rest }) {
|
|
|
247
264
|
const { action, children, onPress, disabled, ...resto } = rest;
|
|
248
265
|
// O contorno do `contrast` olha o tema do APP: dentro do cartão os tokens já são os do escuro.
|
|
249
266
|
const contorno = variant === "contrast" && temaDoApp === "dark" ? s.contrasteNoEscuro : null;
|
|
250
|
-
|
|
267
|
+
// O ALTO CONTRASTE do app (0-D, ADR-0090, a forma "C"): o contorno de 3:1 no cartão, como a web (`[data-contrast="high"] .card`).
|
|
268
|
+
const altoContraste = useAltoContraste() ? { borderColor: t.color.inputStrong } : null;
|
|
269
|
+
const traco = accent == null ? null : (_jsx(View, { pointerEvents: "none", collapsable: false, style: s.tracoCamada, children: _jsx(View, { style: [s.traco, { borderColor: t.color[COR_DO_TRACO[accent]] }], ...MARCA_DO_TRACO }) }));
|
|
251
270
|
if (onPress != null) {
|
|
252
271
|
const pele = variant ?? "interactive";
|
|
253
272
|
return (_jsxs(Pressable, { onPress: onPress, disabled: disabled, accessibilityRole: "button", ...estadoAcessivel({ disabled: !!disabled }), style: ({ pressed: tocando }) => [
|
|
254
|
-
s.cardBase, s[`card_${pele}`], contorno, traco != null && s.comTraco,
|
|
273
|
+
s.cardBase, s[`card_${pele}`], contorno, altoContraste, traco != null && s.comTraco,
|
|
255
274
|
tocando && REACAO_AO_TOQUE.pressionado, disabled && REACAO_AO_TOQUE.inerte,
|
|
256
275
|
style,
|
|
257
|
-
], ...(pele === "outline"
|
|
276
|
+
], ...marcaDoCartao(pele === "outline", altoContraste != null), ...resto, children: [traco, children] }));
|
|
258
277
|
}
|
|
259
278
|
const corpo = (_jsxs(_Fragment, { children: [traco, children, action != null && _jsx(View, { style: s.acaoDaMarca, children: action })] }));
|
|
260
|
-
const pele = (_jsx(View, { style: [s.cardBase, s[`card_${variant ?? "base"}`], contorno, traco != null && s.comTraco, style], ...(variant === "outline"
|
|
279
|
+
const pele = (_jsx(View, { style: [s.cardBase, s[`card_${variant ?? "base"}`], contorno, altoContraste, traco != null && s.comTraco, style], ...marcaDoCartao(variant === "outline", altoContraste != null), ...resto, children: corpo }));
|
|
261
280
|
// 🔴 SOBRE O AMARELO A COR DO TEXTO NÃO É ESCOLHA, É OBRIGAÇÃO — e os números decidiram isto.
|
|
262
281
|
// Medido nos dois temas, texto contra o `primary`:
|
|
263
282
|
// texto comum ........ 10,34 no claro · **1,83 no escuro** 🔴 ilegível
|
package/dist/menu.js
CHANGED
|
@@ -83,7 +83,8 @@ const folha = criarFolha((t) => ({
|
|
|
83
83
|
width: t.size.space2, height: t.size.space2, ...canto(t.size.radiusFull),
|
|
84
84
|
// A cor do ponto é a do TEXTO da linha, como na web (`.menu-ponto` pinta com `currentColor`) — era o destaque, azul
|
|
85
85
|
// no claro e amarelo no escuro (bloco 1, 23/10/2026).
|
|
86
|
-
|
|
86
|
+
// D4 (14/11/2026): cinza, como o visto — o `.menu-ponto` da web pinta com a cor da casa da marca, agora a de apoio.
|
|
87
|
+
backgroundColor: t.color.mutedForeground,
|
|
87
88
|
},
|
|
88
89
|
// O rótulo de seção: 14 em peso médio e esmaecido (no componente), alinhado ao texto dos itens.
|
|
89
90
|
rotuloDoGrupo: { paddingHorizontal: t.size.space3, paddingTop: t.size.space2, paddingBottom: t.size.space1 },
|
|
@@ -381,7 +382,7 @@ function renderizar(items, prefixo, paiSub, ctx) {
|
|
|
381
382
|
case "checkbox": {
|
|
382
383
|
const cb = it;
|
|
383
384
|
const ligado = cb.checked ?? ctx.marcado[k] ?? cb.defaultChecked ?? false;
|
|
384
|
-
return (_jsx(Linha, { ctx: ctx, papel: "checkbox", rotulo: cb.label, icone: cb.leadingIcon, estado: { checked: ligado }, inativo: !!cb.disabled || apagado(k, subAberto), marca: ligado ? _jsx(Icon, { name: "check", size: "sm", color: ctx.tf.color.
|
|
385
|
+
return (_jsx(Linha, { ctx: ctx, papel: "checkbox", rotulo: cb.label, icone: cb.leadingIcon, estado: { checked: ligado }, inativo: !!cb.disabled || apagado(k, subAberto), marca: ligado ? _jsx(Icon, { name: "check", size: "sm", color: ctx.tf.color.mutedForeground }) : null, aoTocar: () => {
|
|
385
386
|
// Alterna e FICA aberto — a escolha múltipla da referência e o item da web.
|
|
386
387
|
if (cb.checked === undefined)
|
|
387
388
|
ctx.marcar(k, !ligado);
|
|
@@ -427,10 +428,10 @@ function Linha({ ctx, papel, rotulo, icone, marca, estado, inativo = false, dest
|
|
|
427
428
|
accessibilityRole: papel === "checkbox" ? "checkbox" : papel === "radio" ? "radio"
|
|
428
429
|
: papel === "link" ? "link" : "menuitem", ...estadoAcessivel({ ...estado, disabled: inativo }), style: ({ pressed }) => [
|
|
429
430
|
s.item, pressed && (destrutivo ? s.itemTocandoPerigo : s.itemTocando), inativo && s.desabilitado,
|
|
430
|
-
], children: [
|
|
431
|
+
], children: [icone ? _jsx(Icon, { name: icone, size: "md", color: cor }) : null, typeof rotulo === "string" || typeof rotulo === "number"
|
|
431
432
|
// 16 em peso médio, o título do item da referência.
|
|
432
433
|
? _jsx(Text, { size: "md", weight: 500, tone: destrutivo ? "danger" : "default", style: s.rotulo, children: rotulo })
|
|
433
|
-
: _jsx(View, { style: s.rotulo, children: rotulo }), final] }));
|
|
434
|
+
: _jsx(View, { style: s.rotulo, children: rotulo }), final, marca !== undefined ? _jsx(View, { style: s.indicador, children: marca }) : null] }));
|
|
434
435
|
}
|
|
435
436
|
/** O gatilho do submenu: a seta de 16 gira 90° ao abrir, como a da referência. */
|
|
436
437
|
function LinhaDeSubmenu({ ctx, def, aberto, inativo, alternar, children }) {
|
package/dist/navigation.d.ts
CHANGED
|
@@ -216,6 +216,8 @@ export interface AureaStepItem {
|
|
|
216
216
|
export interface StepperProps extends ViewProps {
|
|
217
217
|
items: AureaStepItem[];
|
|
218
218
|
label?: string;
|
|
219
|
+
/** `"vertical"`: um passo embaixo do outro, para a coluna estreita (PV-08). O padrão, `"horizontal"`, não muda. */
|
|
220
|
+
orientation?: "horizontal" | "vertical";
|
|
219
221
|
/** Glifos de `done` e `error`. Registre-os, ou o passo mostra o número. */
|
|
220
222
|
doneIcon?: AureaIcon | false;
|
|
221
223
|
errorIcon?: AureaIcon | false;
|
|
@@ -227,7 +229,7 @@ export interface StepperProps extends ViewProps {
|
|
|
227
229
|
* próximo é `accessibilityState={{selected}}`, que é o que os leitores anunciam. Não é o mesmo
|
|
228
230
|
* vocabulário — é o vocabulário que existe, e dizer isso é melhor que fingir paridade.
|
|
229
231
|
*/
|
|
230
|
-
export declare function Stepper({ items, label, doneIcon, errorIcon, style, ...rest }: StepperProps): React.JSX.Element;
|
|
232
|
+
export declare function Stepper({ items, label, orientation, doneIcon, errorIcon, style, ...rest }: StepperProps): React.JSX.Element;
|
|
231
233
|
export interface AureaTabItem {
|
|
232
234
|
id: string;
|
|
233
235
|
label: React.ReactNode;
|
package/dist/navigation.js
CHANGED
|
@@ -34,7 +34,7 @@ import { Pressable, View } from "react-native";
|
|
|
34
34
|
import { SafeAreaInsetsContext, initialWindowMetrics } from "react-native-safe-area-context";
|
|
35
35
|
import { useAnotarBottomNav } from "./barranav.js";
|
|
36
36
|
import { Avatar, Badge } from "./display.js";
|
|
37
|
-
import { canto, comOpacidade, criarFolha, estadoAcessivel, fioDoEscolhido, misturaOpaca, aroDoEstilo, fundoDaPele, marcaDoEstilo, peleDoAtual } from "./estilos.js";
|
|
37
|
+
import { canto, comOpacidade, criarFolha, estadoAcessivel, fioDoEscolhido, misturaOpaca, aroDoEstilo, fundoDaPele, marcaDoEstilo, peleDoAtual, preenchimento } from "./estilos.js";
|
|
38
38
|
import { NaSuperficie } from "./superficie.js";
|
|
39
39
|
import { Icon } from "./icon.js";
|
|
40
40
|
import { Card } from "./layout.js";
|
|
@@ -44,6 +44,8 @@ import { Text } from "./text.js";
|
|
|
44
44
|
import { useAureaStrings, useAureaTokens, useDirecaoRtl } from "./theme.js";
|
|
45
45
|
// Sem `SafeAreaProvider` nem medida da abertura: nenhum recuo.
|
|
46
46
|
const SEM_RECUO = { top: 0, right: 0, bottom: 0, left: 0 };
|
|
47
|
+
// A bolinha do `Stepper`: 32, a mesma do `.step-dot` da web. A linha em pé se mede por ela.
|
|
48
|
+
const BOLINHA = 32;
|
|
47
49
|
const folha = criarFolha((t) => ({
|
|
48
50
|
// ── Topbar ─────────────────────────────────────────────────────────────────────────────────
|
|
49
51
|
// ⚠ Sem `position: sticky` — ele não existe no React Native. Na web o `.topbar` gruda no topo
|
|
@@ -284,7 +286,17 @@ const folha = criarFolha((t) => ({
|
|
|
284
286
|
flexDirection: "row", gap: t.size.space1,
|
|
285
287
|
borderBottomWidth: t.size.borderWidth, borderColor: "transparent",
|
|
286
288
|
},
|
|
289
|
+
// A LINHA DE PONTA A PONTA embaixo da fila secundária (o Victor, 14/11/2026, *"B, ponta a ponta"*; o "sem linha" não é
|
|
290
|
+
// 100% — as divisões de dentro ficam): a linha clara (o texto a 10%, a mesma da tabela com `dividers`) vai na fileira
|
|
291
|
+
// que rola, que tem a largura toda; a borda transparente de dentro sai, para a altura não mudar. Também na Ember (14/11/2026); era
|
|
292
|
+
// linha da tabela. (14/11/2026: vale também para a Ember.)
|
|
293
|
+
filaSecundariaComFio: { borderBottomWidth: t.size.borderWidth, borderColor: preenchimento(t, 2) },
|
|
294
|
+
abasSecundariasSemBorda: { borderBottomWidth: 0 },
|
|
295
|
+
// AS ABAS ENCHEM A FILA (2-C b, a 0.71.0, como a web): cada aba cresce e a fila ocupa a linha (`fill` na `FilaRolante`).
|
|
296
|
+
// A sobra se reparte por igual a partir do rótulo — no Yoga não existe o "mínimo do conteúdo" da web, e a base 0
|
|
297
|
+
// espremeria o rótulo quando não cabe; com a base do rótulo, quando não cabe, a fila rola, como antes.
|
|
287
298
|
abaSecundaria: {
|
|
299
|
+
flexGrow: 1,
|
|
288
300
|
alignItems: "center", justifyContent: "center", minHeight: t.size.controlHMd,
|
|
289
301
|
paddingHorizontal: t.size.space3, paddingVertical: t.size.space1 + t.size.space05,
|
|
290
302
|
},
|
|
@@ -297,11 +309,23 @@ const folha = criarFolha((t) => ({
|
|
|
297
309
|
passoItem: { flex: 1 },
|
|
298
310
|
passoDentro: { alignItems: "center" },
|
|
299
311
|
bolinha: {
|
|
300
|
-
width:
|
|
312
|
+
width: BOLINHA, height: BOLINHA, marginBottom: t.size.space2,
|
|
301
313
|
alignItems: "center", justifyContent: "center", ...canto(t.size.radiusFull),
|
|
302
314
|
borderWidth: t.size.borderWidth, borderColor: "transparent",
|
|
303
315
|
backgroundColor: misturaOpaca(t.color.foreground, t.color.background, 0.2),
|
|
304
316
|
},
|
|
317
|
+
// EM PÉ (`orientation="vertical"`, PV-08, 14/11/2026 — a mesma da web): a bolinha à esquerda, o nome ao lado a `space3`
|
|
318
|
+
// e centrado nela, o "Opcional" embaixo, `space6` de um passo ao outro, e a linha descendo entre as bolinhas. A linha
|
|
319
|
+
// tem a espessura e o lugar da linha deitada da web (2 = duas bordas; no meio da bolinha).
|
|
320
|
+
trilhaEmPe: { flexDirection: "column" },
|
|
321
|
+
passoEmPe: { flexDirection: "row", alignItems: "flex-start", gap: t.size.space3, paddingBottom: t.size.space6 },
|
|
322
|
+
passoEmPeUltimo: { paddingBottom: 0 },
|
|
323
|
+
bolinhaEmPe: { marginBottom: 0 },
|
|
324
|
+
textoEmPe: { flex: 1, minWidth: 0 },
|
|
325
|
+
nomeEmPe: { minHeight: BOLINHA, justifyContent: "center" },
|
|
326
|
+
linhaEmPe: {
|
|
327
|
+
position: "absolute", top: BOLINHA, bottom: 0, start: BOLINHA / 2 - t.size.borderWidth, width: t.size.borderWidth * 2,
|
|
328
|
+
},
|
|
305
329
|
}));
|
|
306
330
|
/**
|
|
307
331
|
* A barra inferior — a pele da navegação, **não a navegação**.
|
|
@@ -603,32 +627,44 @@ export function NavList({ items, chevron = "caret-right", style, ...rest }) {
|
|
|
603
627
|
* próximo é `accessibilityState={{selected}}`, que é o que os leitores anunciam. Não é o mesmo
|
|
604
628
|
* vocabulário — é o vocabulário que existe, e dizer isso é melhor que fingir paridade.
|
|
605
629
|
*/
|
|
606
|
-
export function Stepper({ items, label, doneIcon = "check", errorIcon = "x-circle", style, ...rest }) {
|
|
630
|
+
export function Stepper({ items, label, orientation = "horizontal", doneIcon = "check", errorIcon = "x-circle", style, ...rest }) {
|
|
607
631
|
const t = useAureaTokens();
|
|
608
632
|
const s = folha(t);
|
|
609
633
|
const strings = useAureaStrings();
|
|
610
|
-
|
|
634
|
+
const emPe = orientation === "vertical";
|
|
635
|
+
return (_jsx(View, { accessibilityRole: "list", accessibilityLabel: label ?? strings.stepperLabel, style: [emPe ? s.trilhaEmPe : s.trilha, style], ...rest, children: items.map((it, n) => {
|
|
611
636
|
const st = it.state ?? "default";
|
|
612
637
|
const cor = st === "error" ? (t.color.danger400 ?? t.color.destructive)
|
|
613
638
|
// o passo atual na cor do TEXTO, como na web (`.step-active`) — era o destaque, azul no claro (23/10/2026)
|
|
614
639
|
: st === "active" ? t.color.foreground
|
|
615
640
|
: t.color.foreground;
|
|
616
|
-
const
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
641
|
+
const ultimo = n === items.length - 1;
|
|
642
|
+
// a linha que desce até o próximo: amarela quando o próximo já foi feito ou é o atual, como a deitada da web
|
|
643
|
+
const proximo = items[n + 1]?.state;
|
|
644
|
+
const linha = emPe && !ultimo ? (_jsx(View, { pointerEvents: "none", style: [s.linhaEmPe, {
|
|
645
|
+
backgroundColor: proximo === "done" || proximo === "active" ? t.color.primary : t.color.border,
|
|
646
|
+
}] })) : null;
|
|
647
|
+
const alinhar = emPe ? "auto" : "center"; // em pé, o nome segue a direção da escrita
|
|
648
|
+
const bolinha = (_jsx(View, { style: [
|
|
649
|
+
s.bolinha, emPe && s.bolinhaEmPe,
|
|
650
|
+
st === "error" && { borderColor: "transparent", backgroundColor: t.color.dangerBg },
|
|
651
|
+
st === "active" && { borderColor: "transparent", backgroundColor: comOpacidade(t.color.primary, 0.14) },
|
|
652
|
+
], children: st === "done" && doneIcon
|
|
653
|
+
? _jsx(Icon, { name: doneIcon, size: "sm", color: cor })
|
|
654
|
+
: st === "error" && errorIcon
|
|
655
|
+
? _jsx(Icon, { name: errorIcon, size: "sm", color: cor })
|
|
656
|
+
: _jsx(Text, { size: "sm", weight: 600, style: { color: cor }, children: n + 1 }) }));
|
|
657
|
+
const nome = typeof it.label === "string"
|
|
658
|
+
? _jsx(Text, { size: "sm", weight: 600, align: alinhar, style: { color: cor }, children: it.label })
|
|
659
|
+
: it.label;
|
|
660
|
+
const nota = it.optional != null && (typeof it.optional === "string"
|
|
661
|
+
? _jsx(Text, { size: "xs", tone: "muted", align: alinhar, children: it.optional })
|
|
662
|
+
: it.optional);
|
|
663
|
+
const miolo = emPe ? (_jsxs(_Fragment, { children: [linha, bolinha, _jsxs(View, { style: s.textoEmPe, children: [_jsx(View, { style: s.nomeEmPe, children: nome }), nota] })] })) : (_jsxs(_Fragment, { children: [bolinha, nome, nota] }));
|
|
664
|
+
const passoEmPe = emPe ? [s.passoEmPe, ultimo && s.passoEmPeUltimo] : null;
|
|
629
665
|
// O item da lista é o passo; o tocável fica DENTRO dele (o papel de item não pode ir no botão). Na web, o passo
|
|
630
666
|
// atual é `aria-current="step"` (bloco 1, 24/10/2026).
|
|
631
|
-
return it.onPress ? (_jsx(View, { role: "listitem", style: s.passoItem, children: _jsx(Pressable, { onPress: it.onPress, accessibilityRole: "button", ...estadoAcessivel({ selected: st === "active" }, "step"), style: s.passoDentro, children: miolo }) }, n)) : (_jsx(View, { role: "listitem", accessible: true, ...estadoAcessivel({ selected: st === "active" }, "step"), style: s.passo, children: miolo }, n));
|
|
667
|
+
return it.onPress ? (_jsx(View, { role: "listitem", style: emPe ? null : s.passoItem, children: _jsx(Pressable, { onPress: it.onPress, accessibilityRole: "button", ...estadoAcessivel({ selected: st === "active" }, "step"), style: emPe ? passoEmPe : s.passoDentro, children: miolo }) }, n)) : (_jsx(View, { role: "listitem", accessible: true, ...estadoAcessivel({ selected: st === "active" }, "step"), style: emPe ? passoEmPe : s.passo, children: miolo }, n));
|
|
632
668
|
}) }));
|
|
633
669
|
}
|
|
634
670
|
/**
|
|
@@ -670,9 +706,10 @@ export function Tabs({ tabs, value, onChange, label, justify, variant = "primary
|
|
|
670
706
|
const strings = useAureaStrings();
|
|
671
707
|
const aberta = tabs.find((it) => it.id === value);
|
|
672
708
|
const secundaria = variant === "secondary";
|
|
709
|
+
const comFio = secundaria;
|
|
673
710
|
// S-04 (05/11/2026): a aba escolhida DESLIZA (`deslize.tsx`) — a cápsula amarela, e na secundária o fio de baixo.
|
|
674
711
|
const fila = useFilaQueDesliza(value);
|
|
675
|
-
return (_jsxs(View, { style: style, ...rest, children: [_jsx(FilaRolante, { justify: justify, children: _jsxs(View, { accessibilityRole: "tablist", accessibilityLabel: label ?? strings.tabsLabel, style: secundaria ? s.abasSecundarias : s.abas, children: [_jsx(IndicadorQueDesliza, { alvo: fila.alvo, aoFicarPronto: fila.aoFicarPronto, style: secundaria ? undefined : [canto(t.size.radiusControl), s.abaDeTabAtiva], children: secundaria ? _jsx(View, { style: s.fioDaAba }) : null }), tabs.map((it) => {
|
|
712
|
+
return (_jsxs(View, { style: style, ...rest, children: [_jsx(FilaRolante, { justify: justify, fill: secundaria || undefined, style: comFio ? s.filaSecundariaComFio : undefined, marca: comFio ? { dataSet: { aureaLine: "tabs" } } : undefined, children: _jsxs(View, { accessibilityRole: "tablist", accessibilityLabel: label ?? strings.tabsLabel, style: secundaria ? [s.abasSecundarias, { flexGrow: 1 }, comFio && s.abasSecundariasSemBorda] : s.abas, children: [_jsx(IndicadorQueDesliza, { alvo: fila.alvo, aoFicarPronto: fila.aoFicarPronto, style: secundaria ? undefined : [canto(t.size.radiusControl), s.abaDeTabAtiva], children: secundaria ? _jsx(View, { style: s.fioDaAba }) : null }), tabs.map((it) => {
|
|
676
713
|
const ativa = it.id === value;
|
|
677
714
|
return (_jsxs(Pressable, { onLayout: fila.medir(it.id), onPress: it.disabled ? undefined : () => onChange?.(it.id), disabled: it.disabled, accessibilityRole: "tab", ...estadoAcessivel({ selected: ativa, disabled: !!it.disabled }), accessibilityLabel: typeof it.label === "string" ? it.label : undefined, style: [
|
|
678
715
|
secundaria ? s.abaSecundaria : s.abaDeTab,
|
package/dist/rolagem.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ export interface FilaRolanteProps {
|
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
/** Estilo do invólucro externo, não do conteúdo. */
|
|
7
7
|
style?: StyleProp<ViewStyle>;
|
|
8
|
+
/** Uma marca só do navegador (`dataSet`, no `react-native-web`) no invólucro — a do fio das abas `secondary`, que a
|
|
9
|
+
* varredura do site reconhece (0.70.0). No aparelho, `dataSet` não existe e é ignorado. */
|
|
10
|
+
marca?: object;
|
|
8
11
|
testID?: string;
|
|
9
12
|
/**
|
|
10
13
|
* Onde a fila fica quando CABE — E3, 25/09/2026. `start` (o padrão, o de sempre), `center` ou
|
|
@@ -27,4 +30,4 @@ export type AureaFilaJustify = "start" | "center" | "end";
|
|
|
27
30
|
* O componente fica com a informação em vez de adivinhar: `onLayout` dá a largura visível e
|
|
28
31
|
* `onContentSizeChange` dá a do conteúdo. Com as duas, `transbordou` é uma conta, não um palpite.
|
|
29
32
|
*/
|
|
30
|
-
export declare function FilaRolante({ children, style, testID, justify, fill }: FilaRolanteProps): React.JSX.Element;
|
|
33
|
+
export declare function FilaRolante({ children, style, testID, justify, fill, marca }: FilaRolanteProps): React.JSX.Element;
|
package/dist/rolagem.js
CHANGED
|
@@ -31,7 +31,7 @@ const JUSTIFICAR = { center: "center", end: "flex-end" };
|
|
|
31
31
|
* O componente fica com a informação em vez de adivinhar: `onLayout` dá a largura visível e
|
|
32
32
|
* `onContentSizeChange` dá a do conteúdo. Com as duas, `transbordou` é uma conta, não um palpite.
|
|
33
33
|
*/
|
|
34
|
-
export function FilaRolante({ children, style, testID, justify = "start", fill }) {
|
|
34
|
+
export function FilaRolante({ children, style, testID, justify = "start", fill, marca }) {
|
|
35
35
|
const [visivel, setVisivel] = React.useState(0);
|
|
36
36
|
const [conteudo, setConteudo] = React.useState(0);
|
|
37
37
|
const transbordou = conteudo > visivel && visivel > 0;
|
|
@@ -46,5 +46,5 @@ export function FilaRolante({ children, style, testID, justify = "start", fill }
|
|
|
46
46
|
// fileira, o filho tem a largura dele. Medido pelo app: rolador 335 de largura, fileira 281,
|
|
47
47
|
// encostada à esquerda, e um `Cluster justify="center"` em volta não mudava nada.
|
|
48
48
|
contentContainerStyle: fill ? { flexGrow: 1 }
|
|
49
|
-
: justify === "start" ? { flexGrow: 0 } : { flexGrow: 1, justifyContent: JUSTIFICAR[justify] }, style: style, children: children }));
|
|
49
|
+
: justify === "start" ? { flexGrow: 0 } : { flexGrow: 1, justifyContent: JUSTIFICAR[justify] }, style: style, ...marca, children: children }));
|
|
50
50
|
}
|
package/dist/text.js
CHANGED
|
@@ -22,7 +22,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
22
22
|
import * as React from "react";
|
|
23
23
|
import { Text as TextRN } from "react-native";
|
|
24
24
|
import { canto, criarFolha, letraDoAmarelo, letraDoToken } from "./estilos.js";
|
|
25
|
-
import { useAureaTokens, useSobreAMarca } from "./theme.js";
|
|
25
|
+
import { useAltoContraste, useAureaTokens, useSobreAMarca } from "./theme.js";
|
|
26
26
|
// 🔴 A ESCALA TEM CINCO DEGRAUS QUE SE ENXERGAM, E DEZ NOMES — ordem do Victor, 19/09/2026,
|
|
27
27
|
// olhando o app no aparelho: *"o tamanho das fontes: existem variações demais, fica muito
|
|
28
28
|
// estranho"*.
|
|
@@ -119,6 +119,9 @@ export function Text({ type, size, weight: pesoPedido, font: fontePedida, tone =
|
|
|
119
119
|
const t = useAureaTokens();
|
|
120
120
|
const s = folha(t);
|
|
121
121
|
const sobreAMarca = useSobreAMarca();
|
|
122
|
+
// O alto contraste do app (0-D): o link sublinhado na cor da letra (abaixo).
|
|
123
|
+
const alto = useAltoContraste();
|
|
124
|
+
const sublinhadoDoAlto = alto ? { textDecorationLine: "underline" } : null;
|
|
122
125
|
// Sem `type`, os padrões de sempre (`md`, 400, `ui`, `normal`) — nada muda para quem já usa.
|
|
123
126
|
const papel = type ? PAPEL[type] : undefined;
|
|
124
127
|
const weight = pesoPedido ?? papel?.peso ?? 400;
|
|
@@ -171,7 +174,7 @@ export function Text({ type, size, weight: pesoPedido, font: fontePedida, tone =
|
|
|
171
174
|
// Android ele sai na cor da letra, que já é o amarelo.
|
|
172
175
|
const { children, ...resto } = rest;
|
|
173
176
|
if (t.theme === "light") {
|
|
174
|
-
return (_jsx(TextRN, { style: [s[tone], proprio, style], ...resto, children: _jsx(TextRN, { style: { backgroundColor: t.color.linkMark }, children: children }) }));
|
|
177
|
+
return (_jsx(TextRN, { style: [s[tone], proprio, sublinhadoDoAlto, style], ...resto, children: _jsx(TextRN, { style: { backgroundColor: t.color.linkMark }, children: children }) }));
|
|
175
178
|
}
|
|
176
179
|
return (_jsx(TextRN, { style: [s[tone], proprio, { textDecorationLine: "underline", textDecorationColor: t.color.linkUnderline }, style], ...resto, children: children }));
|
|
177
180
|
}
|
package/dist/theme.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export type AureaThemeControl = {
|
|
|
10
10
|
setDensity: (d: AureaDensity) => void;
|
|
11
11
|
toggleTheme: () => void;
|
|
12
12
|
};
|
|
13
|
+
/** O tamanho do texto do app (ADR-0090): `"lg"` sobe 2 cada degrau da letra, do `xs` ao `2xl`, como a web. */
|
|
14
|
+
export type AureaTextSize = "md" | "lg";
|
|
13
15
|
export type AureaProviderProps = {
|
|
14
16
|
children: React.ReactNode;
|
|
15
17
|
/** Controlado: quando presente, manda, e `setTheme` só avisa. */
|
|
@@ -76,15 +78,25 @@ export type AureaProviderProps = {
|
|
|
76
78
|
* submenu), para que apontem para onde se lê. Um provedor dentro de outro sem `direction` herda o de fora.
|
|
77
79
|
*/
|
|
78
80
|
direction?: "ltr" | "rtl";
|
|
81
|
+
/**
|
|
82
|
+
* O alto contraste no app inteiro (0-D, 14/11/2026 — o `highContrast` do `AppShell` da web, a forma "C" da ADR-0090):
|
|
83
|
+
* tudo o que o "aumentar contraste" do sistema faz, e mais o texto de apoio mais escuro, o contorno no cartão e no
|
|
84
|
+
* botão e o link sublinhado. Ausente, um provedor dentro de outro herda o de fora.
|
|
85
|
+
*/
|
|
86
|
+
highContrast?: boolean;
|
|
87
|
+
/** O texto grande no app inteiro (0-E, o `textSize` do `AppShell` da web, a forma "B"). Herda como o `highContrast`. */
|
|
88
|
+
textSize?: AureaTextSize;
|
|
79
89
|
/** Avisado quando o modo CONTROLADO recebe um pedido de troca — é o app que decide. */
|
|
80
90
|
onThemeChange?: (t: AureaThemeName) => void;
|
|
81
91
|
onDensityChange?: (d: AureaDensity) => void;
|
|
82
92
|
};
|
|
83
|
-
export declare function AureaProvider({ children, theme, density, brand, defaultTheme, defaultDensity, fontFamilies, icons, strings, direction, onThemeChange, onDensityChange, }: AureaProviderProps): React.JSX.Element;
|
|
93
|
+
export declare function AureaProvider({ children, theme, density, brand, defaultTheme, defaultDensity, fontFamilies, icons, strings, direction, highContrast, textSize, onThemeChange, onDensityChange, }: AureaProviderProps): React.JSX.Element;
|
|
84
94
|
/**
|
|
85
95
|
* Interno: `true` quando a escrita corre da direita para a esquerda — a do `AureaProvider` mais próximo que disse
|
|
86
96
|
* `direction` ou, sem nenhum, a do aparelho (`I18nManager.isRTL`), como o `useIsRTL` da referência do celular.
|
|
87
97
|
*/
|
|
98
|
+
/** Interno: `true` com o alto contraste do app ligado (`highContrast` no `AureaProvider`). Fora de provedor, `false`. */
|
|
99
|
+
export declare function useAltoContraste(): boolean;
|
|
88
100
|
export declare function useDirecaoRtl(): boolean;
|
|
89
101
|
/** Os dois eixos e como trocá-los. Mesma forma do hook homônimo de `@aurea-uds/react`. */
|
|
90
102
|
export declare function useAureaTheme(): AureaThemeControl;
|
package/dist/theme.js
CHANGED
|
@@ -2,9 +2,31 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { I18nManager, useColorScheme } from "react-native";
|
|
4
4
|
import { IconRegistryProvider } from "./icon.js";
|
|
5
|
-
import { comOpacidade } from "./estilos.js";
|
|
5
|
+
import { comOpacidade, misturaOpaca } from "./estilos.js";
|
|
6
6
|
import { defaultStrings } from "./strings.js";
|
|
7
7
|
import { resolverTokens, } from "./tokens.js";
|
|
8
|
+
const SEM_MODOS = { alto: false, texto: "md" };
|
|
9
|
+
/**
|
|
10
|
+
* Os modos de leitura sobre os tokens (0-D e 0-E no nativo, 14/11/2026 — as formas que o Victor aprovou na web em
|
|
11
|
+
* 04/11/2026, ADR-0090). O texto grande ("B"): cada degrau da letra sobe 2, do `textXs` ao `text2xl` (a entrelinha
|
|
12
|
+
* acompanha, porque é razão); a altura dos controles NÃO muda: no nativo o controle médio já tem o alvo de toque (a web
|
|
13
|
+
* subiu o dela de 36 para 44). O alto contraste ("C"): o texto de apoio a 80% do texto, e as marcas dos controles na
|
|
14
|
+
* tinta — os mesmos tokens que o `[data-contrast="high"]` da web troca; o resto (o contorno dos campos, do cartão e do
|
|
15
|
+
* botão, o link sublinhado) as peças desenham lendo `useMaisContraste()`/`useAltoContraste()`.
|
|
16
|
+
*/
|
|
17
|
+
function aplicarModos(t, m) {
|
|
18
|
+
if (!m.alto && m.texto === "md")
|
|
19
|
+
return t;
|
|
20
|
+
const s = t.size;
|
|
21
|
+
const size = m.texto === "lg" ? { ...s,
|
|
22
|
+
textXs: s.textXs + 2, textSm: s.textSm + 2, textMd: s.textMd + 2, textBase: s.textBase + 2,
|
|
23
|
+
textLg: s.textLg + 2, textXl: s.textXl + 2, text2xl: s.text2xl + 2 } : s;
|
|
24
|
+
const c = t.color;
|
|
25
|
+
const color = m.alto ? { ...c,
|
|
26
|
+
mutedForeground: misturaOpaca(c.foreground, c.background, 0.8),
|
|
27
|
+
controlThumb: c.brandYellowInk, controlSelectedForeground: c.brandYellowInk, controlSelectedDot: c.brandYellowInk } : c;
|
|
28
|
+
return { ...t, size, color };
|
|
29
|
+
}
|
|
8
30
|
// `comfortable` não é gosto: MEDIDO em 02/09/2026, os 8 tokens de densidade do `comfortable` são
|
|
9
31
|
// idênticos aos do `base` (8/8), e os das outras duas não batem em nenhum. É a densidade que o
|
|
10
32
|
// CSS já assume quando ninguém declara `data-density`.
|
|
@@ -12,7 +34,11 @@ const DENSIDADE_PADRAO = "comfortable";
|
|
|
12
34
|
// `dark` é o que o catálogo inteiro declara no `<html>`, e o que a identidade da Aurea assume.
|
|
13
35
|
const TEMA_PADRAO = "dark";
|
|
14
36
|
const Contexto = React.createContext(null);
|
|
15
|
-
export function AureaProvider({ children, theme, density, brand, defaultTheme, defaultDensity, fontFamilies, icons, strings, direction, onThemeChange, onDensityChange, }) {
|
|
37
|
+
export function AureaProvider({ children, theme, density, brand, defaultTheme, defaultDensity, fontFamilies, icons, strings, direction, highContrast, textSize, onThemeChange, onDensityChange, }) {
|
|
38
|
+
// Os modos de leitura herdam do provedor de fora quando este não diz (o tema num pedaço continua com eles).
|
|
39
|
+
const deFora = React.useContext(Contexto)?.modos ?? SEM_MODOS;
|
|
40
|
+
const alto = highContrast ?? deFora.alto, texto = textSize ?? deFora.texto;
|
|
41
|
+
const modos = React.useMemo(() => ({ alto, texto }), [alto, texto]);
|
|
16
42
|
const doAparelho = useColorScheme();
|
|
17
43
|
const [temaInterno, setTemaInterno] = React.useState(defaultTheme ?? null);
|
|
18
44
|
const [densidadeInterna, setDensidadeInterna] = React.useState(defaultDensity ?? DENSIDADE_PADRAO);
|
|
@@ -41,7 +67,8 @@ export function AureaProvider({ children, theme, density, brand, defaultTheme, d
|
|
|
41
67
|
// Alternar é sobre o que está NA TELA — a mesma regra que o hook da web escreveu.
|
|
42
68
|
toggleTheme: () => setTheme(temaEfetivo === "dark" ? "light" : "dark"),
|
|
43
69
|
},
|
|
44
|
-
tokens: resolverTokens(temaEfetivo, densidadeEfetiva, fontFamilies, brand),
|
|
70
|
+
tokens: aplicarModos(resolverTokens(temaEfetivo, densidadeEfetiva, fontFamilies, brand), modos),
|
|
71
|
+
modos,
|
|
45
72
|
// As frases NÃO dependem do par (tema, densidade), mas moram no mesmo `useMemo` de propósito:
|
|
46
73
|
// um contexto a mais só se paga quando ele muda em outra hora, e este muda junto — é a mesma
|
|
47
74
|
// conta que o cabeçalho deste arquivo já fez para os dois contextos que viraram um.
|
|
@@ -49,7 +76,7 @@ export function AureaProvider({ children, theme, density, brand, defaultTheme, d
|
|
|
49
76
|
fontes: fontFamilies,
|
|
50
77
|
marca: brand ?? null,
|
|
51
78
|
raiz: null,
|
|
52
|
-
}), [temaEfetivo, densidadeEfetiva, setTheme, setDensity, fontFamilies, strings, brand]);
|
|
79
|
+
}), [temaEfetivo, densidadeEfetiva, setTheme, setDensity, fontFamilies, strings, brand, modos]);
|
|
53
80
|
// O registro de ícones fica num contexto PRÓPRIO: ele não muda quando o tema muda, e juntá-lo
|
|
54
81
|
// ao valor do tema faria toda árvore que só desenha ícone re-renderizar na troca de tema.
|
|
55
82
|
const comIcones = icons
|
|
@@ -67,6 +94,10 @@ const DirecaoContext = React.createContext(null);
|
|
|
67
94
|
* Interno: `true` quando a escrita corre da direita para a esquerda — a do `AureaProvider` mais próximo que disse
|
|
68
95
|
* `direction` ou, sem nenhum, a do aparelho (`I18nManager.isRTL`), como o `useIsRTL` da referência do celular.
|
|
69
96
|
*/
|
|
97
|
+
/** Interno: `true` com o alto contraste do app ligado (`highContrast` no `AureaProvider`). Fora de provedor, `false`. */
|
|
98
|
+
export function useAltoContraste() {
|
|
99
|
+
return React.useContext(Contexto)?.modos?.alto ?? false;
|
|
100
|
+
}
|
|
70
101
|
export function useDirecaoRtl() {
|
|
71
102
|
const d = React.useContext(DirecaoContext);
|
|
72
103
|
return d ? d === "rtl" : I18nManager.isRTL;
|
|
@@ -171,7 +202,7 @@ export function TemaDentro({ tema, children }) {
|
|
|
171
202
|
const v = usar("TemaDentro");
|
|
172
203
|
const valor = React.useMemo(() => ({
|
|
173
204
|
...v,
|
|
174
|
-
tokens: resolverTokens(tema, v.controle.density, v.fontes, v.marca),
|
|
205
|
+
tokens: aplicarModos(resolverTokens(tema, v.controle.density, v.fontes, v.marca), v.modos ?? SEM_MODOS),
|
|
175
206
|
raiz: v.raiz ?? v,
|
|
176
207
|
}), [v, tema]);
|
|
177
208
|
if (v.tokens.theme === tema)
|
package/dist/toast.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type StyleProp, type ViewStyle } from "react-native";
|
|
|
3
3
|
import { type AureaIcon } from "./icon.js";
|
|
4
4
|
import { type AureaAlertVariant } from "./feedback.js";
|
|
5
5
|
/** As mesmas quatro faces do `AureaToastType` da web (`system.tsx:65`). */
|
|
6
|
-
export type AureaToastType = AureaAlertVariant
|
|
6
|
+
export type AureaToastType = Exclude<AureaAlertVariant, "neutral">;
|
|
7
7
|
export interface AureaToastInput {
|
|
8
8
|
title: React.ReactNode;
|
|
9
9
|
description?: React.ReactNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aurea-uds/native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.71.0",
|
|
4
4
|
"description": "A Aurea UDS para React Native: o provider de tema e densidade, os componentes e os ícones do Phosphor sobre react-native-svg.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aurea",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"NOTICE"
|
|
56
56
|
],
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@aurea-uds/tokens": "^0.
|
|
58
|
+
"@aurea-uds/tokens": "^0.71.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@react-native-community/datetimepicker": ">=8",
|