@aurea-uds/native 0.40.0 → 0.41.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 +2 -1
- package/dist/actions.js +3 -1
- package/dist/busca.js +9 -2
- package/dist/data.js +4 -2
- package/dist/display.js +1 -1
- package/dist/escolha.js +9 -3
- package/dist/estilos.d.ts +7 -0
- package/dist/estilos.js +9 -0
- package/dist/exibicao.js +6 -3
- package/dist/inputs.js +13 -3
- package/dist/layout.js +9 -2
- package/dist/menu.js +2 -1
- package/dist/navigation.js +2 -1
- package/dist/numero.js +6 -2
- package/dist/overlays.js +4 -3
- package/dist/sistema.js +6 -2
- package/dist/superficie.d.ts +4 -0
- package/dist/superficie.js +13 -0
- package/dist/text.d.ts +5 -3
- package/dist/text.js +7 -5
- package/dist/theme.d.ts +2 -2
- package/dist/tokens.d.ts +1 -1
- package/dist/tokens.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -68,7 +68,8 @@ pnpm add @aurea-uds/native react-native-svg react-native-safe-area-context
|
|
|
68
68
|
|
|
69
69
|
Quatro **peers obrigatórios**: `react` (≥19), `react-native` (≥0.76, pela Nova Arquitetura),
|
|
70
70
|
`react-native-svg` (≥15, pelos ícones) e `react-native-safe-area-context` (≥5, pelo `Screen`).
|
|
71
|
-
Para o texto sair
|
|
71
|
+
Para o texto sair nas fontes da Aurea (Inter, Sora nos títulos e IBM Plex Mono no código — ADR-0077), some
|
|
72
|
+
`@aurea-uds/fonts`.
|
|
72
73
|
|
|
73
74
|
O último costuma **já estar instalado**: `react-navigation` e `expo-router` o arrastam. Declará-lo
|
|
74
75
|
como peer não adiciona peso ao app — só diz o que já ia estar lá.
|
package/dist/actions.js
CHANGED
|
@@ -253,7 +253,9 @@ function CorpoDoBotao({ children, appearance = "solid", tone = "neutral", size =
|
|
|
253
253
|
// (a folha do botão dela usa a entrelinha de cada degrau da escala). Era `none` (1,0), e a letra
|
|
254
254
|
// precisa de 1,3 em para caber inteira — a IBM Plex subia 1,025 e descia 0,275; a
|
|
255
255
|
// Atkinson Hyperlegible (ADR-0053) sobe 0,984 e desce 0,316, o mesmo 1,3 (medido na
|
|
256
|
-
// tabela `hhea` dos dois arquivos, 01/10/2026):
|
|
256
|
+
// tabela `hhea` dos dois arquivos, 01/10/2026). Desde a ADR-0077 (0.40.1): a Inter pede 1,21 (sobe
|
|
257
|
+
// 0,969, desce 0,241), a Sora 1,26 e a IBM Plex Mono os mesmos 1,3 (medido na `hhea`, 22/10/2026) —
|
|
258
|
+
// todas cabem nesta linha. No Android o RN
|
|
257
259
|
// corta o que passa da linha, e a perna do g, do p e do ç sumia. Cabe em todo tamanho e
|
|
258
260
|
// densidade (conta da 0.32.0): `xs`/`sm` têm linha de 21 e o menor botão mede 28 (`xs`
|
|
259
261
|
// no compacto); o `md` tem linha de 24 e mede 44 ou mais; `lg`/`xl`, 27 e 52 ou mais.
|
package/dist/busca.js
CHANGED
|
@@ -69,7 +69,8 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
69
69
|
import * as React from "react";
|
|
70
70
|
import { Animated, Easing, FlatList, Modal, PanResponder, Pressable, TextInput, View, } from "react-native";
|
|
71
71
|
import { IconButton } from "./actions.js";
|
|
72
|
-
import { canto, cantosDeCima, criarFolha, estadoAcessivel, preenchimento } from "./estilos.js";
|
|
72
|
+
import { canto, cantosDeCima, criarFolha, estadoAcessivel, preenchimento, fundoDeCampo } from "./estilos.js";
|
|
73
|
+
import { useNaSuperficie } from "./superficie.js";
|
|
73
74
|
import { Spinner } from "./feedback.js";
|
|
74
75
|
import { Icon } from "./icon.js";
|
|
75
76
|
import { KeyboardAvoiding, alturaDoTamanho, indicadorDaEscolhida, respiroDoGatilho, respiroDoTamanho, useCampo, } from "./inputs.js";
|
|
@@ -101,7 +102,7 @@ const folha = criarFolha((t) => ({
|
|
|
101
102
|
caixa: {
|
|
102
103
|
width: "100%", minWidth: 0,
|
|
103
104
|
borderWidth: t.size.borderWidth, borderColor: "transparent",
|
|
104
|
-
...canto(t.size.radiusControl),
|
|
105
|
+
...canto(t.size.radiusControl),
|
|
105
106
|
flexDirection: "row", alignItems: "center",
|
|
106
107
|
},
|
|
107
108
|
invalido: { borderColor: "transparent", backgroundColor: t.color.dangerBg },
|
|
@@ -214,6 +215,8 @@ const folha = criarFolha((t) => ({
|
|
|
214
215
|
*/
|
|
215
216
|
export function Combobox({ items, value, onValueChange, onSearchChange, searchDelay = ESPERA_PADRAO, loading, onEndReached, placeholder, searchPlaceholder, empty, clearable = true, draggable = true, disabled, size, chevron = "caret-down", searchIcon = "magnifying-glass", searchKeyboardType, style, testID, }) {
|
|
216
217
|
const t = useAureaTokens();
|
|
218
|
+
// ADR-0078: dentro de uma superfície branca o campo volta ao cinza.
|
|
219
|
+
const naSuperficie = useNaSuperficie();
|
|
217
220
|
const s = folha(t);
|
|
218
221
|
// A folha sai do fluxo: pinta com os tokens do APP (ADR-0063 — ver `useTokensDoApp`).
|
|
219
222
|
const tf = useTokensDoApp();
|
|
@@ -304,6 +307,7 @@ export function Combobox({ items, value, onValueChange, onSearchChange, searchDe
|
|
|
304
307
|
const nada = !loading && filtrados.length === 0;
|
|
305
308
|
return (_jsxs(_Fragment, { children: [_jsxs(View, { style: [
|
|
306
309
|
s.caixa,
|
|
310
|
+
fundoDeCampo(t, naSuperficie),
|
|
307
311
|
// 0.32.0: o gatilho do `Select` — altura de toque, 16 dos lados no `md` e 12 entre o
|
|
308
312
|
// texto e as ações (era 13 e nada).
|
|
309
313
|
{ height: alturaDoTamanho(t, tam), paddingHorizontal: respiroDoGatilho(t, tam), gap: t.size.space3 },
|
|
@@ -375,6 +379,8 @@ const dobrar = (v) => {
|
|
|
375
379
|
*/
|
|
376
380
|
export function SearchField({ value, onChangeText, onSearchChange, searchDelay = ESPERA_PADRAO, placeholder, disabled, size, icon = "magnifying-glass", clearable = true, onSubmit, style, testID, }) {
|
|
377
381
|
const t = useAureaTokens();
|
|
382
|
+
// ADR-0078: dentro de uma superfície branca o campo volta ao cinza.
|
|
383
|
+
const naSuperficie = useNaSuperficie();
|
|
378
384
|
const s = folha(t);
|
|
379
385
|
const peleDaMarca = usePeleSobreAMarca();
|
|
380
386
|
const strings = useAureaStrings();
|
|
@@ -413,6 +419,7 @@ export function SearchField({ value, onChangeText, onSearchChange, searchDelay =
|
|
|
413
419
|
}, [cancelar, onChangeText, searchDelay]);
|
|
414
420
|
return (_jsxs(View, { testID: testID, style: [
|
|
415
421
|
s.caixa,
|
|
422
|
+
fundoDeCampo(t, naSuperficie),
|
|
416
423
|
{ height: alturaDoTamanho(t, tam), paddingHorizontal: respiroDoTamanho(t, tam),
|
|
417
424
|
gap: t.size.space1 },
|
|
418
425
|
campo?.invalido && s.invalido,
|
package/dist/data.js
CHANGED
|
@@ -233,14 +233,16 @@ export function Table({ caption, columns, rows, keyExtractor, onRowPress, empty,
|
|
|
233
233
|
const desenharLinha = React.useCallback((linha) => {
|
|
234
234
|
const corpo = (_jsxs(_Fragment, { children: [principal ? (_jsx(View, { accessible: true, children: (() => {
|
|
235
235
|
const v = conteudo(principal, linha);
|
|
236
|
-
|
|
236
|
+
// ADR-0077: o número da tabela fica na fonte do texto, com algarismos de mesma largura (como na web);
|
|
237
|
+
// o `numeric` sozinho seria a IBM Plex Mono, que é do app e do `KPI`.
|
|
238
|
+
return typeof v === "string" ? _jsx(Text, { size: "md", weight: 600, numeric: true, font: "ui", children: v }) : v;
|
|
237
239
|
})() })) : null, secundarias.map((coluna) => {
|
|
238
240
|
const v = conteudo(coluna, linha);
|
|
239
241
|
const nome = typeof coluna.header === "string" && typeof v === "string"
|
|
240
242
|
? `${coluna.header}: ${v}` : undefined;
|
|
241
243
|
return (_jsxs(View, { accessible: true, accessibilityLabel: nome, style: s.celula, children: [typeof coluna.header === "string"
|
|
242
244
|
? _jsx(Text, { size: "sm", tone: "muted", style: s.nomeDaColuna, children: coluna.header })
|
|
243
|
-
: coluna.header, typeof v === "string" ? _jsx(Text, { size: "sm", numeric: true, style: s.valor, children: v }) : v] }, coluna.key));
|
|
245
|
+
: coluna.header, typeof v === "string" ? _jsx(Text, { size: "sm", numeric: true, font: "ui", style: s.valor, children: v }) : v] }, coluna.key));
|
|
244
246
|
})] }));
|
|
245
247
|
// Só vira alvo se houver o que tocar. Uma linha `Pressable` sem ação é um botão que não faz
|
|
246
248
|
// nada — e o leitor de tela a anunciaria como botão.
|
package/dist/display.js
CHANGED
|
@@ -40,7 +40,7 @@ const folha = criarFolha((t) => ({
|
|
|
40
40
|
// Até a 0.10.1 eram `3px 9px` e `gap:6` crus, e o texto saía com entrelinha 1,0: no Android a
|
|
41
41
|
// perna do g e do p era cortada (a mesma causa do E1 no `Button`). A linha da referência é ≥ 1,33 ×
|
|
42
42
|
// a letra, e a letra precisa de 1,3 (a IBM Plex e a Atkinson Hyperlegible da ADR-0053, medidas
|
|
43
|
-
// na tabela `hhea`). O raio continua a cápsula da Aurea (identidade) e a
|
|
43
|
+
// na tabela `hhea`). Desde a ADR-0077 (0.40.1), menos: a Inter 1,21, a Sora 1,26, a IBM Plex Mono 1,3. O raio continua a cápsula da Aurea (identidade) e a
|
|
44
44
|
// borda continua nossa.
|
|
45
45
|
// ⚠ O `xs` NÃO existe na referência (é o contador sobre ícone): fica a medida nossa, 16 de altura,
|
|
46
46
|
// agora com letra 12 e linha 16 para caber a letra inteira.
|
package/dist/escolha.js
CHANGED
|
@@ -12,7 +12,8 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
12
12
|
// do `BottomSheet` (`overlays.tsx`).
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { Animated, PanResponder, Platform, Pressable, TextInput, View, } from "react-native";
|
|
15
|
-
import { canto, criarFolha, estadoAcessivel,
|
|
15
|
+
import { canto, criarFolha, estadoAcessivel, fundoDeCampo } from "./estilos.js";
|
|
16
|
+
import { useNaSuperficie } from "./superficie.js";
|
|
16
17
|
import { Icon } from "./icon.js";
|
|
17
18
|
import { Label, useCampo } from "./inputs.js";
|
|
18
19
|
import { driverNativo, useReduceMotion } from "./movimento.js";
|
|
@@ -56,7 +57,7 @@ const folha = criarFolha((t) => ({
|
|
|
56
57
|
width: t.size.space10 + t.size.space1, height: t.size.touchControlHMd,
|
|
57
58
|
alignItems: "center", justifyContent: "center",
|
|
58
59
|
borderWidth: t.size.borderWidth, borderColor: "transparent",
|
|
59
|
-
...canto(t.size.radiusControl),
|
|
60
|
+
...canto(t.size.radiusControl),
|
|
60
61
|
},
|
|
61
62
|
// A casa ativa: a borda da cor do foco, com a espessura do anel (o contorno de 2 da referência).
|
|
62
63
|
casaAtiva: { borderColor: t.color.focusStrong, borderWidth: t.size.focusWidth },
|
|
@@ -238,7 +239,9 @@ export function Slider({ label, labelHidden, value, defaultValue, onValueChange,
|
|
|
238
239
|
// A área de toque chega aos 44 no eixo de fora (o trilho tem 20).
|
|
239
240
|
const folga = (t.size.targetMin - t.size.space5) / 2;
|
|
240
241
|
const nomeDoGrupo = typeof label === "string" ? label : campo?.label;
|
|
241
|
-
|
|
242
|
+
// ADR-0077: o valor do `Slider` fica na fonte do texto, com algarismos de mesma largura (o `.slider-output` da
|
|
243
|
+
// web); o `numeric` sozinho seria a IBM Plex Mono, que é do app e do `KPI`.
|
|
244
|
+
const valorEscrito = showValue ? (_jsx(Text, { size: "xs", weight: 500, numeric: true, font: "ui", children: valores.map(texto).join(" – ") })) : null;
|
|
242
245
|
const trilhoDesenhado = (_jsxs(View, { ...gestoDoTrilho.panHandlers, onLayout: (e) => {
|
|
243
246
|
const { width, height } = e.nativeEvent.layout;
|
|
244
247
|
setTrilho(vertical ? height : width);
|
|
@@ -317,6 +320,8 @@ function proximoCodigo(anterior, texto, tamanho) {
|
|
|
317
320
|
*/
|
|
318
321
|
export function OTPField({ length, value, defaultValue, onValueChange, mask, disabled, label, style, testID }) {
|
|
319
322
|
const t = useAureaTokens();
|
|
323
|
+
// ADR-0078: dentro de uma superfície branca o campo volta ao cinza.
|
|
324
|
+
const naSuperficie = useNaSuperficie();
|
|
320
325
|
const s = folha(t);
|
|
321
326
|
const strings = useAureaStrings();
|
|
322
327
|
const campo = useCampo();
|
|
@@ -342,6 +347,7 @@ export function OTPField({ length, value, defaultValue, onValueChange, mask, dis
|
|
|
342
347
|
const ativa = focado && i === valor.length;
|
|
343
348
|
return (_jsx(View, { testID: testID ? `${testID}-casa-${i}` : undefined, style: [
|
|
344
349
|
s.casa,
|
|
350
|
+
fundoDeCampo(t, naSuperficie),
|
|
345
351
|
ativa && s.casaAtiva,
|
|
346
352
|
invalido && s.casaInvalida,
|
|
347
353
|
// Sobre a marca vale a tinta, inclusive no lugar do vermelho — a regra do `Input`.
|
package/dist/estilos.d.ts
CHANGED
|
@@ -40,6 +40,13 @@ export declare const comOpacidade: (cor: string, pct: number) => string;
|
|
|
40
40
|
* contorno), 3 = 20% (marca do checkbox e do rádio, trilho do switch).
|
|
41
41
|
*/
|
|
42
42
|
export declare const preenchimento: (t: AureaTokens, nivel: 1 | 2 | 3) => string;
|
|
43
|
+
/**
|
|
44
|
+
* O fundo do CAMPO (ADR-0078, a web na 0.40.0, o nativo na 0.40.1). No CLARO, solto na tela: a cor do cartão com a
|
|
45
|
+
* sombra leve (`shadowSm`, a mesma da referência); dentro de uma superfície branca (`useNaSuperficie()`, em
|
|
46
|
+
* `superficie.tsx`) e no ESCURO, o cinza de antes (`preenchimento(t, 2)`), sem sombra. Quem chama põe este estilo
|
|
47
|
+
* logo depois da pele do campo, antes dos estados (inválido, desativado), que continuam vencendo.
|
|
48
|
+
*/
|
|
49
|
+
export declare const fundoDeCampo: (t: AureaTokens, naSuperficie: boolean) => ViewStyle;
|
|
43
50
|
/**
|
|
44
51
|
* A mesma mistura, OPACA: a cor da frente a `pct` sobre a do fundo. Para o que tem algo passando POR TRÁS (o traço dos
|
|
45
52
|
* passos) ou cobre outra peça (as fotos sobrepostas) — translúcido, o que está atrás aparece. Hex de seis, como o
|
package/dist/estilos.js
CHANGED
|
@@ -56,6 +56,15 @@ export const comOpacidade = (cor, pct) => /^#[0-9a-fA-F]{6}$/.test(cor)
|
|
|
56
56
|
* contorno), 3 = 20% (marca do checkbox e do rádio, trilho do switch).
|
|
57
57
|
*/
|
|
58
58
|
export const preenchimento = (t, nivel) => comOpacidade(t.color.foreground, nivel === 1 ? 0.06 : nivel === 2 ? 0.1 : 0.2);
|
|
59
|
+
/**
|
|
60
|
+
* O fundo do CAMPO (ADR-0078, a web na 0.40.0, o nativo na 0.40.1). No CLARO, solto na tela: a cor do cartão com a
|
|
61
|
+
* sombra leve (`shadowSm`, a mesma da referência); dentro de uma superfície branca (`useNaSuperficie()`, em
|
|
62
|
+
* `superficie.tsx`) e no ESCURO, o cinza de antes (`preenchimento(t, 2)`), sem sombra. Quem chama põe este estilo
|
|
63
|
+
* logo depois da pele do campo, antes dos estados (inválido, desativado), que continuam vencendo.
|
|
64
|
+
*/
|
|
65
|
+
export const fundoDeCampo = (t, naSuperficie) => t.theme === "light" && !naSuperficie
|
|
66
|
+
? { backgroundColor: t.color.card, boxShadow: [...t.shadowLayers.shadowSm] }
|
|
67
|
+
: { backgroundColor: preenchimento(t, 2) };
|
|
59
68
|
/**
|
|
60
69
|
* A mesma mistura, OPACA: a cor da frente a `pct` sobre a do fundo. Para o que tem algo passando POR TRÁS (o traço dos
|
|
61
70
|
* passos) ou cobre outra peça (as fotos sobrepostas) — translúcido, o que está atrás aparece. Hex de seis, como o
|
package/dist/exibicao.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
4
4
|
//
|
|
5
5
|
// As quatro são as do pacote nativo da referência — anatomia, medidas, estados, comportamento e
|
|
6
6
|
// acessibilidade lidos no pacote publicado dela —, com o que é da Aurea por cima: as cores do tema,
|
|
7
|
-
// o canto 22 do cartão e a cápsula, a
|
|
7
|
+
// o canto 22 do cartão e a cápsula, a Inter e a Sora (ADR-0077), os ícones Phosphor, sem degradê, "menos movimento".
|
|
8
8
|
//
|
|
9
9
|
// Medido no pacote dela antes de escrito (a classe vira dp: `px-3` = 12, `py-4` = 16, `gap-4` = 16):
|
|
10
10
|
//
|
|
@@ -28,6 +28,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
28
28
|
import * as React from "react";
|
|
29
29
|
import { Animated, Easing, Pressable, View, } from "react-native";
|
|
30
30
|
import { canto, comOpacidade, criarFolha, estadoAcessivel, REACAO_AO_TOQUE } from "./estilos.js";
|
|
31
|
+
import { NaSuperficie } from "./superficie.js";
|
|
31
32
|
import { GrupoDeEsqueleto, Skeleton, usePulsoDoEsqueleto } from "./feedback.js";
|
|
32
33
|
import { Icon } from "./icon.js";
|
|
33
34
|
import { driverNativo, useReduceMotion } from "./movimento.js";
|
|
@@ -139,7 +140,9 @@ export function Accordion({ items, variant = "default", multiple = false, defaul
|
|
|
139
140
|
setInterno(novo);
|
|
140
141
|
onValueChange?.(novo);
|
|
141
142
|
};
|
|
142
|
-
|
|
143
|
+
const corpo = (_jsx(View, { testID: testID, style: [s.accordion, surface && s.accordionSurface, style], children: items.map((item, i) => (_jsxs(React.Fragment, { children: [i > 0 ? _jsx(View, { style: [s.fio, surface && s.fioSurface] }) : null, _jsx(ItemDoAccordion, { item: item, aberto: abertos.includes(item.id), surface: surface, onAlternar: alternar, testID: testID ? `${testID}-${item.id}` : undefined })] }, item.id))) }));
|
|
144
|
+
// ADR-0078: o `surface` é um cartão — o campo de dentro fica cinza. O comum herda o que está em volta.
|
|
145
|
+
return surface ? _jsx(NaSuperficie.Provider, { value: true, children: corpo }) : corpo;
|
|
143
146
|
}
|
|
144
147
|
function ItemDoAccordion({ item, aberto, surface, onAlternar, testID }) {
|
|
145
148
|
const t = useAureaTokens();
|
|
@@ -277,7 +280,7 @@ export function ScrollShadow({ children, orientation, visibility = "auto", isEna
|
|
|
277
280
|
return _jsxs(View, { testID: testID, style: style, children: [rolador, fios] });
|
|
278
281
|
}
|
|
279
282
|
// Na superfície, os fios ficam na borda da JANELA da lista (o miolo), e não na da caixa.
|
|
280
|
-
return (_jsx(View, { testID: testID, style: [s.superficieDaLista, style], children: _jsxs(View, { style: s.miolo, children: [rolador, fios] }) }));
|
|
283
|
+
return (_jsx(View, { testID: testID, style: [s.superficieDaLista, style], children: _jsxs(View, { style: s.miolo, children: [_jsx(NaSuperficie.Provider, { value: true, children: rolador }), fios] }) }));
|
|
281
284
|
}
|
|
282
285
|
/**
|
|
283
286
|
* Um comando para vários esqueletos — o skeleton-group da referência. O `isLoading` e a `animation`
|
package/dist/inputs.js
CHANGED
|
@@ -45,7 +45,8 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
45
45
|
import * as React from "react";
|
|
46
46
|
import { Animated, KeyboardAvoidingView as KeyboardAvoidingViewRN, Modal, Platform, Pressable, ScrollView, TextInput, View, } from "react-native";
|
|
47
47
|
import Svg, { Path } from "react-native-svg";
|
|
48
|
-
import { canto, cantosDeCima, criarFolha, estadoAcessivel, fioDoEscolhido, peleDoCartao, peleDoCartaoEscolhido, preenchimento } from "./estilos.js";
|
|
48
|
+
import { canto, cantosDeCima, criarFolha, estadoAcessivel, fioDoEscolhido, peleDoCartao, peleDoCartaoEscolhido, preenchimento, fundoDeCampo } from "./estilos.js";
|
|
49
|
+
import { useNaSuperficie } from "./superficie.js";
|
|
49
50
|
import { FilaRolante } from "./rolagem.js";
|
|
50
51
|
import { IconButton } from "./actions.js";
|
|
51
52
|
import { Icon } from "./icon.js";
|
|
@@ -72,7 +73,7 @@ const folha = criarFolha((t) => ({
|
|
|
72
73
|
caixa: {
|
|
73
74
|
width: "100%", minWidth: 0,
|
|
74
75
|
borderWidth: t.size.borderWidth, borderColor: "transparent",
|
|
75
|
-
...canto(t.size.radiusControl),
|
|
76
|
+
...canto(t.size.radiusControl),
|
|
76
77
|
color: t.color.foreground,
|
|
77
78
|
},
|
|
78
79
|
// O `.textarea` é o único da família com raio LG em vez do de controle: uma caixa alta em
|
|
@@ -88,7 +89,7 @@ const folha = criarFolha((t) => ({
|
|
|
88
89
|
grupo: {
|
|
89
90
|
flexDirection: "row", alignItems: "center", width: "100%", minWidth: 0,
|
|
90
91
|
borderWidth: t.size.borderWidth, borderColor: "transparent",
|
|
91
|
-
...canto(t.size.radiusControl),
|
|
92
|
+
...canto(t.size.radiusControl),
|
|
92
93
|
gap: t.size.space1,
|
|
93
94
|
},
|
|
94
95
|
// Dentro do grupo o campo perde a caixa e vira só o texto — a borda passou a ser do grupo.
|
|
@@ -231,6 +232,8 @@ export function Input({ value, defaultValue, onChangeText, placeholder, disabled
|
|
|
231
232
|
// `returnKeyType`, `onSubmitEditing`, `maxLength`. Defeito publicado na `0.8.2`.
|
|
232
233
|
...rest }) {
|
|
233
234
|
const t = useAureaTokens();
|
|
235
|
+
// ADR-0078: dentro de uma superfície branca o campo volta ao cinza.
|
|
236
|
+
const naSuperficie = useNaSuperficie();
|
|
234
237
|
const s = folha(t);
|
|
235
238
|
const peleDaMarca = usePeleSobreAMarca();
|
|
236
239
|
const campo = useCampo();
|
|
@@ -263,6 +266,7 @@ export function Input({ value, defaultValue, onChangeText, placeholder, disabled
|
|
|
263
266
|
// desenhando daria borda dentro de borda — que é exatamente o defeito que o `.input-group
|
|
264
267
|
// > .input` da web zera à mão (`aurea.css:751`).
|
|
265
268
|
grupo ? s.campoNoGrupo : s.caixa,
|
|
269
|
+
!grupo && fundoDeCampo(t, naSuperficie),
|
|
266
270
|
grupo
|
|
267
271
|
? { fontSize: fonteDoTamanho(t, tam), fontFamily: t.font.ui[400], color: t.color.foreground }
|
|
268
272
|
: { height: alturaDoTamanho(t, tam), paddingHorizontal: respiroDoTamanho(t, tam),
|
|
@@ -329,6 +333,8 @@ export function Textarea({ rows, size, style, ...rest }) {
|
|
|
329
333
|
*/
|
|
330
334
|
export function InputGroup({ size, disabled, children, style, testID, ...rest }) {
|
|
331
335
|
const t = useAureaTokens();
|
|
336
|
+
// ADR-0078: dentro de uma superfície branca o campo volta ao cinza.
|
|
337
|
+
const naSuperficie = useNaSuperficie();
|
|
332
338
|
const s = folha(t);
|
|
333
339
|
const peleDaMarca = usePeleSobreAMarca();
|
|
334
340
|
const campo = useCampo();
|
|
@@ -340,6 +346,7 @@ export function InputGroup({ size, disabled, children, style, testID, ...rest })
|
|
|
340
346
|
const ctx = React.useMemo(() => ({ size: tam, disabled: inativo, aoFocar: setFocado }), [tam, inativo]);
|
|
341
347
|
return (_jsx(View, { testID: testID, style: [
|
|
342
348
|
s.grupo,
|
|
349
|
+
fundoDeCampo(t, naSuperficie),
|
|
343
350
|
{ height: alturaDoTamanho(t, tam), paddingHorizontal: respiroDoTamanho(t, tam) },
|
|
344
351
|
campo?.invalido && s.invalido,
|
|
345
352
|
// O foco vem do campo lá dentro, por contexto: no React Native não existe `:focus-within`,
|
|
@@ -625,6 +632,8 @@ export const indicadorDaEscolhida = (t) => (_jsx(View, { style: folha(t).indicad
|
|
|
625
632
|
*/
|
|
626
633
|
export function Select({ items, value, onChange, placeholder, disabled, size, chevron = "caret-down", style, testID, }) {
|
|
627
634
|
const t = useAureaTokens();
|
|
635
|
+
// ADR-0078: dentro de uma superfície branca o campo volta ao cinza.
|
|
636
|
+
const naSuperficie = useNaSuperficie();
|
|
628
637
|
const s = folha(t);
|
|
629
638
|
// A folha sai do fluxo: pinta com os tokens do APP (ADR-0063 — ver `useTokensDoApp`).
|
|
630
639
|
const tf = useTokensDoApp();
|
|
@@ -637,6 +646,7 @@ export function Select({ items, value, onChange, placeholder, disabled, size, ch
|
|
|
637
646
|
const escolhido = items.find((i) => i.value === value);
|
|
638
647
|
return (_jsxs(_Fragment, { children: [_jsxs(Pressable, { testID: testID, onPress: inativo ? undefined : () => setAberto(true), disabled: inativo, accessibilityRole: "button", accessibilityLabel: campo?.label, accessibilityHint: campo?.hint, accessibilityValue: { text: escolhido?.label }, ...estadoAcessivel({ disabled: !!inativo, expanded: aberto }), style: [
|
|
639
648
|
s.caixa,
|
|
649
|
+
fundoDeCampo(t, naSuperficie),
|
|
640
650
|
// 0.32.0: o gatilho da referência — 16 dos lados (era 13) e 12 entre o valor e a seta.
|
|
641
651
|
// Os 12 de cima e de baixo dela são a altura de toque: 48 menos a linha de 24 do valor.
|
|
642
652
|
{ flexDirection: "row", alignItems: "center", justifyContent: "space-between",
|
package/dist/layout.js
CHANGED
|
@@ -18,6 +18,7 @@ import { Pressable, StyleSheet, View } from "react-native";
|
|
|
18
18
|
// envelope). O `ViewProps`/`TextProps` do RN 0.87 ja' declaram `ref`, entao ele viaja no
|
|
19
19
|
// `...rest` sem nada a mais.
|
|
20
20
|
import { canto, comOpacidade, criarFolha, peleDoCartao, peleDoCartaoEscolhido, REACAO_AO_TOQUE, estadoAcessivel } from "./estilos.js";
|
|
21
|
+
import { NaSuperficie } from "./superficie.js";
|
|
21
22
|
import { Text } from "./text.js";
|
|
22
23
|
import { useAureaTheme, useAureaTokens, SobreAMarca, TemaDentro } from "./theme.js";
|
|
23
24
|
const folha = criarFolha((t) => ({
|
|
@@ -217,13 +218,19 @@ export function Separator({ orientation = "horizontal", label, style, ...rest })
|
|
|
217
218
|
* Cartão com duas ações não tem `onPress`: cada ação é um botão dentro de um cartão comum.
|
|
218
219
|
*/
|
|
219
220
|
export function Card(props) {
|
|
221
|
+
// ADR-0078 (0.40.1): o cartão é superfície branca, e o campo de dentro volta ao cinza. O de contorno
|
|
222
|
+
// (transparente) e o `inset` (cinza) não são: HERDAM o que está em volta, como na web (eles não entram na
|
|
223
|
+
// lista de superfícies do `aurea.css`) — numa tela, o campo de dentro fica branco; dentro de outro cartão,
|
|
224
|
+
// cinza.
|
|
220
225
|
// MT-01 (ADR-0063, 10/10/2026): o `contrast` é o tema escuro DENTRO do cartão, então TODO filho
|
|
221
226
|
// se ajusta — texto, selo, botão, campo —, e não só a lista declarada do `brand`. A marca não
|
|
222
227
|
// atravessa: dentro de um cartão amarelo, o `contrast` não é amarelo, e a tinta dele não vale.
|
|
223
228
|
if (props.variant === "contrast") {
|
|
224
|
-
return (_jsx(TemaDentro, { tema: "dark", children: _jsx(SobreAMarca.Provider, { value: null, children: _jsx(CorpoDoCartao, { ...props }) }) }));
|
|
229
|
+
return (_jsx(NaSuperficie.Provider, { value: true, children: _jsx(TemaDentro, { tema: "dark", children: _jsx(SobreAMarca.Provider, { value: null, children: _jsx(CorpoDoCartao, { ...props }) }) }) }));
|
|
225
230
|
}
|
|
226
|
-
|
|
231
|
+
if (props.variant === "outline" || props.variant === "inset")
|
|
232
|
+
return _jsx(CorpoDoCartao, { ...props });
|
|
233
|
+
return _jsx(NaSuperficie.Provider, { value: true, children: _jsx(CorpoDoCartao, { ...props }) });
|
|
227
234
|
}
|
|
228
235
|
/** A cor CHEIA de cada tom do traço — a mesma nos dois temas (ADR-0063, exceção à ADR-0061). */
|
|
229
236
|
const COR_DO_TRACO = {
|
package/dist/menu.js
CHANGED
|
@@ -28,6 +28,7 @@ import { Animated, Easing, Linking, Modal, Pressable, ScrollView, View, useWindo
|
|
|
28
28
|
import Svg, { Path } from "react-native-svg";
|
|
29
29
|
import { SafeAreaInsetsContext, initialWindowMetrics } from "react-native-safe-area-context";
|
|
30
30
|
import { canto, criarFolha, estadoAcessivel, letraDoToken } from "./estilos.js";
|
|
31
|
+
import { NaSuperficie } from "./superficie.js";
|
|
31
32
|
import { Icon } from "./icon.js";
|
|
32
33
|
import { Text } from "./text.js";
|
|
33
34
|
import { ForaDaMarca, useTokensDoApp } from "./theme.js";
|
|
@@ -318,7 +319,7 @@ function Seta({ tf, lado, ancora, painel }) {
|
|
|
318
319
|
*/
|
|
319
320
|
export function Popover({ trigger, title, children, side = "bottom", arrow = false, testID }) {
|
|
320
321
|
const c = useCamada(trigger);
|
|
321
|
-
return (_jsxs(_Fragment, { children: [c.gatilho, _jsxs(CamadaPresa, { c: c, side: side, seta: arrow, testID: testID, children: [_jsx(TituloDoPopover, { title: title }), typeof children === "string" ? _jsx(Text, { size: "md", tone: "muted", children: children }) : children] })] }));
|
|
322
|
+
return (_jsxs(_Fragment, { children: [c.gatilho, _jsxs(CamadaPresa, { c: c, side: side, seta: arrow, testID: testID, children: [_jsx(TituloDoPopover, { title: title }), _jsx(NaSuperficie.Provider, { value: true, children: typeof children === "string" ? _jsx(Text, { size: "md", tone: "muted", children: children }) : children })] })] }));
|
|
322
323
|
}
|
|
323
324
|
function TituloDoPopover({ title }) {
|
|
324
325
|
const s = folha(useTokensDoApp());
|
package/dist/navigation.js
CHANGED
|
@@ -4,6 +4,7 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
|
4
4
|
import { useAnotarBottomNav } from "./barranav.js";
|
|
5
5
|
import { Avatar, Badge } from "./display.js";
|
|
6
6
|
import { canto, comOpacidade, criarFolha, estadoAcessivel, fioDoEscolhido, misturaOpaca } from "./estilos.js";
|
|
7
|
+
import { NaSuperficie } from "./superficie.js";
|
|
7
8
|
import { Icon } from "./icon.js";
|
|
8
9
|
import { Card } from "./layout.js";
|
|
9
10
|
import { FilaRolante } from "./rolagem.js";
|
|
@@ -465,7 +466,7 @@ export function Header({ variant = "floating", inset = "bar", brand, children, s
|
|
|
465
466
|
s.topo, s[`topo_${variant}`],
|
|
466
467
|
variant === "flush" && inset !== "bar" && s[`topo_recuo_${inset}`],
|
|
467
468
|
style,
|
|
468
|
-
], ...rest, children: [brand != null && _jsx(View, { children: brand }), children] }));
|
|
469
|
+
], ...rest, children: [brand != null && _jsx(View, { children: brand }), variant === "flush" ? children : _jsx(NaSuperficie.Provider, { value: true, children: children })] }));
|
|
469
470
|
}
|
|
470
471
|
/** @deprecated `Topbar` é o nome antigo do `Header` (07/10/2026). Continua funcionando, igual; use `Header`. */
|
|
471
472
|
export function Topbar(props) {
|
package/dist/numero.js
CHANGED
|
@@ -48,7 +48,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
48
48
|
import * as React from "react";
|
|
49
49
|
import { Platform, TextInput, View } from "react-native";
|
|
50
50
|
import { IconButton } from "./actions.js";
|
|
51
|
-
import { canto, criarFolha, estadoAcessivel,
|
|
51
|
+
import { canto, criarFolha, estadoAcessivel, fundoDeCampo } from "./estilos.js";
|
|
52
|
+
import { useNaSuperficie } from "./superficie.js";
|
|
52
53
|
import { useCampo } from "./inputs.js";
|
|
53
54
|
import { useAureaStrings, useAureaTokens, usePeleSobreAMarca } from "./theme.js";
|
|
54
55
|
// 0.32.0: o campo comum na altura de TOQUE, como o `Input` (40 · 48 · 56; era 32 · 36 · 40). O
|
|
@@ -81,7 +82,7 @@ const folha = criarFolha((t) => ({
|
|
|
81
82
|
campo: {
|
|
82
83
|
width: t.size.space16, textAlign: "center",
|
|
83
84
|
borderWidth: t.size.borderWidth, borderColor: "transparent",
|
|
84
|
-
...canto(t.size.radiusControl),
|
|
85
|
+
...canto(t.size.radiusControl),
|
|
85
86
|
// A mesma correção de Android do `Input` do Lote 4 — ver `inputs.tsx:280-296`.
|
|
86
87
|
paddingVertical: 0, textAlignVertical: "center",
|
|
87
88
|
},
|
|
@@ -253,6 +254,8 @@ const paraEdicao = (n, locale) => {
|
|
|
253
254
|
*/
|
|
254
255
|
export function NumberField({ value, defaultValue, onValueChange, min, max, step = 1, format, locale, disabled, readOnly, size, fullWidth = false, label, placeholder, keyboardType, icons = { increment: "plus", decrement: "minus" }, style, testID, }) {
|
|
255
256
|
const t = useAureaTokens();
|
|
257
|
+
// ADR-0078: dentro de uma superfície branca o campo volta ao cinza.
|
|
258
|
+
const naSuperficie = useNaSuperficie();
|
|
256
259
|
const s = folha(t);
|
|
257
260
|
const peleDaMarca = usePeleSobreAMarca();
|
|
258
261
|
const strings = useAureaStrings();
|
|
@@ -369,6 +372,7 @@ export function NumberField({ value, defaultValue, onValueChange, min, max, step
|
|
|
369
372
|
// campo solto. Sem um dos dois, é um nó anônimo para o leitor de tela.
|
|
370
373
|
accessibilityLabel: label ?? campo?.label, accessibilityHint: campo?.hint, ...estadoAcessivel({ disabled: !!inativo }), "aria-invalid": campo?.invalido, style: [
|
|
371
374
|
s.campo,
|
|
375
|
+
fundoDeCampo(t, naSuperficie),
|
|
372
376
|
tam === "display" && s.campoDisplay,
|
|
373
377
|
fullWidth && s.campoLargo,
|
|
374
378
|
{ height: alturaDoTamanho(t, tam), fontSize: fonteDoTamanho(t, tam),
|
package/dist/overlays.js
CHANGED
|
@@ -63,6 +63,7 @@ import * as React from "react";
|
|
|
63
63
|
import { Animated, Easing, Modal, PanResponder, Pressable, ScrollView, View, } from "react-native";
|
|
64
64
|
import { Button } from "./actions.js";
|
|
65
65
|
import { canto, cantosDeCima, criarFolha } from "./estilos.js";
|
|
66
|
+
import { NaSuperficie } from "./superficie.js";
|
|
66
67
|
import { CloseButton } from "./actions.js";
|
|
67
68
|
import { RecuoDaFolha } from "./screen.js";
|
|
68
69
|
import { Text } from "./text.js";
|
|
@@ -193,7 +194,7 @@ export function Dialog({ open, title, children, footer, onClose, scroll = true,
|
|
|
193
194
|
const t = useTokensDoApp();
|
|
194
195
|
const s = folha(t);
|
|
195
196
|
const Corpo = scroll ? ScrollView : View;
|
|
196
|
-
return (_jsx(ForaDaMarca, { children: _jsx(Modal, { visible: open, transparent: true, animationType: "fade", statusBarTranslucent: true, navigationBarTranslucent: true, onRequestClose: onClose, testID: testID, children: _jsxs(View, { style: [s.fundo, s.centro], children: [_jsx(Pressable, { style: s.fundoDeToque, onPress: onClose, accessible: false, testID: testID ? `${testID}-fundo` : undefined }), _jsxs(View, { style: [s.superficie, style], children: [_jsx(Text, { size: "lg", weight: 500, accessibilityRole: "header", style: [s.tituloDaJanela, s.tituloComFechar], children: title }), _jsx(View, { style: s.fechar, children: _jsx(CloseButton, { onPress: onClose }) }), _jsx(Corpo, { ...(scroll ? { contentContainerStyle: s.corpo } : { style: s.corpo }), children: children }), footer ? _jsx(View, { style: s.rodape, children: footer }) : null] })] }) }) }));
|
|
197
|
+
return (_jsx(ForaDaMarca, { children: _jsx(Modal, { visible: open, transparent: true, animationType: "fade", statusBarTranslucent: true, navigationBarTranslucent: true, onRequestClose: onClose, testID: testID, children: _jsxs(View, { style: [s.fundo, s.centro], children: [_jsx(Pressable, { style: s.fundoDeToque, onPress: onClose, accessible: false, testID: testID ? `${testID}-fundo` : undefined }), _jsxs(View, { style: [s.superficie, style], children: [_jsx(Text, { size: "lg", weight: 500, accessibilityRole: "header", style: [s.tituloDaJanela, s.tituloComFechar], children: title }), _jsx(View, { style: s.fechar, children: _jsx(CloseButton, { onPress: onClose }) }), _jsx(Corpo, { ...(scroll ? { contentContainerStyle: s.corpo } : { style: s.corpo }), children: _jsx(NaSuperficie.Provider, { value: true, children: children }) }), footer ? _jsx(View, { style: s.rodape, children: footer }) : null] })] }) }) }));
|
|
197
198
|
}
|
|
198
199
|
/**
|
|
199
200
|
* A decisão que não se desfaz.
|
|
@@ -268,7 +269,7 @@ export function Drawer({ open, title, children, onClose, side = "right", scroll
|
|
|
268
269
|
return (_jsx(ForaDaMarca, { children: _jsx(Modal, { visible: open, transparent: true, animationType: "none", statusBarTranslucent: true, navigationBarTranslucent: true, onRequestClose: onClose, testID: testID, children: _jsxs(View, { style: s.fundo, children: [_jsx(Pressable, { style: s.fundoDeToque, onPress: onClose, accessible: false, testID: testID ? `${testID}-fundo` : undefined }), _jsxs(Animated.View, { style: [
|
|
269
270
|
s.gaveta, side === "right" ? s.gavetaDireita : s.gavetaEsquerda,
|
|
270
271
|
{ transform: [{ translateX: desloca }] }, style,
|
|
271
|
-
], children: [_jsx(Text, { size: "lg", weight: 500, accessibilityRole: "header", style: [s.tituloDaJanela, s.tituloComFechar], children: title }), _jsx(View, { style: [s.fechar, s.fecharDaGaveta], children: _jsx(CloseButton, { label: strings.close, onPress: onClose }) }), _jsx(Corpo, { ...(scroll ? { contentContainerStyle: s.corpo } : { style: s.corpo }), children: children })] })] }) }) }));
|
|
272
|
+
], children: [_jsx(Text, { size: "lg", weight: 500, accessibilityRole: "header", style: [s.tituloDaJanela, s.tituloComFechar], children: title }), _jsx(View, { style: [s.fechar, s.fecharDaGaveta], children: _jsx(CloseButton, { label: strings.close, onPress: onClose }) }), _jsx(Corpo, { ...(scroll ? { contentContainerStyle: s.corpo } : { style: s.corpo }), children: _jsx(NaSuperficie.Provider, { value: true, children: children }) })] })] }) }) }));
|
|
272
273
|
}
|
|
273
274
|
/**
|
|
274
275
|
* A folha que sobe de baixo. **NÃO existe na web** — é o único componente deste lote sem ficha.
|
|
@@ -323,5 +324,5 @@ export function BottomSheet({ open, title, children, onClose, grabber = true, dr
|
|
|
323
324
|
}).start();
|
|
324
325
|
},
|
|
325
326
|
}), [draggable, onClose, arrasto, reduzir, t.easing.easeEmphasized]);
|
|
326
|
-
return (_jsx(ForaDaMarca, { children: _jsx(Modal, { visible: open, transparent: true, animationType: reduzir !== false ? "none" : "slide", statusBarTranslucent: true, navigationBarTranslucent: true, onRequestClose: onClose, testID: testID, children: _jsxs(View, { style: s.fundo, children: [_jsx(Pressable, { style: s.fundoDeToque, onPress: onClose, accessible: false, testID: testID ? `${testID}-fundo` : undefined }), _jsxs(Animated.View, { ...naoAtravessa, ...gestos.panHandlers, onLayout: (e) => { altura.current = e.nativeEvent.layout.height; }, style: [s.folhaBaixo, !grabber && s.folhaSemPuxador, { transform: [{ translateY: arrasto }] }, style], children: [grabber ? (_jsx(View, { style: s.puxadorArea, accessible: false, importantForAccessibility: "no-hide-descendants", children: _jsx(View, { style: s.puxador }) })) : null, title ? (_jsx(View, { style: s.cabecalho, children: _jsx(Text, { size: "lg", weight: 500, accessibilityRole: "header", style: s.titulo, children: title }) })) : null, _jsx(Corpo, { ...(scroll ? { contentContainerStyle: s.corpo } : { style: s.corpo }), children: children }), _jsx(RecuoDaFolha, {})] })] }) }) }));
|
|
327
|
+
return (_jsx(ForaDaMarca, { children: _jsx(Modal, { visible: open, transparent: true, animationType: reduzir !== false ? "none" : "slide", statusBarTranslucent: true, navigationBarTranslucent: true, onRequestClose: onClose, testID: testID, children: _jsxs(View, { style: s.fundo, children: [_jsx(Pressable, { style: s.fundoDeToque, onPress: onClose, accessible: false, testID: testID ? `${testID}-fundo` : undefined }), _jsxs(Animated.View, { ...naoAtravessa, ...gestos.panHandlers, onLayout: (e) => { altura.current = e.nativeEvent.layout.height; }, style: [s.folhaBaixo, !grabber && s.folhaSemPuxador, { transform: [{ translateY: arrasto }] }, style], children: [grabber ? (_jsx(View, { style: s.puxadorArea, accessible: false, importantForAccessibility: "no-hide-descendants", children: _jsx(View, { style: s.puxador }) })) : null, title ? (_jsx(View, { style: s.cabecalho, children: _jsx(Text, { size: "lg", weight: 500, accessibilityRole: "header", style: s.titulo, children: title }) })) : null, _jsx(Corpo, { ...(scroll ? { contentContainerStyle: s.corpo } : { style: s.corpo }), children: _jsx(NaSuperficie.Provider, { value: true, children: children }) }), _jsx(RecuoDaFolha, {})] })] }) }) }));
|
|
327
328
|
}
|
package/dist/sistema.js
CHANGED
|
@@ -35,7 +35,8 @@ import { Linking, Platform, Pressable, View } from "react-native";
|
|
|
35
35
|
import RNDateTimePicker, { DateTimePickerAndroid } from "@react-native-community/datetimepicker";
|
|
36
36
|
import * as ImagePicker from "expo-image-picker";
|
|
37
37
|
import { IconButton } from "./actions.js";
|
|
38
|
-
import { canto, criarFolha, estadoAcessivel, preenchimento } from "./estilos.js";
|
|
38
|
+
import { canto, criarFolha, estadoAcessivel, preenchimento, fundoDeCampo } from "./estilos.js";
|
|
39
|
+
import { useNaSuperficie } from "./superficie.js";
|
|
39
40
|
import { Alert } from "./feedback.js";
|
|
40
41
|
import { Icon } from "./icon.js";
|
|
41
42
|
import { alturaDoTamanho, respiroDoTamanho, useCampo } from "./inputs.js";
|
|
@@ -46,7 +47,7 @@ const folha = criarFolha((t) => ({
|
|
|
46
47
|
gatilho: {
|
|
47
48
|
flexDirection: "row", alignItems: "center", justifyContent: "space-between",
|
|
48
49
|
width: "100%", borderWidth: t.size.borderWidth, borderColor: "transparent",
|
|
49
|
-
...canto(t.size.radiusControl),
|
|
50
|
+
...canto(t.size.radiusControl),
|
|
50
51
|
},
|
|
51
52
|
invalido: { borderColor: "transparent", backgroundColor: t.color.dangerBg },
|
|
52
53
|
// No navegador o texto e o ícone vão numa caixa escondida do leitor de tela (E16): a mesma
|
|
@@ -139,6 +140,8 @@ const doCampoWeb = (texto, mode, base) => {
|
|
|
139
140
|
*/
|
|
140
141
|
export function DatePicker({ value, onChange, mode = "date", minimumDate, maximumDate, disabled, size, format, placeholder, icon = "calendar", style, testID, }) {
|
|
141
142
|
const t = useAureaTokens();
|
|
143
|
+
// ADR-0078: dentro de uma superfície branca o campo volta ao cinza.
|
|
144
|
+
const naSuperficie = useNaSuperficie();
|
|
142
145
|
const s = folha(t);
|
|
143
146
|
const strings = useAureaStrings();
|
|
144
147
|
const campo = useCampo();
|
|
@@ -171,6 +174,7 @@ export function DatePicker({ value, onChange, mode = "date", minimumDate, maximu
|
|
|
171
174
|
// dos lados (era 13). Era uma cópia das contas de lá.
|
|
172
175
|
const pele = [
|
|
173
176
|
s.gatilho,
|
|
177
|
+
fundoDeCampo(t, naSuperficie),
|
|
174
178
|
{ height: alturaDoTamanho(t, tam), paddingHorizontal: respiroDoTamanho(t, tam) },
|
|
175
179
|
campo?.invalido && s.invalido,
|
|
176
180
|
inativo && s.desabilitado,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// ADR-0078 (0.40.1 no nativo): "estou numa superfície branca". No CLARO, o campo solto na tela é a cor do cartão
|
|
2
|
+
// com a sombra leve (`fundoDeCampo`, em `estilos.ts`); dentro de uma superfície que pinta a cor do cartão, ele volta
|
|
3
|
+
// ao cinza de antes — branco no branco só a sombra separa. Na web quem avisa é a cascata (`--field-fill`); aqui, este
|
|
4
|
+
// contexto, que o `Card` liga (o de contorno e o `inset` herdam de quem está em volta; o `contrast` liga), e também o
|
|
5
|
+
// `Dialog`, o `Drawer`, a `BottomSheet`, o conteúdo do `Popover`, o `Accordion` com `surface`, o `Header` flutuante e
|
|
6
|
+
// o de pílula e o `ScrollShadow` de superfície. Peça nova que pinta a cor do cartão e recebe conteúdo do app liga
|
|
7
|
+
// também. O `Alert`, o `Toast` e a célula da `Table` não: são um elemento só para o leitor de tela, e campo dentro
|
|
8
|
+
// deles some no iPhone (check 43). Interno ao pacote: não sai pela porta da frente (nome com inicial maiúscula conta
|
|
9
|
+
// como componente).
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
export const NaSuperficie = React.createContext(false);
|
|
12
|
+
/** `true` dentro de uma superfície branca da Aurea (ou do app que ligou o contexto). */
|
|
13
|
+
export const useNaSuperficie = () => React.useContext(NaSuperficie);
|
package/dist/text.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ export interface TextProps extends TextPropsRN {
|
|
|
34
34
|
/**
|
|
35
35
|
* GAR-16 (0.28.0): algarismos da mesma largura (`fontVariant: ["tabular-nums"]`, iOS e Android) —
|
|
36
36
|
* para número que alinha em coluna ou muda na tela. Desligado por padrão, como na web.
|
|
37
|
+
* ADR-0077 (0.40.1): e na fonte de código, a IBM Plex Mono — o valor e o número de identificação, como
|
|
38
|
+
* na web. O `font` passado explicitamente continua mandando.
|
|
37
39
|
*/
|
|
38
40
|
numeric?: boolean;
|
|
39
41
|
}
|
|
@@ -41,9 +43,9 @@ export interface TextProps extends TextPropsRN {
|
|
|
41
43
|
* Texto da Aurea. Sem provider acima, `useAureaTokens` levanta — de propósito: um padrão
|
|
42
44
|
* silencioso aqui desenharia o app inteiro no tema errado sem nada acusar.
|
|
43
45
|
*
|
|
44
|
-
* ⚠ **`fontWeight` não aparece em lugar nenhum deste arquivo, e isso é a ADR-0039.** Na
|
|
45
|
-
*
|
|
46
|
-
*
|
|
46
|
+
* ⚠ **`fontWeight` não aparece em lugar nenhum deste arquivo, e isso é a ADR-0039.** Na Inter, na Sora
|
|
47
|
+
* e na IBM Plex Mono (ADR-0077; era assim também na Atkinson e na IBM Plex) só Regular, Italic e Bold
|
|
48
|
+
* moram na família principal; Medium e SemiBold são famílias
|
|
47
49
|
* próprias. Pedir peso 600 por `fontWeight` devolveria o Regular sintetizado — **em silêncio**.
|
|
48
50
|
* Quem escolhe a fonte aqui é o `fontFamily`, com o nome PostScript que o provider já resolveu.
|
|
49
51
|
*/
|
package/dist/text.js
CHANGED
|
@@ -108,9 +108,9 @@ const folha = criarFolha((t) => {
|
|
|
108
108
|
* Texto da Aurea. Sem provider acima, `useAureaTokens` levanta — de propósito: um padrão
|
|
109
109
|
* silencioso aqui desenharia o app inteiro no tema errado sem nada acusar.
|
|
110
110
|
*
|
|
111
|
-
* ⚠ **`fontWeight` não aparece em lugar nenhum deste arquivo, e isso é a ADR-0039.** Na
|
|
112
|
-
*
|
|
113
|
-
*
|
|
111
|
+
* ⚠ **`fontWeight` não aparece em lugar nenhum deste arquivo, e isso é a ADR-0039.** Na Inter, na Sora
|
|
112
|
+
* e na IBM Plex Mono (ADR-0077; era assim também na Atkinson e na IBM Plex) só Regular, Italic e Bold
|
|
113
|
+
* moram na família principal; Medium e SemiBold são famílias
|
|
114
114
|
* próprias. Pedir peso 600 por `fontWeight` devolveria o Regular sintetizado — **em silêncio**.
|
|
115
115
|
* Quem escolhe a fonte aqui é o `fontFamily`, com o nome PostScript que o provider já resolveu.
|
|
116
116
|
*/
|
|
@@ -121,7 +121,9 @@ export function Text({ type, size, weight: pesoPedido, font: fontePedida, tone =
|
|
|
121
121
|
// Sem `type`, os padrões de sempre (`md`, 400, `ui`, `normal`) — nada muda para quem já usa.
|
|
122
122
|
const papel = type ? PAPEL[type] : undefined;
|
|
123
123
|
const weight = pesoPedido ?? papel?.peso ?? 400;
|
|
124
|
-
|
|
124
|
+
// ADR-0077 (0.40.1): o `numeric` vai na fonte de CÓDIGO, a IBM Plex Mono — os valores e os números de identificação,
|
|
125
|
+
// como a `.typography-numeric` da web. A fonte pedida explicitamente (`font`) continua ganhando.
|
|
126
|
+
const font = fontePedida ?? (numeric ? "code" : papel?.fonte ?? "ui");
|
|
125
127
|
const tracking = trackingPedido ?? (papel?.junto ? "tight" : undefined);
|
|
126
128
|
const proprio = React.useMemo(() => {
|
|
127
129
|
const fontSize = size
|
|
@@ -132,7 +134,7 @@ export function Text({ type, size, weight: pesoPedido, font: fontePedida, tone =
|
|
|
132
134
|
: papel ? t.size[papel.entrelinha] ?? t.size.leadingNormal : t.size.leadingNormal;
|
|
133
135
|
const escala = t.font[font];
|
|
134
136
|
// O itálico é UMA fonte, não um estilo sintético: `fontStyle:"italic"` faria o sistema
|
|
135
|
-
// inclinar o desenho reto, e a
|
|
137
|
+
// inclinar o desenho reto, e a Inter tem itálico desenhado. Só o `ui` o tem — nos outros
|
|
136
138
|
// papéis o pedido cai no peso pedido, que é o comportamento honesto.
|
|
137
139
|
const familia = italic && escala.italic ? escala.italic : escala[weight];
|
|
138
140
|
return {
|
package/dist/theme.d.ts
CHANGED
|
@@ -27,8 +27,8 @@ export type AureaProviderProps = {
|
|
|
27
27
|
*/
|
|
28
28
|
defaultDensity?: AureaDensity;
|
|
29
29
|
/**
|
|
30
|
-
* O mapa `papel -> peso -> família` que faz o texto sair na
|
|
31
|
-
* tema devolve a família PEDIDA ("
|
|
30
|
+
* O mapa `papel -> peso -> família` que faz o texto sair na Inter, o título na Sora e o código na IBM
|
|
31
|
+
* Plex Mono (ADR-0077). Sem ele, o tema devolve a família PEDIDA ("Inter"), que no aparelho vira fonte de
|
|
32
32
|
* sistema para todo peso que
|
|
33
33
|
* não seja Regular/Italic/Bold — **medido na tabela `name` dos .ttf**: Medium e SemiBold são
|
|
34
34
|
* famílias próprias, não pesos da mesma família (ADR-0039).
|
package/dist/tokens.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export type AureaTokens = {
|
|
|
62
62
|
/** 1rem em dp. Medido no navegador (raiz sem `font-size` = 16px), não presumido. */
|
|
63
63
|
remInDp: number;
|
|
64
64
|
};
|
|
65
|
-
/** O mapa que o consumidor injeta para o texto sair na
|
|
65
|
+
/** O mapa que o consumidor injeta para o texto sair na Inter, na Sora e na IBM Plex Mono. Ver `AureaProviderProps`. */
|
|
66
66
|
export type AureaFontFamilies = {
|
|
67
67
|
ui: AureaFontInput;
|
|
68
68
|
editorial: AureaFontInput;
|
package/dist/tokens.js
CHANGED
|
@@ -89,7 +89,7 @@ export function resolverTokens(theme, density, fontFamilies) {
|
|
|
89
89
|
// que some daqui some do app sem ninguém acusar.
|
|
90
90
|
}
|
|
91
91
|
// Sem mapa injetado, a família CRUA do token preenche os quatro pesos: é o token dizendo
|
|
92
|
-
// "
|
|
92
|
+
// "Inter", que no aparelho vira Regular ou fonte de sistema. Honesto e previsível —
|
|
93
93
|
// e é por isso que o `fontFamilies` do provider existe.
|
|
94
94
|
const font = {
|
|
95
95
|
ui: normalizarEscala(fontFamilies?.ui, texto.fontUi ?? "System"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aurea-uds/native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.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.41.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@react-native-community/datetimepicker": ">=8",
|