@aurea-uds/native 0.56.0 → 0.59.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/LICENSE CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  Apache License
2
3
  Version 2.0, January 2004
3
4
  http://www.apache.org/licenses/
@@ -178,7 +179,7 @@
178
179
  APPENDIX: How to apply the Apache License to your work.
179
180
 
180
181
  To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "{}"
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
183
  replaced with your own identifying information. (Don't include
183
184
  the brackets!) The text should be enclosed in the appropriate
184
185
  comment syntax for the file format. We also recommend that a
@@ -186,7 +187,7 @@
186
187
  same "printed page" as the copyright notice for easier
187
188
  identification within third-party archives.
188
189
 
189
- Copyright 2015 IBM Corp.
190
+ Copyright [yyyy] [name of copyright owner]
190
191
 
191
192
  Licensed under the Apache License, Version 2.0 (the "License");
192
193
  you may not use this file except in compliance with the License.
package/dist/data.d.ts CHANGED
@@ -118,6 +118,11 @@ export interface TableProps<T> extends Virtualizavel {
118
118
  onRowPress?: (linha: T) => void;
119
119
  /** O que mostrar sem linhas. Sem isto, a frase de vazio da tabela de frases. */
120
120
  empty?: React.ReactNode;
121
+ /**
122
+ * MNT-38: as fileiras juntas num cartão só, com uma linha clara entre elas (menos depois da última) — o `dividers` da web,
123
+ * no arranjo do aparelho, onde cada fileira já é um cartão. Sem efeito na marca Ember, como na web.
124
+ */
125
+ dividers?: boolean;
121
126
  style?: StyleProp<ViewStyle>;
122
127
  testID?: string;
123
128
  }
@@ -141,5 +146,5 @@ export interface TableProps<T> extends Virtualizavel {
141
146
  * cartão. É o que impede o defeito da tabela virada em lista: quatro números soltos, um embaixo
142
147
  * do outro, sem dizer o que cada um é.
143
148
  */
144
- export declare function Table<T>({ caption, columns, rows, keyExtractor, onRowPress, empty, virtualized, style, testID, }: TableProps<T>): React.JSX.Element;
149
+ export declare function Table<T>({ caption, columns, rows, keyExtractor, onRowPress, empty, dividers, virtualized, style, testID, }: TableProps<T>): React.JSX.Element;
145
150
  export {};
package/dist/data.js CHANGED
@@ -56,7 +56,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
56
56
  // .table th :1185 `subtle-foreground`, fundo `surface-2`, textXs, CAIXA ALTA
57
57
  import * as React from "react";
58
58
  import { FlatList, Pressable, View, useWindowDimensions, } from "react-native";
59
- import { aroDoEstilo, canto, criarFolha, marcaDoEstilo, peleDoPonto } from "./estilos.js";
59
+ import { aroDoEstilo, canto, criarFolha, marcaDoEstilo, peleDoPonto, preenchimento } from "./estilos.js";
60
60
  import { IconeEmMoldura } from "./moldura.js";
61
61
  import { Text } from "./text.js";
62
62
  import { useAureaStrings, useAureaTokens } from "./theme.js";
@@ -107,6 +107,11 @@ const folha = criarFolha((t) => ({
107
107
  linhaTocavel: { minHeight: t.size.targetMin ?? 44 },
108
108
  celula: { flexDirection: "row", gap: t.size.space3, alignItems: "flex-start" },
109
109
  nomeDaColuna: { flexShrink: 0, maxWidth: "45%" },
110
+ // `dividers` (MNT-38, 05/11/2026, *"Pode, um cartão só"*): as fileiras juntas num cartão só, e entre elas a linha clara —
111
+ // o texto a 10%, a mesma da web. Uma faixa de 1, e não borda: a borda colorida é o que a trava do sem linha recusa.
112
+ grupo: { ...canto(t.size.radiusLg), backgroundColor: t.color.card, overflow: "hidden" },
113
+ linhaNoGrupo: { ...canto(0), backgroundColor: "transparent" },
114
+ divisoria: { height: t.size.borderWidth, backgroundColor: preenchimento(t, 2) },
110
115
  vazio: { paddingVertical: t.size.space6, alignItems: "center" },
111
116
  }));
112
117
  /**
@@ -240,9 +245,10 @@ export function DataList({ items, layout = "auto", style, testID }) {
240
245
  * cartão. É o que impede o defeito da tabela virada em lista: quatro números soltos, um embaixo
241
246
  * do outro, sem dizer o que cada um é.
242
247
  */
243
- export function Table({ caption, columns, rows, keyExtractor, onRowPress, empty, virtualized = false, style, testID, }) {
248
+ export function Table({ caption, columns, rows, keyExtractor, onRowPress, empty, dividers, virtualized = false, style, testID, }) {
244
249
  const t = useAureaTokens();
245
250
  const s = folha(t);
251
+ const agrupada = !!dividers && t.brand !== "ember";
246
252
  const strings = useAureaStrings();
247
253
  const principal = columns.find((c) => c.primary);
248
254
  const secundarias = columns.filter((c) => c !== principal);
@@ -270,9 +276,9 @@ export function Table({ caption, columns, rows, keyExtractor, onRowPress, empty,
270
276
  // nada — e o leitor de tela a anunciaria como botão.
271
277
  // A linha é o item da lista; a tocável é um botão DENTRO dele (o papel de item não pode ir no botão).
272
278
  return onRowPress
273
- ? _jsx(View, { role: "listitem", children: _jsx(Pressable, { accessibilityRole: "button", onPress: () => onRowPress(linha), style: [s.linha, s.linhaTocavel], children: corpo }) })
274
- : _jsx(View, { role: "listitem", style: s.linha, children: corpo });
275
- }, [principal, secundarias, conteudo, onRowPress, s]);
279
+ ? _jsx(View, { role: "listitem", children: _jsx(Pressable, { accessibilityRole: "button", onPress: () => onRowPress(linha), style: [s.linha, s.linhaTocavel, agrupada && s.linhaNoGrupo], children: corpo }) })
280
+ : _jsx(View, { role: "listitem", style: [s.linha, agrupada && s.linhaNoGrupo], children: corpo });
281
+ }, [principal, secundarias, conteudo, onRowPress, s, agrupada]);
276
282
  const chave = React.useCallback((linha, n) => keyExtractor ? keyExtractor(linha, n) : String(n), [keyExtractor]);
277
283
  const nomeDaLista = typeof caption === "string" ? caption : strings.tableLabel;
278
284
  if (rows.length === 0) {
@@ -281,7 +287,7 @@ export function Table({ caption, columns, rows, keyExtractor, onRowPress, empty,
281
287
  : _jsx(Text, { size: "sm", tone: "muted", children: strings.dataEmpty }) }));
282
288
  }
283
289
  if (virtualized) {
284
- return (_jsx(FlatList, { accessibilityRole: "list", accessibilityLabel: nomeDaLista, data: rows, keyExtractor: chave, renderItem: ({ item }) => desenharLinha(item), ItemSeparatorComponent: () => _jsx(View, { style: { height: t.size.space2 } }), style: style, testID: testID }));
290
+ return (_jsx(FlatList, { accessibilityRole: "list", accessibilityLabel: nomeDaLista, data: rows, keyExtractor: chave, renderItem: ({ item }) => desenharLinha(item), ItemSeparatorComponent: () => _jsx(View, { "aria-hidden": true, style: agrupada ? s.divisoria : { height: t.size.space2 } }), style: [agrupada && s.grupo, style], testID: testID }));
285
291
  }
286
- return (_jsx(View, { accessibilityRole: "list", accessibilityLabel: nomeDaLista, style: [s.tabela, style], testID: testID, children: rows.map((linha, n) => (_jsx(React.Fragment, { children: desenharLinha(linha) }, chave(linha, n)))) }));
292
+ return (_jsx(View, { accessibilityRole: "list", accessibilityLabel: nomeDaLista, style: [agrupada ? s.grupo : s.tabela, style], testID: testID, children: rows.map((linha, n) => (_jsxs(React.Fragment, { children: [agrupada && n > 0 ? _jsx(View, { "aria-hidden": true, style: s.divisoria }) : null, desenharLinha(linha)] }, chave(linha, n)))) }));
287
293
  }
@@ -0,0 +1,30 @@
1
+ import * as React from "react";
2
+ import { type LayoutChangeEvent, type StyleProp, type ViewStyle } from "react-native";
3
+ /** O lugar de um item dentro da fila, como o `onLayout` dele diz. */
4
+ export type CaixaDoItem = {
5
+ x: number;
6
+ y: number;
7
+ width: number;
8
+ height: number;
9
+ };
10
+ /**
11
+ * A medida de cada item da fila e a do escolhido — o par do indicador. `medir(chave)` vai no `onLayout` de cada item;
12
+ * `pronto` diz quando o indicador já está no lugar, e só então o item deixa de se pintar (antes, ele se pinta, como
13
+ * sempre — nenhum quadro fica sem o escolhido).
14
+ */
15
+ export declare function useFilaQueDesliza(ativo: string | undefined): {
16
+ medir: (chave: string) => (e: LayoutChangeEvent) => void;
17
+ alvo: CaixaDoItem | null;
18
+ pronto: boolean;
19
+ aoFicarPronto: React.Dispatch<React.SetStateAction<boolean>>;
20
+ };
21
+ /**
22
+ * A peça que anda. Mora DENTRO da fila, como primeiro filho, atrás dos itens; `style` é a pintura do escolhido (a mesma
23
+ * que o item usa), e `children` o que mais ela leva (o fio da aba secundária).
24
+ */
25
+ export declare function IndicadorQueDesliza({ alvo, aoFicarPronto, style, children }: {
26
+ alvo: CaixaDoItem | null;
27
+ aoFicarPronto: (pronto: boolean) => void;
28
+ style?: StyleProp<ViewStyle>;
29
+ children?: React.ReactNode;
30
+ }): React.JSX.Element;
@@ -0,0 +1,90 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // Aurea nativo — O ESCOLHIDO DESLIZA (S-04, 05/11/2026), o par do `useDeslize` da web.
3
+ //
4
+ // O Victor achou o escolhido do `SegmentedControl` e do `Tabs` PULANDO de um item ao outro. A referência tem uma peça
5
+ // separada atrás dos itens, que anda até o escolhido; aqui é esta. Aprovado na bancada da web (*"Pode, Ember também"*),
6
+ // e levado ao nativo pela regra do §8 (peça editada se confere no outro alvo).
7
+ //
8
+ // ⚠ **POR QUE QUADRO A QUADRO, E NÃO `Animated.timing`.** O indicador muda de LARGURA (os itens não têm a mesma), e a
9
+ // largura não anda pelo motor de animação do aparelho — ele só move `transform` e `opacity`. E o pacote não escreve o
10
+ // `useNativeDriver` à mão (o `native-e13.test.tsx` cobra que seja sempre `driverNativo()`, que no aparelho é `true`).
11
+ // Esticar com `scaleX` deformaria as pontas da cápsula. Então a peça anda pelo relógio da tela
12
+ // (`requestAnimationFrame`), com o tempo e a curva dos tokens (`durationSlow`, `easeEmphasized`) — os mesmos da web.
13
+ // São uns 17 quadros, e só o indicador se redesenha: o estado é DELE, não do controle.
14
+ //
15
+ // Quem pediu menos movimento vê a troca de uma vez (`useReduceMotion`, `movimento.ts`) — e, enquanto o sistema não
16
+ // respondeu, também: a primeira posição nunca anima.
17
+ import * as React from "react";
18
+ import { Easing, View } from "react-native";
19
+ import { useReduceMotion } from "./movimento.js";
20
+ import { useAureaTokens } from "./theme.js";
21
+ const mesma = (a, b) => !!a && !!b && a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
22
+ /**
23
+ * A medida de cada item da fila e a do escolhido — o par do indicador. `medir(chave)` vai no `onLayout` de cada item;
24
+ * `pronto` diz quando o indicador já está no lugar, e só então o item deixa de se pintar (antes, ele se pinta, como
25
+ * sempre — nenhum quadro fica sem o escolhido).
26
+ */
27
+ export function useFilaQueDesliza(ativo) {
28
+ const [caixas, setCaixas] = React.useState({});
29
+ const [pronto, setPronto] = React.useState(false);
30
+ const medir = React.useCallback((chave) => (e) => {
31
+ const { x, y, width, height } = e.nativeEvent.layout;
32
+ const nova = { x, y, width, height };
33
+ setCaixas((c) => (mesma(c[chave] ?? null, nova) ? c : { ...c, [chave]: nova }));
34
+ }, []);
35
+ const alvo = ativo != null ? caixas[ativo] ?? null : null;
36
+ return { medir, alvo, pronto: pronto && alvo != null, aoFicarPronto: setPronto };
37
+ }
38
+ /**
39
+ * A peça que anda. Mora DENTRO da fila, como primeiro filho, atrás dos itens; `style` é a pintura do escolhido (a mesma
40
+ * que o item usa), e `children` o que mais ela leva (o fio da aba secundária).
41
+ */
42
+ export function IndicadorQueDesliza({ alvo, aoFicarPronto, style, children }) {
43
+ const t = useAureaTokens();
44
+ const reduzir = useReduceMotion();
45
+ // A ORIGEM: o indicador fica em `left: 0, top: 0`, e o `onLayout` dele diz onde isso cai no mesmo sistema de
46
+ // coordenadas dos itens (borda e recheio da fila incluídos, em qualquer plataforma). O deslocamento é a diferença.
47
+ const [origem, setOrigem] = React.useState(null);
48
+ const [caixa, setCaixa] = React.useState(null);
49
+ const atual = React.useRef(null);
50
+ const { durationSlow } = t.size;
51
+ const curva = t.easing.easeEmphasized;
52
+ React.useEffect(() => {
53
+ if (!alvo)
54
+ return;
55
+ const de = atual.current;
56
+ if (!de || reduzir !== false || mesma(de, alvo)) {
57
+ atual.current = alvo;
58
+ setCaixa(alvo);
59
+ return;
60
+ }
61
+ const ease = Easing.bezier(...curva);
62
+ const t0 = Date.now();
63
+ let quadro = 0;
64
+ const passo = () => {
65
+ const p = Math.min(1, (Date.now() - t0) / durationSlow);
66
+ const e = ease(p);
67
+ const entre = (a, b) => a + (b - a) * e;
68
+ const c = { x: entre(de.x, alvo.x), y: entre(de.y, alvo.y), width: entre(de.width, alvo.width), height: entre(de.height, alvo.height) };
69
+ atual.current = c;
70
+ setCaixa(c);
71
+ if (p < 1)
72
+ quadro = requestAnimationFrame(passo);
73
+ };
74
+ quadro = requestAnimationFrame(passo);
75
+ // Troca no meio do caminho: o próximo parte de onde a peça está (`atual`), e não do item de antes.
76
+ return () => cancelAnimationFrame(quadro);
77
+ }, [alvo?.x, alvo?.y, alvo?.width, alvo?.height, reduzir, durationSlow, curva]);
78
+ const pronto = caixa != null && origem != null;
79
+ React.useEffect(() => { aoFicarPronto(pronto); }, [pronto, aoFicarPronto]);
80
+ return (_jsx(View, { collapsable: false, pointerEvents: "none", accessible: false, importantForAccessibility: "no-hide-descendants", accessibilityElementsHidden: true, onLayout: (e) => {
81
+ const { x, y } = e.nativeEvent.layout;
82
+ setOrigem((o) => (o && o.x === x && o.y === y ? o : { x, y }));
83
+ }, style: [
84
+ { position: "absolute", left: 0, top: 0 },
85
+ pronto && caixa && origem
86
+ ? { width: caixa.width, height: caixa.height, transform: [{ translateX: caixa.x - origem.x }, { translateY: caixa.y - origem.y }] }
87
+ : { width: 0, height: 0, opacity: 0 },
88
+ style,
89
+ ], children: children }));
90
+ }
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 Inter e a Sora (ADR-0077), os ícones Phosphor, sem degradê, "menos movimento".
7
+ // o canto 22 do cartão e a cápsula, a Inter e a Sora (ADR-0077), os ícones Phosphor, "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
  //
package/dist/inputs.js CHANGED
@@ -52,6 +52,7 @@ import { FilaRolante } from "./rolagem.js";
52
52
  import { IconButton } from "./actions.js";
53
53
  import { Icon } from "./icon.js";
54
54
  import { useReduceMotion, driverNativo } from "./movimento.js";
55
+ import { IndicadorQueDesliza, useFilaQueDesliza } from "./deslize.js";
55
56
  import { RecuoDaFolha } from "./screen.js";
56
57
  import { Text } from "./text.js";
57
58
  import { useAureaStrings, useAureaTokens, useTokensDoApp, usePeleSobreAMarca, ForaDaMarca } from "./theme.js";
@@ -600,34 +601,37 @@ export function SegmentedControl({ items, value, onChange, label, disabled, just
600
601
  const pele = peleDoSegmento(t, selectedStyle);
601
602
  const campo = useCampo();
602
603
  const inativo = disabled ?? campo?.disabled;
603
- return (_jsx(FilaRolante, { justify: justify, fill: fullWidth, children: _jsx(View, { accessibilityRole: "radiogroup", accessibilityLabel: label ?? campo?.label, style: [s.segmentada, fullWidth && s.segmentadaCheia, inativo && s.desabilitado, style], ...marcaDoEstilo("segmentStyle", selectedStyle), ...rest, children: items.map((it) => {
604
- const ativo = it.value === value;
605
- return (_jsxs(Pressable, { onPress: inativo ? undefined : () => onChange?.(it.value), disabled: inativo, accessibilityRole: "radio", ...estadoAcessivel({ checked: ativo, disabled: !!inativo }), accessibilityLabel: typeof it.label === "string" ? it.label : undefined, style: [s.segmento, fullWidth && s.segmentoCheio, ativo && s.segmentoAtivo,
606
- ativo && pele && { backgroundColor: pele.fundo,
607
- boxShadow: [...(pele.aro ? [aroDoEstilo(t, pele.aro)] : []), ...(pele.sombra ? t.shadowLayers.shadowSm : [])] },
608
- pele?.ponto && s.segmentoComPonto], children: [pele?.ponto && _jsx(View, { collapsable: false, style: [s.pontoDoSegmento, ativo && { backgroundColor: t.color.primary }] }), typeof it.label === "string"
609
- ? _jsx(Text, { size: "sm", weight: ativo ? 600 : 400,
610
- // 🔴 ERA `foreground`, E ISSO QUEBRAVA A LINGUAGEM DE SELECIONADO.
611
- // Achado pelo consumidor em 17/09/2026. A web pinta o escolhido com a
612
- // MARCA (`aurea.css:937-938`), e o comentário de cima daquela regra diz
613
- // que nav ativo, aba ativa, item de lista e botão ligado mostram o mesmo
614
- // sinal — ordem do Victor, 24/07. O `SegmentedControl` daqui discordava
615
- // da web **e do `BottomNav` deste mesmo pacote**, que já usa este token.
616
- //
617
- // ⚠ **`primaryEmphasis` e NÃO `primary`, e a razão está no CSS:** *"sem
618
- // fundo, a marca vira TEXTO, e o amarelo puro"* não se lê no claro
619
- // (`aurea.css:358`). É a mesma lição que a `0.8.3` pagou no `Button`.
620
- // No escuro os dois valem o mesmo amarelo; no claro este aprofunda.
621
- //
622
- // ~~⚠ Uma divergência declarada: o token, e não a mistura da web.~~ → A COR
623
- // DA WEB (bloco 1, 23/10/2026): desde a ADR-0076 o token é o AZUL no claro,
624
- // e o Victor viu a aba "Mês" azul no app (*"pq ficou azul se na web não é
625
- // azul?"*). ~~A aba escolhida é a mistura da web, `corDoEscolhido`.~~ → Desde
626
- // 24/10/2026 a cápsula escolhida é o amarelo do botão (ver `segmentoAtivo`), e
627
- // o nome vai na tinta do botão.
628
- style: { color: ativo ? (pele?.letra ?? t.color.primaryForeground) : t.color.mutedForeground }, children: it.label })
629
- : it.label] }, it.value));
630
- }) }) }));
604
+ // S-04 (05/11/2026): o escolhido DESLIZA de um segmento ao outro (`deslize.tsx`). A pintura do indicador é a mesma do
605
+ // segmento aceso; enquanto ele não está no lugar, o segmento se pinta sozinho, como sempre.
606
+ const fila = useFilaQueDesliza(value);
607
+ const pinturaDoAceso = [s.segmentoAtivo, pele && { backgroundColor: pele.fundo,
608
+ boxShadow: [...(pele.aro ? [aroDoEstilo(t, pele.aro)] : []), ...(pele.sombra ? t.shadowLayers.shadowSm : [])] }];
609
+ return (_jsx(FilaRolante, { justify: justify, fill: fullWidth, children: _jsxs(View, { accessibilityRole: "radiogroup", accessibilityLabel: label ?? campo?.label, style: [s.segmentada, fullWidth && s.segmentadaCheia, inativo && s.desabilitado, style], ...marcaDoEstilo("segmentStyle", selectedStyle), ...rest, children: [_jsx(IndicadorQueDesliza, { alvo: fila.alvo, aoFicarPronto: fila.aoFicarPronto, style: [canto(t.size.radiusControl), pinturaDoAceso] }), items.map((it) => {
610
+ const ativo = it.value === value;
611
+ return (_jsxs(Pressable, { onLayout: fila.medir(it.value), onPress: inativo ? undefined : () => onChange?.(it.value), disabled: inativo, accessibilityRole: "radio", ...estadoAcessivel({ checked: ativo, disabled: !!inativo }), accessibilityLabel: typeof it.label === "string" ? it.label : undefined, style: [s.segmento, fullWidth && s.segmentoCheio, ativo && !fila.pronto && pinturaDoAceso,
612
+ pele?.ponto && s.segmentoComPonto], children: [pele?.ponto && _jsx(View, { collapsable: false, style: [s.pontoDoSegmento, ativo && { backgroundColor: t.color.primary }] }), typeof it.label === "string"
613
+ ? _jsx(Text, { size: "sm", weight: ativo ? 600 : 400,
614
+ // 🔴 ERA `foreground`, E ISSO QUEBRAVA A LINGUAGEM DE SELECIONADO.
615
+ // Achado pelo consumidor em 17/09/2026. A web pinta o escolhido com a
616
+ // MARCA (`aurea.css:937-938`), e o comentário de cima daquela regra diz
617
+ // que nav ativo, aba ativa, item de lista e botão ligado mostram o mesmo
618
+ // sinal — ordem do Victor, 24/07. O `SegmentedControl` daqui discordava
619
+ // da web **e do `BottomNav` deste mesmo pacote**, que já usa este token.
620
+ //
621
+ // ⚠ **`primaryEmphasis` e NÃO `primary`, e a razão está no CSS:** *"sem
622
+ // fundo, a marca vira TEXTO, e o amarelo puro"* não se lê no claro
623
+ // (`aurea.css:358`). É a mesma lição que a `0.8.3` pagou no `Button`.
624
+ // No escuro os dois valem o mesmo amarelo; no claro este aprofunda.
625
+ //
626
+ // ~~⚠ Uma divergência declarada: o token, e não a mistura da web.~~ → A COR
627
+ // DA WEB (bloco 1, 23/10/2026): desde a ADR-0076 o token é o AZUL no claro,
628
+ // e o Victor viu a aba "Mês" azul no app (*"pq ficou azul se na web não é
629
+ // azul?"*). ~~A aba escolhida é a mistura da web, `corDoEscolhido`.~~ → Desde
630
+ // 24/10/2026 a cápsula escolhida é o amarelo do botão (ver `segmentoAtivo`), e
631
+ // o nome vai na tinta do botão.
632
+ style: { color: ativo ? (pele?.letra ?? t.color.primaryForeground) : t.color.mutedForeground }, children: it.label })
633
+ : it.label] }, it.value));
634
+ })] }) }));
631
635
  }
632
636
  // ─────────────────────────────────────────────────────────────────────────────────────────────
633
637
  // Select — o "motor novo sobre `Modal`" que a §5.2.4 previu
@@ -1,6 +1,37 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Aurea nativo — a categoria **Navigation**: `BottomNav`, `Header` (o antigo `Topbar`), `NavList` e `Stepper`.
3
+ //
4
+ // Lote 3 do `NATIVE.md` §5.5 — a moldura. O consumidor medido (§5.1) especifica ela **literal**:
5
+ // *navegação inferior fixa com quatro abas e contador de não lidos*, *o botão central abrindo uma
6
+ // folha*, *pull-to-refresh na lista e no painel*, e um *onboarding de 3 passos*.
7
+ //
8
+ // ⚠ **E a primeira coisa a dizer é o que este módulo NÃO faz: roteamento.** Isso está escrito no
9
+ // `NATIVE.md` §5.5 desde 31/08/2026 e não é lacuna — `expo-router`/`react-navigation` é escolha do
10
+ // app. O que a Aurea entrega é a **pele** que se pluga nele: um `BottomNav` recebe `items` e
11
+ // `current` e avisa por `onPress`. Quem troca de tela é o app.
12
+ //
13
+ // Medido antes de escrito, com a linha:
14
+ //
15
+ // .topbar aurea.css:81 linha, space-between, gap space-4, minH topbar-height
16
+ // .topbar-floating :82 raio de CARTÃO, borda, margem space-4
17
+ // .topbar-pill :87 largura de conteúdo, centrado, raio de controle
18
+ // .bottom-nav :270 linha, gap space-1, margem space-4, raio de controle, sombra
19
+ // .bottom-nav-item :273 coluna centrada, minH control-h-lg, textXs, mutedForeground
20
+ // .bottom-nav-mark :306 a caixa de 2rem que ANCORA o contador
21
+ // .bottom-nav-badge :310 canto do ícone, deslocado por -space-05
22
+ // [aria-current] :331 foreground + peso médio, e o ícone perde a transparência
23
+ // os sete indicadores :360-397 de `none` a `circle-bold`
24
+ // .nav-list :405 coluna com gap space-05
25
+ // .nav-list-row :416 linha, gap space-3, ~~minH control-h-lg~~, raio card − space-1
26
+ // (0.32.0: recheio e letra da linha nativa da referência)
27
+ // .stepper :1141 colunas iguais
28
+ // .step-dot :1145 32 redondo, borda border-strong, fundo surface-1
29
+ //
30
+ // A semântica veio do FONTE (`navigation-client.tsx`), e é dela que sai a decisão mais importante
31
+ // deste módulo — a de acessibilidade, logo abaixo.
32
+ import * as React from "react";
2
33
  import { Pressable, View } from "react-native";
3
- import { useSafeAreaInsets } from "react-native-safe-area-context";
34
+ import { SafeAreaInsetsContext, initialWindowMetrics } from "react-native-safe-area-context";
4
35
  import { useAnotarBottomNav } from "./barranav.js";
5
36
  import { Avatar, Badge } from "./display.js";
6
37
  import { canto, comOpacidade, criarFolha, estadoAcessivel, fioDoEscolhido, misturaOpaca, aroDoEstilo, fundoDaPele, marcaDoEstilo, peleDoAtual } from "./estilos.js";
@@ -8,8 +39,11 @@ import { NaSuperficie } from "./superficie.js";
8
39
  import { Icon } from "./icon.js";
9
40
  import { Card } from "./layout.js";
10
41
  import { FilaRolante } from "./rolagem.js";
42
+ import { IndicadorQueDesliza, useFilaQueDesliza } from "./deslize.js";
11
43
  import { Text } from "./text.js";
12
44
  import { useAureaStrings, useAureaTokens } from "./theme.js";
45
+ // Sem `SafeAreaProvider` nem medida da abertura: nenhum recuo.
46
+ const SEM_RECUO = { top: 0, right: 0, bottom: 0, left: 0 };
13
47
  const folha = criarFolha((t) => ({
14
48
  // ── Topbar ─────────────────────────────────────────────────────────────────────────────────
15
49
  // ⚠ Sem `position: sticky` — ele não existe no React Native. Na web o `.topbar` gruda no topo
@@ -346,7 +380,9 @@ export function BottomNav({ items, current, variant = "floating", indicator = "c
346
380
  const t = useAureaTokens();
347
381
  const s = folha(t);
348
382
  const strings = useAureaStrings();
349
- const inset = useSafeAreaInsets();
383
+ // O recuo pelo CONTEXTO, com a medida da abertura e o zero como reserva (o jeito do `menu.tsx`): o gancho
384
+ // `useSafeAreaInsets()` LEVANTA ERRO sem `SafeAreaProvider` em cima (auditoria externa, 05/11/2026).
385
+ const inset = React.useContext(SafeAreaInsetsContext) ?? initialWindowMetrics?.insets ?? SEM_RECUO;
350
386
  const redondo = indicator.startsWith("circle");
351
387
  const disco = indicator === "circle-bold";
352
388
  const capsula = indicator === "capsule";
@@ -630,18 +666,20 @@ export function Tabs({ tabs, value, onChange, label, justify, variant = "primary
630
666
  const strings = useAureaStrings();
631
667
  const aberta = tabs.find((it) => it.id === value);
632
668
  const secundaria = variant === "secondary";
633
- return (_jsxs(View, { style: style, ...rest, children: [_jsx(FilaRolante, { justify: justify, children: _jsx(View, { accessibilityRole: "tablist", accessibilityLabel: label ?? strings.tabsLabel, style: secundaria ? s.abasSecundarias : s.abas, children: tabs.map((it) => {
634
- const ativa = it.id === value;
635
- return (_jsxs(Pressable, { 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: [
636
- secundaria ? s.abaSecundaria : s.abaDeTab,
637
- ativa && !secundaria && s.abaDeTabAtiva,
638
- it.disabled && { opacity: t.size.opacityDisabled },
639
- ], children: [typeof it.label === "string"
640
- ? _jsx(Text, { size: "sm", weight: secundaria ? (ativa ? 600 : 400) : 500,
641
- // Na cápsula escolhida (amarela, 24/10/2026), o nome vai na tinta do botão; na secundária, a
642
- // cor do texto de sempre, sobre o fio amarelo.
643
- style: { color: !ativa ? t.color.mutedForeground
644
- : secundaria ? t.color.foreground : t.color.primaryForeground }, children: it.label })
645
- : it.label, ativa && secundaria && _jsx(View, { style: s.fioDaAba })] }, it.id));
646
- }) }) }), aberta && panel === "plain" ? (_jsx(View, { accessibilityLabel: typeof aberta.label === "string" ? aberta.label : undefined, style: s.painel, children: aberta.content })) : aberta ? (_jsx(Card, { variant: "inset", accessibilityLabel: typeof aberta.label === "string" ? aberta.label : undefined, style: s.painel, children: aberta.content })) : null] }));
669
+ // S-04 (05/11/2026): a aba escolhida DESLIZA (`deslize.tsx`) — a cápsula amarela, e na secundária o fio de baixo.
670
+ const fila = useFilaQueDesliza(value);
671
+ 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) => {
672
+ const ativa = it.id === value;
673
+ 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: [
674
+ secundaria ? s.abaSecundaria : s.abaDeTab,
675
+ ativa && !secundaria && !fila.pronto && s.abaDeTabAtiva,
676
+ it.disabled && { opacity: t.size.opacityDisabled },
677
+ ], children: [typeof it.label === "string"
678
+ ? _jsx(Text, { size: "sm", weight: secundaria ? (ativa ? 600 : 400) : 500,
679
+ // Na cápsula escolhida (amarela, 24/10/2026), o nome vai na tinta do botão; na secundária, a
680
+ // cor do texto de sempre, sobre o fio amarelo.
681
+ style: { color: !ativa ? t.color.mutedForeground
682
+ : secundaria ? t.color.foreground : t.color.primaryForeground }, children: it.label })
683
+ : it.label, ativa && secundaria && !fila.pronto && _jsx(View, { style: s.fioDaAba })] }, it.id));
684
+ })] }) }), aberta && panel === "plain" ? (_jsx(View, { accessibilityLabel: typeof aberta.label === "string" ? aberta.label : undefined, style: s.painel, children: aberta.content })) : aberta ? (_jsx(Card, { variant: "inset", accessibilityLabel: typeof aberta.label === "string" ? aberta.label : undefined, style: s.painel, children: aberta.content })) : null] }));
647
685
  }
package/dist/rolagem.js CHANGED
@@ -16,7 +16,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
16
16
  // não acha a sexta opção. A saída óbvia do React Native **não serve** — `fadingEdgeLength` é
17
17
  // `@platform android` (medido no tipo do RN), e usá-la daria o aviso no Android e **nada no
18
18
  // iPhone**. É a armadilha de um alvo só que este projeto já pagou várias vezes.
19
- // Gradiente também não: proibido desde a Fase 0.
20
19
  //
21
20
  // **O que fica, e é o mesmo da web:** a opção cortada pela borda é o sinal, e ele vem do recorte.
22
21
  // O que este módulo acrescenta é MEDIR se há transbordo, para (1) mostrar a barra de rolagem só
package/dist/toast.js CHANGED
@@ -55,7 +55,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
55
55
  // `<x>Bg`/`<x>` que o `Alert` do Lote 2 usa (`feedback.tsx:60-63`).
56
56
  import * as React from "react";
57
57
  import { Animated, Easing, View } from "react-native";
58
- import { useSafeAreaInsets } from "react-native-safe-area-context";
58
+ import { SafeAreaInsetsContext, initialWindowMetrics } from "react-native-safe-area-context";
59
59
  import { CloseButton } from "./actions.js";
60
60
  import { canto, criarFolha } from "./estilos.js";
61
61
  import { Icon } from "./icon.js";
@@ -63,6 +63,8 @@ import { ICONE_DA_VARIANTE } from "./feedback.js";
63
63
  import { useReduceMotion, driverNativo } from "./movimento.js";
64
64
  import { Text } from "./text.js";
65
65
  import { AvisosContext, useAureaStrings, useAureaTokens } from "./theme.js";
66
+ // Sem `SafeAreaProvider` nem medida da abertura: nenhum recuo.
67
+ const SEM_RECUO = { top: 0, right: 0, bottom: 0, left: 0 };
66
68
  const folha = criarFolha((t) => ({
67
69
  hospedeiro: { flex: 1 },
68
70
  pilha: {
@@ -82,6 +84,9 @@ const folha = criarFolha((t) => ({
82
84
  ...(t.shadow.shadowMd ? { boxShadow: [t.shadow.shadowMd] } : null),
83
85
  },
84
86
  texto: { flex: 1, minWidth: 0, gap: 2 },
87
+ // O grupo LIDO (ícone + texto), irmão da ação e do X — a forma do `Alert` (auditoria externa de 05/11/2026). O vão é
88
+ // o mesmo da moldura, então nada muda de lugar na tela.
89
+ grupo: { flex: 1, minWidth: 0, flexDirection: "row", alignItems: "center", gap: 11 },
85
90
  // 0.32.0: o tipo deixou de tingir o fundo e a borda (eram `aviso_info`…`aviso_danger`). Como o aviso
86
91
  // da web desta versão e o da referência: o fundo é o da janela, e a cor do tipo vai no ícone e no
87
92
  // TÍTULO.
@@ -121,7 +126,10 @@ export function useToast() {
121
126
  export function ToastHost({ children, max = 3, duration = DURACAO_PADRAO, offset = 0, style, testID, }) {
122
127
  const t = useAureaTokens();
123
128
  const s = folha(t);
124
- const inset = useSafeAreaInsets();
129
+ // O recuo pelo CONTEXTO, com a medida da abertura e o zero como reserva (o jeito do `menu.tsx`): o gancho
130
+ // `useSafeAreaInsets()` LEVANTA ERRO sem `SafeAreaProvider` em cima, e o exemplo de uso desta peça nunca pediu o
131
+ // provedor — o app sem expo-router nem react-navigation quebrava ao montar (auditoria externa, 05/11/2026).
132
+ const inset = React.useContext(SafeAreaInsetsContext) ?? initialWindowMetrics?.insets ?? SEM_RECUO;
125
133
  const [avisos, setAvisos] = React.useState([]);
126
134
  const proximo = React.useRef(0);
127
135
  // Os relógios vivem numa `ref` porque fechar um aviso à mão tem de PARAR o dele — senão o
@@ -197,15 +205,15 @@ export function Toast({ toast, onClose }) {
197
205
  : tipo === "danger" ? (t.color.danger400 ?? t.color.destructive)
198
206
  : (t.color.info400 ?? t.color.info);
199
207
  const glifo = toast.icon === false ? null : (toast.icon ?? ICONE_DA_VARIANTE[tipo]);
200
- return (_jsxs(Animated.View, { accessible: true, ...(tipo === "danger" ? { accessibilityRole: "alert" } : null), accessibilityLiveRegion: tipo === "danger" ? "assertive" : "polite", style: [
208
+ return (_jsxs(Animated.View, { accessibilityLiveRegion: tipo === "danger" ? "assertive" : "polite", style: [
201
209
  s.aviso,
202
210
  // Os mesmos 12dp de baixo que o `.toast[data-starting-style]` da web usa.
203
211
  { opacity: entrada, transform: [{ translateY: entrada.interpolate({
204
212
  inputRange: [0, 1], outputRange: [12, 0],
205
213
  }) }] },
206
- ], testID: `toast-${toast.id}`, children: [glifo ? _jsx(Icon, { name: glifo, size: "md", color: corDoIcone, weight: toast.icon ? undefined : "fill" }) : null, _jsxs(View, { style: s.texto, children: [_jsx(Text, { size: "base", weight: 500, style: { color: corDoIcone }, children: toast.title }), toast.description != null
207
- ? (typeof toast.description === "string"
208
- ? _jsx(Text, { size: "sm", tone: "muted", children: toast.description })
209
- : toast.description)
210
- : null] }), toast.action, _jsx(CloseButton, { label: strings.dismissNotification, onPress: onClose })] }));
214
+ ], testID: `toast-${toast.id}`, children: [_jsxs(View, { accessible: true, ...(tipo === "danger" ? { accessibilityRole: "alert" } : null), style: s.grupo, children: [glifo ? _jsx(Icon, { name: glifo, size: "md", color: corDoIcone, weight: toast.icon ? undefined : "fill" }) : null, _jsxs(View, { style: s.texto, children: [_jsx(Text, { size: "base", weight: 500, style: { color: corDoIcone }, children: toast.title }), toast.description != null
215
+ ? (typeof toast.description === "string"
216
+ ? _jsx(Text, { size: "sm", tone: "muted", children: toast.description })
217
+ : toast.description)
218
+ : null] })] }), toast.action, _jsx(CloseButton, { label: strings.dismissNotification, onPress: onClose })] }));
211
219
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurea-uds/native",
3
- "version": "0.56.0",
3
+ "version": "0.59.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.56.0"
58
+ "@aurea-uds/tokens": "^0.59.0"
59
59
  },
60
60
  "peerDependencies": {
61
61
  "@react-native-community/datetimepicker": ">=8",