@aurea-uds/native 0.27.0 → 0.28.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.d.ts +14 -1
- package/dist/actions.js +60 -6
- package/dist/data.js +2 -2
- package/dist/display.js +1 -1
- package/dist/estilos.d.ts +1 -0
- package/dist/estilos.js +11 -0
- package/dist/feedback.js +4 -2
- package/dist/index.d.ts +1 -1
- package/dist/midia.d.ts +9 -1
- package/dist/midia.js +21 -6
- package/dist/strings.d.ts +4 -0
- package/dist/strings.js +4 -0
- package/dist/text.d.ts +10 -5
- package/dist/text.js +10 -5
- package/dist/theme.d.ts +7 -0
- package/dist/theme.js +6 -28
- package/dist/toast.js +4 -2
- package/dist/tokens.d.ts +7 -3
- package/dist/tokens.js +2 -1
- package/package.json +2 -2
package/dist/actions.d.ts
CHANGED
|
@@ -40,6 +40,19 @@ export interface ButtonProps extends Omit<PressableProps, "children" | "style">
|
|
|
40
40
|
fullWidth?: boolean;
|
|
41
41
|
/** Estado de alternância, anunciado ao leitor de tela como `checked`. */
|
|
42
42
|
pressed?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* GAR-14 (0.28.0): o botão COMPARTILHA — os mesmos nomes da web. No aparelho, abre o compartilhar do
|
|
45
|
+
* sistema (`Share` do React Native); o link vai DENTRO da mensagem no Android, que descarta o `url`.
|
|
46
|
+
* No navegador (`react-native-web`), a regra da web: detectar o recurso; sem ele, copiar e avisar
|
|
47
|
+
* "Link copiado" pelo `ToastHost`, e dizer ao leitor de tela.
|
|
48
|
+
*/
|
|
49
|
+
share?: AureaShareData;
|
|
50
|
+
}
|
|
51
|
+
/** O que o `Button share` compartilha (GAR-14). Os nomes são os da web. */
|
|
52
|
+
export interface AureaShareData {
|
|
53
|
+
url?: string;
|
|
54
|
+
title?: string;
|
|
55
|
+
text?: string;
|
|
43
56
|
}
|
|
44
57
|
/**
|
|
45
58
|
* Botão. `Pressable` do RN, alvo ≥ `--target-min`, pele de token.
|
|
@@ -79,6 +92,6 @@ export declare function IconButton(props: IconButtonProps): React.JSX.Element;
|
|
|
79
92
|
*/
|
|
80
93
|
export declare function folgaDoToque(t: AureaTokens, size?: AureaButtonSize): number;
|
|
81
94
|
/** Fechado: sem `appearance` e sem `tone`, porque a cor é a do glifo. */
|
|
82
|
-
export interface ThemeToggleProps extends Omit<IconButtonProps, "name" | "label" | "onPress" | "appearance" | "tone"> {
|
|
95
|
+
export interface ThemeToggleProps extends Omit<IconButtonProps, "name" | "label" | "onPress" | "appearance" | "tone" | "share"> {
|
|
83
96
|
}
|
|
84
97
|
export declare function ThemeToggle(props: ThemeToggleProps): React.JSX.Element;
|
package/dist/actions.js
CHANGED
|
@@ -21,11 +21,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
21
21
|
// `appearance:"nav"` — é a pele do item de navegação, e quem a consome é o `BottomNav`/`NavList`
|
|
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
|
-
import { Pressable, View } from "react-native";
|
|
24
|
+
import { AccessibilityInfo, Platform, Pressable, Share, View } from "react-native";
|
|
25
25
|
import { canto, criarFolha, REACAO_AO_TOQUE, estadoAcessivel } from "./estilos.js";
|
|
26
26
|
import { Icon } from "./icon.js";
|
|
27
27
|
import { Text } from "./text.js";
|
|
28
|
-
import { useAureaStrings, useAureaTheme, useAureaTokens, useSobreAMarca } from "./theme.js";
|
|
28
|
+
import { AvisosContext, useAureaStrings, useAureaTheme, useAureaTokens, useSobreAMarca } from "./theme.js";
|
|
29
29
|
const ALTURA = {
|
|
30
30
|
xs: "controlHXs", sm: "controlHSm", md: "controlHMd", lg: "controlHLg", xl: "controlHXl",
|
|
31
31
|
};
|
|
@@ -137,6 +137,58 @@ const folha = criarFolha((t) => ({
|
|
|
137
137
|
// `Card` com `onPress` passou a reagir igual (R-04, 24/09/2026).
|
|
138
138
|
...REACAO_AO_TOQUE,
|
|
139
139
|
}));
|
|
140
|
+
// GAR-14 · o compartilhar do nativo. Ver a prop `share`.
|
|
141
|
+
async function compartilhar(dados, avisos, strings) {
|
|
142
|
+
if (Platform.OS !== "web") {
|
|
143
|
+
// O iOS manda o `url` como link de verdade e o `message` como texto; o Android só lê o `message`.
|
|
144
|
+
const mensagem = [dados.text, dados.url].filter(Boolean).join(" ");
|
|
145
|
+
try {
|
|
146
|
+
await Share.share(Platform.OS === "ios" && dados.url
|
|
147
|
+
? { url: dados.url, message: dados.text, title: dados.title }
|
|
148
|
+
: { message: mensagem, title: dados.title });
|
|
149
|
+
}
|
|
150
|
+
catch { /* a pessoa fechou, ou o sistema recusou: não há o que dizer */ }
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
// O alvo nativo não tem os tipos do navegador: só o pedaço que se usa aqui (como no E16).
|
|
154
|
+
const g = globalThis;
|
|
155
|
+
const nav = g.navigator;
|
|
156
|
+
const url = dados.url ?? g.location?.href ?? "";
|
|
157
|
+
const pacote = { url, ...(dados.title ? { title: dados.title } : null), ...(dados.text ? { text: dados.text } : null) };
|
|
158
|
+
if (typeof nav?.share === "function" && (typeof nav.canShare !== "function" || nav.canShare(pacote))) {
|
|
159
|
+
try {
|
|
160
|
+
await nav.share(pacote);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
catch (e) {
|
|
164
|
+
if (e?.name === "AbortError")
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const avisar = (falhou) => {
|
|
169
|
+
const texto = falhou ? strings.linkCopyFailed : strings.linkCopied;
|
|
170
|
+
avisos?.add(falhou ? { title: texto, description: url, type: "danger", duration: 0 } : { title: texto, type: "success", duration: 1500 });
|
|
171
|
+
AccessibilityInfo.announceForAccessibility(texto);
|
|
172
|
+
};
|
|
173
|
+
try {
|
|
174
|
+
if (typeof nav?.clipboard?.writeText !== "function")
|
|
175
|
+
throw new Error("sem área de transferência");
|
|
176
|
+
await nav.clipboard.writeText(url);
|
|
177
|
+
avisar(false);
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
avisar(true);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/** O toque do botão com o `share`: o `onPress` do app primeiro, depois o compartilhar. O `Button` e
|
|
184
|
+
* o `IconButton` usam o mesmo — com um só, os dois não divergem. */
|
|
185
|
+
function useToqueComShare(share, onPress) {
|
|
186
|
+
const avisos = React.useContext(AvisosContext);
|
|
187
|
+
const strings = useAureaStrings();
|
|
188
|
+
if (!share)
|
|
189
|
+
return onPress;
|
|
190
|
+
return (e) => { onPress?.(e); void compartilhar(share, avisos, strings); };
|
|
191
|
+
}
|
|
140
192
|
/**
|
|
141
193
|
* Botão. `Pressable` do RN, alvo ≥ `--target-min`, pele de token.
|
|
142
194
|
*
|
|
@@ -150,8 +202,9 @@ export function Button(props) {
|
|
|
150
202
|
return _jsx(CorpoDoBotao, { ...props });
|
|
151
203
|
}
|
|
152
204
|
/** O corpo do `Button`. `semRecuo` é só do `LinkButton`: sem recuo, sem borda e sem altura. */
|
|
153
|
-
function CorpoDoBotao({ children, appearance = "solid", tone = "neutral", size = "md", leadingIcon, trailingIcon, leading, trailing, icons, fullWidth = false, pressed, disabled, accessibilityLabel, semRecuo = false, ...rest }) {
|
|
205
|
+
function CorpoDoBotao({ children, appearance = "solid", tone = "neutral", size = "md", leadingIcon, trailingIcon, leading, trailing, icons, fullWidth = false, pressed, disabled, accessibilityLabel, semRecuo = false, share, onPress, ...rest }) {
|
|
154
206
|
const t = useAureaTokens();
|
|
207
|
+
const aoTocar = useToqueComShare(share, onPress);
|
|
155
208
|
const s = folha(t);
|
|
156
209
|
const marca = useSobreAMarca();
|
|
157
210
|
const cor = pintarSobreAMarca(pintar(t, tone), marca, tone, appearance);
|
|
@@ -168,7 +221,7 @@ function CorpoDoBotao({ children, appearance = "solid", tone = "neutral", size =
|
|
|
168
221
|
...(semRecuo ? { height: undefined, paddingHorizontal: 0, borderWidth: 0 } : null),
|
|
169
222
|
}), [t, size, appearance, cor.solido, cor.contorno, corDaBorda, fullWidth, semRecuo]);
|
|
170
223
|
const corDoTexto = appearance === "solid" ? cor.texto : cor.sobre;
|
|
171
|
-
return (_jsx(Pressable, { disabled: disabled, accessibilityRole: "button", accessibilityLabel: accessibilityLabel, ...estadoAcessivel({ disabled: !!disabled, pressed }), style: ({ pressed: tocando }) => [
|
|
224
|
+
return (_jsx(Pressable, { disabled: disabled, onPress: aoTocar, accessibilityRole: "button", accessibilityLabel: accessibilityLabel, ...estadoAcessivel({ disabled: !!disabled, pressed }), style: ({ pressed: tocando }) => [
|
|
172
225
|
s.alvo, fullWidth && s.alvoLargura,
|
|
173
226
|
tocando && s.pressionado, disabled && s.inerte,
|
|
174
227
|
], ...rest, children: _jsxs(View, { style: [s.caixa, caixa], children: [leading ?? null, leadingIcon ? _jsx(Icon, { name: leadingIcon, size: ICONE[size], color: corDoTexto, icons: icons }) : null, typeof children === "string"
|
|
@@ -212,8 +265,9 @@ export function folgaDoToque(t, size = "md") {
|
|
|
212
265
|
}
|
|
213
266
|
/** O corpo do `IconButton`. A cor própria do ícone (`corDoIcone`) é só do `ThemeToggle`: o
|
|
214
267
|
* `IconButton` público não tem cor solta, e dentro do cartão da marca ela não vale (a tinta vence). */
|
|
215
|
-
function BotaoDeIcone({ name, label, appearance = "ghost", tone = "neutral", size = "md", icons, pressed, disabled, corDoIcone, pesoDoIcone, ...rest }) {
|
|
268
|
+
function BotaoDeIcone({ name, label, appearance = "ghost", tone = "neutral", size = "md", icons, pressed, disabled, corDoIcone, pesoDoIcone, share, onPress, ...rest }) {
|
|
216
269
|
const t = useAureaTokens();
|
|
270
|
+
const aoTocar = useToqueComShare(share, onPress);
|
|
217
271
|
const s = folha(t);
|
|
218
272
|
const marca = useSobreAMarca();
|
|
219
273
|
const cor = pintarSobreAMarca(pintar(t, tone), marca, tone, appearance);
|
|
@@ -225,7 +279,7 @@ function BotaoDeIcone({ name, label, appearance = "ghost", tone = "neutral", siz
|
|
|
225
279
|
backgroundColor: appearance === "solid" ? cor.solido : "transparent",
|
|
226
280
|
borderColor: cor.contorno ?? (appearance === "outline" ? corDaBorda : "transparent"),
|
|
227
281
|
}), [t, lado, size, appearance, cor.solido, cor.contorno, corDaBorda]);
|
|
228
|
-
return (_jsx(Pressable, { disabled: disabled, accessibilityRole: "button", accessibilityLabel: label, ...estadoAcessivel({ disabled: !!disabled, pressed }), style: ({ pressed: tocando }) => [
|
|
282
|
+
return (_jsx(Pressable, { disabled: disabled, onPress: aoTocar, accessibilityRole: "button", accessibilityLabel: label, ...estadoAcessivel({ disabled: !!disabled, pressed }), style: ({ pressed: tocando }) => [
|
|
229
283
|
// Largura FIXA, como o só-ícone da referência: ele nunca estica,
|
|
230
284
|
// nem numa coluna sem alinhamento. O alvo é o maior entre o desenho e o `targetMin`.
|
|
231
285
|
s.alvo, { width: Math.max(lado, t.size.targetMin), alignItems: "center" },
|
package/dist/data.js
CHANGED
|
@@ -233,14 +233,14 @@ 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
|
-
return typeof v === "string" ? _jsx(Text, { size: "md", weight: 600, children: v }) : v;
|
|
236
|
+
return typeof v === "string" ? _jsx(Text, { size: "md", weight: 600, numeric: true, children: v }) : v;
|
|
237
237
|
})() })) : null, secundarias.map((coluna) => {
|
|
238
238
|
const v = conteudo(coluna, linha);
|
|
239
239
|
const nome = typeof coluna.header === "string" && typeof v === "string"
|
|
240
240
|
? `${coluna.header}: ${v}` : undefined;
|
|
241
241
|
return (_jsxs(View, { accessible: true, accessibilityLabel: nome, style: s.celula, children: [typeof coluna.header === "string"
|
|
242
242
|
? _jsx(Text, { size: "sm", tone: "muted", style: s.nomeDaColuna, children: coluna.header })
|
|
243
|
-
: coluna.header, typeof v === "string" ? _jsx(Text, { size: "sm", style: s.valor, children: v }) : v] }, coluna.key));
|
|
243
|
+
: coluna.header, typeof v === "string" ? _jsx(Text, { size: "sm", numeric: true, style: s.valor, children: v }) : v] }, coluna.key));
|
|
244
244
|
})] }));
|
|
245
245
|
// Só vira alvo se houver o que tocar. Uma linha `Pressable` sem ação é um botão que não faz
|
|
246
246
|
// nada — e o leitor de tela a anunciaria como botão.
|
package/dist/display.js
CHANGED
|
@@ -301,7 +301,7 @@ export function KPI({ label, value, trend, direction, tone, directionLabel, vari
|
|
|
301
301
|
const nome = direction && partes.every((p) => p !== null) ? partes.filter(Boolean).join(", ") : undefined;
|
|
302
302
|
const Caixa = variant === "plain" ? View : Card;
|
|
303
303
|
return (_jsxs(Caixa, { style: [s.kpi, style], accessible: true, accessibilityLabel: nome, ...rest, children: [typeof label === "string" ? _jsx(Text, { size: "sm", tone: "muted", children: label }) : label, typeof value === "string" || typeof value === "number"
|
|
304
|
-
? _jsx(Text, { size: "3xl", weight: 700, children: value }) : value, direction
|
|
304
|
+
? _jsx(Text, { size: "3xl", weight: 700, numeric: true, children: value }) : value, direction
|
|
305
305
|
? _jsxs(View, { style: s.tendencia, children: [_jsx(View, { style: s.seta, children: _jsx(Icon, { name: GLIFO_DA_DIRECAO[direction], size: "sm", color: cor }) }), temTendencia && textoDaTendencia] })
|
|
306
306
|
: temTendencia && textoDaTendencia] }));
|
|
307
307
|
}
|
package/dist/estilos.d.ts
CHANGED
|
@@ -87,6 +87,7 @@ export type TomDeCor = "neutral" | "primary" | "info" | "success" | "warning" |
|
|
|
87
87
|
* nomeia — e o dia em que um tom novo entra numa só.
|
|
88
88
|
*/
|
|
89
89
|
export declare const acentoDoTom: (t: AureaTokens, tom: TomDeCor) => string;
|
|
90
|
+
export declare const letraDoToken: (t: AureaTokens, token: string) => string | undefined;
|
|
90
91
|
/**
|
|
91
92
|
* O FUNDO CHEIO de um tom de estado e a letra em cima dele — o par do botão cheio (ADR-0061, 0.27.0):
|
|
92
93
|
* o selo cheio é o botão cheio do mesmo tom. `primary` e `neutral` não têm o par: `undefined`, e
|
package/dist/estilos.js
CHANGED
|
@@ -95,6 +95,17 @@ export const acentoDoTom = (t, tom) => tom === "primary" ? t.color.primaryEmphas
|
|
|
95
95
|
: tom === "warning" ? t.color.warning400 ?? t.color.warning
|
|
96
96
|
: tom === "danger" ? t.color.danger400 ?? t.color.destructive
|
|
97
97
|
: t.color.secondaryForeground;
|
|
98
|
+
/**
|
|
99
|
+
* A cor de LETRA (e de desenho sobre a tela) de um token de cor — ADR-0061. Os quatro tokens de
|
|
100
|
+
* estado (`success`, `info`, `warning`, `destructive`) são o FUNDO cheio; quem escreve ou desenha
|
|
101
|
+
* sobre a tela usa o par `-400` de cada tema. Qualquer outro token passa como está — e é por isso
|
|
102
|
+
* que a lista é FECHADA: um `primary400` que nascesse amanhã não pode mudar o texto amarelo sem
|
|
103
|
+
* ninguém pedir. Achado na 0.28.0: o `Text` com tom e a barra do `Progress` tinham ficado de fora.
|
|
104
|
+
*/
|
|
105
|
+
const PAR_DE_LETRA = {
|
|
106
|
+
success: "success400", info: "info400", warning: "warning400", destructive: "danger400",
|
|
107
|
+
};
|
|
108
|
+
export const letraDoToken = (t, token) => (PAR_DE_LETRA[token] ? t.color[PAR_DE_LETRA[token]] : undefined) ?? t.color[token];
|
|
98
109
|
/**
|
|
99
110
|
* O FUNDO CHEIO de um tom de estado e a letra em cima dele — o par do botão cheio (ADR-0061, 0.27.0):
|
|
100
111
|
* o selo cheio é o botão cheio do mesmo tom. `primary` e `neutral` não têm o par: `undefined`, e
|
package/dist/feedback.js
CHANGED
|
@@ -22,7 +22,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
22
22
|
import * as React from "react";
|
|
23
23
|
import { Animated, Easing, View } from "react-native";
|
|
24
24
|
import { IconButton } from "./actions.js";
|
|
25
|
-
import { canto, criarFolha, estadoAcessivel } from "./estilos.js";
|
|
25
|
+
import { canto, criarFolha, estadoAcessivel, letraDoToken } from "./estilos.js";
|
|
26
26
|
import { Icon } from "./icon.js";
|
|
27
27
|
import { IconeEmMoldura } from "./moldura.js";
|
|
28
28
|
import { useReduceMotion, driverNativo } from "./movimento.js";
|
|
@@ -183,7 +183,9 @@ export function Progress({ value, label, detail, tone = "brand", style, testID }
|
|
|
183
183
|
const reduzir = useReduceMotion();
|
|
184
184
|
const semTotal = value == null || Number.isNaN(value);
|
|
185
185
|
const pct = semTotal ? undefined : Math.max(0, Math.min(100, value));
|
|
186
|
-
|
|
186
|
+
// ADR-0061: a barra é desenho sobre a trilha, como a letra — usa o par `-400`, como a web
|
|
187
|
+
// (`.progress-tone-*`). Na 0.27.0 ela ficou com a cor de fundo cheio; achado na 0.28.0.
|
|
188
|
+
const cor = letraDoToken(t, COR_DO_TOM[tone]);
|
|
187
189
|
const temApoio = detail != null && detail !== false && detail !== "";
|
|
188
190
|
const emTexto = temApoio && (typeof detail === "string" || typeof detail === "number") ? String(detail) : undefined;
|
|
189
191
|
// A largura do trilho, para o pedaço saber quanto andar. O `translateX` do RN não aceita
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type { ScreenProps, AureaScreenBackground, AureaScreenEdge } from "./scre
|
|
|
13
13
|
export { Stack, Cluster, Grid, Card, Separator } from "./layout.js";
|
|
14
14
|
export type { StackProps, ClusterProps, AureaStackAlign, AureaClusterAlign, AureaClusterJustify, GridProps, CardProps, SeparatorProps, AureaCardVariant, AureaGridMin, } from "./layout.js";
|
|
15
15
|
export { Button, IconButton, LinkButton, ThemeToggle } from "./actions.js";
|
|
16
|
-
export type { ButtonProps, IconButtonProps, LinkButtonProps, ThemeToggleProps, AureaButtonAppearance, AureaButtonSize, AureaButtonTone, } from "./actions.js";
|
|
16
|
+
export type { ButtonProps, IconButtonProps, LinkButtonProps, ThemeToggleProps, AureaButtonAppearance, AureaButtonSize, AureaButtonTone, AureaShareData, } from "./actions.js";
|
|
17
17
|
export { Spinner, Skeleton, Progress, Alert, EmptyState, DataState, ICONE_DA_VARIANTE } from "./feedback.js";
|
|
18
18
|
export type { SpinnerProps, SkeletonProps, ProgressProps, AlertProps, EmptyStateProps, DataStateProps, AureaSpinnerSize, AureaAlertVariant, AureaDataStateValue, AureaProgressTone, } from "./feedback.js";
|
|
19
19
|
export { Badge, Status, Avatar, KPI, formatarContagem } from "./display.js";
|
package/dist/midia.d.ts
CHANGED
|
@@ -30,6 +30,14 @@ export interface ImageProps {
|
|
|
30
30
|
*/
|
|
31
31
|
render?: React.ReactElement;
|
|
32
32
|
onError?: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* GAR-15 (0.28.0): a captura dentro de uma moldura de celular — GENÉRICA, sem ilha, entalhe nem
|
|
35
|
+
* botões, como na web. Com moldura, o `style` vai para a MOLDURA (tamanho e lugar); a proporção
|
|
36
|
+
* (`ratio`, padrão 9/19,5) vai para a captura.
|
|
37
|
+
*/
|
|
38
|
+
frame?: "phone";
|
|
39
|
+
/** GAR-15 (0.28.0): a captura do tema escuro. No tema escuro aparece esta; no claro, a `source`. */
|
|
40
|
+
sourceDark?: AureaImageSource;
|
|
33
41
|
style?: StyleProp<ViewStyle>;
|
|
34
42
|
testID?: string;
|
|
35
43
|
}
|
|
@@ -48,7 +56,7 @@ export interface ImageProps {
|
|
|
48
56
|
* Trocar o bitmap por uma caixa muda o que se vê, não o que a foto É — e o `role="image"` mapeia
|
|
49
57
|
* nos dois sistemas (`ReactAccessibilityDelegate.kt:461`, `RCTConversions.h:96`).
|
|
50
58
|
*/
|
|
51
|
-
export declare function Image({ source, alt, ratio, fit, fallback, fallbackIcon, render, onError, style, testID, }: ImageProps): React.JSX.Element;
|
|
59
|
+
export declare function Image({ source: fonteClara, alt, ratio, fit, fallback, fallbackIcon, render, onError, frame, sourceDark, style, testID, }: ImageProps): React.JSX.Element;
|
|
52
60
|
export interface AureaGalleryItem {
|
|
53
61
|
id: string;
|
|
54
62
|
source: AureaImageSource;
|
package/dist/midia.js
CHANGED
|
@@ -56,6 +56,16 @@ const folha = criarFolha((t) => ({
|
|
|
56
56
|
},
|
|
57
57
|
contain: { backgroundColor: "transparent" },
|
|
58
58
|
quebrada: { alignItems: "center", justifyContent: "center" },
|
|
59
|
+
// GAR-15 (0.28.0): a moldura de celular — os mesmos tokens da web (`.image-frame-phone`): a
|
|
60
|
+
// superfície do cartão, a borda, a sombra média e o canto da folha de baixo; o de dentro acompanha.
|
|
61
|
+
moldura: {
|
|
62
|
+
padding: t.size.space2,
|
|
63
|
+
borderWidth: t.size.borderWidth, borderColor: t.color.border,
|
|
64
|
+
...canto(t.size.radiusSheet),
|
|
65
|
+
backgroundColor: t.color.card,
|
|
66
|
+
...(t.shadow.shadowMd ? { boxShadow: [t.shadow.shadowMd] } : null),
|
|
67
|
+
},
|
|
68
|
+
naMoldura: { ...canto(t.size.radiusSheet - t.size.space2), aspectRatio: 9 / 19.5 },
|
|
59
69
|
ladrilho: { gap: t.size.space1, padding: t.size.space1, ...canto(t.size.radiusLg) },
|
|
60
70
|
ladrilhoEscolhido: { backgroundColor: t.color.secondary },
|
|
61
71
|
}));
|
|
@@ -93,10 +103,12 @@ const fonteDaImagem = (s) => typeof s === "string" ? { uri: s } : s;
|
|
|
93
103
|
* Trocar o bitmap por uma caixa muda o que se vê, não o que a foto É — e o `role="image"` mapeia
|
|
94
104
|
* nos dois sistemas (`ReactAccessibilityDelegate.kt:461`, `RCTConversions.h:96`).
|
|
95
105
|
*/
|
|
96
|
-
export function Image({ source, alt, ratio, fit = "cover", fallback, fallbackIcon = "image", render, onError, style, testID, }) {
|
|
106
|
+
export function Image({ source: fonteClara, alt, ratio, fit = "cover", fallback, fallbackIcon = "image", render, onError, frame, sourceDark, style, testID, }) {
|
|
97
107
|
const t = useAureaTokens();
|
|
98
108
|
const s = folha(t);
|
|
99
109
|
const [quebrou, setQuebrou] = React.useState(false);
|
|
110
|
+
// O tema é do provider, então aqui basta escolher a fonte — não há duas imagens como na web.
|
|
111
|
+
const source = t.theme === "dark" && sourceDark ? sourceDark : fonteClara;
|
|
100
112
|
// A `source` nova merece uma tentativa nova — é a mesma linha do `Avatar` (`display.tsx:283`),
|
|
101
113
|
// e sem ela uma URL quebrada deixa um buraco permanente mesmo depois de o app trocar a foto.
|
|
102
114
|
React.useEffect(() => { setQuebrou(false); }, [source]);
|
|
@@ -104,11 +116,14 @@ export function Image({ source, alt, ratio, fit = "cover", fallback, fallbackIco
|
|
|
104
116
|
const caixa = [
|
|
105
117
|
s.imagem,
|
|
106
118
|
fit === "contain" && s.contain,
|
|
119
|
+
frame && s.naMoldura,
|
|
107
120
|
proporcao != null && { aspectRatio: proporcao },
|
|
108
|
-
style,
|
|
121
|
+
!frame && style,
|
|
109
122
|
];
|
|
123
|
+
// Com moldura, a imagem vai dentro de uma caixa que leva o `style` e o `testID` do consumidor.
|
|
124
|
+
const moldar = (filho) => frame ? _jsx(View, { testID: testID, style: [s.moldura, style], children: filho }) : filho;
|
|
110
125
|
if (quebrou) {
|
|
111
|
-
return (_jsx(View, { testID: testID, style: [caixa, s.quebrada], accessible: true, accessibilityRole: "image", accessibilityLabel: alt || undefined, children: fallback ?? (fallbackIcon
|
|
126
|
+
return moldar(_jsx(View, { testID: frame ? undefined : testID, style: [caixa, s.quebrada], accessible: true, accessibilityRole: "image", accessibilityLabel: alt || undefined, children: fallback ?? (fallbackIcon
|
|
112
127
|
? _jsx(Icon, { name: fallbackIcon, size: "lg", color: t.color.mutedForeground })
|
|
113
128
|
: null) }));
|
|
114
129
|
}
|
|
@@ -120,21 +135,21 @@ export function Image({ source, alt, ratio, fit = "cover", fallback, fallbackIco
|
|
|
120
135
|
accessible: alt !== "",
|
|
121
136
|
accessibilityRole: alt !== "" ? "image" : undefined,
|
|
122
137
|
accessibilityLabel: alt !== "" ? alt : undefined,
|
|
123
|
-
testID,
|
|
138
|
+
testID: frame ? undefined : testID,
|
|
124
139
|
};
|
|
125
140
|
// `cloneElement` e não `useRender`: o idioma do Base UI não existe aqui, e o que o caso real
|
|
126
141
|
// precisa é de um elemento pronto recebendo as nossas props. As props do consumidor vêm
|
|
127
142
|
// primeiro no objeto do elemento e as nossas depois — `source` e `onError` são o contrato
|
|
128
143
|
// deste componente, e deixá-las sobrescrevíveis seria prometer o substituto e não entregá-lo.
|
|
129
144
|
if (render)
|
|
130
|
-
return React.cloneElement(render, comuns);
|
|
145
|
+
return moldar(React.cloneElement(render, comuns));
|
|
131
146
|
// ⚠ O molde é `ImageStyle` e não `ViewStyle`, e a conversão é CONSCIENTE: os dois tipos só
|
|
132
147
|
// divergem em duas coisas — o `overflow` do `ViewStyle` aceita `"scroll"`, que o `ImageStyle`
|
|
133
148
|
// não tem, e o `ImageStyle` soma `resizeMode`/`tintColor`/`overlayColor`. **Nada aqui escreve
|
|
134
149
|
// nenhuma das duas**: a folha põe largura, raio, fundo e proporção, e o `resizeMode` vai como
|
|
135
150
|
// prop, ao lado. A API pública fica em `ViewStyle` de propósito — quem chama pensa em caixa, e
|
|
136
151
|
// fazer o consumidor importar `ImageStyle` para passar um raio seria vazar o primitivo.
|
|
137
|
-
return _jsx(ImageRN, { ...comuns, style: caixa, resizeMode: fit });
|
|
152
|
+
return moldar(_jsx(ImageRN, { ...comuns, style: caixa, resizeMode: fit }));
|
|
138
153
|
}
|
|
139
154
|
/**
|
|
140
155
|
* A grade de fotos, e a foto grande quando se toca.
|
package/dist/strings.d.ts
CHANGED
|
@@ -60,6 +60,10 @@ export interface AureaStrings {
|
|
|
60
60
|
confirmProceed: string;
|
|
61
61
|
/** O botão que dispensa um aviso da pilha. Mesmo nome da web. */
|
|
62
62
|
dismissNotification: string;
|
|
63
|
+
/** GAR-14 (0.28.0): o aviso do `Button share` quando o link foi copiado. Mesmo nome da web. */
|
|
64
|
+
linkCopied: string;
|
|
65
|
+
/** GAR-14 (0.28.0): o aviso quando nem compartilhar nem copiar deu certo. Mesmo nome da web. */
|
|
66
|
+
linkCopyFailed: string;
|
|
63
67
|
/** O nome da `Table` sem `caption`. Mesmo nome — e mesmo recuo — da web. */
|
|
64
68
|
tableLabel: string;
|
|
65
69
|
/** O nome do `Chart` sem `label`. Mesmo nome da web. */
|
package/dist/strings.js
CHANGED
|
@@ -48,6 +48,8 @@ export const defaultStrings = {
|
|
|
48
48
|
confirmCancel: "Cancel",
|
|
49
49
|
confirmProceed: "Continue",
|
|
50
50
|
dismissNotification: "Dismiss notification",
|
|
51
|
+
linkCopied: "Link copied",
|
|
52
|
+
linkCopyFailed: "Could not copy. Copy the link below.",
|
|
51
53
|
tableLabel: "Table",
|
|
52
54
|
chartLabel: "Chart",
|
|
53
55
|
increment: "Increase",
|
|
@@ -96,6 +98,8 @@ export const ptBR = {
|
|
|
96
98
|
confirmCancel: "Cancelar",
|
|
97
99
|
confirmProceed: "Continuar",
|
|
98
100
|
dismissNotification: "Dispensar notificação",
|
|
101
|
+
linkCopied: "Link copiado",
|
|
102
|
+
linkCopyFailed: "Não deu para copiar. Copie o link abaixo.",
|
|
99
103
|
tableLabel: "Tabela",
|
|
100
104
|
chartLabel: "Gráfico",
|
|
101
105
|
increment: "Aumentar",
|
package/dist/text.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import * as React from "react";
|
|
|
2
2
|
import { type TextProps as TextPropsRN } from "react-native";
|
|
3
3
|
/** A escala dos tokens (`--text-xs` … `--text-5xl`). `md` é o corpo, como no `body` da web. */
|
|
4
4
|
export type AureaTextSize = "xs" | "sm" | "md" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl";
|
|
5
|
-
/** Os
|
|
6
|
-
export type AureaTextWeight = 400 | 500 | 600 | 700;
|
|
7
|
-
/** Papel de tipografia — os
|
|
8
|
-
export type AureaTextFont = "ui" | "editorial" | "code";
|
|
5
|
+
/** Os pesos que o pacote de fontes entrega (o 800 desde a 0.28.0, GAR-16). Ver ADR-0039: cada peso é uma FAMÍLIA. */
|
|
6
|
+
export type AureaTextWeight = 400 | 500 | 600 | 700 | 800;
|
|
7
|
+
/** Papel de tipografia — os `--font-*` da Aurea (o `heading` desde a 0.28.0). */
|
|
8
|
+
export type AureaTextFont = "ui" | "editorial" | "code" | "heading";
|
|
9
9
|
/** O que a cor SIGNIFICA. Mesmo vocabulário do `tone` do Button (ADR-0044). */
|
|
10
10
|
export type AureaTextTone = "default" | "muted" | "subtle" | "primary" | "link" | "danger" | "success" | "warning" | "info";
|
|
11
11
|
export type AureaTextLeading = "none" | "tight" | "normal" | "relaxed";
|
|
@@ -31,6 +31,11 @@ export interface TextProps extends TextPropsRN {
|
|
|
31
31
|
align?: "auto" | "left" | "right" | "center";
|
|
32
32
|
/** Aplica o `tracking` do token. É RAZÃO de `em`: multiplicado pelo `fontSize` aqui dentro. */
|
|
33
33
|
tracking?: "tight" | "normal" | "wide" | "wider" | "widest";
|
|
34
|
+
/**
|
|
35
|
+
* GAR-16 (0.28.0): algarismos da mesma largura (`fontVariant: ["tabular-nums"]`, iOS e Android) —
|
|
36
|
+
* para número que alinha em coluna ou muda na tela. Desligado por padrão, como na web.
|
|
37
|
+
*/
|
|
38
|
+
numeric?: boolean;
|
|
34
39
|
}
|
|
35
40
|
/**
|
|
36
41
|
* Texto da Aurea. Sem provider acima, `useAureaTokens` levanta — de propósito: um padrão
|
|
@@ -42,7 +47,7 @@ export interface TextProps extends TextPropsRN {
|
|
|
42
47
|
* próprias. Pedir peso 600 por `fontWeight` devolveria o Regular sintetizado — **em silêncio**.
|
|
43
48
|
* Quem escolhe a fonte aqui é o `fontFamily`, com o nome PostScript que o provider já resolveu.
|
|
44
49
|
*/
|
|
45
|
-
export declare function Text({ type, size, weight: pesoPedido, font: fontePedida, tone, leading, italic, align, tracking: trackingPedido, style, ...rest }: TextProps): React.JSX.Element;
|
|
50
|
+
export declare function Text({ type, size, weight: pesoPedido, font: fontePedida, tone, leading, italic, align, tracking: trackingPedido, numeric, style, ...rest }: TextProps): React.JSX.Element;
|
|
46
51
|
export type AureaTypographyColor = "default" | "muted";
|
|
47
52
|
export type AureaTypographyWeight = "normal" | "medium" | "semibold" | "bold";
|
|
48
53
|
export type AureaTypographyAlign = "start" | "center" | "end" | "justify";
|
package/dist/text.js
CHANGED
|
@@ -21,7 +21,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
21
21
|
// que os tokens já publicam seria uma segunda verdade sobre tipografia.
|
|
22
22
|
import * as React from "react";
|
|
23
23
|
import { Text as TextRN } from "react-native";
|
|
24
|
-
import { canto, criarFolha } from "./estilos.js";
|
|
24
|
+
import { canto, criarFolha, letraDoToken } from "./estilos.js";
|
|
25
25
|
import { 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
|
|
@@ -66,7 +66,8 @@ const TAMANHO = {
|
|
|
66
66
|
const ENTRELINHA = {
|
|
67
67
|
none: "leadingNone", tight: "leadingTight", normal: "leadingNormal", relaxed: "leadingRelaxed",
|
|
68
68
|
};
|
|
69
|
-
|
|
69
|
+
// O título usa o papel `heading` (GAR-16, 0.28.0) — hoje a mesma fonte do texto, no mesmo peso 600.
|
|
70
|
+
const titulo = (tamanho) => ({ tamanho, peso: 600, entrelinha: "leadingTight", fonte: "heading", junto: true });
|
|
70
71
|
const PAPEL = {
|
|
71
72
|
h1: titulo("text4xl"), h2: titulo("text3xl"), h3: titulo("text2xl"),
|
|
72
73
|
h4: titulo("textXl"), h5: titulo("textLg"), h6: titulo("textBase"),
|
|
@@ -90,7 +91,10 @@ const COR = {
|
|
|
90
91
|
const folha = criarFolha((t) => {
|
|
91
92
|
const tons = {};
|
|
92
93
|
for (const [tom, token] of Object.entries(COR)) {
|
|
93
|
-
|
|
94
|
+
// ADR-0061: `success`, `info`, `warning` e `destructive` são a cor de FUNDO cheio; a LETRA é o
|
|
95
|
+
// par `-400` de cada tema. Na 0.27.0 este mapa ficou de fora e o texto de tom saía com a cor de
|
|
96
|
+
// fundo — no escuro, ~2,5:1. Achado na 0.28.0; `paleta-adr0061.test.tsx` cobra.
|
|
97
|
+
tons[tom] = { color: letraDoToken(t, token) ?? t.color.foreground };
|
|
94
98
|
}
|
|
95
99
|
return tons;
|
|
96
100
|
});
|
|
@@ -104,7 +108,7 @@ const folha = criarFolha((t) => {
|
|
|
104
108
|
* próprias. Pedir peso 600 por `fontWeight` devolveria o Regular sintetizado — **em silêncio**.
|
|
105
109
|
* Quem escolhe a fonte aqui é o `fontFamily`, com o nome PostScript que o provider já resolveu.
|
|
106
110
|
*/
|
|
107
|
-
export function Text({ type, size, weight: pesoPedido, font: fontePedida, tone = "default", leading, italic = false, align, tracking: trackingPedido, style, ...rest }) {
|
|
111
|
+
export function Text({ type, size, weight: pesoPedido, font: fontePedida, tone = "default", leading, italic = false, align, tracking: trackingPedido, numeric = false, style, ...rest }) {
|
|
108
112
|
const t = useAureaTokens();
|
|
109
113
|
const s = folha(t);
|
|
110
114
|
const sobreAMarca = useSobreAMarca();
|
|
@@ -134,13 +138,14 @@ export function Text({ type, size, weight: pesoPedido, font: fontePedida, tone =
|
|
|
134
138
|
// É a impedância que a Etapa 2 mediu e resolveu emitindo razão em vez de dp.
|
|
135
139
|
...(tracking ? { letterSpacing: fontSize * t.tracking[`tracking${tracking[0].toUpperCase()}${tracking.slice(1)}`] } : null),
|
|
136
140
|
...(align ? { textAlign: align } : null),
|
|
141
|
+
...(numeric ? { fontVariant: ["tabular-nums"] } : null),
|
|
137
142
|
// O código leva a pele do `code` da web: fundo, canto e um recheio pequeno (a referência).
|
|
138
143
|
...(type === "code" ? {
|
|
139
144
|
alignSelf: "flex-start", backgroundColor: t.color.surface2, ...canto(t.size.radiusXs),
|
|
140
145
|
paddingHorizontal: t.size.space1, paddingVertical: t.size.space05,
|
|
141
146
|
} : null),
|
|
142
147
|
};
|
|
143
|
-
}, [t, type, papel, size, weight, font, leading, italic, align, tracking]);
|
|
148
|
+
}, [t, type, papel, size, weight, font, leading, italic, align, tracking, numeric]);
|
|
144
149
|
// 🔴 SOBRE UMA SUPERFÍCIE DA MARCA A COR É FORÇADA, e ela vence até o tom explícito.
|
|
145
150
|
// Medido contra o `primary` nos dois temas: texto comum dá **1,83 no escuro**, esmaecido
|
|
146
151
|
// **1,35**, e `danger` menos ainda. **Nenhum tom alcança os 4,5 da norma sobre o amarelo** —
|
package/dist/theme.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AureaToastManager } from "./toast.js";
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { type AureaIconRegistry } from "./icon.js";
|
|
3
4
|
import { type AureaStrings } from "./strings.js";
|
|
@@ -73,6 +74,12 @@ export declare function useAureaTokens(): AureaTokens;
|
|
|
73
74
|
* As frases visíveis. Mesmo nome do hook da web (`useAureaStrings`), tabela bem menor — ver
|
|
74
75
|
* `strings.ts`.
|
|
75
76
|
*/
|
|
77
|
+
/**
|
|
78
|
+
* O gerente de avisos do `ToastHost`, para quem não pode importar o `toast.tsx` — o `Button share`
|
|
79
|
+
* (GAR-14, 0.28.0): o `toast.tsx` importa o `IconButton`, e o botão importar o toast fecharia um
|
|
80
|
+
* ciclo. Interno: o público continua sendo o `useToast`. `null` sem `ToastHost` acima.
|
|
81
|
+
*/
|
|
82
|
+
export declare const AvisosContext: React.Context<AureaToastManager | null>;
|
|
76
83
|
export declare function useAureaStrings(): AureaStrings;
|
|
77
84
|
export interface SobreAMarcaValor {
|
|
78
85
|
/** A única cor que se pode desenhar sobre a marca: letra, contorno e glifo. 4,54 nos dois temas. */
|
package/dist/theme.js
CHANGED
|
@@ -1,32 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// Aurea nativo — o provider de tema × densidade, e os dois hooks que ele alimenta.
|
|
3
|
-
//
|
|
4
|
-
// ADR-0037: o motor é o `StyleSheet` puro e **esta camada é nossa**. Não há Unistyles para
|
|
5
|
-
// registrar tema, então o lugar onde os dois eixos moram é um contexto do React — e a ADR foi
|
|
6
|
-
// honesta sobre a única aposta que isso carrega: *"se o contexto do React, sem as otimizações do
|
|
7
|
-
// Unistyles, re-renderiza a ponto de doer na troca de tema em tela real"*. Ainda não foi medido
|
|
8
|
-
// em aparelho.
|
|
9
|
-
//
|
|
10
|
-
// UM CONTEXTO, E NÃO DOIS — e vale escrever por que, porque a primeira versão tinha dois.
|
|
11
|
-
// A ideia era que quem só troca o tema assinasse um contexto "estável" e não re-renderizasse
|
|
12
|
-
// junto com a tela. **Não funciona, e a razão é óbvia depois de vista:** o valor de controle
|
|
13
|
-
// contém `theme` e `density`, então ele muda exatamente quando o de tokens muda. Dois contextos
|
|
14
|
-
// que mudam juntos não poupam render nenhum — poupam só a impressão de estarem poupando.
|
|
15
|
-
//
|
|
16
|
-
// O que de fato reduz custo é o `useMemo`: entre renders que NÃO trocam eixo, os dois objetos são
|
|
17
|
-
// os mesmos por identidade, e a subárvore não é notificada. É o que está feito.
|
|
18
|
-
//
|
|
19
|
-
// Se um dia doer em aparelho, a saída é a que a ADR-0037 já prevê — contexto fatiado de verdade,
|
|
20
|
-
// com as AÇÕES separadas do ESTADO. Aí a separação compra algo, porque as ações não mudam. Não
|
|
21
|
-
// está feito hoje porque seria mais superfície pública para um ganho não medido.
|
|
22
|
-
//
|
|
23
|
-
// PARIDADE COM A WEB, de propósito: `useAureaTheme()` devolve o mesmo `{theme, density, setTheme,
|
|
24
|
-
// setDensity, toggleTheme}` do hook homônimo de `@aurea-uds/react`. Uma diferença real: lá o
|
|
25
|
-
// valor pode ser `null` (no servidor o tema é desconhecido e fingir um produz erro de
|
|
26
|
-
// hidratação); aqui não há SSR, então nunca é nulo.
|
|
27
|
-
//
|
|
28
|
-
// E `useAureaTokens()` NÃO tem par na web porque lá ele não faria sentido: o CSS resolve o token
|
|
29
|
-
// no uso. Não é hook duplicado — é o hook que só o alvo sem cascata precisa ter.
|
|
30
2
|
import * as React from "react";
|
|
31
3
|
import { useColorScheme } from "react-native";
|
|
32
4
|
import { IconRegistryProvider } from "./icon.js";
|
|
@@ -106,6 +78,12 @@ export function useAureaTokens() {
|
|
|
106
78
|
* As frases visíveis. Mesmo nome do hook da web (`useAureaStrings`), tabela bem menor — ver
|
|
107
79
|
* `strings.ts`.
|
|
108
80
|
*/
|
|
81
|
+
/**
|
|
82
|
+
* O gerente de avisos do `ToastHost`, para quem não pode importar o `toast.tsx` — o `Button share`
|
|
83
|
+
* (GAR-14, 0.28.0): o `toast.tsx` importa o `IconButton`, e o botão importar o toast fecharia um
|
|
84
|
+
* ciclo. Interno: o público continua sendo o `useToast`. `null` sem `ToastHost` acima.
|
|
85
|
+
*/
|
|
86
|
+
export const AvisosContext = React.createContext(null);
|
|
109
87
|
export function useAureaStrings() {
|
|
110
88
|
return usar("useAureaStrings").strings;
|
|
111
89
|
}
|
package/dist/toast.js
CHANGED
|
@@ -62,7 +62,7 @@ import { Icon } from "./icon.js";
|
|
|
62
62
|
import { ICONE_DA_VARIANTE } from "./feedback.js";
|
|
63
63
|
import { useReduceMotion, driverNativo } from "./movimento.js";
|
|
64
64
|
import { Text } from "./text.js";
|
|
65
|
-
import { useAureaStrings, useAureaTokens } from "./theme.js";
|
|
65
|
+
import { AvisosContext, useAureaStrings, useAureaTokens } from "./theme.js";
|
|
66
66
|
const folha = criarFolha((t) => ({
|
|
67
67
|
hospedeiro: { flex: 1 },
|
|
68
68
|
pilha: {
|
|
@@ -93,7 +93,9 @@ const folha = criarFolha((t) => ({
|
|
|
93
93
|
const DURACAO_PADRAO = 5000;
|
|
94
94
|
/** A entrada, nos mesmos `.28s` do `.toast` do CSS. */
|
|
95
95
|
const ENTRADA = 280;
|
|
96
|
-
|
|
96
|
+
// O contexto mora no `theme.tsx` desde a 0.28.0 (GAR-14): o `Button share` também o lê, e ele não
|
|
97
|
+
// pode importar este arquivo sem fechar um ciclo (este importa o `IconButton`).
|
|
98
|
+
const Ctx = AvisosContext;
|
|
97
99
|
/**
|
|
98
100
|
* O gerente de avisos. **Precisa de um `ToastHost` acima na árvore.**
|
|
99
101
|
*
|
package/dist/tokens.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type AureaShadow = {
|
|
|
15
15
|
*
|
|
16
16
|
* O que chega de fora **não** é total — ver `AureaFontInput` e `normalizarEscala`.
|
|
17
17
|
*/
|
|
18
|
-
export type AureaFontScale = Record<400 | 500 | 600 | 700, string> & {
|
|
18
|
+
export type AureaFontScale = Record<400 | 500 | 600 | 700 | 800, string> & {
|
|
19
19
|
/** Só o papel `ui` tem itálico no pacote de fontes; nos outros é `undefined`. */
|
|
20
20
|
italic?: string;
|
|
21
21
|
};
|
|
@@ -23,14 +23,14 @@ export type AureaFontScale = Record<400 | 500 | 600 | 700, string> & {
|
|
|
23
23
|
* O que o consumidor INJETA, e é parcial porque o pacote de fontes é parcial — medido em
|
|
24
24
|
* 03/09/2026 no `@aurea-uds/fonts/native`:
|
|
25
25
|
*
|
|
26
|
-
* ui 400 400i 500 600 700
|
|
26
|
+
* ui 400 400i 500 600 700 800 ← o 800 entrou na 0.28.0 (GAR-16)
|
|
27
27
|
* editorial 400 500 600 700 ← apelido do `ui` desde a ADR-0053 (sai na 1.0)
|
|
28
28
|
* code 400 500 600 ← não há 700
|
|
29
29
|
*
|
|
30
30
|
* É a grade dos arquivos de fonte, não um esquecimento nosso. Até a 0.12.4 o `editorial` era a
|
|
31
31
|
* IBM Plex Serif, sem 400; a ADR-0053 tirou a serifada e o deixou apontando para a Atkinson.
|
|
32
32
|
*/
|
|
33
|
-
export type AureaFontInput = Partial<Record<"400" | "500" | "600" | "700" | "400i", string>>;
|
|
33
|
+
export type AureaFontInput = Partial<Record<"400" | "500" | "600" | "700" | "800" | "400i", string>>;
|
|
34
34
|
export type AureaTokens = {
|
|
35
35
|
theme: AureaThemeName;
|
|
36
36
|
density: AureaDensity;
|
|
@@ -43,6 +43,7 @@ export type AureaTokens = {
|
|
|
43
43
|
ui: AureaFontScale;
|
|
44
44
|
editorial: AureaFontScale;
|
|
45
45
|
code: AureaFontScale;
|
|
46
|
+
heading: AureaFontScale;
|
|
46
47
|
};
|
|
47
48
|
/**
|
|
48
49
|
* `boxShadow` do RN 0.76+ — **a primeira camada** de cada sombra. Para a sombra INTEIRA, use
|
|
@@ -66,6 +67,9 @@ export type AureaFontFamilies = {
|
|
|
66
67
|
ui: AureaFontInput;
|
|
67
68
|
editorial: AureaFontInput;
|
|
68
69
|
code: AureaFontInput;
|
|
70
|
+
/** O papel do título (GAR-16, 0.28.0). Opcional: sem ele, o título usa o mapa do `ui` — que é a
|
|
71
|
+
* mesma fonte hoje, e é o que acontece com quem ainda passa o mapa de antes da 0.28.0. */
|
|
72
|
+
heading?: AureaFontInput;
|
|
69
73
|
};
|
|
70
74
|
/**
|
|
71
75
|
* Resolve os tokens para um par (tema, densidade). Puro e sem estado: o provider chama isto
|
package/dist/tokens.js
CHANGED
|
@@ -23,7 +23,7 @@ const ehSombra = (v) => typeof v === "object" && v !== null && "blurRadius" in v
|
|
|
23
23
|
function mesclar(...grupos) {
|
|
24
24
|
return Object.assign({}, ...grupos);
|
|
25
25
|
}
|
|
26
|
-
const PESOS = [400, 500, 600, 700];
|
|
26
|
+
const PESOS = [400, 500, 600, 700, 800];
|
|
27
27
|
/**
|
|
28
28
|
* Fecha a grade parcial que o pacote de fontes emite numa escala TOTAL.
|
|
29
29
|
*
|
|
@@ -95,6 +95,7 @@ export function resolverTokens(theme, density, fontFamilies) {
|
|
|
95
95
|
ui: normalizarEscala(fontFamilies?.ui, texto.fontUi ?? "System"),
|
|
96
96
|
editorial: normalizarEscala(fontFamilies?.editorial, texto.fontEditorial ?? "System"),
|
|
97
97
|
code: normalizarEscala(fontFamilies?.code, texto.fontCode ?? "System"),
|
|
98
|
+
heading: normalizarEscala(fontFamilies?.heading ?? fontFamilies?.ui, texto.fontHeading ?? texto.fontUi ?? "System"),
|
|
98
99
|
};
|
|
99
100
|
return { theme, density, color, size, font, shadow, shadowLayers: { ...shadowLayers }, easing, tracking: { ...tracking }, remInDp: REM_EM_DP };
|
|
100
101
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aurea-uds/native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.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.28.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@react-native-community/datetimepicker": ">=8",
|