@schandlergarcia/sf-web-components 1.8.0 → 1.9.1
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/components/library/cards/SemanticTableCard.d.ts +1 -1
- package/dist/components/library/chat/ChatBar.d.ts +14 -11
- package/dist/components/library/chat/ChatBar.js +2 -3
- package/dist/components/library/chat/ChatBar.js.map +1 -1
- package/dist/components/library/chat/ChatInput.d.ts +9 -8
- package/dist/components/library/chat/ChatInput.js.map +1 -1
- package/dist/components/library/chat/ChatMessage.d.ts +18 -4
- package/dist/components/library/chat/ChatMessage.js.map +1 -1
- package/dist/components/library/chat/ChatMessageList.d.ts +11 -8
- package/dist/components/library/chat/ChatMessageList.js.map +1 -1
- package/dist/components/library/chat/ChatPanel.d.ts +16 -12
- package/dist/components/library/chat/ChatPanel.js +8 -9
- package/dist/components/library/chat/ChatPanel.js.map +1 -1
- package/dist/components/library/chat/ChatSuggestions.d.ts +5 -4
- package/dist/components/library/chat/ChatSuggestions.js +2 -3
- package/dist/components/library/chat/ChatSuggestions.js.map +1 -1
- package/dist/components/library/chat/ChatToolCall.d.ts +11 -3
- package/dist/components/library/chat/ChatToolCall.js.map +1 -1
- package/dist/components/library/chat/ChatTypingIndicator.d.ts +4 -3
- package/dist/components/library/chat/ChatTypingIndicator.js +2 -3
- package/dist/components/library/chat/ChatTypingIndicator.js.map +1 -1
- package/dist/components/library/chat/ChatWelcome.d.ts +9 -7
- package/dist/components/library/chat/ChatWelcome.js +6 -7
- package/dist/components/library/chat/ChatWelcome.js.map +1 -1
- package/dist/components/library/chat/index.d.ts +10 -0
- package/dist/components/library/chat/useChatState.d.ts +37 -11
- package/dist/components/library/chat/useChatState.js +63 -46
- package/dist/components/library/chat/useChatState.js.map +1 -1
- package/dist/components/library/data/DataModeProvider.d.ts +15 -11
- package/dist/components/library/data/DataModeProvider.js +1 -1
- package/dist/components/library/data/DataModeProvider.js.map +1 -1
- package/dist/components/library/data/DataModeToggle.d.ts +4 -3
- package/dist/components/library/data/DataModeToggle.js +4 -5
- package/dist/components/library/data/DataModeToggle.js.map +1 -1
- package/dist/components/library/data/chartDataProvider.d.ts +41 -3
- package/dist/components/library/data/filterUtils.d.ts +38 -9
- package/dist/components/library/data/filterUtils.js.map +1 -1
- package/dist/components/library/data/useDataSource.d.ts +6 -4
- package/dist/components/library/data/useDataSource.js.map +1 -1
- package/dist/components/library/data/usePageFilters.d.ts +31 -5
- package/dist/components/library/data/usePageFilters.js +6 -2
- package/dist/components/library/data/usePageFilters.js.map +1 -1
- package/dist/components/library/index.d.ts +92 -73
- package/dist/components/library/index.js +25 -25
- package/dist/components/library/index.js.map +1 -1
- package/dist/components/library/skeletons/CardSkeleton.d.ts +5 -4
- package/dist/components/library/skeletons/CardSkeleton.js +2 -3
- package/dist/components/library/skeletons/CardSkeleton.js.map +1 -1
- package/dist/components/library/theme/AppThemeProvider.d.ts +13 -50
- package/dist/components/library/theme/AppThemeProvider.js.map +1 -1
- package/dist/components/library/theme/tokens.d.ts +45 -44
- package/dist/components/library/theme/tokens.js.map +1 -1
- package/dist/components/workspace/ComponentRegistry.d.ts +116 -140
- package/dist/components/workspace/ComponentRegistry.js +43 -43
- package/dist/components/workspace/ComponentRegistry.js.map +1 -1
- package/package.json +2 -2
- package/src/components/library/cards/SemanticMetricCard.tsx +1 -1
- package/src/components/library/cards/SemanticTableCard.tsx +3 -3
- package/src/components/library/chat/{ChatBar.jsx → ChatBar.tsx} +19 -8
- package/src/components/library/chat/{ChatInput.jsx → ChatInput.tsx} +13 -11
- package/src/components/library/chat/{ChatMessage.jsx → ChatMessage.tsx} +23 -10
- package/src/components/library/chat/{ChatMessageList.jsx → ChatMessageList.tsx} +13 -11
- package/src/components/library/chat/{ChatPanel.jsx → ChatPanel.tsx} +16 -13
- package/src/components/library/chat/{ChatSuggestions.jsx → ChatSuggestions.tsx} +6 -5
- package/src/components/library/chat/{ChatToolCall.jsx → ChatToolCall.tsx} +14 -4
- package/src/components/library/chat/{ChatTypingIndicator.jsx → ChatTypingIndicator.tsx} +5 -2
- package/src/components/library/chat/{ChatWelcome.jsx → ChatWelcome.tsx} +9 -7
- package/src/components/library/chat/index.tsx +26 -0
- package/src/components/library/chat/useChatState.tsx +182 -0
- package/src/components/library/data/{DataModeProvider.jsx → DataModeProvider.tsx} +25 -8
- package/src/components/library/data/{DataModeToggle.jsx → DataModeToggle.tsx} +5 -2
- package/src/components/library/data/{chartDataProvider.jsx → chartDataProvider.tsx} +49 -5
- package/src/components/library/data/{filterUtils.jsx → filterUtils.tsx} +58 -12
- package/src/components/library/data/{useDataSource.jsx → useDataSource.tsx} +9 -2
- package/src/components/library/data/{usePageFilters.jsx → usePageFilters.tsx} +49 -9
- package/src/components/library/{index.jsx → index.ts} +14 -14
- package/src/components/library/skeletons/{CardSkeleton.jsx → CardSkeleton.tsx} +5 -4
- package/src/components/library/theme/{AppThemeProvider.jsx → AppThemeProvider.tsx} +20 -7
- package/src/components/library/theme/{tokens.jsx → tokens.tsx} +37 -3
- package/src/components/workspace/{ComponentRegistry.jsx → ComponentRegistry.tsx} +137 -32
- package/src/components/library/chat/index.jsx +0 -10
- package/src/components/library/chat/useChatState.jsx +0 -130
|
@@ -1,51 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
100: string;
|
|
8
|
-
200: string;
|
|
9
|
-
300: string;
|
|
10
|
-
400: string;
|
|
11
|
-
500: string;
|
|
12
|
-
600: string;
|
|
13
|
-
700: string;
|
|
14
|
-
800: string;
|
|
15
|
-
900: string;
|
|
16
|
-
950: string;
|
|
17
|
-
};
|
|
18
|
-
accent: {
|
|
19
|
-
50: string;
|
|
20
|
-
100: string;
|
|
21
|
-
200: string;
|
|
22
|
-
300: string;
|
|
23
|
-
400: string;
|
|
24
|
-
500: string;
|
|
25
|
-
600: string;
|
|
26
|
-
700: string;
|
|
27
|
-
800: string;
|
|
28
|
-
900: string;
|
|
29
|
-
950: string;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
fonts: {
|
|
33
|
-
sans: string;
|
|
34
|
-
mono: string;
|
|
35
|
-
};
|
|
36
|
-
radius: {
|
|
37
|
-
sm: string;
|
|
38
|
-
md: string;
|
|
39
|
-
lg: string;
|
|
40
|
-
};
|
|
41
|
-
spacing: {
|
|
42
|
-
pageX: string;
|
|
43
|
-
pageY: string;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Tokens } from "./tokens";
|
|
3
|
+
export type ThemeMode = "light" | "dark";
|
|
4
|
+
export interface ThemeModeContextValue {
|
|
5
|
+
mode: ThemeMode;
|
|
6
|
+
theme: Tokens;
|
|
46
7
|
toggle: () => void;
|
|
47
|
-
}
|
|
48
|
-
export
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
8
|
+
}
|
|
9
|
+
export declare function useThemeMode(): ThemeModeContextValue;
|
|
10
|
+
export interface AppThemeProviderProps {
|
|
11
|
+
initialMode?: ThemeMode;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export default function AppThemeProvider({ initialMode, children }: AppThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppThemeProvider.js","sources":["../../../../src/components/library/theme/AppThemeProvider.
|
|
1
|
+
{"version":3,"file":"AppThemeProvider.js","sources":["../../../../src/components/library/theme/AppThemeProvider.tsx"],"sourcesContent":["import React from \"react\";\nimport { tokens, getTokenCSSProperties, Tokens } from \"./tokens\";\n\nexport type ThemeMode = \"light\" | \"dark\";\n\nexport interface ThemeModeContextValue {\n mode: ThemeMode;\n theme: Tokens;\n toggle: () => void;\n}\n\nconst ThemeModeContext = React.createContext<ThemeModeContextValue>({\n mode: \"light\",\n theme: tokens,\n toggle: () => {}\n});\n\nconst STORAGE_KEY = \"app-color-mode\";\n\nfunction applyHtmlDarkClass(mode: ThemeMode): void {\n if (typeof document === \"undefined\") return;\n const root = document.documentElement;\n if (mode === \"dark\") root.classList.add(\"dark\");\n else root.classList.remove(\"dark\");\n}\n\nfunction applyTokenCSSProperties(): void {\n if (typeof document === \"undefined\") return;\n const root = document.documentElement;\n const props = getTokenCSSProperties();\n for (const [key, value] of Object.entries(props)) {\n root.style.setProperty(key, value);\n }\n}\n\nexport function useThemeMode(): ThemeModeContextValue {\n return React.useContext(ThemeModeContext);\n}\n\nexport interface AppThemeProviderProps {\n initialMode?: ThemeMode;\n children: React.ReactNode;\n}\n\nexport default function AppThemeProvider({ initialMode = \"light\", children }: AppThemeProviderProps) {\n const [mode, setMode] = React.useState<ThemeMode>(initialMode);\n\n React.useEffect(() => {\n applyTokenCSSProperties();\n }, []);\n\n React.useEffect(() => {\n try {\n const stored = window.localStorage.getItem(STORAGE_KEY);\n if (stored === \"light\" || stored === \"dark\") setMode(stored);\n } catch {\n // ignore\n }\n }, []);\n\n React.useEffect(() => {\n applyHtmlDarkClass(mode);\n try {\n window.localStorage.setItem(STORAGE_KEY, mode);\n } catch {\n // ignore\n }\n }, [mode]);\n\n const value = React.useMemo(\n () => ({\n mode,\n theme: tokens,\n toggle: () => setMode((m) => (m === \"dark\" ? \"light\" : \"dark\"))\n }),\n [mode]\n );\n\n return <ThemeModeContext.Provider value={value}>{children}</ThemeModeContext.Provider>;\n}\n"],"names":["ThemeModeContext","React","tokens","STORAGE_KEY","applyHtmlDarkClass","mode","root","applyTokenCSSProperties","props","getTokenCSSProperties","key","value","useThemeMode","AppThemeProvider","initialMode","children","setMode","stored","m","jsx"],"mappings":";;;AAWA,MAAMA,IAAmBC,EAAM,cAAqC;AAAA,EAClE,MAAM;AAAA,EACN,OAAOC;AAAA,EACP,QAAQ,MAAM;AAAA,EAAC;AACjB,CAAC,GAEKC,IAAc;AAEpB,SAASC,EAAmBC,GAAuB;AACjD,MAAI,OAAO,WAAa,IAAa;AACrC,QAAMC,IAAO,SAAS;AACt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
+
/**
|
|
2
|
+
* Design tokens — single source of truth for branding.
|
|
3
|
+
*
|
|
4
|
+
* To rebrand a command center:
|
|
5
|
+
* 1. Swap the `brand` palette (use any Tailwind-style color scale)
|
|
6
|
+
* 2. Swap the `accent` palette
|
|
7
|
+
* 3. Change `fonts.sans` in _app.js (next/font import)
|
|
8
|
+
*
|
|
9
|
+
* AppThemeProvider injects these as CSS custom properties on :root,
|
|
10
|
+
* and tailwind.config.js references them via var(--color-brand-*).
|
|
11
|
+
*/
|
|
12
|
+
export interface ColorShades {
|
|
13
|
+
50: string;
|
|
14
|
+
100: string;
|
|
15
|
+
200: string;
|
|
16
|
+
300: string;
|
|
17
|
+
400: string;
|
|
18
|
+
500: string;
|
|
19
|
+
600: string;
|
|
20
|
+
700: string;
|
|
21
|
+
800: string;
|
|
22
|
+
900: string;
|
|
23
|
+
950: string;
|
|
24
|
+
}
|
|
25
|
+
export interface Tokens {
|
|
26
|
+
colors: {
|
|
27
|
+
brand: ColorShades;
|
|
28
|
+
accent: ColorShades;
|
|
29
|
+
};
|
|
30
|
+
fonts: {
|
|
31
|
+
sans: string;
|
|
32
|
+
mono: string;
|
|
33
|
+
};
|
|
34
|
+
radius: {
|
|
35
|
+
sm: string;
|
|
36
|
+
md: string;
|
|
37
|
+
lg: string;
|
|
38
|
+
};
|
|
39
|
+
spacing: {
|
|
40
|
+
pageX: string;
|
|
41
|
+
pageY: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export declare const tokens: Tokens;
|
|
1
45
|
/**
|
|
2
46
|
* Generates CSS custom property assignments from the token palettes.
|
|
3
47
|
* Used by AppThemeProvider to inject on :root at runtime.
|
|
4
48
|
*/
|
|
5
|
-
export function getTokenCSSProperties():
|
|
6
|
-
export namespace tokens {
|
|
7
|
-
namespace colors {
|
|
8
|
-
let brand: {
|
|
9
|
-
50: string;
|
|
10
|
-
100: string;
|
|
11
|
-
200: string;
|
|
12
|
-
300: string;
|
|
13
|
-
400: string;
|
|
14
|
-
500: string;
|
|
15
|
-
600: string;
|
|
16
|
-
700: string;
|
|
17
|
-
800: string;
|
|
18
|
-
900: string;
|
|
19
|
-
950: string;
|
|
20
|
-
};
|
|
21
|
-
let accent: {
|
|
22
|
-
50: string;
|
|
23
|
-
100: string;
|
|
24
|
-
200: string;
|
|
25
|
-
300: string;
|
|
26
|
-
400: string;
|
|
27
|
-
500: string;
|
|
28
|
-
600: string;
|
|
29
|
-
700: string;
|
|
30
|
-
800: string;
|
|
31
|
-
900: string;
|
|
32
|
-
950: string;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
namespace fonts {
|
|
36
|
-
let sans: string;
|
|
37
|
-
let mono: string;
|
|
38
|
-
}
|
|
39
|
-
namespace radius {
|
|
40
|
-
let sm: string;
|
|
41
|
-
let md: string;
|
|
42
|
-
let lg: string;
|
|
43
|
-
}
|
|
44
|
-
namespace spacing {
|
|
45
|
-
let pageX: string;
|
|
46
|
-
let pageY: string;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
+
export declare function getTokenCSSProperties(): Record<string, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sources":["../../../../src/components/library/theme/tokens.
|
|
1
|
+
{"version":3,"file":"tokens.js","sources":["../../../../src/components/library/theme/tokens.tsx"],"sourcesContent":["/**\n * Design tokens — single source of truth for branding.\n *\n * To rebrand a command center:\n * 1. Swap the `brand` palette (use any Tailwind-style color scale)\n * 2. Swap the `accent` palette\n * 3. Change `fonts.sans` in _app.js (next/font import)\n *\n * AppThemeProvider injects these as CSS custom properties on :root,\n * and tailwind.config.js references them via var(--color-brand-*).\n */\n\nexport interface ColorShades {\n 50: string;\n 100: string;\n 200: string;\n 300: string;\n 400: string;\n 500: string;\n 600: string;\n 700: string;\n 800: string;\n 900: string;\n 950: string;\n}\n\nexport interface Tokens {\n colors: {\n brand: ColorShades;\n accent: ColorShades;\n };\n fonts: {\n sans: string;\n mono: string;\n };\n radius: {\n sm: string;\n md: string;\n lg: string;\n };\n spacing: {\n pageX: string;\n pageY: string;\n };\n}\n\nexport const tokens: Tokens = {\n colors: {\n brand: {\n 50: \"#EEF2FF\",\n 100: \"#E0E7FF\",\n 200: \"#C7D2FE\",\n 300: \"#A5B4FC\",\n 400: \"#818CF8\",\n 500: \"#6366F1\",\n 600: \"#4F46E5\",\n 700: \"#4338CA\",\n 800: \"#3730A3\",\n 900: \"#312E81\",\n 950: \"#1E1B4E\",\n },\n accent: {\n 50: \"#ECFEFF\",\n 100: \"#CFFAFE\",\n 200: \"#A5F3FC\",\n 300: \"#67E8F9\",\n 400: \"#22D3EE\",\n 500: \"#06B6D4\",\n 600: \"#0891B2\",\n 700: \"#0E7490\",\n 800: \"#155E75\",\n 900: \"#164E63\",\n 950: \"#083344\",\n },\n },\n\n fonts: {\n sans: \"Inter\",\n mono: \"JetBrains Mono\",\n },\n\n radius: {\n sm: \"0.5rem\",\n md: \"0.75rem\",\n lg: \"1rem\",\n },\n\n spacing: {\n pageX: \"1.25rem\",\n pageY: \"1.25rem\",\n },\n};\n\n/**\n * Generates CSS custom property assignments from the token palettes.\n * Used by AppThemeProvider to inject on :root at runtime.\n */\nexport function getTokenCSSProperties(): Record<string, string> {\n const props: Record<string, string> = {};\n for (const [palette, shades] of Object.entries(tokens.colors)) {\n for (const [shade, value] of Object.entries(shades)) {\n props[`--color-${palette}-${shade}`] = value;\n }\n }\n return props;\n}\n"],"names":["tokens","getTokenCSSProperties","props","palette","shades","shade","value"],"mappings":"AA8CO,MAAMA,IAAiB;AAAA,EAC5B,QAAQ;AAAA,IACN,OAAO;AAAA,MACL,IAAI;AAAA,MACJ,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,IAAA;AAAA,IAEP,QAAQ;AAAA,MACN,IAAI;AAAA,MAC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|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface Metric {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string | number;
|
|
5
|
+
trend?: string | number | null;
|
|
6
|
+
}
|
|
7
|
+
export interface MetricsStripProps {
|
|
8
|
+
metrics?: Metric[];
|
|
9
|
+
title?: string;
|
|
10
|
+
collapsible?: boolean;
|
|
11
|
+
collapsed?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface ListItem {
|
|
14
|
+
id?: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
status?: "critical" | "warning" | string;
|
|
19
|
+
actions?: Array<string | {
|
|
20
|
+
label: string;
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
23
|
+
export interface ItemListProps {
|
|
24
|
+
items?: ListItem[];
|
|
25
|
+
title?: string;
|
|
26
|
+
onItemClick?: (item: ListItem) => void;
|
|
27
|
+
}
|
|
28
|
+
export interface TableColumn {
|
|
29
|
+
key: string;
|
|
30
|
+
label: string;
|
|
31
|
+
}
|
|
32
|
+
export interface DataTableProps {
|
|
33
|
+
title?: string;
|
|
34
|
+
subtitle?: string;
|
|
35
|
+
columns?: TableColumn[];
|
|
36
|
+
data?: any[];
|
|
37
|
+
rows?: any[];
|
|
38
|
+
searchable?: boolean;
|
|
39
|
+
sortable?: boolean;
|
|
40
|
+
paginated?: boolean;
|
|
41
|
+
pageSize?: number;
|
|
42
|
+
}
|
|
43
|
+
export interface DataPoint {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
}
|
|
48
|
+
export interface DataChartProps {
|
|
49
|
+
title?: string;
|
|
50
|
+
subtitle?: string;
|
|
51
|
+
chartType?: string;
|
|
52
|
+
data?: DataPoint[];
|
|
53
|
+
height?: number;
|
|
54
|
+
}
|
|
55
|
+
export interface MetricCardComponentProps {
|
|
56
|
+
title?: string;
|
|
57
|
+
label?: string;
|
|
58
|
+
value?: string | number;
|
|
59
|
+
trend?: string | number;
|
|
60
|
+
change?: string | number;
|
|
61
|
+
changeType?: string;
|
|
62
|
+
color?: string;
|
|
63
|
+
icon?: React.ReactNode;
|
|
64
|
+
description?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface StatusCardComponentProps {
|
|
67
|
+
title?: string;
|
|
68
|
+
subtitle?: string;
|
|
69
|
+
status?: string;
|
|
70
|
+
items?: any[];
|
|
71
|
+
layout?: string;
|
|
72
|
+
showProgress?: boolean;
|
|
73
|
+
showTimestamp?: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface ActionListProps {
|
|
76
|
+
actions?: Array<string | {
|
|
77
|
+
label: string;
|
|
78
|
+
}>;
|
|
79
|
+
title?: string;
|
|
80
|
+
onAction?: (action: string | {
|
|
81
|
+
label: string;
|
|
82
|
+
}) => void;
|
|
83
|
+
}
|
|
84
|
+
export interface CalloutCardProps {
|
|
85
|
+
title?: string;
|
|
86
|
+
message?: string;
|
|
87
|
+
tone?: "neutral" | "success" | "warning" | "danger";
|
|
88
|
+
}
|
|
89
|
+
export interface SpacerProps {
|
|
90
|
+
size?: "sm" | "md" | "lg";
|
|
91
|
+
}
|
|
92
|
+
export interface NarrativeSummaryProps {
|
|
93
|
+
summary?: string;
|
|
94
|
+
title?: string;
|
|
95
|
+
}
|
|
96
|
+
export interface SchemaComponent {
|
|
97
|
+
id?: string;
|
|
98
|
+
type: string;
|
|
99
|
+
props?: Record<string, any>;
|
|
100
|
+
}
|
|
101
|
+
declare const BUILTIN_COMPONENTS: {
|
|
102
|
+
NarrativeSummary({ summary, title }: NarrativeSummaryProps): import("react/jsx-runtime").JSX.Element;
|
|
103
|
+
MetricsStrip({ metrics, title, collapsible, collapsed: initialCollapsed }: MetricsStripProps): import("react/jsx-runtime").JSX.Element;
|
|
104
|
+
ItemList({ items, title, onItemClick }: ItemListProps): import("react/jsx-runtime").JSX.Element;
|
|
105
|
+
DataTable({ title, subtitle, columns, data, rows, searchable, sortable, paginated, pageSize }: DataTableProps): import("react/jsx-runtime").JSX.Element;
|
|
106
|
+
DataChart({ title, subtitle, chartType, data, height }: DataChartProps): import("react/jsx-runtime").JSX.Element;
|
|
107
|
+
MetricCard({ title, label, value, trend, change, changeType, color, icon, description }: MetricCardComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
108
|
+
StatusCard({ title, subtitle, status, items, layout, showProgress, showTimestamp }: StatusCardComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
ActionList({ actions, title, onAction }: ActionListProps): import("react/jsx-runtime").JSX.Element;
|
|
110
|
+
CalloutCard({ title, message, tone }: CalloutCardProps): import("react/jsx-runtime").JSX.Element;
|
|
65
111
|
Divider(): import("react/jsx-runtime").JSX.Element;
|
|
66
|
-
Spacer({ size }:
|
|
67
|
-
size?: string | undefined;
|
|
68
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
112
|
+
Spacer({ size }: SpacerProps): import("react/jsx-runtime").JSX.Element;
|
|
69
113
|
};
|
|
70
|
-
export function
|
|
71
|
-
export function
|
|
72
|
-
export function
|
|
73
|
-
export function
|
|
114
|
+
export declare function getComponentRegistry(): Record<string, React.ComponentType<any>>;
|
|
115
|
+
export declare function registerComponent(type: string, Component: React.ComponentType<any>): void;
|
|
116
|
+
export declare function registerComponents(map: Record<string, React.ComponentType<any>>): void;
|
|
117
|
+
export declare function renderSchemaComponent(component: SchemaComponent, index: number): React.ReactElement;
|
|
118
|
+
export declare function renderSchema(components?: SchemaComponent[]): React.ReactElement[];
|
|
74
119
|
export default BUILTIN_COMPONENTS;
|
|
75
|
-
declare namespace BUILTIN_COMPONENTS {
|
|
76
|
-
function NarrativeSummary({ summary, title }: {
|
|
77
|
-
summary: any;
|
|
78
|
-
title: any;
|
|
79
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
80
|
-
function MetricsStrip({ metrics, title, collapsible, collapsed: initialCollapsed }: {
|
|
81
|
-
metrics?: never[] | undefined;
|
|
82
|
-
title: any;
|
|
83
|
-
collapsible?: boolean | undefined;
|
|
84
|
-
collapsed?: boolean | undefined;
|
|
85
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
86
|
-
function ItemList({ items, title, onItemClick }: {
|
|
87
|
-
items?: never[] | undefined;
|
|
88
|
-
title: any;
|
|
89
|
-
onItemClick: any;
|
|
90
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
91
|
-
function DataTable({ title, subtitle, columns, data, rows, searchable, sortable, paginated, pageSize }: {
|
|
92
|
-
title: any;
|
|
93
|
-
subtitle: any;
|
|
94
|
-
columns?: never[] | undefined;
|
|
95
|
-
data?: never[] | undefined;
|
|
96
|
-
rows: any;
|
|
97
|
-
searchable?: boolean | undefined;
|
|
98
|
-
sortable?: boolean | undefined;
|
|
99
|
-
paginated?: boolean | undefined;
|
|
100
|
-
pageSize?: number | undefined;
|
|
101
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
102
|
-
function DataChart({ title, subtitle, chartType, data, height }: {
|
|
103
|
-
title: any;
|
|
104
|
-
subtitle: any;
|
|
105
|
-
chartType?: string | undefined;
|
|
106
|
-
data?: never[] | undefined;
|
|
107
|
-
height?: number | undefined;
|
|
108
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
109
|
-
function MetricCard({ title, label, value, trend, change, changeType, color, icon, description }: {
|
|
110
|
-
title: any;
|
|
111
|
-
label: any;
|
|
112
|
-
value: any;
|
|
113
|
-
trend: any;
|
|
114
|
-
change: any;
|
|
115
|
-
changeType: any;
|
|
116
|
-
color: any;
|
|
117
|
-
icon: any;
|
|
118
|
-
description: any;
|
|
119
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
120
|
-
function StatusCard({ title, subtitle, status, items, layout, showProgress, showTimestamp }: {
|
|
121
|
-
title: any;
|
|
122
|
-
subtitle: any;
|
|
123
|
-
status: any;
|
|
124
|
-
items: any;
|
|
125
|
-
layout: any;
|
|
126
|
-
showProgress: any;
|
|
127
|
-
showTimestamp: any;
|
|
128
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
129
|
-
function ActionList({ actions, title, onAction }: {
|
|
130
|
-
actions?: never[] | undefined;
|
|
131
|
-
title: any;
|
|
132
|
-
onAction: any;
|
|
133
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
134
|
-
function CalloutCard({ title, message, tone }: {
|
|
135
|
-
title: any;
|
|
136
|
-
message: any;
|
|
137
|
-
tone?: string | undefined;
|
|
138
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
139
|
-
function Divider(): import("react/jsx-runtime").JSX.Element;
|
|
140
|
-
function Spacer({ size }: {
|
|
141
|
-
size?: string | undefined;
|
|
142
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
143
|
-
}
|