@ericbutera/kaleido 0.2.0 → 0.4.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,17 @@
1
+ import { NamedStat } from '../types';
2
+ /**
3
+ * Renders all glass-managed system metrics.
4
+ *
5
+ * Pass the full response from `GET /admin/metrics`. Each top-level key becomes
6
+ * a labeled section. New glass subsystems automatically appear here when glass
7
+ * adds them — no frontend changes required.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * const { data } = useAdminMetrics();
12
+ * <admin.KaleidoMetricsSection data={data} />
13
+ * ```
14
+ */
15
+ export default function KaleidoMetricsSection({ data, }: {
16
+ data?: Record<string, NamedStat[]> | null;
17
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,3 @@
1
+ export default function LayoutRoute({ title }: {
2
+ title?: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ export default function StatItem({ icon, title, value, desc, to, error, }: {
3
+ icon?: ReactNode;
4
+ title: string;
5
+ value?: ReactNode;
6
+ desc?: string;
7
+ /** Optional URL — wraps the card in a plain anchor link when provided. */
8
+ to?: string;
9
+ /** When set, shows an error warning icon with a tooltip instead of the value. */
10
+ error?: string | null;
11
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,11 @@
1
1
  export { configureAdminLayout } from '../admin/components/adminLayoutConfig';
2
+ export { default as KaleidoMetricsSection } from '../admin/components/KaleidoMetricsSection';
2
3
  export { default as Layout } from '../admin/components/Layout';
4
+ export { default as LayoutRoute } from '../admin/components/LayoutRoute';
5
+ export { default as StatItem } from '../admin/components/StatItem';
3
6
  export { default as Dashboard } from '../admin/pages/Dashboard';
4
7
  export { default as FeatureFlags } from '../admin/pages/FeatureFlags';
5
8
  export { default as Tasks } from '../admin/pages/Tasks';
6
9
  export { default as Users } from '../admin/pages/Users';
10
+ export type { NamedStat, StatResult, SystemMetrics } from '../admin/types';
7
11
  export { default as Route } from './components/Route';
@@ -0,0 +1,23 @@
1
+ export type StatResult = {
2
+ /** @format int64 */
3
+ value: number;
4
+ error?: string | null;
5
+ };
6
+ /** A named, displayable metric with a machine-readable key and human-readable label. */
7
+ export type NamedStat = {
8
+ /** Machine-readable identifier — used by the UI to look up icons and links. */
9
+ key: string;
10
+ /** Human-readable display label. */
11
+ label: string;
12
+ /** Short time-range description, e.g. "last 30 days". */
13
+ desc: string;
14
+ /** @format int64 */
15
+ value: number;
16
+ error?: string | null;
17
+ };
18
+ /**
19
+ * Glass-managed system metrics returned by `GET /admin/metrics`.
20
+ * Each key is a section name; the value is an array of stats for that section.
21
+ * New glass subsystems add new keys automatically.
22
+ */
23
+ export type SystemMetrics = Record<string, NamedStat[]>;