@aurea-uds/react 0.41.0 → 0.43.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/code-client.d.ts +11 -2
- package/dist/code-client.js +24 -1
- package/dist/feedback-client.d.ts +1 -1
- package/dist/inputs-client.d.ts +4 -2
- package/dist/inputs-client.js +8 -2
- package/dist/inputs.d.ts +1 -0
- package/dist/layout-client.d.ts +19 -6
- package/dist/layout-client.js +21 -4
- package/dist/markup.d.ts +4 -1
- package/dist/markup.js +10 -6
- package/package.json +1 -1
package/dist/code-client.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
/** Uma aba do `CodeBlock` em abas: o nome (o "npm"), o código e, se for outra, a língua dele. */
|
|
3
|
+
export interface CodeBlockTab {
|
|
4
|
+
label: string;
|
|
5
|
+
code: string;
|
|
6
|
+
language?: string;
|
|
7
|
+
}
|
|
2
8
|
/** Um pedaço de uma linha de código, com a classe da cor (`tok-keyword`, `tok-string`…) quando tem cor. */
|
|
3
9
|
export interface CodeToken {
|
|
4
10
|
text: string;
|
|
@@ -9,8 +15,8 @@ export type CodeLine = CodeToken[];
|
|
|
9
15
|
/** Quem colore: recebe o código e a língua e devolve as linhas, ou `null` quando não conhece a língua. O da Aurea é o
|
|
10
16
|
* `highlightCode` de `@aurea-uds/react/code-highlight`. */
|
|
11
17
|
export type CodeHighlighter = (code: string, language: string) => CodeLine[] | null;
|
|
12
|
-
export declare function CodeBlock({ children, language, copyable, preview, lineNumbers, highlight, className }: {
|
|
13
|
-
children
|
|
18
|
+
export declare function CodeBlock({ children, language, copyable, preview, lineNumbers, highlight, tabs, className }: {
|
|
19
|
+
children?: string;
|
|
14
20
|
language?: string;
|
|
15
21
|
copyable?: boolean;
|
|
16
22
|
/** A prévia viva do código: com ela, o bloco vira a caixa de exemplo, com as abas Prévia | Código. */
|
|
@@ -19,5 +25,8 @@ export declare function CodeBlock({ children, language, copyable, preview, lineN
|
|
|
19
25
|
lineNumbers?: boolean;
|
|
20
26
|
/** Colore o código. Passe o `highlightCode` de `@aurea-uds/react/code-highlight` (os analisadores são peer opcional). */
|
|
21
27
|
highlight?: CodeHighlighter;
|
|
28
|
+
/** As alternativas do mesmo passo, em abas (o comando de instalar em npm, pnpm, yarn e bun): a fileira em cima, dentro
|
|
29
|
+
* da caixa, e um código por aba. Com `tabs`, o `children` não é lido. */
|
|
30
|
+
tabs?: CodeBlockTab[];
|
|
22
31
|
className?: string;
|
|
23
32
|
}): React.JSX.Element;
|
package/dist/code-client.js
CHANGED
|
@@ -29,6 +29,26 @@ function CaixaDeExemplo({ preview, codigo, className }) {
|
|
|
29
29
|
const botao = (a, rotulo) => _jsx("button", { type: "button", role: "tab", id: `${id}-${a}`, ref: a === "preview" ? refPrevia : refCodigo, className: aba === a ? "active" : undefined, "aria-selected": aba === a, "aria-controls": `${id}-${a}-panel`, tabIndex: aba === a ? 0 : -1, onClick: () => setAba(a), onKeyDown: tecla, children: rotulo });
|
|
30
30
|
return _jsxs("div", { className: cx("demo code-preview", className), children: [_jsx("div", { className: "demo-tabs", children: _jsxs("div", { className: "segmented", role: "tablist", children: [botao("preview", s.codeBlockPreview), botao("code", s.codeBlockCode)] }) }), _jsx("div", { className: "demo-panel", "data-panel": "preview", role: "tabpanel", id: `${id}-preview-panel`, "aria-labelledby": `${id}-preview`, tabIndex: 0, hidden: aba !== "preview", children: preview }), _jsx("div", { className: "demo-panel demo-code", "data-panel": "code", role: "tabpanel", id: `${id}-code-panel`, "aria-labelledby": `${id}-code`, tabIndex: 0, hidden: aba !== "code", children: codigo })] });
|
|
31
31
|
}
|
|
32
|
+
// O CÓDIGO EM ABAS (bloco 1, o 3-A — 23/10/2026): as alternativas do MESMO passo, uma de cada vez — o comando de instalar
|
|
33
|
+
// em npm, pnpm, yarn e bun, como na documentação da referência (a fileira em cima, dentro da caixa do código). O estado é
|
|
34
|
+
// do React; os painéis levam `data-aurea-tabpanel` para o `aurea.js` do core trocar também na página que não acende (o
|
|
35
|
+
// site estático). A tecla para aqui (`stopPropagation`): com os dois na página, a seta andaria duas abas.
|
|
36
|
+
function CodigoEmAbas({ tabs, language, copyable, highlight, className }) {
|
|
37
|
+
const s = useAureaStrings();
|
|
38
|
+
const id = React.useId();
|
|
39
|
+
const [aba, setAba] = React.useState(0);
|
|
40
|
+
const refs = React.useRef([]);
|
|
41
|
+
const ir = (i) => { setAba(i); refs.current[i]?.focus(); };
|
|
42
|
+
const tecla = (e) => {
|
|
43
|
+
const n = tabs.length;
|
|
44
|
+
if (!["ArrowRight", "ArrowLeft", "Home", "End"].includes(e.key))
|
|
45
|
+
return;
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
e.stopPropagation();
|
|
48
|
+
ir(e.key === "Home" ? 0 : e.key === "End" ? n - 1 : e.key === "ArrowRight" ? (aba + 1) % n : (aba - 1 + n) % n);
|
|
49
|
+
};
|
|
50
|
+
return _jsxs("div", { className: cx("code-tabs", className), children: [_jsx("div", { className: "code-tabs-list", role: "tablist", "aria-label": s.tabsLabel, children: tabs.map((t, i) => _jsx("button", { type: "button", role: "tab", id: `${id}-${i}`, ref: el => { refs.current[i] = el; }, className: cx("code-tab", aba === i && "active"), "aria-selected": aba === i, "aria-controls": `${id}-${i}-panel`, tabIndex: aba === i ? 0 : -1, onClick: () => setAba(i), onKeyDown: tecla, children: t.label }, t.label)) }), tabs.map((t, i) => _jsx("div", { role: "tabpanel", id: `${id}-${i}-panel`, "aria-labelledby": `${id}-${i}`, "data-aurea-tabpanel": "", hidden: aba !== i, children: _jsx(CodeBlock, { language: t.language ?? language, copyable: copyable, highlight: highlight, children: t.code }) }, t.label))] });
|
|
51
|
+
}
|
|
32
52
|
// lineNumbers e highlight (lote V, 20/10/2026): as linhas viram um <span class="code-line"> cada, com o "\n" entre
|
|
33
53
|
// elas — o texto do bloco continua IGUAL ao código (copiar com o mouse traz o mesmo texto), e o número é desenhado pelo
|
|
34
54
|
// CSS, sem entrar no texto nem no leitor de tela. Sem as duas, a marcação é a de antes, sem mudar nada.
|
|
@@ -37,7 +57,9 @@ function linhasDoCodigo(codigo, language, highlight) {
|
|
|
37
57
|
const linhas = highlight?.(codigo, language) ?? codigo.split("\n").map(l => l === "" ? [] : [{ text: l }]);
|
|
38
58
|
return codigo.endsWith("\n") && linhas.length > 1 && linhas[linhas.length - 1].length === 0 ? linhas.slice(0, -1) : linhas;
|
|
39
59
|
}
|
|
40
|
-
export function CodeBlock({ children, language = "text", copyable, preview, lineNumbers, highlight, className }) {
|
|
60
|
+
export function CodeBlock({ children, language = "text", copyable, preview, lineNumbers, highlight, tabs, className }) {
|
|
61
|
+
if (tabs && tabs.length > 0)
|
|
62
|
+
return _jsx(CodigoEmAbas, { tabs: tabs, language: language, copyable: copyable, highlight: highlight, className: className });
|
|
41
63
|
if (preview !== undefined)
|
|
42
64
|
return _jsx(CaixaDeExemplo, { preview: preview, className: className, codigo: _jsx(CodeBlock, { language: language, copyable: copyable, lineNumbers: lineNumbers, highlight: highlight, children: children }) });
|
|
43
65
|
const s = useAureaStrings();
|
|
@@ -47,6 +69,7 @@ export function CodeBlock({ children, language = "text", copyable, preview, line
|
|
|
47
69
|
// demo do catálogo já tinha corrigido em 30/07/2026 no lado dele; aqui, na biblioteca, ele
|
|
48
70
|
// seguia aberto e só não aparecia porque nenhuma linha era comprida o bastante. Quem o achou
|
|
49
71
|
// foi o `catalog-sweep` em 10/08/2026, quando o bloco do I1 fez a linha de import crescer.
|
|
72
|
+
children ??= "";
|
|
50
73
|
const linhas = lineNumbers || highlight ? linhasDoCodigo(children, language, highlight) : null;
|
|
51
74
|
const colorido = linhas != null && highlight != null && linhas.some(l => l.some(p => p.className));
|
|
52
75
|
// Os algarismos da última linha: a coluna do número tem a largura deles (99 → 2, 100 → 3).
|
|
@@ -55,7 +55,7 @@ export declare function Spinner({ size, label, decorative, className, ...props }
|
|
|
55
55
|
decorative?: boolean;
|
|
56
56
|
}): React.JSX.Element;
|
|
57
57
|
export type DataStateValue = "loading" | "error" | "empty" | UniversalState;
|
|
58
|
-
export type DataStateProps = HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement> & {
|
|
58
|
+
export type DataStateProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & RefAttributes<HTMLDivElement> & {
|
|
59
59
|
state?: DataStateValue;
|
|
60
60
|
message?: ReactNode;
|
|
61
61
|
skeleton?: ReactNode;
|
package/dist/inputs-client.d.ts
CHANGED
|
@@ -310,15 +310,17 @@ export declare function OTPField({ length, value, defaultValue, onValueChange, m
|
|
|
310
310
|
/** `secondary`: o fundo neutro do `Input` secundário, para o campo dentro de um cartão. */
|
|
311
311
|
variant?: "primary" | "secondary";
|
|
312
312
|
}): React.JSX.Element;
|
|
313
|
-
export declare function SegmentedControl({ items, value, onChange, label, fullWidth }: {
|
|
313
|
+
export declare function SegmentedControl({ items, value, onChange, label, fullWidth, size }: {
|
|
314
314
|
items: Array<{
|
|
315
315
|
value: string;
|
|
316
316
|
label: ReactNode;
|
|
317
|
+
href?: string;
|
|
317
318
|
}>;
|
|
318
319
|
value: string;
|
|
319
|
-
onChange
|
|
320
|
+
onChange?: (v: string) => void;
|
|
320
321
|
label?: string;
|
|
321
322
|
fullWidth?: boolean;
|
|
323
|
+
size?: "sm" | "md";
|
|
322
324
|
}): React.JSX.Element;
|
|
323
325
|
export interface ComboboxOption {
|
|
324
326
|
value: string;
|
package/dist/inputs-client.js
CHANGED
|
@@ -763,9 +763,15 @@ export function OTPField({ length, value, defaultValue, onValueChange, mask, dis
|
|
|
763
763
|
// `fullWidth` (A5, 06/10/2026): o mesmo nome e o mesmo desenho do nativo — o controle ocupa a
|
|
764
764
|
// linha e cada segmento CRESCE a partir do rótulo, sem encolher abaixo dele. É como o grupo
|
|
765
765
|
// de botões alternáveis da referência ocupa a linha.
|
|
766
|
-
|
|
766
|
+
// NAVEGAÇÃO (bloco 1, o 5-A — 23/10/2026): com `href` em TODOS os itens, a cápsula é um <nav> de links — o atual leva
|
|
767
|
+
// `aria-current="page"` —, e não um grupo de escolha: ir para outra página é navegação, e o leitor de tela tem de ouvir
|
|
768
|
+
// "link", não "opção". É a chave Web | Native do site. `size="sm"`: a cápsula baixa da referência (abas de 24).
|
|
769
|
+
export function SegmentedControl({ items, value, onChange, label, fullWidth, size = "md" }) {
|
|
767
770
|
const s = useAureaStrings();
|
|
768
|
-
|
|
771
|
+
const classe = cx("segmented", fullWidth && "segmented-full", size === "sm" && "segmented-sm");
|
|
772
|
+
if (items.length > 0 && items.every(i => i.href != null))
|
|
773
|
+
return _jsx("nav", { className: classe, "aria-label": label ?? s.optionsLabel, children: items.map(i => _jsx("a", { href: i.href, className: i.value === value ? "active" : undefined, "aria-current": i.value === value ? "page" : undefined, children: i.label }, i.value)) });
|
|
774
|
+
return _jsx(BaseRadioGroup, { className: classe, "aria-label": label ?? s.optionsLabel, value: value, onValueChange: v => onChange?.(String(v)), children: items.map(i => _jsx(BaseRadio.Root, { value: i.value, className: i.value === value ? "active" : undefined, nativeButton: true, render: _jsx("button", { type: "button" }), children: i.label }, i.value)) });
|
|
769
775
|
}
|
|
770
776
|
const ehAgrupado = (items) => items != null && items.length > 0 && typeof items[0] === "object" && items[0] != null && "items" in items[0];
|
|
771
777
|
// UM renderizador e UMA lista para os dois combobox: duas cópias da mesma árvore é como a
|
package/dist/inputs.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export * from "./inputs-client.js";
|
|
2
2
|
export { Textarea, Checkbox, Radio, Switch, Range } from "./markup.js";
|
|
3
3
|
export { Label, InputGroup, InputGroupAddon, type AddonSide, type AddonLayout, type FieldSize, type FieldVariant } from "./markup.js";
|
|
4
|
+
export type { ColorSpace, ColorChannel } from "./color.js";
|
package/dist/layout-client.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { type HTMLAttributes, type RefAttributes, type ReactNode } from "react";
|
|
1
|
+
import React, { type HTMLAttributes, type RefAttributes, type ReactNode } from "react";
|
|
2
2
|
import { type Orientation, type Responsive } from "./pure.js";
|
|
3
|
+
import { type IconButtonProps } from "./actions.js";
|
|
3
4
|
import { type HeaderVariant, type HeaderTab, type SidebarVariant, type SidebarScrollbar, type SidebarItem } from "./navigation.js";
|
|
4
|
-
|
|
5
|
+
declare function AppShellSidebarToggle({ className, ...props }: Omit<IconButtonProps, "icon" | "label" | "onClick">): React.JSX.Element | null;
|
|
6
|
+
export declare function AppShell({ brand, navigation, navItems, currentNavId, navLabel, topbar, topbarVariant, topbarDivider, topbarTabs, topbarCurrentTab, topbarTabsLabel, topbarTabsEnd, layout, sidebarVariant, sidebarScrollbar, sidebarFooter, sidebarCollapsed, sidebarCollapsible, defaultSidebarCollapsed, onSidebarCollapsedChange, contentVariant, aside, asideLabel, asideVariant, children, className, ...props }: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement> & {
|
|
5
7
|
brand: ReactNode;
|
|
6
8
|
navigation?: ReactNode;
|
|
7
9
|
navItems?: SidebarItem[];
|
|
@@ -13,14 +15,21 @@ export declare function AppShell({ brand, navigation, navItems, currentNavId, na
|
|
|
13
15
|
sidebarVariant?: SidebarVariant;
|
|
14
16
|
/** O arranjo (lote T, 17/10/2026): `"app"` (o padrão, o de sempre) ou `"docs"`, o da documentação da referência — um
|
|
15
17
|
* bloco CENTRALIZADO de 1400 com a lateral de 220, o texto e o índice de 268 (de 1280 para cima), a barra de cima de 56
|
|
16
|
-
* com a linha das áreas (`topbarTabs`) embaixo. A lateral fica onde a variante dela mandar (`plain`: sem caixa).
|
|
17
|
-
|
|
18
|
+
* com a linha das áreas (`topbarTabs`) embaixo. A lateral fica onde a variante dela mandar (`plain`: sem caixa).
|
|
19
|
+
* `"sidebar"` (MNT-34, 0.42.0): a lateral até o topo, com a marca (`brand`) no topo dela; a barra de cima só existe se o
|
|
20
|
+
* app passar `topbar`, e fica só em cima do conteúdo. Com `sidebarVariant` (flutuante ou de canto), as quatro formas da
|
|
21
|
+
* bancada; sem `layout`, a de sempre. */
|
|
22
|
+
layout?: "app" | "docs" | "sidebar";
|
|
23
|
+
/** O pé fixo da lateral (4-C): a pessoa e o sair (`Sidebar.User`), a lista curta (`Sidebar.Nav`). Só o meio rola. */
|
|
24
|
+
sidebarFooter?: ReactNode;
|
|
18
25
|
/** A segunda linha da barra de cima: as áreas do site, com ícone (o `tabs` do `Header`). */
|
|
19
26
|
topbarTabs?: HeaderTab[];
|
|
20
27
|
/** O `id` da área atual da segunda linha. */
|
|
21
28
|
topbarCurrentTab?: string;
|
|
22
29
|
/** O nome da segunda linha para o leitor de tela. Padrão: `"Sections"`. */
|
|
23
30
|
topbarTabsLabel?: string;
|
|
31
|
+
/** A ponta da linha das áreas (o `tabsEnd` do `Header`): a chave Web | Native da documentação. */
|
|
32
|
+
topbarTabsEnd?: ReactNode;
|
|
24
33
|
/** 0.32.0: a barra de rolagem da lateral da esquerda — o `scrollbar` da `Sidebar`. Padrão `hover` (clara, só com o
|
|
25
34
|
* ponteiro em cima); `visible` é a barra sempre à vista. */
|
|
26
35
|
sidebarScrollbar?: SidebarScrollbar;
|
|
@@ -42,9 +51,13 @@ export declare function AppShell({ brand, navigation, navItems, currentNavId, na
|
|
|
42
51
|
/** AN-01: avisa cada troca — pelo botão, ou pela largura cruzando 1280. Guardar a preferência é do app. */
|
|
43
52
|
onSidebarCollapsedChange?: (collapsed: boolean) => void;
|
|
44
53
|
contentVariant?: "surface" | "plain";
|
|
45
|
-
}):
|
|
54
|
+
}): React.JSX.Element;
|
|
55
|
+
export declare namespace AppShell {
|
|
56
|
+
export { AppShellSidebarToggle as SidebarToggle };
|
|
57
|
+
}
|
|
46
58
|
export type SeparatorSpacing = "none" | "tight" | "normal" | "loose";
|
|
47
59
|
export declare function Separator({ orientation, spacing, className, ...props }: HTMLAttributes<HTMLHRElement> & RefAttributes<HTMLHRElement> & {
|
|
48
60
|
orientation?: Responsive<Orientation>;
|
|
49
61
|
spacing?: SeparatorSpacing;
|
|
50
|
-
}):
|
|
62
|
+
}): React.JSX.Element;
|
|
63
|
+
export {};
|
package/dist/layout-client.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
// Fase 9 (achado A5): este arquivo saiu do index.tsx de 970 linhas. Um módulo por categoria
|
|
4
4
|
// do registry — a taxonomia já existia e é gateada. A ordem de import entre eles é um DAG:
|
|
5
5
|
// internal → system → actions → feedback → inputs → navigation → layout → data-display → resto.
|
|
6
|
-
import { useEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
6
|
+
import React, { useEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
7
7
|
import { Separator as BaseSeparator } from "@base-ui/react/separator";
|
|
8
8
|
import { useDirection } from "@base-ui/react/direction-provider";
|
|
9
9
|
import { cx, useAureaStrings } from "./internal.js";
|
|
@@ -155,9 +155,21 @@ function useLargura(query) {
|
|
|
155
155
|
return () => mq.removeEventListener?.("change", avisar);
|
|
156
156
|
}, () => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia(query).matches, () => false);
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
// O BOTÃO DE RECOLHER AO LADO DO TÍTULO (MNT-34, 0.42.0) — o desenho das quinze laterais que o Victor aprovou (o botão
|
|
159
|
+
// de ícone, sem fundo, com o desenho de lateral, a 12 do título da página; *"quero o botão de recolher conforme eu tinha
|
|
160
|
+
// aprovado"*). No `layout="sidebar"` ele substitui a bolinha da junção: com a barra no conteúdo, o shell o põe no começo
|
|
161
|
+
// dela; sem barra, o app o põe ao lado do próprio título (`AppShell.SidebarToggle`). Abaixo de 1024 ele some — ali a
|
|
162
|
+
// lateral é gaveta, e quem abre é o botão da gaveta.
|
|
163
|
+
const ShellToggleContext = React.createContext(null);
|
|
164
|
+
function AppShellSidebarToggle({ className, ...props }) {
|
|
165
|
+
const c = React.useContext(ShellToggleContext);
|
|
166
|
+
if (!c)
|
|
167
|
+
return null;
|
|
168
|
+
return _jsx(IconButton, { className: cx("sidebar-collapse-trigger", className), icon: "sidebar-simple", label: c.rotulo, "aria-expanded": !c.efetiva, "aria-controls": SHELL_NAV_ID, onClick: c.alternar, ...props });
|
|
169
|
+
}
|
|
170
|
+
export function AppShell({ brand, navigation, navItems, currentNavId, navLabel, topbar, topbarVariant = "floating", topbarDivider, topbarTabs, topbarCurrentTab, topbarTabsLabel, topbarTabsEnd, layout = "app", sidebarVariant, sidebarScrollbar, sidebarFooter, sidebarCollapsed, sidebarCollapsible, defaultSidebarCollapsed, onSidebarCollapsedChange, contentVariant = "surface", aside, asideLabel, asideVariant, children, className, ...props }) {
|
|
159
171
|
const s = useAureaStrings();
|
|
160
|
-
const docs = layout === "docs";
|
|
172
|
+
const docs = layout === "docs", lateral = layout === "sidebar";
|
|
161
173
|
useGavetaFechaNoDesktop(docs);
|
|
162
174
|
const controlado = sidebarCollapsed !== undefined;
|
|
163
175
|
// `null` = ninguém escolheu, e vale a largura.
|
|
@@ -196,8 +208,13 @@ export function AppShell({ brand, navigation, navItems, currentNavId, navLabel,
|
|
|
196
208
|
// No arranjo, o topo é o pequeno (`size="sm"`), e o botão também: com o tamanho de sempre ele ficava 4 maior que os
|
|
197
209
|
// vizinhos e fora da linha deles (medido a 375, sem toque; com toque, todos sobem para 44).
|
|
198
210
|
const botaoDaGaveta = _jsx(IconButton, { className: "nav-toggle", icon: "list", label: s.navigationToggle, popoverTarget: SHELL_NAV_ID, ...(docs ? { size: "sm" } : {}) });
|
|
199
|
-
return
|
|
211
|
+
return _jsx("div", { className: cx("app-shell", layout === "docs" && "app-shell-docs", lateral && "app-shell-lateral", !lateral && topbarVariant === "flush" && "app-shell-flush", sidebarCollapsible && "app-shell-collapsible", aside != null && "app-shell-with-aside", className), ...props, children: _jsxs(ShellToggleContext.Provider, { value: sidebarCollapsible ? { alternar, efetiva, rotulo } : null, children: [_jsx("a", { className: "skip-link", href: `#${SHELL_MAIN_ID}`, children: s.skipToContent }), !lateral && _jsxs(Header, { variant: topbarVariant, divider: topbarDivider, tabs: topbarTabs, currentTab: topbarCurrentTab, tabsLabel: topbarTabsLabel, tabsEnd: topbarTabsEnd, ...(docs ? { maxWidth: "docs", size: "sm" } : {}), brand: docs ? brand : _jsxs(_Fragment, { children: [botaoDaGaveta, brand] }), children: [topbar, docs && botaoDaGaveta] }), sidebarCollapsible && !lateral && _jsx("div", { className: "sidebar-toggle-slot", children: _jsx(Tooltip, { content: rotulo, side: "right", children: _jsx(IconButton, { className: "sidebar-toggle", size: "xs", icon: paraOComeco === direita ? "caret-right" : "caret-left", label: rotulo, "aria-expanded": !efetiva, "aria-controls": SHELL_NAV_ID, onClick: alternar }) }) }), _jsx(Sidebar, { id: SHELL_NAV_ID, popover: "auto", variant: sidebarVariant, scrollbar: sidebarScrollbar, collapsed: efetiva, items: navItems, current: currentNavId, label: navLabel, onToggle: focoDaGaveta, header: lateral ? brand : undefined, footer: sidebarFooter, children: navigation }), docs && aside != null && _jsx("div", { className: "docs-toc-bar", children: _jsxs("button", { type: "button", className: "docs-toc-toggle", popoverTarget: SHELL_TOC_ID, children: [_jsx(Icon, { name: "list-bullets" }), _jsx("span", { className: "docs-toc-current", "data-toc-current": "", children: asideLabel ?? s.tocLabel }), _jsx(Icon, { name: "caret-down" })] }) }), lateral
|
|
212
|
+
? _jsxs("div", { className: "app-shell-column", children: [topbar != null
|
|
213
|
+
? _jsx(Header, { variant: "flush", size: "sm", divider: topbarDivider, brand: _jsxs(_Fragment, { children: [botaoDaGaveta, _jsx(AppShellSidebarToggle, {})] }), children: topbar })
|
|
214
|
+
: _jsxs("div", { className: "app-shell-narrow-bar", children: [botaoDaGaveta, brand] }), _jsx("main", { id: SHELL_MAIN_ID, tabIndex: -1, className: cx("content", contentVariant === "plain" && "content-plain"), children: children })] })
|
|
215
|
+
: _jsx("main", { id: SHELL_MAIN_ID, tabIndex: -1, className: cx("content", contentVariant === "plain" && "content-plain"), children: children }), aside != null && _jsx(Sidebar, { placement: "right", variant: asideVariant ?? sidebarVariant, className: "app-shell-aside", "aria-label": asideLabel ?? s.tocLabel, ...(docs ? { id: SHELL_TOC_ID, popover: "auto", onToggle: focoDaGaveta } : {}), children: aside })] }) });
|
|
200
216
|
}
|
|
217
|
+
AppShell.SidebarToggle = AppShellSidebarToggle;
|
|
201
218
|
export function Separator({ orientation, spacing = "none", className, ...props }) {
|
|
202
219
|
const ancora = useRef(null);
|
|
203
220
|
const resolvida = useValorResponsivo(orientation, "horizontal", ancora);
|
package/dist/markup.d.ts
CHANGED
|
@@ -375,6 +375,9 @@ export interface HeaderProps extends HTMLAttributes<HTMLElement>, RefAttributes<
|
|
|
375
375
|
currentTab?: string;
|
|
376
376
|
/** O nome da segunda linha para o leitor de tela. Padrão: `"Sections"`. */
|
|
377
377
|
tabsLabel?: string;
|
|
378
|
+
/** O que fica na PONTA da segunda linha, do lado oposto das áreas (bloco 1, o 5-A — 23/10/2026): a chave Web | Native
|
|
379
|
+
* da documentação da referência. Some abaixo de 768, como lá. Sem `tabs`, não aparece. */
|
|
380
|
+
tabsEnd?: ReactNode;
|
|
378
381
|
}
|
|
379
382
|
/** Uma área da segunda linha do `Header`: o nome, o endereço e, se quiser, o ícone (o desenho que o app passa). */
|
|
380
383
|
export interface HeaderTab {
|
|
@@ -384,7 +387,7 @@ export interface HeaderTab {
|
|
|
384
387
|
icon?: ReactNode;
|
|
385
388
|
render?: SidebarItem["render"];
|
|
386
389
|
}
|
|
387
|
-
export declare function Header({ variant, divider, brand, items, current, actions, maxWidth, itemsJustify, size, blurred, menuActions, navLabel, menuLabel, menuId, tabs, currentTab, tabsLabel, children, className, ...props }: HeaderProps): React.JSX.Element;
|
|
390
|
+
export declare function Header({ variant, divider, brand, items, current, actions, maxWidth, itemsJustify, size, blurred, menuActions, navLabel, menuLabel, menuId, tabs, currentTab, tabsLabel, tabsEnd, children, className, ...props }: HeaderProps): React.JSX.Element;
|
|
388
391
|
/** @deprecated `Topbar` é o nome antigo do `Header` (07/10/2026). Continua funcionando, igual; use `Header`. */
|
|
389
392
|
export declare function Topbar(props: HeaderProps): React.JSX.Element;
|
|
390
393
|
export declare function Kbd({ children, className, ...props }: HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement>): React.JSX.Element;
|
package/dist/markup.js
CHANGED
|
@@ -206,13 +206,17 @@ function linksDoHeader(items, current) {
|
|
|
206
206
|
return _jsx("li", { children: it.render ? fundirRender(it.render, p, "a") : _jsx("a", { href: it.href, ...p }) }, it.id);
|
|
207
207
|
}) });
|
|
208
208
|
}
|
|
209
|
-
export function Header({ variant = "floating", divider, brand, items, current, actions, maxWidth, itemsJustify = "end", size = "md", blurred, menuActions, navLabel = "Main", menuLabel = "Menu", menuId = "aurea-header-menu", tabs, currentTab, tabsLabel = "Sections", children, className, ...props }) {
|
|
209
|
+
export function Header({ variant = "floating", divider, brand, items, current, actions, maxWidth, itemsJustify = "end", size = "md", blurred, menuActions, navLabel = "Main", menuLabel = "Menu", menuId = "aurea-header-menu", tabs, currentTab, tabsLabel = "Sections", tabsEnd, children, className, ...props }) {
|
|
210
210
|
const site = !!items && items.length > 0, comAbas = !!tabs && tabs.length > 0;
|
|
211
|
-
const miolo = _jsxs(_Fragment, { children: [brand != null && _jsx("div", { className: "brand", children: brand }), site && _jsx("nav", { className: "topbar-nav", "aria-label": navLabel, children: linksDoHeader(items, current) }), children, actions != null && _jsx("div", { className: "topbar-actions", children: actions }), site && _jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "btn btn-ghost btn-icon topbar-menu-toggle", popoverTarget: menuId, "aria-label": menuLabel, children: _jsx("span", { className: "topbar-menu-icon", "aria-hidden": "true" }) }), _jsxs("nav", { id: menuId, popover: "auto", className: "topbar-menu-panel", "aria-label": navLabel, children: [linksDoHeader(items, current), menuActions != null && _jsx("div", { className: "topbar-menu-actions", children: menuActions })] })] }), comAbas &&
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
211
|
+
const miolo = _jsxs(_Fragment, { children: [brand != null && _jsx("div", { className: "brand", children: brand }), site && _jsx("nav", { className: "topbar-nav", "aria-label": navLabel, children: linksDoHeader(items, current) }), children, actions != null && _jsx("div", { className: "topbar-actions", children: actions }), site && _jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "btn btn-ghost btn-icon topbar-menu-toggle", popoverTarget: menuId, "aria-label": menuLabel, children: _jsx("span", { className: "topbar-menu-icon", "aria-hidden": "true" }) }), _jsxs("nav", { id: menuId, popover: "auto", className: "topbar-menu-panel", "aria-label": navLabel, children: [linksDoHeader(items, current), menuActions != null && _jsx("div", { className: "topbar-menu-actions", children: menuActions })] })] }), comAbas && (() => {
|
|
212
|
+
const abas = _jsx("nav", { className: "topbar-tabs", "aria-label": tabsLabel, children: tabs.map(t => {
|
|
213
|
+
const p = { className: "topbar-tab", "aria-current": t.id === currentTab ? "page" : undefined,
|
|
214
|
+
children: _jsxs(_Fragment, { children: [t.icon != null && _jsx("span", { className: "topbar-tab-icon", "aria-hidden": "true", children: t.icon }), _jsx("span", { children: t.label })] }) };
|
|
215
|
+
return _jsx(React.Fragment, { children: t.render ? fundirRender(t.render, p, "a") : _jsx("a", { href: t.href, ...p }) }, t.id);
|
|
216
|
+
}) });
|
|
217
|
+
// Sem o encaixe, a marcação de sempre; com ele, a linha das áreas e a ponta numa mesma faixa.
|
|
218
|
+
return tabsEnd == null ? abas : _jsxs("div", { className: "topbar-tabs-row", children: [abas, _jsx("div", { className: "topbar-tabs-end", children: tabsEnd })] });
|
|
219
|
+
})()] });
|
|
216
220
|
return _jsx("header", { className: cx("topbar", `topbar-${variant}`, divider && variant === "flush" && "topbar-divider", site && "topbar-site", site && itemsJustify === "start" && "topbar-items-start", size === "sm" && "topbar-sm", blurred && variant === "flush" && "topbar-blurred", maxWidth && "topbar-contained", comAbas && "topbar-with-tabs", className), ...props, children: maxWidth ? _jsx("div", { className: cx("container", maxWidth !== "xl" && `container-${maxWidth}`, "topbar-inner"), children: miolo }) : miolo });
|
|
217
221
|
}
|
|
218
222
|
/** @deprecated `Topbar` é o nome antigo do `Header` (07/10/2026). Continua funcionando, igual; use `Header`. */
|