@trinityui/design-system 1.0.3 → 1.0.5
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/CHANGELOG.md +36 -0
- package/README.md +6 -0
- package/dist/Legend.js +1455 -0
- package/dist/accessibility.d.ts +119 -0
- package/dist/accessibility.d.ts.map +1 -0
- package/dist/assets/index.d.ts +234 -0
- package/dist/assets/index.d.ts.map +1 -0
- package/dist/components/AI/AIActions.d.ts +104 -0
- package/dist/components/AI/AIActions.d.ts.map +1 -0
- package/dist/components/AI/AIAvatar.d.ts +32 -0
- package/dist/components/AI/AIAvatar.d.ts.map +1 -0
- package/dist/components/AI/AIChat.d.ts +142 -0
- package/dist/components/AI/AIChat.d.ts.map +1 -0
- package/dist/components/AI/AIContainer.d.ts +97 -0
- package/dist/components/AI/AIContainer.d.ts.map +1 -0
- package/dist/components/AI/AIExplainability.d.ts +46 -0
- package/dist/components/AI/AIExplainability.d.ts.map +1 -0
- package/dist/components/AI/AILabel.d.ts +43 -0
- package/dist/components/AI/AILabel.d.ts.map +1 -0
- package/dist/components/AI/AIMessage.d.ts +93 -0
- package/dist/components/AI/AIMessage.d.ts.map +1 -0
- package/dist/components/AI/AIRelatedQuestions.d.ts +53 -0
- package/dist/components/AI/AIRelatedQuestions.d.ts.map +1 -0
- package/dist/components/AI/AIResponseRenderer.d.ts +50 -0
- package/dist/components/AI/AIResponseRenderer.d.ts.map +1 -0
- package/dist/components/AI/AISources.d.ts +66 -0
- package/dist/components/AI/AISources.d.ts.map +1 -0
- package/dist/components/AI/AISourcesPanel.d.ts +84 -0
- package/dist/components/AI/AISourcesPanel.d.ts.map +1 -0
- package/dist/components/AI/AITextBlock.d.ts +56 -0
- package/dist/components/AI/AITextBlock.d.ts.map +1 -0
- package/dist/components/AI/AIVisuals.d.ts +104 -0
- package/dist/components/AI/AIVisuals.d.ts.map +1 -0
- package/dist/components/AI/AIVoiceInput.d.ts +66 -0
- package/dist/components/AI/AIVoiceInput.d.ts.map +1 -0
- package/dist/components/AI/ChatHeader.d.ts +52 -0
- package/dist/components/AI/ChatHeader.d.ts.map +1 -0
- package/dist/components/AI/ChatHistoryList.d.ts +80 -0
- package/dist/components/AI/ChatHistoryList.d.ts.map +1 -0
- package/dist/components/AI/ChatThread.d.ts +74 -0
- package/dist/components/AI/ChatThread.d.ts.map +1 -0
- package/dist/components/AI/InsightEngine.d.ts +147 -0
- package/dist/components/AI/InsightEngine.d.ts.map +1 -0
- package/dist/components/AI/InsightEngineInput.d.ts +94 -0
- package/dist/components/AI/InsightEngineInput.d.ts.map +1 -0
- package/dist/components/AI/QueryInput.d.ts +114 -0
- package/dist/components/AI/QueryInput.d.ts.map +1 -0
- package/dist/components/AI/UserAvatar.d.ts +24 -0
- package/dist/components/AI/UserAvatar.d.ts.map +1 -0
- package/dist/components/AI/UserMessage.d.ts +26 -0
- package/dist/components/AI/UserMessage.d.ts.map +1 -0
- package/dist/components/AI/index.d.ts +39 -0
- package/dist/components/AI/index.d.ts.map +1 -0
- package/dist/components/AI/tokens.d.ts +132 -0
- package/dist/components/AI/tokens.d.ts.map +1 -0
- package/dist/components/AI/types/index.d.ts +6 -0
- package/dist/components/AI/types/index.d.ts.map +1 -0
- package/dist/components/AI/types/response.d.ts +312 -0
- package/dist/components/AI/types/response.d.ts.map +1 -0
- package/dist/components/AppLayout/AIFab.d.ts +50 -0
- package/dist/components/AppLayout/AIFab.d.ts.map +1 -0
- package/dist/components/AppLayout/AIFabLayout.deprecated.d.ts +32 -0
- package/dist/components/AppLayout/AIFabLayout.deprecated.d.ts.map +1 -0
- package/dist/components/AppLayout/AppLayout.d.ts +154 -0
- package/dist/components/AppLayout/AppLayout.d.ts.map +1 -0
- package/dist/components/AppLayout/InsightEnginePanel.d.ts +141 -0
- package/dist/components/AppLayout/InsightEnginePanel.d.ts.map +1 -0
- package/dist/components/AppLayout/ResizablePanel.d.ts +52 -0
- package/dist/components/AppLayout/ResizablePanel.d.ts.map +1 -0
- package/dist/components/AppLayout/ThreadHistorySidebar.d.ts +53 -0
- package/dist/components/AppLayout/ThreadHistorySidebar.d.ts.map +1 -0
- package/dist/components/AppLayout/index.d.ts +27 -0
- package/dist/components/AppLayout/index.d.ts.map +1 -0
- package/dist/components/Charts/AreaChart.d.ts +38 -0
- package/dist/components/Charts/AreaChart.d.ts.map +1 -0
- package/dist/components/Charts/BarChart.d.ts +47 -0
- package/dist/components/Charts/BarChart.d.ts.map +1 -0
- package/dist/components/Charts/ChartWrapper.d.ts +48 -0
- package/dist/components/Charts/ChartWrapper.d.ts.map +1 -0
- package/dist/components/Charts/ComposedChart.d.ts +34 -0
- package/dist/components/Charts/ComposedChart.d.ts.map +1 -0
- package/dist/components/Charts/CustomLegend.d.ts +69 -0
- package/dist/components/Charts/CustomLegend.d.ts.map +1 -0
- package/dist/components/Charts/CustomTooltip.d.ts +55 -0
- package/dist/components/Charts/CustomTooltip.d.ts.map +1 -0
- package/dist/components/Charts/LineChart.d.ts +36 -0
- package/dist/components/Charts/LineChart.d.ts.map +1 -0
- package/dist/components/Charts/PieChart.d.ts +52 -0
- package/dist/components/Charts/PieChart.d.ts.map +1 -0
- package/dist/components/Charts/RadialChart.d.ts +51 -0
- package/dist/components/Charts/RadialChart.d.ts.map +1 -0
- package/dist/components/Charts/ScatterChart.d.ts +55 -0
- package/dist/components/Charts/ScatterChart.d.ts.map +1 -0
- package/dist/components/Charts/Sparkline.d.ts +44 -0
- package/dist/components/Charts/Sparkline.d.ts.map +1 -0
- package/dist/components/Charts/index.d.ts +48 -0
- package/dist/components/Charts/index.d.ts.map +1 -0
- package/dist/components/Charts/tokens.d.ts +200 -0
- package/dist/components/Charts/tokens.d.ts.map +1 -0
- package/dist/components/Charts/types.d.ts +595 -0
- package/dist/components/Charts/types.d.ts.map +1 -0
- package/dist/components/Combobox/Combobox.d.ts +99 -0
- package/dist/components/Combobox/Combobox.d.ts.map +1 -0
- package/dist/components/Combobox/index.d.ts +3 -0
- package/dist/components/Combobox/index.d.ts.map +1 -0
- package/dist/components/CommandPalette/CommandPalette.d.ts +76 -0
- package/dist/components/CommandPalette/CommandPalette.d.ts.map +1 -0
- package/dist/components/CommandPalette/index.d.ts +2 -0
- package/dist/components/CommandPalette/index.d.ts.map +1 -0
- package/dist/components/DataCard/DataCard.d.ts +60 -0
- package/dist/components/DataCard/DataCard.d.ts.map +1 -0
- package/dist/components/DataCard/index.d.ts +2 -0
- package/dist/components/DataCard/index.d.ts.map +1 -0
- package/dist/components/DataTable/CellRenderers.d.ts +78 -0
- package/dist/components/DataTable/CellRenderers.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.d.ts +36 -0
- package/dist/components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/components/DataTable/InlineAddRow.d.ts +27 -0
- package/dist/components/DataTable/InlineAddRow.d.ts.map +1 -0
- package/dist/components/DataTable/index.d.ts +6 -0
- package/dist/components/DataTable/index.d.ts.map +1 -0
- package/dist/components/DataTable/tokens.d.ts +132 -0
- package/dist/components/DataTable/tokens.d.ts.map +1 -0
- package/dist/components/DataTable/types.d.ts +334 -0
- package/dist/components/DataTable/types.d.ts.map +1 -0
- package/dist/components/DiffViewer/DiffViewer.d.ts +63 -0
- package/dist/components/DiffViewer/DiffViewer.d.ts.map +1 -0
- package/dist/components/DiffViewer/index.d.ts +3 -0
- package/dist/components/DiffViewer/index.d.ts.map +1 -0
- package/dist/components/DockLayout/DockLayout.d.ts +78 -0
- package/dist/components/DockLayout/DockLayout.d.ts.map +1 -0
- package/dist/components/DockLayout/index.d.ts +3 -0
- package/dist/components/DockLayout/index.d.ts.map +1 -0
- package/dist/components/FileUpload/FileUpload.d.ts +93 -0
- package/dist/components/FileUpload/FileUpload.d.ts.map +1 -0
- package/dist/components/FileUpload/index.d.ts +2 -0
- package/dist/components/FileUpload/index.d.ts.map +1 -0
- package/dist/components/FilterBar/FilterBar.d.ts +76 -0
- package/dist/components/FilterBar/FilterBar.d.ts.map +1 -0
- package/dist/components/FilterBar/index.d.ts +2 -0
- package/dist/components/FilterBar/index.d.ts.map +1 -0
- package/dist/components/Footer.d.ts +30 -0
- package/dist/components/Footer.d.ts.map +1 -0
- package/dist/components/Icon.d.ts +67 -0
- package/dist/components/Icon.d.ts.map +1 -0
- package/dist/components/IllustratedMessage.d.ts +99 -0
- package/dist/components/IllustratedMessage.d.ts.map +1 -0
- package/dist/components/LandingPage/FeatureCard.d.ts +89 -0
- package/dist/components/LandingPage/FeatureCard.d.ts.map +1 -0
- package/dist/components/LandingPage/LandingPage.d.ts +126 -0
- package/dist/components/LandingPage/LandingPage.d.ts.map +1 -0
- package/dist/components/LandingPage/index.d.ts +11 -0
- package/dist/components/LandingPage/index.d.ts.map +1 -0
- package/dist/components/Modal/Modal.d.ts +181 -0
- package/dist/components/Modal/Modal.d.ts.map +1 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/Modal/index.d.ts.map +1 -0
- package/dist/components/PageHeader/PageHeader.d.ts +91 -0
- package/dist/components/PageHeader/PageHeader.d.ts.map +1 -0
- package/dist/components/PageHeader/index.d.ts +2 -0
- package/dist/components/PageHeader/index.d.ts.map +1 -0
- package/dist/components/RichTextEditor/RichTextEditor.d.ts +52 -0
- package/dist/components/RichTextEditor/RichTextEditor.d.ts.map +1 -0
- package/dist/components/RichTextEditor/index.d.ts +3 -0
- package/dist/components/RichTextEditor/index.d.ts.map +1 -0
- package/dist/components/SearchInput/SearchInput.d.ts +66 -0
- package/dist/components/SearchInput/SearchInput.d.ts.map +1 -0
- package/dist/components/SearchInput/index.d.ts +2 -0
- package/dist/components/SearchInput/index.d.ts.map +1 -0
- package/dist/components/SimpleTable/SimpleTable.d.ts +93 -0
- package/dist/components/SimpleTable/SimpleTable.d.ts.map +1 -0
- package/dist/components/SimpleTable/index.d.ts +3 -0
- package/dist/components/SimpleTable/index.d.ts.map +1 -0
- package/dist/components/SplitPane/SplitPane.d.ts +52 -0
- package/dist/components/SplitPane/SplitPane.d.ts.map +1 -0
- package/dist/components/SplitPane/index.d.ts +3 -0
- package/dist/components/SplitPane/index.d.ts.map +1 -0
- package/dist/components/StatusIndicator/Badge.d.ts +71 -0
- package/dist/components/StatusIndicator/Badge.d.ts.map +1 -0
- package/dist/components/StatusIndicator/Chip.d.ts +64 -0
- package/dist/components/StatusIndicator/Chip.d.ts.map +1 -0
- package/dist/components/StatusIndicator/Indicators.d.ts +81 -0
- package/dist/components/StatusIndicator/Indicators.d.ts.map +1 -0
- package/dist/components/StatusIndicator/Legend.d.ts +42 -0
- package/dist/components/StatusIndicator/Legend.d.ts.map +1 -0
- package/dist/components/StatusIndicator/Shapes.d.ts +32 -0
- package/dist/components/StatusIndicator/Shapes.d.ts.map +1 -0
- package/dist/components/StatusIndicator/StatusIndicator.d.ts +183 -0
- package/dist/components/StatusIndicator/StatusIndicator.d.ts.map +1 -0
- package/dist/components/StatusIndicator/index.d.ts +55 -0
- package/dist/components/StatusIndicator/index.d.ts.map +1 -0
- package/dist/components/StatusIndicator/types.d.ts +37 -0
- package/dist/components/StatusIndicator/types.d.ts.map +1 -0
- package/dist/components/Timeline/Timeline.d.ts +89 -0
- package/dist/components/Timeline/Timeline.d.ts.map +1 -0
- package/dist/components/Timeline/index.d.ts +2 -0
- package/dist/components/Timeline/index.d.ts.map +1 -0
- package/dist/components/Toast/Toast.d.ts +124 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toast/index.d.ts.map +1 -0
- package/dist/components/TopNavHeader.d.ts +55 -0
- package/dist/components/TopNavHeader.d.ts.map +1 -0
- package/dist/components/TopNavWithSidebar.d.ts +64 -0
- package/dist/components/TopNavWithSidebar.d.ts.map +1 -0
- package/dist/components/TransferList/TransferList.d.ts +62 -0
- package/dist/components/TransferList/TransferList.d.ts.map +1 -0
- package/dist/components/TransferList/index.d.ts +3 -0
- package/dist/components/TransferList/index.d.ts.map +1 -0
- package/dist/components/TreeView/TreeView.d.ts +89 -0
- package/dist/components/TreeView/TreeView.d.ts.map +1 -0
- package/dist/components/TreeView/index.d.ts +3 -0
- package/dist/components/TreeView/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +119 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/internal/index.d.ts +27 -0
- package/dist/components/internal/index.d.ts.map +1 -0
- package/dist/components/navigation/components.d.ts +85 -0
- package/dist/components/navigation/components.d.ts.map +1 -0
- package/dist/components/navigation/hooks.d.ts +65 -0
- package/dist/components/navigation/hooks.d.ts.map +1 -0
- package/dist/components/navigation/index.d.ts +28 -0
- package/dist/components/navigation/index.d.ts.map +1 -0
- package/dist/components/navigation/styled.d.ts +13 -0
- package/dist/components/navigation/styled.d.ts.map +1 -0
- package/dist/components/navigation/types.d.ts +58 -0
- package/dist/components/navigation/types.d.ts.map +1 -0
- package/dist/components/shared/TrinityLogoSvg.d.ts +29 -0
- package/dist/components/shared/TrinityLogoSvg.d.ts.map +1 -0
- package/dist/components/shared.d.ts +92 -0
- package/dist/components/shared.d.ts.map +1 -0
- package/dist/components/templates/Dashboard/DashboardTemplate.d.ts +66 -0
- package/dist/components/templates/Dashboard/DashboardTemplate.d.ts.map +1 -0
- package/dist/components/templates/Dashboard/index.d.ts +2 -0
- package/dist/components/templates/Dashboard/index.d.ts.map +1 -0
- package/dist/components/templates/ListDetail/ListDetailTemplate.d.ts +88 -0
- package/dist/components/templates/ListDetail/ListDetailTemplate.d.ts.map +1 -0
- package/dist/components/templates/ListDetail/index.d.ts +2 -0
- package/dist/components/templates/ListDetail/index.d.ts.map +1 -0
- package/dist/components/templates/Settings/SettingsTemplate.d.ts +78 -0
- package/dist/components/templates/Settings/SettingsTemplate.d.ts.map +1 -0
- package/dist/components/templates/Settings/index.d.ts +2 -0
- package/dist/components/templates/Settings/index.d.ts.map +1 -0
- package/dist/components/templates/index.d.ts +5 -0
- package/dist/components/templates/index.d.ts.map +1 -0
- package/dist/essentials.d.ts +49 -0
- package/dist/essentials.d.ts.map +1 -0
- package/dist/essentials.js +256 -0
- package/dist/form.d.ts +212 -0
- package/dist/form.d.ts.map +1 -0
- package/dist/hierarchy.d.ts +371 -0
- package/dist/hierarchy.d.ts.map +1 -0
- package/dist/hooks/useTrinityPalette.d.ts +54 -0
- package/dist/hooks/useTrinityPalette.d.ts.map +1 -0
- package/dist/hooks.d.ts +217 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/index.d.ts +111 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2293 -3731
- package/dist/presets/analytics.d.ts +197 -0
- package/dist/presets/analytics.d.ts.map +1 -0
- package/dist/presets/crm.d.ts +67 -0
- package/dist/presets/crm.d.ts.map +1 -0
- package/dist/presets/index.d.ts +21 -0
- package/dist/presets/index.d.ts.map +1 -0
- package/dist/presets/portal.d.ts +67 -0
- package/dist/presets/portal.d.ts.map +1 -0
- package/dist/theme.d.ts +221 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/tokens.d.ts +4760 -0
- package/dist/tokens.d.ts.map +1 -0
- package/package.json +6 -9
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Response Schema
|
|
3
|
+
* Canonical types for AI response architecture.
|
|
4
|
+
*
|
|
5
|
+
* Design Principles:
|
|
6
|
+
* 1. HETEROGENEOUS: A single response can contain mixed content types
|
|
7
|
+
* 2. ORDERED: Block order is preserved and meaningful
|
|
8
|
+
* 3. EXTENSIBLE: New block types can be added without breaking changes
|
|
9
|
+
* 4. TYPED: Discriminated union ensures type safety per block type
|
|
10
|
+
*
|
|
11
|
+
* Architecture:
|
|
12
|
+
* ```
|
|
13
|
+
* AIResponse
|
|
14
|
+
* └── blocks: AIResponseBlock[]
|
|
15
|
+
* ├── TextBlock (type: 'text')
|
|
16
|
+
* ├── TableBlock (type: 'table') [future]
|
|
17
|
+
* ├── ChartBlock (type: 'chart') [future]
|
|
18
|
+
* ├── ImageBlock (type: 'image') [future]
|
|
19
|
+
* ├── FormBlock (type: 'form') [future]
|
|
20
|
+
* └── ActionsBlock (type: 'actions') [future]
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Why This Structure:
|
|
24
|
+
* - Discriminated unions (`type` field) enable exhaustive switch/case handling
|
|
25
|
+
* - Array preserves order without complex ordering logic
|
|
26
|
+
* - Each block is self-contained with its own props
|
|
27
|
+
* - Metadata at response level (id, timestamp) separate from content
|
|
28
|
+
* - Sources/citations link to specific blocks via optional `blockId`
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* const response: AIResponse = {
|
|
33
|
+
* id: 'resp-123',
|
|
34
|
+
* blocks: [
|
|
35
|
+
* { type: 'text', content: 'Here is the analysis:' },
|
|
36
|
+
* { type: 'table', columns: [...], rows: [...] },
|
|
37
|
+
* { type: 'text', content: 'Key takeaway: growth is 14% YoY.' },
|
|
38
|
+
* ],
|
|
39
|
+
* metadata: {
|
|
40
|
+
* model: 'gpt-4',
|
|
41
|
+
* timestamp: '2026-01-10T10:30:00Z',
|
|
42
|
+
* processingTime: 1250,
|
|
43
|
+
* },
|
|
44
|
+
* };
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* Base interface for all blocks.
|
|
49
|
+
* Every block has a `type` discriminator and optional `id` for targeting.
|
|
50
|
+
*/
|
|
51
|
+
export interface BaseBlock {
|
|
52
|
+
/** Discriminator for block type */
|
|
53
|
+
type: string;
|
|
54
|
+
/** Optional unique identifier for this block (for citations, anchoring) */
|
|
55
|
+
id?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Text Block
|
|
59
|
+
* Renders as paragraph text, optionally with markdown formatting.
|
|
60
|
+
*
|
|
61
|
+
* This is the foundational block type - all AI responses will have at least one.
|
|
62
|
+
*/
|
|
63
|
+
export interface TextBlock extends BaseBlock {
|
|
64
|
+
type: 'text';
|
|
65
|
+
/** The text content */
|
|
66
|
+
content: string;
|
|
67
|
+
/** Whether to render as markdown (default: false) */
|
|
68
|
+
markdown?: boolean;
|
|
69
|
+
/** Optional semantic role for styling */
|
|
70
|
+
variant?: 'body' | 'caption' | 'heading' | 'quote';
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Table Block [FUTURE]
|
|
74
|
+
* @reserved - Schema defined but rendering not yet implemented
|
|
75
|
+
*/
|
|
76
|
+
export interface TableBlock extends BaseBlock {
|
|
77
|
+
type: 'table';
|
|
78
|
+
columns: Array<{
|
|
79
|
+
key: string;
|
|
80
|
+
label: string;
|
|
81
|
+
align?: 'left' | 'center' | 'right';
|
|
82
|
+
width?: number | string;
|
|
83
|
+
}>;
|
|
84
|
+
rows: Array<Record<string, unknown>>;
|
|
85
|
+
title?: string;
|
|
86
|
+
compact?: boolean;
|
|
87
|
+
sortable?: boolean;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Chart Block [FUTURE]
|
|
91
|
+
* @reserved - Schema defined but rendering not yet implemented
|
|
92
|
+
*/
|
|
93
|
+
export interface ChartBlock extends BaseBlock {
|
|
94
|
+
type: 'chart';
|
|
95
|
+
chartType: 'bar' | 'line' | 'pie' | 'area' | 'donut';
|
|
96
|
+
data: Array<Record<string, unknown>>;
|
|
97
|
+
series: Array<{
|
|
98
|
+
dataKey: string;
|
|
99
|
+
name?: string;
|
|
100
|
+
color?: string;
|
|
101
|
+
}>;
|
|
102
|
+
xAxis?: {
|
|
103
|
+
dataKey: string;
|
|
104
|
+
label?: string;
|
|
105
|
+
};
|
|
106
|
+
yAxis?: {
|
|
107
|
+
label?: string;
|
|
108
|
+
};
|
|
109
|
+
title?: string;
|
|
110
|
+
height?: number;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Image Block [FUTURE]
|
|
114
|
+
* @reserved - Schema defined but rendering not yet implemented
|
|
115
|
+
*/
|
|
116
|
+
export interface ImageBlock extends BaseBlock {
|
|
117
|
+
type: 'image';
|
|
118
|
+
src: string;
|
|
119
|
+
alt: string;
|
|
120
|
+
caption?: string;
|
|
121
|
+
maxWidth?: number | string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Form Block [FUTURE]
|
|
125
|
+
* @reserved - Schema defined but rendering not yet implemented
|
|
126
|
+
*/
|
|
127
|
+
export interface FormBlock extends BaseBlock {
|
|
128
|
+
type: 'form';
|
|
129
|
+
fields: Array<{
|
|
130
|
+
name: string;
|
|
131
|
+
label: string;
|
|
132
|
+
type: 'text' | 'number' | 'select' | 'checkbox' | 'textarea';
|
|
133
|
+
value?: unknown;
|
|
134
|
+
options?: Array<{
|
|
135
|
+
value: string;
|
|
136
|
+
label: string;
|
|
137
|
+
}>;
|
|
138
|
+
placeholder?: string;
|
|
139
|
+
required?: boolean;
|
|
140
|
+
}>;
|
|
141
|
+
submitLabel?: string;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Actions Block [FUTURE]
|
|
145
|
+
* @reserved - Schema defined but rendering not yet implemented
|
|
146
|
+
*/
|
|
147
|
+
export interface ActionsBlock extends BaseBlock {
|
|
148
|
+
type: 'actions';
|
|
149
|
+
items: Array<{
|
|
150
|
+
id?: string;
|
|
151
|
+
label: string;
|
|
152
|
+
icon?: string;
|
|
153
|
+
variant?: 'text' | 'outlined' | 'contained';
|
|
154
|
+
color?: 'primary' | 'secondary' | 'inherit';
|
|
155
|
+
href?: string;
|
|
156
|
+
disabled?: boolean;
|
|
157
|
+
}>;
|
|
158
|
+
direction?: 'row' | 'column';
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* AIResponseBlock - Discriminated union of all supported block types.
|
|
162
|
+
*
|
|
163
|
+
* Use `block.type` to narrow the type in switch/case or conditionals.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```tsx
|
|
167
|
+
* function renderBlock(block: AIResponseBlock) {
|
|
168
|
+
* switch (block.type) {
|
|
169
|
+
* case 'text':
|
|
170
|
+
* return <TextRenderer content={block.content} />;
|
|
171
|
+
* case 'table':
|
|
172
|
+
* return <TableRenderer columns={block.columns} rows={block.rows} />;
|
|
173
|
+
* // ... exhaustive handling
|
|
174
|
+
* }
|
|
175
|
+
* }
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
export type AIResponseBlock = TextBlock | TableBlock | ChartBlock | ImageBlock | FormBlock | ActionsBlock;
|
|
179
|
+
/**
|
|
180
|
+
* Extract block type string literals for type guards
|
|
181
|
+
*/
|
|
182
|
+
export type AIResponseBlockType = AIResponseBlock['type'];
|
|
183
|
+
/**
|
|
184
|
+
* Metadata about the AI response generation.
|
|
185
|
+
*/
|
|
186
|
+
export interface AIResponseMetadata {
|
|
187
|
+
/** Model used to generate response */
|
|
188
|
+
model?: string;
|
|
189
|
+
/** ISO timestamp of response generation */
|
|
190
|
+
timestamp?: string;
|
|
191
|
+
/** Processing time in milliseconds */
|
|
192
|
+
processingTime?: number;
|
|
193
|
+
/** Token usage */
|
|
194
|
+
tokens?: {
|
|
195
|
+
prompt?: number;
|
|
196
|
+
completion?: number;
|
|
197
|
+
total?: number;
|
|
198
|
+
};
|
|
199
|
+
/** Confidence score (0-1) */
|
|
200
|
+
confidence?: number;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Source citation for response content.
|
|
204
|
+
*/
|
|
205
|
+
export interface AIResponseSource {
|
|
206
|
+
/** Unique identifier */
|
|
207
|
+
id: string;
|
|
208
|
+
/** Source title/name */
|
|
209
|
+
title: string;
|
|
210
|
+
/** Source URL */
|
|
211
|
+
url?: string;
|
|
212
|
+
/** Source type */
|
|
213
|
+
type?: 'document' | 'webpage' | 'database' | 'api' | 'other';
|
|
214
|
+
/** Relevance score (0-1) */
|
|
215
|
+
relevance?: number;
|
|
216
|
+
/** Which block(s) this source supports */
|
|
217
|
+
blockIds?: string[];
|
|
218
|
+
/** Snippet/excerpt from source */
|
|
219
|
+
excerpt?: string;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* AIResponse - Canonical schema for a complete AI response.
|
|
223
|
+
*
|
|
224
|
+
* This is the top-level type that wraps all response content.
|
|
225
|
+
* Use this as the contract between AI service and UI components.
|
|
226
|
+
*
|
|
227
|
+
* Key Design Decisions:
|
|
228
|
+
* 1. `blocks` is an ordered array - sequence matters for narrative
|
|
229
|
+
* 2. `metadata` is optional - not all responses need it
|
|
230
|
+
* 3. `sources` are at response level but can reference specific blocks
|
|
231
|
+
* 4. `relatedQuestions` are response-level suggestions
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```tsx
|
|
235
|
+
* // Simple text response
|
|
236
|
+
* const simple: AIResponse = {
|
|
237
|
+
* id: 'r1',
|
|
238
|
+
* blocks: [{ type: 'text', content: 'Hello!' }],
|
|
239
|
+
* };
|
|
240
|
+
*
|
|
241
|
+
* // Complex multi-block response
|
|
242
|
+
* const complex: AIResponse = {
|
|
243
|
+
* id: 'r2',
|
|
244
|
+
* blocks: [
|
|
245
|
+
* { type: 'text', id: 'intro', content: 'Analysis summary:' },
|
|
246
|
+
* { type: 'chart', id: 'chart1', chartType: 'bar', data: [...] },
|
|
247
|
+
* { type: 'text', content: 'The data shows growth.' },
|
|
248
|
+
* ],
|
|
249
|
+
* sources: [
|
|
250
|
+
* { id: 's1', title: 'Q4 Report', blockIds: ['chart1'] },
|
|
251
|
+
* ],
|
|
252
|
+
* relatedQuestions: ['What about Q3?', 'Show monthly breakdown'],
|
|
253
|
+
* metadata: { model: 'gpt-4', timestamp: '2026-01-10T10:30:00Z' },
|
|
254
|
+
* };
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
export interface AIResponse {
|
|
258
|
+
/** Unique identifier for this response */
|
|
259
|
+
id: string;
|
|
260
|
+
/** Ordered array of content blocks */
|
|
261
|
+
blocks: AIResponseBlock[];
|
|
262
|
+
/** Sources/citations for the response content */
|
|
263
|
+
sources?: AIResponseSource[];
|
|
264
|
+
/** Suggested follow-up questions */
|
|
265
|
+
relatedQuestions?: string[];
|
|
266
|
+
/** Response generation metadata */
|
|
267
|
+
metadata?: AIResponseMetadata;
|
|
268
|
+
/** Error state (if response failed) */
|
|
269
|
+
error?: {
|
|
270
|
+
code: string;
|
|
271
|
+
message: string;
|
|
272
|
+
recoverable?: boolean;
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Type guard to check if a block is a TextBlock
|
|
277
|
+
*/
|
|
278
|
+
export declare function isTextBlock(block: AIResponseBlock): block is TextBlock;
|
|
279
|
+
/**
|
|
280
|
+
* Type guard to check if a block is a TableBlock
|
|
281
|
+
*/
|
|
282
|
+
export declare function isTableBlock(block: AIResponseBlock): block is TableBlock;
|
|
283
|
+
/**
|
|
284
|
+
* Type guard to check if a block is a ChartBlock
|
|
285
|
+
*/
|
|
286
|
+
export declare function isChartBlock(block: AIResponseBlock): block is ChartBlock;
|
|
287
|
+
/**
|
|
288
|
+
* Type guard to check if a block is an ImageBlock
|
|
289
|
+
*/
|
|
290
|
+
export declare function isImageBlock(block: AIResponseBlock): block is ImageBlock;
|
|
291
|
+
/**
|
|
292
|
+
* Type guard to check if a block is a FormBlock
|
|
293
|
+
*/
|
|
294
|
+
export declare function isFormBlock(block: AIResponseBlock): block is FormBlock;
|
|
295
|
+
/**
|
|
296
|
+
* Type guard to check if a block is an ActionsBlock
|
|
297
|
+
*/
|
|
298
|
+
export declare function isActionsBlock(block: AIResponseBlock): block is ActionsBlock;
|
|
299
|
+
/**
|
|
300
|
+
* Helper type to create a response with only text blocks
|
|
301
|
+
*/
|
|
302
|
+
export type TextOnlyResponse = Omit<AIResponse, 'blocks'> & {
|
|
303
|
+
blocks: TextBlock[];
|
|
304
|
+
};
|
|
305
|
+
/**
|
|
306
|
+
* Helper type for response building
|
|
307
|
+
*/
|
|
308
|
+
export type PartialAIResponse = Partial<AIResponse> & {
|
|
309
|
+
id: string;
|
|
310
|
+
blocks: AIResponseBlock[];
|
|
311
|
+
};
|
|
312
|
+
//# sourceMappingURL=response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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,EAAE,eAAe,GAAG,KAAK,IAAI,YAAY,CAE5E;AAMD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,GAAG;IAC1D,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview AIFab component.
|
|
3
|
+
* @module components/AppLayout/AIFab
|
|
4
|
+
* AIFab Component
|
|
5
|
+
* Floating Action Button for launching the AI chat panel
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import { AIFab } from '@trinityui/design-system';
|
|
9
|
+
*
|
|
10
|
+
* <AIFab />
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
import React from 'react';
|
|
14
|
+
/**
|
|
15
|
+
* Props for AIFab component.
|
|
16
|
+
*/
|
|
17
|
+
export interface AIFabProps {
|
|
18
|
+
/** Whether the AI panel is currently open */
|
|
19
|
+
open?: boolean;
|
|
20
|
+
/** Callback when the FAB is clicked */
|
|
21
|
+
onClick?: () => void;
|
|
22
|
+
/** Position of the FAB */
|
|
23
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
24
|
+
/** Custom offset from the edge (in pixels) */
|
|
25
|
+
offset?: {
|
|
26
|
+
x?: number;
|
|
27
|
+
y?: number;
|
|
28
|
+
};
|
|
29
|
+
/** Whether to show a badge (e.g., for notifications) */
|
|
30
|
+
showBadge?: boolean;
|
|
31
|
+
/** Badge content (number or dot) */
|
|
32
|
+
badgeContent?: number | string;
|
|
33
|
+
/** Size of the FAB */
|
|
34
|
+
size?: 'small' | 'medium' | 'large';
|
|
35
|
+
/** Tooltip text */
|
|
36
|
+
tooltip?: string;
|
|
37
|
+
/** Whether the FAB is disabled */
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
/** Custom z-index */
|
|
40
|
+
zIndex?: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* AIFab - Floating Action Button for launching AI chat
|
|
44
|
+
*
|
|
45
|
+
* A beautifully styled FAB with Trinity AI branding that can be used
|
|
46
|
+
* to open the InsightEnginePanel from anywhere in the application.
|
|
47
|
+
*/
|
|
48
|
+
export declare const AIFab: React.FC<AIFabProps>;
|
|
49
|
+
export default AIFab;
|
|
50
|
+
//# sourceMappingURL=AIFab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AIFab.d.ts","sourceRoot":"","sources":["../../../src/components/AppLayout/AIFab.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,CAAC;IACrE,8CAA8C;IAC9C,MAAM,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,sBAAsB;IACtB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,mBAAmB;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA6FtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview AIFabLayout.deprecated component.
|
|
3
|
+
* @module components/AppLayout/AIFabLayout.deprecated
|
|
4
|
+
* AIFabLayout - DEPRECATED
|
|
5
|
+
*
|
|
6
|
+
* @deprecated Use `AppLayout` with `navStyle="topnav"` and `aiTrigger="fab"` instead.
|
|
7
|
+
* This component will be removed in v2.0.0.
|
|
8
|
+
*
|
|
9
|
+
* Migration:
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // Before (deprecated)
|
|
12
|
+
* import { AIFabLayout } from '@trinityui/design-system';
|
|
13
|
+
* <AIFabLayout navStyle="topnav" />
|
|
14
|
+
*
|
|
15
|
+
* // After
|
|
16
|
+
* import { AppLayout } from '@trinityui/design-system';
|
|
17
|
+
* <AppLayout navStyle="topnav" aiTrigger="fab" />
|
|
18
|
+
* ```
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* import { AIFabLayout } from '@trinityui/design-system';
|
|
22
|
+
*
|
|
23
|
+
* <AIFabLayout />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
import React from 'react';
|
|
27
|
+
import { AppLayoutProps } from './AppLayout';
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use `AppLayout` instead. AIFabLayout will be removed in v2.0.0.
|
|
30
|
+
*/
|
|
31
|
+
export declare const AIFabLayout: React.FC<AppLayoutProps>;
|
|
32
|
+
//# sourceMappingURL=AIFabLayout.deprecated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AIFabLayout.deprecated.d.ts","sourceRoot":"","sources":["../../../src/components/AppLayout/AIFabLayout.deprecated.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAa,cAAc,EAAE,MAAM,aAAa,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAchD,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview AppLayout component.
|
|
3
|
+
* @module components/AppLayout/AppLayout
|
|
4
|
+
* AppLayout - Unified Application Shell
|
|
5
|
+
*
|
|
6
|
+
* A flexible application layout that supports multiple navigation styles and AI integration modes.
|
|
7
|
+
* This component consolidates the functionality of the previous AppLayout and AIFabLayout components.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { AppLayout } from '@trinityui/design-system';
|
|
12
|
+
*
|
|
13
|
+
* <AppLayout
|
|
14
|
+
* name="Example"
|
|
15
|
+
* >
|
|
16
|
+
* <div>Example content</div>
|
|
17
|
+
* </AppLayout>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example Top navigation with FAB AI trigger
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <AppLayout
|
|
23
|
+
* navStyle="topnav"
|
|
24
|
+
* aiTrigger="fab"
|
|
25
|
+
* companyName="Acme Corp"
|
|
26
|
+
* >
|
|
27
|
+
* <YourContent />
|
|
28
|
+
* </AppLayout>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example Sidebar navigation with no AI integration
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <AppLayout
|
|
34
|
+
* navStyle="sidebar"
|
|
35
|
+
* aiTrigger="none"
|
|
36
|
+
* companyName="Acme Corp"
|
|
37
|
+
* >
|
|
38
|
+
* <YourContent />
|
|
39
|
+
* </AppLayout>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
import React from 'react';
|
|
43
|
+
import { SxProps, Theme } from '@mui/material';
|
|
44
|
+
import { type InsightEnginePanelProps } from './InsightEnginePanel';
|
|
45
|
+
import { type AIFabProps } from './AIFab';
|
|
46
|
+
/**
|
|
47
|
+
* Navigation style determines the overall layout structure
|
|
48
|
+
* - 'sidebar': Full sidebar navigation with collapsible drawer (default)
|
|
49
|
+
* - 'topnav': Simple top navigation bar only
|
|
50
|
+
*/
|
|
51
|
+
export type NavStyle = 'sidebar' | 'topnav';
|
|
52
|
+
/**
|
|
53
|
+
* AI trigger mode determines how users access the AI assistant
|
|
54
|
+
* - 'sidebar': AI is accessed via a nav item in the sidebar (default for sidebar nav)
|
|
55
|
+
* - 'fab': AI is accessed via a floating action button (default for topnav)
|
|
56
|
+
* - 'none': No AI integration
|
|
57
|
+
*/
|
|
58
|
+
export type AITrigger = 'sidebar' | 'fab' | 'none';
|
|
59
|
+
/**
|
|
60
|
+
* Navigation item for sidebar
|
|
61
|
+
*/
|
|
62
|
+
export interface NavItem {
|
|
63
|
+
id: string;
|
|
64
|
+
label: string;
|
|
65
|
+
icon: React.ReactNode;
|
|
66
|
+
badge?: number;
|
|
67
|
+
isSpecial?: boolean;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Props for AppLayout component.
|
|
71
|
+
*/
|
|
72
|
+
export interface AppLayoutProps {
|
|
73
|
+
/** Child content to render in the main area */
|
|
74
|
+
children: React.ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* Navigation style
|
|
77
|
+
* @default 'sidebar'
|
|
78
|
+
*/
|
|
79
|
+
navStyle?: NavStyle;
|
|
80
|
+
/**
|
|
81
|
+
* AI trigger mode
|
|
82
|
+
* @default 'sidebar' when navStyle='sidebar', 'fab' when navStyle='topnav'
|
|
83
|
+
*/
|
|
84
|
+
aiTrigger?: AITrigger;
|
|
85
|
+
/**
|
|
86
|
+
* Company or app name displayed in the header
|
|
87
|
+
*/
|
|
88
|
+
companyName?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Navigation items for sidebar mode.
|
|
91
|
+
* Required when navStyle='sidebar'. If empty or not provided, sidebar navigation will not render.
|
|
92
|
+
* Include an item with id='insight-engine' and isSpecial=true to add AI trigger to sidebar.
|
|
93
|
+
*/
|
|
94
|
+
navItems?: NavItem[];
|
|
95
|
+
/**
|
|
96
|
+
* Currently selected navigation item ID (controlled).
|
|
97
|
+
* If not provided, no item will be highlighted.
|
|
98
|
+
*/
|
|
99
|
+
selectedNavItem?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Callback when selected navigation item changes.
|
|
102
|
+
* Called when user clicks a non-AI nav item.
|
|
103
|
+
*/
|
|
104
|
+
onSelectedNavItemChange?: (itemId: string) => void;
|
|
105
|
+
/**
|
|
106
|
+
* User information for the avatar/menu.
|
|
107
|
+
* The `initials` field should be provided; if omitted, no initials will be displayed.
|
|
108
|
+
*/
|
|
109
|
+
user?: {
|
|
110
|
+
name: string;
|
|
111
|
+
email?: string;
|
|
112
|
+
initials?: string;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Client name for the client selector
|
|
116
|
+
*/
|
|
117
|
+
clientName?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Available clients for the selector
|
|
120
|
+
*/
|
|
121
|
+
clients?: {
|
|
122
|
+
id: string;
|
|
123
|
+
name: string;
|
|
124
|
+
}[];
|
|
125
|
+
/**
|
|
126
|
+
* Callback when client changes
|
|
127
|
+
*/
|
|
128
|
+
onClientChange?: (clientId: string) => void;
|
|
129
|
+
/**
|
|
130
|
+
* @deprecated Use onSelectedNavItemChange instead.
|
|
131
|
+
* Callback when navigation item is clicked.
|
|
132
|
+
*/
|
|
133
|
+
onNavigate?: (itemId: string) => void;
|
|
134
|
+
/**
|
|
135
|
+
* Props passed to the AIFab component (when aiTrigger='fab')
|
|
136
|
+
*/
|
|
137
|
+
fabProps?: Partial<AIFabProps>;
|
|
138
|
+
/**
|
|
139
|
+
* Props passed to the InsightEnginePanel component
|
|
140
|
+
*/
|
|
141
|
+
panelProps?: Partial<InsightEnginePanelProps>;
|
|
142
|
+
/**
|
|
143
|
+
* Custom panel width
|
|
144
|
+
* @default 420
|
|
145
|
+
*/
|
|
146
|
+
aiPanelWidth?: number;
|
|
147
|
+
/**
|
|
148
|
+
* SX props for the content wrapper
|
|
149
|
+
*/
|
|
150
|
+
contentSx?: SxProps<Theme>;
|
|
151
|
+
}
|
|
152
|
+
export declare const AppLayout: React.FC<AppLayoutProps>;
|
|
153
|
+
export default AppLayout;
|
|
154
|
+
//# sourceMappingURL=AppLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppLayout.d.ts","sourceRoot":"","sources":["../../../src/components/AppLayout/AppLayout.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAgC,MAAM,OAAO,CAAC;AACrD,OAAO,EAAgC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAI7E,OAAO,EAAsB,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAExF,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAOjD;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;;OAG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