@actionexec/dashboards 0.7.0 → 0.9.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.
@@ -0,0 +1,7 @@
1
+ interface Props {
2
+ data: Record<string, unknown>;
3
+ palette: string[];
4
+ label?: string;
5
+ }
6
+ export declare function CompositionWidget({ data, palette, label: propLabel }: Props): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,29 @@
1
+ import type { ReactNode } from 'react';
2
+ /** Estados em que o widget mostra uma mensagem no lugar do conteudo. */
3
+ export type WidgetStateKind = 'empty' | 'error' | 'loading' | 'unconfigured';
4
+ interface WidgetStateProps {
5
+ kind: WidgetStateKind;
6
+ /** Sobrescreve a mensagem padrao do estado. */
7
+ message?: string;
8
+ }
9
+ /** Mensagem centralizada exibida no lugar do conteudo do widget. */
10
+ export declare function WidgetState({ kind, message }: WidgetStateProps): import("react/jsx-runtime").JSX.Element;
11
+ interface WidgetFrameProps {
12
+ /** Sufixo da classe do widget (`kpi` -> `.widget-kpi`). */
13
+ name: string;
14
+ title?: string;
15
+ /** Quando definido, substitui o conteudo pela mensagem de estado. */
16
+ state?: WidgetStateKind;
17
+ stateMessage?: string;
18
+ /** Renderizado entre o titulo e o conteudo (ex: barra de abas da tabela). */
19
+ toolbar?: ReactNode;
20
+ children?: ReactNode;
21
+ }
22
+ /**
23
+ * Casca padrao de um widget: mesma hierarquia visual em todos os tipos.
24
+ *
25
+ * O titulo sai do payload computado ou da config; widgets sem titulo apenas o
26
+ * omitem — o conteudo ocupa a altura toda, sem espacador vazio.
27
+ */
28
+ export declare function WidgetFrame({ name, title, state, stateMessage, toolbar, children }: WidgetFrameProps): import("react/jsx-runtime").JSX.Element;
29
+ export {};
@@ -0,0 +1,26 @@
1
+ export interface ComputedComparison {
2
+ id?: string;
3
+ label?: string | null;
4
+ /** `unavailable` = configurada, mas sem como resolver (ex: desvio sem filtro de data). */
5
+ status?: string;
6
+ display?: string;
7
+ baseline?: number | null;
8
+ baseline_formatted?: string | null;
9
+ delta?: number | null;
10
+ delta_formatted?: string | null;
11
+ variance_pct?: number | null;
12
+ ratio?: number | null;
13
+ /** Numero em destaque, ja formatado pelo backend conforme `display`. */
14
+ formatted?: string | null;
15
+ trend?: string | null;
16
+ sentiment?: string | null;
17
+ }
18
+ export declare const TREND_ARROWS: Record<string, string>;
19
+ /**
20
+ * Comparacoes que o dashboard publicado mostra.
21
+ *
22
+ * As indisponiveis somem em vez de virar "-": quem ve o dashboard nao configurou
23
+ * nada e nao tem o que fazer com o aviso. Quem configurou ve a pendencia no
24
+ * builder, que le o mesmo `status`.
25
+ */
26
+ export declare function visibleComparisons(raw: unknown): ComputedComparison[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actionexec/dashboards",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Biblioteca de renderizacao de dashboards da plataforma Action — componente <Dashboard> unico, consumindo /external/dashboards.",
5
5
  "type": "module",
6
6
  "repository": {