@aurea-uds/react 0.25.0 → 0.27.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.
@@ -1,2 +1,2 @@
1
1
  export * from "./data-display-client.js";
2
- export { Kbd, KPI, DataList, Timeline, Prose, Text, Heading, Paragraph, Code, type TextProps, type HeadingProps, type ParagraphProps, type CodeProps, type TypographyType, type TypographyColor, type TypographyWeight, type TypographyAlign, type HeadingLevel, type ParagraphSize } from "./markup.js";
2
+ export { Kbd, KPI, DataList, Timeline, Prose, Text, Heading, Paragraph, Code, type KPIProps, type KPIDirection, type KPITone, type KPIVariant, type TextProps, type HeadingProps, type ParagraphProps, type CodeProps, type TypographyType, type TypographyColor, type TypographyWeight, type TypographyAlign, type HeadingLevel, type ParagraphSize } from "./markup.js";
@@ -1,2 +1,2 @@
1
1
  export * from "./feedback-client.js";
2
- export { Badge, formatBadgeCount, Progress, Skeleton, type BadgeVariant, type BadgeEmphasis, type BadgeSize, type BadgePlacement, type BadgeProps, type ProgressProps, type ProgressTone } from "./markup.js";
2
+ export { Badge, formatBadgeCount, Progress, Skeleton, type BadgeVariant, type BadgeCategory, type BadgeEmphasis, type BadgeSize, type BadgePlacement, type BadgeProps, type ProgressProps, type ProgressTone } from "./markup.js";
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export { cx, defaultStrings, ptBR, defaultSpriteUrl, gridStateToParams, gridStat
2
2
  export { useAureaStrings, useSpriteUrl, useTheme, useDensity } from "./internal.js";
3
3
  export { type Responsive, type Breakpoint, type ContainerBreakpoint, type Orientation, ESCALA, ESCALA_CONTAINER } from "./pure.js";
4
4
  export { ContainerScope, useValorResponsivo } from "./responsivo-runtime.js";
5
- export { AspectRatio, InputGroup, InputGroupAddon, Label, Card, Stack, Cluster, Grid, Container, Section, KPI, DataList, Timeline, Prose, Text, Heading, Paragraph, Code, Badge, Progress, Skeleton, AvatarGroup, LogStream, MediaPlayerShell, Header, Topbar, Kbd, Textarea, Checkbox, Radio, Switch, Range, formatBadgeCount, type BadgeVariant, type BadgeEmphasis, type BadgeSize, type BadgePlacement, type BadgeProps, type ProgressProps, type ProgressTone, type AvatarSize, type HeaderVariant, type HeaderProps, type TopbarVariant, type SectionVariant, type SectionFooterGroup, type TextProps, type HeadingProps, type ParagraphProps, type CodeProps, type TypographyType, type TypographyColor, type TypographyWeight, type TypographyAlign, type HeadingLevel, type ParagraphSize } from "./markup.js";
5
+ export { AspectRatio, InputGroup, InputGroupAddon, Label, Card, Stack, Cluster, Grid, Container, Section, KPI, DataList, Timeline, Prose, Text, Heading, Paragraph, Code, Badge, Progress, Skeleton, AvatarGroup, LogStream, MediaPlayerShell, Header, Topbar, Kbd, Textarea, Checkbox, Radio, Switch, Range, formatBadgeCount, type BadgeVariant, type BadgeCategory, type BadgeEmphasis, type BadgeSize, type BadgePlacement, type BadgeProps, type KPIProps, type KPIDirection, type KPITone, type KPIVariant, type ProgressProps, type ProgressTone, type AvatarSize, type HeaderVariant, type HeaderProps, type TopbarVariant, type SectionVariant, type SectionFooterGroup, type TextProps, type HeadingProps, type ParagraphProps, type CodeProps, type TypographyType, type TypographyColor, type TypographyWeight, type TypographyAlign, type HeadingLevel, type ParagraphSize } from "./markup.js";
6
6
  export * from "./system.js";
7
7
  export * from "./actions.js";
8
8
  export * from "./feedback.js";
package/dist/markup.d.ts CHANGED
@@ -2,7 +2,8 @@ import React, { type HTMLAttributes, type InputHTMLAttributes, type ReactElement
2
2
  import { type Responsive } from "./pure.js";
3
3
  import type { ComponentSize } from "./actions.js";
4
4
  import type { SidebarItem } from "./navigation-client.js";
5
- export type BadgeVariant = "neutral" | "primary" | "info" | "success" | "warning" | "danger" | "running" | "paused" | "offline" | "review";
5
+ export type BadgeCategory = "red" | "orange" | "green" | "teal" | "cyan" | "blue" | "violet" | "pink";
6
+ export type BadgeVariant = "neutral" | "primary" | "info" | "success" | "warning" | "danger" | "running" | "paused" | "offline" | "review" | BadgeCategory;
6
7
  export type AvatarSize = "sm" | "md" | "lg";
7
8
  export type HeaderVariant = "floating" | "flush" | "pill";
8
9
  /** @deprecated `Topbar` é o nome antigo do `Header` (07/10/2026). O tipo continua valendo; use `HeaderVariant`. */
@@ -141,11 +142,24 @@ export interface SectionProps extends HTMLAttributes<HTMLElement>, RefAttributes
141
142
  * quando ela for uma região que o leitor de tela deva listar.
142
143
  */
143
144
  export declare function Section({ surface, spacing, theme, variant, brand, links, legal, maxWidth, navLabel, children, className, ...props }: SectionProps): React.JSX.Element;
144
- export declare function KPI({ label, value, trend, className, ...props }: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement> & {
145
+ export type KPIDirection = "up" | "down" | "flat";
146
+ export type KPITone = "success" | "danger" | "neutral";
147
+ export type KPIVariant = "card" | "plain";
148
+ export interface KPIProps extends HTMLAttributes<HTMLDivElement>, RefAttributes<HTMLDivElement> {
145
149
  label: ReactNode;
146
150
  value: ReactNode;
151
+ /** A mudança, como texto do domínio ("+8% no mês"). */
147
152
  trend?: ReactNode;
148
- }): React.JSX.Element;
153
+ /** Para onde foi. Desenha a seta, pinta a tendência e diz a palavra ao leitor de tela. */
154
+ direction?: KPIDirection;
155
+ /** A cor da tendência. Padrão: alta = `success`, baixa = `danger`, estável = `neutral`. */
156
+ tone?: KPITone;
157
+ /** A palavra que o leitor de tela ouve antes da tendência. Padrão em inglês: "Up", "Down", "No change". */
158
+ directionLabel?: string;
159
+ /** `plain` tira a caixa: o número dentro de um cartão que já existe. */
160
+ variant?: KPIVariant;
161
+ }
162
+ export declare function KPI({ label, value, trend, direction, tone, directionLabel, variant, className, ...props }: KPIProps): React.JSX.Element;
149
163
  export declare function DataList({ items }: {
150
164
  items: Array<{
151
165
  term: ReactNode;
package/dist/markup.js CHANGED
@@ -88,8 +88,14 @@ export function Section({ surface = "background", spacing = "md", theme, variant
88
88
  ? fundirRender(it.render, { className: "section-footer-link", children: it.label }, "a")
89
89
  : _jsx("a", { className: "section-footer-link", href: it.href, children: it.label }) }, it.id)) })] }, n)) }), children] }), legal != null && _jsx("div", { className: "section-footer-legal", children: legal })] }) });
90
90
  }
91
- // ── Data Display ─────────────────────────────────────────────────────────────────────────────
92
- export function KPI({ label, value, trend, className, ...props }) { return _jsxs(Card, { className: cx("kpi", className), ...props, children: [_jsx("span", { className: "muted", children: label }), _jsx("strong", { children: value }), trend && _jsx("small", { children: trend })] }); }
91
+ const TOM_DA_DIRECAO = { up: "success", down: "danger", flat: "neutral" };
92
+ const PALAVRA_DA_DIRECAO = { up: "Up", down: "Down", flat: "No change" };
93
+ export function KPI({ label, value, trend, direction, tone, directionLabel, variant = "card", className, ...props }) {
94
+ const tom = direction ? (tone ?? TOM_DA_DIRECAO[direction]) : undefined;
95
+ const miolo = _jsxs(_Fragment, { children: [_jsx("span", { className: "muted", children: label }), _jsx("strong", { children: value }), (trend || trend === 0 || direction) && _jsxs("small", { className: direction ? cx("kpi-trend", `kpi-trend-${direction}`, `kpi-tone-${tom}`) : undefined, children: [direction && _jsx("span", { className: "kpi-trend-icon", "aria-hidden": "true" }), direction && _jsx("span", { className: "sr-only", children: directionLabel ?? PALAVRA_DA_DIRECAO[direction] }), trend] })] });
96
+ return variant === "plain" ? _jsx("div", { className: cx("kpi", className), ...props, children: miolo })
97
+ : _jsx(Card, { className: cx("kpi", className), ...props, children: miolo });
98
+ }
93
99
  export function DataList({ items }) { return _jsx("dl", { className: "data-list", children: items.map((i, n) => _jsxs(React.Fragment, { children: [_jsx("dt", { children: i.term }), _jsx("dd", { children: i.value })] }, n)) }); }
94
100
  export function Timeline({ items }) { return _jsx("ol", { className: "timeline", children: items.map((i, n) => _jsxs("li", { children: [_jsx("span", { className: "timeline-dot" }), _jsxs("div", { children: [_jsx("strong", { children: i.title }), i.description && _jsx("p", { children: i.description }), i.time && _jsx("small", { className: "muted", children: i.time })] })] }, n)) }); }
95
101
  // Prose (item L5): UMA LINHA, e é para ser mesmo — quem transforma Markdown em elementos é o
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurea-uds/react",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "description": "Os componentes React da Aurea UDS. Importe @aurea-uds/fonts/css e @aurea-uds/core/css junto.",
5
5
  "keywords": [
6
6
  "aurea",