@aurea-uds/react 0.8.12 → 0.8.14
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/markup.d.ts +4 -1
- package/dist/markup.js +2 -2
- package/dist/navigation-client.d.ts +3 -1
- package/dist/navigation-client.js +2 -2
- package/package.json +1 -1
package/dist/markup.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export declare function Prose({ className, ...props }: HTMLAttributes<HTMLDivEle
|
|
|
38
38
|
export type BadgeEmphasis = "soft" | "solid" | "outline";
|
|
39
39
|
export type BadgeSize = "xs" | "sm" | "md" | "lg";
|
|
40
40
|
export type BadgePlacement = "top-end" | "top-start" | "bottom-end" | "bottom-start";
|
|
41
|
+
export type BadgeFit = "auto" | "content";
|
|
41
42
|
export declare function formatBadgeCount(count: number, max?: number): string;
|
|
42
43
|
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement>, RefAttributes<HTMLSpanElement> {
|
|
43
44
|
variant?: BadgeVariant;
|
|
@@ -55,6 +56,8 @@ export interface BadgeProps extends HTMLAttributes<HTMLSpanElement>, RefAttribut
|
|
|
55
56
|
count?: number;
|
|
56
57
|
max?: number;
|
|
57
58
|
showZero?: boolean;
|
|
59
|
+
/** `content`: do tamanho do texto mesmo numa coluna. Padrão `auto`, que segue o recipiente. */
|
|
60
|
+
fit?: BadgeFit;
|
|
58
61
|
/** Liga o modo SOBREPOSTO e escolhe o canto. `children` passa a ser o que se decora. */
|
|
59
62
|
anchor?: BadgePlacement;
|
|
60
63
|
/** `circle` recolhe o canto em 14% — é o `overlap` da MUI, para avatar redondo. */
|
|
@@ -65,7 +68,7 @@ export interface BadgeProps extends HTMLAttributes<HTMLSpanElement>, RefAttribut
|
|
|
65
68
|
* Nome da MUI, e não `content`: este colide com o atributo HTML de mesmo nome. */
|
|
66
69
|
badgeContent?: ReactNode;
|
|
67
70
|
}
|
|
68
|
-
export declare function Badge({ variant, emphasis, size, dot, leading, trailing, image, imageAlt, count, max, showZero, anchor, anchorShape, invisible, badgeContent, children, className, ...props }: BadgeProps): React.JSX.Element;
|
|
71
|
+
export declare function Badge({ variant, emphasis, size, dot, leading, trailing, image, imageAlt, count, max, showZero, fit, anchor, anchorShape, invisible, badgeContent, children, className, ...props }: BadgeProps): React.JSX.Element;
|
|
69
72
|
export declare function Progress({ value, label }: {
|
|
70
73
|
value: number;
|
|
71
74
|
label?: string;
|
package/dist/markup.js
CHANGED
|
@@ -83,12 +83,12 @@ export function Prose({ className, ...props }) { return _jsx("div", { className:
|
|
|
83
83
|
// `max` com `+` é o idioma universal do contador (MUI, Ant, Material 3). Exportada porque quem
|
|
84
84
|
// escreve o nome acessível precisa do MESMO texto — "99+ unread" tem de bater com o que se vê.
|
|
85
85
|
export function formatBadgeCount(count, max = 99) { return count > max ? `${max}+` : String(count); }
|
|
86
|
-
export function Badge({ variant = "neutral", emphasis = "soft", size = "md", dot, leading, trailing, image, imageAlt, count, max = 99, showZero, anchor, anchorShape = "square", invisible, badgeContent, children, className, ...props }) {
|
|
86
|
+
export function Badge({ variant = "neutral", emphasis = "soft", size = "md", dot, leading, trailing, image, imageAlt, count, max = 99, showZero, fit = "auto", anchor, anchorShape = "square", invisible, badgeContent, children, className, ...props }) {
|
|
87
87
|
const numero = count != null ? formatBadgeCount(count, max) : undefined;
|
|
88
88
|
const miolo = anchor ? (numero ?? badgeContent) : (numero ?? children);
|
|
89
89
|
// Ponto puro: `dot` sem nada para mostrar. Aí o badge não tem conteúdo, e ganha medida própria.
|
|
90
90
|
const soPonto = !!dot && miolo == null;
|
|
91
|
-
const chip = _jsxs("span", { className: cx("badge", variant !== "neutral" && `badge-${variant}`, emphasis !== "soft" && `badge-${emphasis}`, size !== "md" && `badge-${size}`, anchor && `badge-overlay badge-at-${anchor}`, anchor && anchorShape === "circle" && "badge-on-circle", anchor && soPonto && "badge-is-dot", className), ...props, children: [dot && !soPonto && _jsx("span", { className: "badge-dot" }), image && _jsx("img", { className: "badge-image", src: image, alt: imageAlt ?? "" }), leading, miolo, trailing] });
|
|
91
|
+
const chip = _jsxs("span", { className: cx("badge", variant !== "neutral" && `badge-${variant}`, emphasis !== "soft" && `badge-${emphasis}`, size !== "md" && `badge-${size}`, fit === "content" && !anchor && "badge-fit", anchor && `badge-overlay badge-at-${anchor}`, anchor && anchorShape === "circle" && "badge-on-circle", anchor && soPonto && "badge-is-dot", className), ...props, children: [dot && !soPonto && _jsx("span", { className: "badge-dot" }), image && _jsx("img", { className: "badge-image", src: image, alt: imageAlt ?? "" }), leading, miolo, trailing] });
|
|
92
92
|
if (!anchor)
|
|
93
93
|
return chip;
|
|
94
94
|
// Some em zero por padrão, como a MUI: caixa de entrada zerada não merece um "0" no canto.
|
|
@@ -81,14 +81,16 @@ export declare function Sidebar({ items, current, collapsed, variant, label, chi
|
|
|
81
81
|
}): React.JSX.Element;
|
|
82
82
|
export type BottomNavVariant = "floating" | "edge";
|
|
83
83
|
export type BottomNavIndicator = "none" | "subtle" | "pill" | "circle" | "circle-raised" | "circle-bold" | "circle-outline";
|
|
84
|
+
export type BottomNavWidth = "full" | "content";
|
|
84
85
|
/** @deprecated Os quatro nomes de 17/08/2026. Use `variant` + `indicator`. */
|
|
85
86
|
export type BottomNavVariantLegacy = "flat" | "surface" | "pill" | "dock";
|
|
86
87
|
export type BottomNavVariantAny = BottomNavVariant | BottomNavVariantLegacy;
|
|
87
|
-
export declare function BottomNav({ items, current, variant, indicator, label, className, ...props }: HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement> & {
|
|
88
|
+
export declare function BottomNav({ items, current, variant, indicator, width, label, className, ...props }: HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement> & {
|
|
88
89
|
items: SidebarItem[];
|
|
89
90
|
current?: string;
|
|
90
91
|
variant?: BottomNavVariantAny;
|
|
91
92
|
indicator?: BottomNavIndicator;
|
|
93
|
+
width?: BottomNavWidth;
|
|
92
94
|
label?: string;
|
|
93
95
|
}): React.JSX.Element;
|
|
94
96
|
export interface NavListItem {
|
|
@@ -222,12 +222,12 @@ export function Sidebar({ items, current, collapsed, variant = "floating", label
|
|
|
222
222
|
const LEGADO = {
|
|
223
223
|
flat: ["edge", "none"], surface: ["floating", "circle"], pill: ["floating", "pill"], dock: ["floating", "circle"]
|
|
224
224
|
};
|
|
225
|
-
export function BottomNav({ items, current, variant = "floating", indicator = "none", label, className, ...props }) {
|
|
225
|
+
export function BottomNav({ items, current, variant = "floating", indicator = "none", width = "full", label, className, ...props }) {
|
|
226
226
|
const s = useAureaStrings();
|
|
227
227
|
const [layout, marca0] = variant in LEGADO ? LEGADO[variant] : [variant, indicator];
|
|
228
228
|
// O indicador explícito ganha do que o nome legado implica: quem escreveu os dois quis os dois.
|
|
229
229
|
const ind = indicator !== "none" ? indicator : marca0;
|
|
230
|
-
return _jsx("nav", { className: cx("bottom-nav", layout === "edge" && "bottom-nav-edge", `bottom-nav-ind-${ind}`, className), "aria-label": label ?? s.bottomNavLabel, ...props, children: items.map(it => {
|
|
230
|
+
return _jsx("nav", { className: cx("bottom-nav", layout === "edge" && "bottom-nav-edge", layout !== "edge" && width === "content" && "bottom-nav-content", `bottom-nav-ind-${ind}`, className), "aria-label": label ?? s.bottomNavLabel, ...props, children: items.map(it => {
|
|
231
231
|
const ativo = it.id === current;
|
|
232
232
|
// O CONTADOR PENDURA NO ÍCONE, e é por isso que existe esta caixa. Pendurado no ITEM (a
|
|
233
233
|
// primeira versão), `50%` cai no meio do RÓTULO quando o item é linha — o Victor viu o número
|