@aurea-uds/react 0.9.0 → 0.10.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/inputs-client.d.ts +7 -1
- package/dist/inputs-client.js +4 -3
- package/dist/layout-client.d.ts +3 -1
- package/dist/layout-client.js +6 -2
- package/dist/markup.d.ts +12 -2
- package/dist/markup.js +12 -3
- package/package.json +1 -1
package/dist/inputs-client.d.ts
CHANGED
|
@@ -9,11 +9,17 @@ export interface FieldProps extends HTMLAttributes<HTMLDivElement>, RefAttribute
|
|
|
9
9
|
label: string;
|
|
10
10
|
hint?: ReactNode;
|
|
11
11
|
error?: ReactNode;
|
|
12
|
+
/** B-12 (24/09/2026): texto de ajuda que precisa de uma FRASE — mora embaixo do controle, onde
|
|
13
|
+
* cabe, e não divide a linha do rótulo. O `hint` continua o que é: nota curta ao lado do rótulo
|
|
14
|
+
* ("opcional", "em MB"). É o lugar do `Description` do HeroUI e da `description` que o
|
|
15
|
+
* `Checkbox` desta casa já tem. Entra no `aria-describedby` na ordem da tela: hint, descrição,
|
|
16
|
+
* erro. */
|
|
17
|
+
description?: ReactNode;
|
|
12
18
|
name?: string;
|
|
13
19
|
orientation?: Responsive<FieldOrientation>;
|
|
14
20
|
labelWidth?: FieldLabelWidth;
|
|
15
21
|
}
|
|
16
|
-
export declare function Field({ label, hint, error, children, className, id, name, orientation, labelWidth, style, ...props }: FieldProps): React.JSX.Element;
|
|
22
|
+
export declare function Field({ label, hint, description, error, children, className, id, name, orientation, labelWidth, style, ...props }: FieldProps): React.JSX.Element;
|
|
17
23
|
export declare function Form({ errors, onSubmit, children, className, ...props }: Omit<React.FormHTMLAttributes<HTMLFormElement>, "onSubmit"> & RefAttributes<HTMLFormElement> & {
|
|
18
24
|
errors?: Record<string, string | string[]>;
|
|
19
25
|
onSubmit?: (values: Record<string, unknown>) => void;
|
package/dist/inputs-client.js
CHANGED
|
@@ -79,7 +79,7 @@ function elementoRotulavel(tipo) {
|
|
|
79
79
|
// regra que os outros: recebe `id` e espalha `...props` no `Input`, que é o nó focal.
|
|
80
80
|
return [Input, Select, Textarea, SearchField, PasswordField, Checkbox, Radio, Switch, Range, Combobox, MultiCombobox].includes(tipo);
|
|
81
81
|
}
|
|
82
|
-
export function Field({ label, hint, error, children, className, id, name, orientation, labelWidth, style, ...props }) {
|
|
82
|
+
export function Field({ label, hint, description, error, children, className, id, name, orientation, labelWidth, style, ...props }) {
|
|
83
83
|
const auto = React.useId();
|
|
84
84
|
// Fragment não cria nó no DOM. Um Fragment com um só controle é só sintaxe; com vários,
|
|
85
85
|
// Field precisa voltar para grupo em vez de pendurar `htmlFor` num id que nunca existirá.
|
|
@@ -100,8 +100,9 @@ export function Field({ label, hint, error, children, className, id, name, orien
|
|
|
100
100
|
const idControle = unico?.props.id ?? id ?? `${auto}-control`;
|
|
101
101
|
const idRotulo = `${auto}-label`;
|
|
102
102
|
const idHint = hint ? `${auto}-hint` : undefined;
|
|
103
|
+
const idDescricao = description ? `${auto}-description` : undefined;
|
|
103
104
|
const idErro = error ? `${auto}-error` : undefined;
|
|
104
|
-
const descrito = [idHint, idErro].filter(Boolean).join(" ") || undefined;
|
|
105
|
+
const descrito = [idHint, idDescricao, idErro].filter(Boolean).join(" ") || undefined;
|
|
105
106
|
// As chaves de aria só entram quando têm VALOR. Passar `undefined` explícito não é o mesmo que
|
|
106
107
|
// não passar: quando o filho vira `Field.Control` do motor (ramo do `name`), a prop explícita
|
|
107
108
|
// do elemento vence a mesclagem, e o `aria-invalid` que o motor calculou a partir do erro
|
|
@@ -124,7 +125,7 @@ export function Field({ label, hint, error, children, className, id, name, orien
|
|
|
124
125
|
// árvore de acessibilidade enquanto a frase de erro aparece na tela. Pior que não mostrar.
|
|
125
126
|
const controleFinal = name ? _jsx(BaseField.Control, { render: controle }) : controle;
|
|
126
127
|
const estilo = labelWidth ? { ...style, "--field-label-width": labelWidth === "auto" ? "max-content" : labelWidth } : style;
|
|
127
|
-
const corpo = _jsxs("div", { className: cx("field", peleDoEixo("field", orientation, "vertical", "field"), className), ...(nomeAqui ? {} : { role: "group", "aria-labelledby": idRotulo, ...(rotulavel ? {} : { "aria-describedby": descrito }) }), style: estilo, ...props, children: [_jsxs("span", { className: "label", children: [nomeAqui ? _jsx("label", { htmlFor: idControle, children: label }) : _jsx("span", { id: idRotulo, children: label }), hint && _jsx("span", { className: "hint", id: idHint, children: hint })] }), controleFinal, error && _jsx("span", { className: "field-error", id: idErro, children: error }), name && _jsx(BaseField.Error, { className: "field-error" })] });
|
|
128
|
+
const corpo = _jsxs("div", { className: cx("field", peleDoEixo("field", orientation, "vertical", "field"), className), ...(nomeAqui ? {} : { role: "group", "aria-labelledby": idRotulo, ...(rotulavel ? {} : { "aria-describedby": descrito }) }), style: estilo, ...props, children: [_jsxs("span", { className: "label", children: [nomeAqui ? _jsx("label", { htmlFor: idControle, children: label }) : _jsx("span", { id: idRotulo, children: label }), hint && _jsx("span", { className: "hint", id: idHint, children: hint })] }), controleFinal, description && _jsx("span", { className: "field-description", id: idDescricao, children: description }), error && _jsx("span", { className: "field-error", id: idErro, children: error }), name && _jsx(BaseField.Error, { className: "field-error" })] });
|
|
128
129
|
// `Field.Root` do motor entra SÓ quando há `name`: é ele que liga o campo à chave de `errors`
|
|
129
130
|
// do formulário. Ele não desenha nada — é contexto — então a pele não muda.
|
|
130
131
|
return name ? _jsx(BaseField.Root, { name: name, invalid: error ? true : undefined, render: corpo }) : corpo;
|
package/dist/layout-client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type HTMLAttributes, type RefAttributes, type ReactNode } from "react";
|
|
2
2
|
import { type Orientation, type Responsive } from "./pure.js";
|
|
3
3
|
import { type TopbarVariant, type SidebarVariant, type SidebarItem } from "./navigation.js";
|
|
4
|
-
export declare function AppShell({ brand, navigation, navItems, currentNavId, navLabel, topbar, topbarVariant, sidebarVariant, sidebarCollapsed, children, className, ...props }: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement> & {
|
|
4
|
+
export declare function AppShell({ brand, navigation, navItems, currentNavId, navLabel, topbar, topbarVariant, topbarDivider, sidebarVariant, sidebarCollapsed, contentVariant, children, className, ...props }: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement> & {
|
|
5
5
|
brand: ReactNode;
|
|
6
6
|
navigation?: ReactNode;
|
|
7
7
|
navItems?: SidebarItem[];
|
|
@@ -9,8 +9,10 @@ export declare function AppShell({ brand, navigation, navItems, currentNavId, na
|
|
|
9
9
|
navLabel?: string;
|
|
10
10
|
topbar?: ReactNode;
|
|
11
11
|
topbarVariant?: Exclude<TopbarVariant, "pill">;
|
|
12
|
+
topbarDivider?: boolean;
|
|
12
13
|
sidebarVariant?: SidebarVariant;
|
|
13
14
|
sidebarCollapsed?: boolean;
|
|
15
|
+
contentVariant?: "surface" | "plain";
|
|
14
16
|
}): import("react").JSX.Element;
|
|
15
17
|
export type SeparatorSpacing = "none" | "tight" | "normal" | "loose";
|
|
16
18
|
export declare function Separator({ orientation, spacing, className, ...props }: HTMLAttributes<HTMLHRElement> & RefAttributes<HTMLHRElement> & {
|
package/dist/layout-client.js
CHANGED
|
@@ -116,10 +116,14 @@ function useGavetaFechaNoDesktop() {
|
|
|
116
116
|
// texto ("8.174" virava "8.17"), medido num app real a 1400px. `navItems`/`currentNavId` vão para o
|
|
117
117
|
// Sidebar que o shell já cria, e a caixa dupla deixa de ser o único caminho. `navigation` continua
|
|
118
118
|
// valendo para quem escreve a navegação à mão, e as duas se somam: a lista vem antes.
|
|
119
|
-
|
|
119
|
+
// B-10 (24/09/2026): `contentVariant="plain"` tira a caixa do `.content`. Ela é um cartão (mesmo
|
|
120
|
+
// fundo, borda e raio do `.card`), e todo `Card` lá dentro virava caixa dentro de caixa igual — um
|
|
121
|
+
// app gastou 14 `!important` para apagá-la. `surface`, a caixa, continua o padrão.
|
|
122
|
+
// B-07: `topbarDivider` repassa a linha de baixo para a barra `flush` que o shell monta.
|
|
123
|
+
export function AppShell({ brand, navigation, navItems, currentNavId, navLabel, topbar, topbarVariant = "floating", topbarDivider, sidebarVariant, sidebarCollapsed, contentVariant = "surface", children, className, ...props }) {
|
|
120
124
|
const s = useAureaStrings();
|
|
121
125
|
useGavetaFechaNoDesktop();
|
|
122
|
-
return _jsxs("div", { className: cx("app-shell", topbarVariant === "flush" && "app-shell-flush", className), ...props, children: [_jsx("a", { className: "skip-link", href: `#${SHELL_MAIN_ID}`, children: s.skipToContent }), _jsx(Topbar, { variant: topbarVariant, brand: _jsxs(_Fragment, { children: [_jsx(IconButton, { className: "nav-toggle", icon: "menu", label: s.navigationToggle, popoverTarget: SHELL_NAV_ID }), brand] }), children: topbar }), _jsx(Sidebar, { id: SHELL_NAV_ID, popover: "auto", variant: sidebarVariant, collapsed: sidebarCollapsed, items: navItems, current: currentNavId, label: navLabel, onToggle: focoDaGaveta, children: navigation }), _jsx("main", { id: SHELL_MAIN_ID, tabIndex: -1, className: "content", children: children })] });
|
|
126
|
+
return _jsxs("div", { className: cx("app-shell", topbarVariant === "flush" && "app-shell-flush", className), ...props, children: [_jsx("a", { className: "skip-link", href: `#${SHELL_MAIN_ID}`, children: s.skipToContent }), _jsx(Topbar, { variant: topbarVariant, divider: topbarDivider, brand: _jsxs(_Fragment, { children: [_jsx(IconButton, { className: "nav-toggle", icon: "menu", label: s.navigationToggle, popoverTarget: SHELL_NAV_ID }), brand] }), children: topbar }), _jsx(Sidebar, { id: SHELL_NAV_ID, popover: "auto", variant: sidebarVariant, collapsed: sidebarCollapsed, items: navItems, current: currentNavId, label: navLabel, onToggle: focoDaGaveta, children: navigation }), _jsx("main", { id: SHELL_MAIN_ID, tabIndex: -1, className: cx("content", contentVariant === "plain" && "content-plain"), children: children })] });
|
|
123
127
|
}
|
|
124
128
|
export function Separator({ orientation, spacing = "none", className, ...props }) {
|
|
125
129
|
const ancora = useRef(null);
|
package/dist/markup.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export type AvatarSize = "sm" | "md" | "lg";
|
|
|
6
6
|
export type TopbarVariant = "floating" | "flush" | "pill";
|
|
7
7
|
type CardBase = HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement> & {
|
|
8
8
|
padding?: "normal" | "none";
|
|
9
|
+
orientation?: "vertical" | "horizontal";
|
|
9
10
|
};
|
|
10
11
|
export type CardProps = CardBase & ({
|
|
11
12
|
variant?: "base" | "raised" | "inset" | "selected" | "danger";
|
|
@@ -14,7 +15,15 @@ export type CardProps = CardBase & ({
|
|
|
14
15
|
variant: "interactive";
|
|
15
16
|
render: ReactElement;
|
|
16
17
|
});
|
|
17
|
-
export declare function Card({ variant, padding, className, render, ...props }: CardProps): ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
18
|
+
export declare function Card({ variant, padding, orientation, className, render, ...props }: CardProps): ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
19
|
+
export declare namespace Card {
|
|
20
|
+
export { CardMedia as Media };
|
|
21
|
+
}
|
|
22
|
+
/** A mídia do cartão — a primeira das partes da especificação do `Card` (A-14). No vertical,
|
|
23
|
+
* primeira filha, ela SANGRA até a borda de cima e dos lados; no horizontal, fica à esquerda com a
|
|
24
|
+
* largura de miniatura, dentro do respiro, com o raio que sai da conta da casa (ADR-0033: raio do
|
|
25
|
+
* cartão menos o respiro dele). O que vai dentro — `Image`, vídeo — é do app. */
|
|
26
|
+
declare function CardMedia({ className, ...props }: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>): React.JSX.Element;
|
|
18
27
|
export type LayoutGap = "tight" | "normal" | "loose";
|
|
19
28
|
export type StackAlign = "start" | "center" | "end" | "stretch";
|
|
20
29
|
export type ClusterAlign = "start" | "center" | "end" | "baseline";
|
|
@@ -124,9 +133,10 @@ export declare function LogStream({ lines }: {
|
|
|
124
133
|
}>;
|
|
125
134
|
}): React.JSX.Element;
|
|
126
135
|
export declare function MediaPlayerShell({ children, className, ...props }: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>): React.JSX.Element;
|
|
127
|
-
export declare function Topbar({ variant, brand, children, className, ...props }: HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement> & {
|
|
136
|
+
export declare function Topbar({ variant, divider, brand, children, className, ...props }: HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement> & {
|
|
128
137
|
variant?: TopbarVariant;
|
|
129
138
|
brand?: ReactNode;
|
|
139
|
+
divider?: boolean;
|
|
130
140
|
}): React.JSX.Element;
|
|
131
141
|
export declare function Kbd({ children, className, ...props }: HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement>): React.JSX.Element;
|
|
132
142
|
export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement>, RefAttributes<HTMLTextAreaElement> {
|
package/dist/markup.js
CHANGED
|
@@ -37,9 +37,15 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
37
37
|
// tocar motor. Na dúvida, ele NÃO entra — cliente a mais é lento, servidor a mais é quebrado.
|
|
38
38
|
import React, { forwardRef } from "react";
|
|
39
39
|
import { cx, fundirRender, peleDoEixo } from "./pure.js";
|
|
40
|
-
export function Card({ variant = "base", padding = "normal", className, render, ...props }) {
|
|
41
|
-
return fundirRender(render, { className: cx("card", variant !== "base" && `card-${variant}`, padding === "none" && "card-flush", className), ...props });
|
|
40
|
+
export function Card({ variant = "base", padding = "normal", orientation = "vertical", className, render, ...props }) {
|
|
41
|
+
return fundirRender(render, { className: cx("card", variant !== "base" && `card-${variant}`, padding === "none" && "card-flush", orientation === "horizontal" && "card-horizontal", className), ...props });
|
|
42
42
|
}
|
|
43
|
+
/** A mídia do cartão — a primeira das partes da especificação do `Card` (A-14). No vertical,
|
|
44
|
+
* primeira filha, ela SANGRA até a borda de cima e dos lados; no horizontal, fica à esquerda com a
|
|
45
|
+
* largura de miniatura, dentro do respiro, com o raio que sai da conta da casa (ADR-0033: raio do
|
|
46
|
+
* cartão menos o respiro dele). O que vai dentro — `Image`, vídeo — é do app. */
|
|
47
|
+
function CardMedia({ className, ...props }) { return _jsx("div", { className: cx("card-media", className), ...props }); }
|
|
48
|
+
Card.Media = CardMedia;
|
|
43
49
|
export function Stack({ gap, align, className, ...props }) { return _jsx("div", { className: cx("stack", gap && gap !== "normal" && `stack-gap-${gap}`, align && align !== "stretch" && `stack-align-${align}`, className), ...props }); }
|
|
44
50
|
export function Cluster({ gap, align, justify, wrap, className, ...props }) { return _jsx("div", { className: cx("cluster", gap && gap !== "normal" && `cluster-gap-${gap}`, align && align !== "center" && `cluster-align-${align}`, justify && justify !== "start" && `cluster-justify-${justify}`, wrap === false && "cluster-nowrap", className), ...props }); }
|
|
45
51
|
export function Grid({ gap, min, columns, className, style, ...props }) {
|
|
@@ -99,7 +105,10 @@ export function LogStream({ lines }) { return _jsx("div", { className: "log-stre
|
|
|
99
105
|
// ── Media ────────────────────────────────────────────────────────────────────────────────────
|
|
100
106
|
export function MediaPlayerShell({ children, className, ...props }) { return _jsx("div", { className: cx("media-player", className), ...props, children: children }); }
|
|
101
107
|
// ── Navigation ───────────────────────────────────────────────────────────────────────────────
|
|
102
|
-
|
|
108
|
+
// B-07 (24/09/2026): `divider` põe a linha de baixo na `flush`. Ela é fundo igual ao da página e
|
|
109
|
+
// gruda no topo; sem linha, o conteúdo passa por baixo dela e nada diz onde a barra acaba. Só na
|
|
110
|
+
// `flush`: a `floating` e a `pill` são caixas com borda própria.
|
|
111
|
+
export function Topbar({ variant = "floating", divider, brand, children, className, ...props }) { return _jsxs("header", { className: cx("topbar", `topbar-${variant}`, divider && variant === "flush" && "topbar-divider", className), ...props, children: [brand != null && _jsx("div", { className: "brand", children: brand }), children] }); }
|
|
103
112
|
// ── System / interno ─────────────────────────────────────────────────────────────────────────
|
|
104
113
|
// Kbd — representação de tecla/atalho. <kbd> é o elemento HTML certo; a pele é nossa. Ele já
|
|
105
114
|
// morava fora da casa dele (no `internal.tsx`, por causa do `Button`); agora mora aqui, pelo
|