@handled-ai/design-system 0.8.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.
- package/README.md +14 -4
- package/dist/charts/bar-chart-component.d.ts +24 -0
- package/dist/charts/bar-chart-component.js +123 -0
- package/dist/charts/bar-chart-component.js.map +1 -0
- package/dist/charts/chart-tooltip.d.ts +26 -0
- package/dist/charts/chart-tooltip.js +69 -0
- package/dist/charts/chart-tooltip.js.map +1 -0
- package/dist/charts/chart.d.ts +64 -0
- package/dist/charts/chart.js +285 -0
- package/dist/charts/chart.js.map +1 -0
- package/dist/charts/donut-chart.d.ts +21 -0
- package/dist/charts/donut-chart.js +96 -0
- package/dist/charts/donut-chart.js.map +1 -0
- package/dist/charts/index.d.ts +11 -0
- package/dist/charts/index.js +10 -0
- package/dist/charts/index.js.map +1 -0
- package/dist/charts/pipeline-overview.d.ts +76 -0
- package/dist/charts/pipeline-overview.js +372 -0
- package/dist/charts/pipeline-overview.js.map +1 -0
- package/dist/charts/sankey-chart.d.ts +52 -0
- package/dist/charts/sankey-chart.js +219 -0
- package/dist/charts/sankey-chart.js.map +1 -0
- package/dist/charts/top-line-metrics.d.ts +26 -0
- package/dist/charts/top-line-metrics.js +224 -0
- package/dist/charts/top-line-metrics.js.map +1 -0
- package/dist/charts/trend-area-chart.d.ts +21 -0
- package/dist/charts/trend-area-chart.js +150 -0
- package/dist/charts/trend-area-chart.js.map +1 -0
- package/dist/charts/volume-analysis-chart.d.ts +19 -0
- package/dist/charts/volume-analysis-chart.js +121 -0
- package/dist/charts/volume-analysis-chart.js.map +1 -0
- package/dist/components/activity-detail.d.ts +38 -0
- package/dist/components/activity-detail.js +163 -0
- package/dist/components/activity-detail.js.map +1 -0
- package/dist/components/activity-log.d.ts +21 -0
- package/dist/components/activity-log.js +61 -0
- package/dist/components/activity-log.js.map +1 -0
- package/dist/components/agent-popover.d.ts +71 -0
- package/dist/components/agent-popover.js +282 -0
- package/dist/components/agent-popover.js.map +1 -0
- package/dist/components/agent-widget.d.ts +24 -0
- package/dist/components/agent-widget.js +117 -0
- package/dist/components/agent-widget.js.map +1 -0
- package/dist/components/avatar.d.ts +13 -0
- package/dist/components/avatar.js +140 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +12 -0
- package/dist/components/badge.js +75 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/button.d.ts +13 -0
- package/dist/components/button.js +83 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/card.d.ts +11 -0
- package/dist/components/card.js +119 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/contact-list.d.ts +34 -0
- package/dist/components/contact-list.js +84 -0
- package/dist/components/contact-list.js.map +1 -0
- package/dist/components/dashboard-cards.d.ts +10 -0
- package/dist/components/dashboard-cards.js +164 -0
- package/dist/components/dashboard-cards.js.map +1 -0
- package/dist/components/data-table-display.d.ts +19 -0
- package/dist/components/data-table-display.js +109 -0
- package/dist/components/data-table-display.js.map +1 -0
- package/dist/components/data-table-filter.d.ts +18 -0
- package/dist/components/data-table-filter.js +107 -0
- package/dist/components/data-table-filter.js.map +1 -0
- package/dist/components/data-table-quick-views.d.ts +13 -0
- package/dist/components/data-table-quick-views.js +90 -0
- package/dist/components/data-table-quick-views.js.map +1 -0
- package/dist/components/data-table-toolbar.d.ts +18 -0
- package/dist/components/data-table-toolbar.js +45 -0
- package/dist/components/data-table-toolbar.js.map +1 -0
- package/dist/components/data-table.d.ts +39 -0
- package/dist/components/data-table.js +821 -0
- package/dist/components/data-table.js.map +1 -0
- package/dist/components/detail-view.d.ts +44 -0
- package/dist/components/detail-view.js +165 -0
- package/dist/components/detail-view.js.map +1 -0
- package/dist/components/dialog.d.ts +19 -0
- package/dist/components/dialog.js +188 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +27 -0
- package/dist/components/dropdown-menu.js +279 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/entity-panel.d.ts +69 -0
- package/dist/components/entity-panel.js +584 -0
- package/dist/components/entity-panel.js.map +1 -0
- package/dist/components/inbox-row.d.ts +27 -0
- package/dist/components/inbox-row.js +139 -0
- package/dist/components/inbox-row.js.map +1 -0
- package/dist/components/inbox-toolbar.d.ts +21 -0
- package/dist/components/inbox-toolbar.js +203 -0
- package/dist/components/inbox-toolbar.js.map +1 -0
- package/dist/components/input.d.ts +5 -0
- package/dist/components/input.js +50 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/insights-filter-bar.d.ts +21 -0
- package/dist/components/insights-filter-bar.js +99 -0
- package/dist/components/insights-filter-bar.js.map +1 -0
- package/dist/components/item-list-display.d.ts +22 -0
- package/dist/components/item-list-display.js +240 -0
- package/dist/components/item-list-display.js.map +1 -0
- package/dist/components/item-list-filter.d.ts +16 -0
- package/dist/components/item-list-filter.js +87 -0
- package/dist/components/item-list-filter.js.map +1 -0
- package/dist/components/item-list-toolbar.d.ts +25 -0
- package/dist/components/item-list-toolbar.js +79 -0
- package/dist/components/item-list-toolbar.js.map +1 -0
- package/dist/components/item-list.d.ts +20 -0
- package/dist/components/item-list.js +702 -0
- package/dist/components/item-list.js.map +1 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.js +55 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/message.d.ts +23 -0
- package/dist/components/message.js +117 -0
- package/dist/components/message.js.map +1 -0
- package/dist/components/metric-card.d.ts +25 -0
- package/dist/components/metric-card.js +107 -0
- package/dist/components/metric-card.js.map +1 -0
- package/dist/components/performance-metrics-table.d.ts +38 -0
- package/dist/components/performance-metrics-table.js +342 -0
- package/dist/components/performance-metrics-table.js.map +1 -0
- package/dist/components/preview-list.d.ts +14 -0
- package/dist/components/preview-list.js +83 -0
- package/dist/components/preview-list.js.map +1 -0
- package/dist/components/progress.d.ts +6 -0
- package/dist/components/progress.js +69 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/quick-action-chat-area.d.ts +24 -0
- package/dist/components/quick-action-chat-area.js +178 -0
- package/dist/components/quick-action-chat-area.js.map +1 -0
- package/dist/components/quick-action-modal.d.ts +30 -0
- package/dist/components/quick-action-modal.js +288 -0
- package/dist/components/quick-action-modal.js.map +1 -0
- package/dist/components/quick-action-sidebar-nav.d.ts +51 -0
- package/dist/components/quick-action-sidebar-nav.js +528 -0
- package/dist/components/quick-action-sidebar-nav.js.map +1 -0
- package/dist/components/recommended-actions-section.d.ts +23 -0
- package/dist/components/recommended-actions-section.js +215 -0
- package/dist/components/recommended-actions-section.js.map +1 -0
- package/dist/components/report-card.d.ts +26 -0
- package/dist/components/report-card.js +69 -0
- package/dist/components/report-card.js.map +1 -0
- package/dist/components/score-analysis-modal.d.ts +26 -0
- package/dist/components/score-analysis-modal.js +141 -0
- package/dist/components/score-analysis-modal.js.map +1 -0
- package/dist/components/score-breakdown.d.ts +17 -0
- package/dist/components/score-breakdown.js +162 -0
- package/dist/components/score-breakdown.js.map +1 -0
- package/dist/components/score-feedback.d.ts +40 -0
- package/dist/components/score-feedback.js +209 -0
- package/dist/components/score-feedback.js.map +1 -0
- package/dist/components/score-ring.d.ts +14 -0
- package/dist/components/score-ring.js +79 -0
- package/dist/components/score-ring.js.map +1 -0
- package/dist/components/scroll-area.d.ts +7 -0
- package/dist/components/scroll-area.js +101 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +17 -0
- package/dist/components/select.js +228 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +6 -0
- package/dist/components/separator.js +61 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +16 -0
- package/dist/components/sheet.js +168 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.d.ts +73 -0
- package/dist/components/sidebar.js +723 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/signal-feedback-inline.d.ts +51 -0
- package/dist/components/signal-feedback-inline.js +548 -0
- package/dist/components/signal-feedback-inline.js.map +1 -0
- package/dist/components/simple-data-table.d.ts +15 -0
- package/dist/components/simple-data-table.js +91 -0
- package/dist/components/simple-data-table.js.map +1 -0
- package/dist/components/skeleton.d.ts +5 -0
- package/dist/components/skeleton.js +44 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/status-badge.d.ts +10 -0
- package/dist/components/status-badge.js +82 -0
- package/dist/components/status-badge.js.map +1 -0
- package/dist/components/styled-bar-list.d.ts +20 -0
- package/dist/components/styled-bar-list.js +59 -0
- package/dist/components/styled-bar-list.js.map +1 -0
- package/dist/components/suggested-actions.d.ts +110 -0
- package/dist/components/suggested-actions.js +1538 -0
- package/dist/components/suggested-actions.js.map +1 -0
- package/dist/components/table.d.ts +12 -0
- package/dist/components/table.js +147 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +14 -0
- package/dist/components/tabs.js +129 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +5 -0
- package/dist/components/textarea.js +47 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/timeline-activity.d.ts +34 -0
- package/dist/components/timeline-activity.js +181 -0
- package/dist/components/timeline-activity.js.map +1 -0
- package/dist/components/tooltip.d.ts +9 -0
- package/dist/components/tooltip.js +93 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/view-mode-toggle.d.ts +16 -0
- package/dist/components/view-mode-toggle.js +24 -0
- package/dist/components/view-mode-toggle.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +21 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/index.d.ts +68 -1878
- package/dist/index.js +69 -10918
- package/dist/index.js.map +1 -1
- package/dist/lib/icons.d.ts +18 -0
- package/dist/lib/icons.js +21 -0
- package/dist/lib/icons.js.map +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +9 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/prototype/index.d.ts +20 -0
- package/dist/prototype/index.js +8 -0
- package/dist/prototype/index.js.map +1 -0
- package/dist/prototype/prototype-accounts-view.d.ts +22 -0
- package/dist/prototype/prototype-accounts-view.js +70 -0
- package/dist/prototype/prototype-accounts-view.js.map +1 -0
- package/dist/prototype/prototype-admin-view.d.ts +21 -0
- package/dist/prototype/prototype-admin-view.js +53 -0
- package/dist/prototype/prototype-admin-view.js.map +1 -0
- package/dist/prototype/prototype-config.d.ts +226 -0
- package/dist/prototype/prototype-config.js +1 -0
- package/dist/prototype/prototype-config.js.map +1 -0
- package/dist/prototype/prototype-inbox-view.d.ts +48 -0
- package/dist/prototype/prototype-inbox-view.js +701 -0
- package/dist/prototype/prototype-inbox-view.js.map +1 -0
- package/dist/prototype/prototype-insights-view.d.ts +23 -0
- package/dist/prototype/prototype-insights-view.js +335 -0
- package/dist/prototype/prototype-insights-view.js.map +1 -0
- package/dist/prototype/prototype-shell.d.ts +40 -0
- package/dist/prototype/prototype-shell.js +190 -0
- package/dist/prototype/prototype-shell.js.map +1 -0
- package/dist/prototype/prototype-work-queue-view.d.ts +8 -0
- package/dist/prototype/prototype-work-queue-view.js +17 -0
- package/dist/prototype/prototype-work-queue-view.js.map +1 -0
- package/dist/three/agent-orb.d.ts +39 -0
- package/dist/three/agent-orb.js +500 -0
- package/dist/three/agent-orb.js.map +1 -0
- package/dist/three/index.d.ts +2 -0
- package/dist/three/index.js +2 -0
- package/dist/three/index.js.map +1 -0
- package/package.json +98 -17
- package/src/charts/bar-chart-component.tsx +150 -0
- package/src/charts/chart-tooltip.tsx +86 -0
- package/src/charts/chart.tsx +371 -0
- package/src/charts/donut-chart.tsx +112 -0
- package/src/charts/index.ts +13 -0
- package/src/charts/pipeline-overview.tsx +476 -0
- package/src/charts/sankey-chart.tsx +290 -0
- package/src/charts/top-line-metrics.tsx +261 -0
- package/src/charts/trend-area-chart.tsx +150 -0
- package/src/charts/volume-analysis-chart.tsx +124 -0
- package/src/components/activity-detail.tsx +233 -0
- package/src/components/activity-log.tsx +89 -0
- package/src/components/agent-popover.tsx +373 -0
- package/src/components/agent-widget.tsx +163 -0
- package/src/components/avatar.tsx +109 -0
- package/src/components/badge.tsx +48 -0
- package/src/components/button.tsx +59 -0
- package/src/components/card.tsx +92 -0
- package/src/components/contact-list.tsx +121 -0
- package/src/components/dashboard-cards.tsx +170 -0
- package/src/components/data-table-display.tsx +139 -0
- package/src/components/data-table-filter.tsx +138 -0
- package/src/components/data-table-quick-views.tsx +103 -0
- package/src/components/data-table-toolbar.tsx +56 -0
- package/src/components/data-table.tsx +915 -0
- package/src/components/detail-view.tsx +237 -0
- package/src/components/dialog.tsx +158 -0
- package/src/components/dropdown-menu.tsx +257 -0
- package/src/components/entity-panel.tsx +767 -0
- package/src/components/inbox-row.tsx +132 -0
- package/src/components/inbox-toolbar.tsx +213 -0
- package/src/components/input.tsx +21 -0
- package/src/components/insights-filter-bar.tsx +132 -0
- package/src/components/item-list-display.tsx +278 -0
- package/src/components/item-list-filter.tsx +118 -0
- package/src/components/item-list-toolbar.tsx +97 -0
- package/src/components/item-list.tsx +843 -0
- package/src/components/label.tsx +24 -0
- package/src/components/message.tsx +83 -0
- package/src/components/metric-card.tsx +178 -0
- package/src/components/performance-metrics-table.tsx +442 -0
- package/src/components/preview-list.tsx +62 -0
- package/src/components/progress.tsx +31 -0
- package/src/components/quick-action-chat-area.tsx +156 -0
- package/src/components/quick-action-modal.tsx +331 -0
- package/src/components/quick-action-sidebar-nav.tsx +592 -0
- package/src/components/recommended-actions-section.tsx +258 -0
- package/src/components/report-card.tsx +106 -0
- package/src/components/score-analysis-modal.tsx +172 -0
- package/src/components/score-breakdown.tsx +179 -0
- package/src/components/score-feedback.tsx +288 -0
- package/src/components/score-ring.tsx +87 -0
- package/src/components/scroll-area.tsx +58 -0
- package/src/components/select.tsx +190 -0
- package/src/components/separator.tsx +28 -0
- package/src/components/sheet.tsx +143 -0
- package/src/components/sidebar.tsx +726 -0
- package/src/components/signal-feedback-inline.tsx +591 -0
- package/src/components/simple-data-table.tsx +124 -0
- package/src/components/skeleton.tsx +15 -0
- package/src/components/status-badge.tsx +63 -0
- package/src/components/styled-bar-list.tsx +70 -0
- package/src/components/suggested-actions.tsx +1985 -0
- package/src/components/table.tsx +116 -0
- package/src/components/tabs.tsx +91 -0
- package/src/components/textarea.tsx +18 -0
- package/src/components/timeline-activity.tsx +234 -0
- package/src/components/tooltip.tsx +57 -0
- package/src/components/view-mode-toggle.tsx +39 -0
- package/src/hooks/use-mobile.ts +21 -0
- package/src/index.ts +77 -0
- package/src/lib/icons.ts +18 -0
- package/src/lib/utils.ts +6 -0
- package/src/prototype/index.ts +11 -0
- package/src/prototype/prototype-accounts-view.tsx +112 -0
- package/src/prototype/prototype-admin-view.tsx +67 -0
- package/src/prototype/prototype-config.ts +243 -0
- package/src/prototype/prototype-inbox-view.tsx +810 -0
- package/src/prototype/prototype-insights-view.tsx +379 -0
- package/src/prototype/prototype-shell.tsx +219 -0
- package/src/prototype/prototype-work-queue-view.tsx +30 -0
- package/src/styles/globals.css +299 -0
- package/src/three/agent-orb.tsx +557 -0
- package/src/three/index.ts +5 -0
- package/src/types/r3f.d.ts +8 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @handled-ai/design-system/prototype
|
|
3
|
+
* Prototype template system (transitively depends on charts)
|
|
4
|
+
*/
|
|
5
|
+
export * from "./prototype-config"
|
|
6
|
+
export * from "./prototype-shell"
|
|
7
|
+
export * from "./prototype-inbox-view"
|
|
8
|
+
export * from "./prototype-insights-view"
|
|
9
|
+
export * from "./prototype-accounts-view"
|
|
10
|
+
export * from "./prototype-admin-view"
|
|
11
|
+
export * from "./prototype-work-queue-view"
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Button } from "../components/button"
|
|
5
|
+
import { Badge } from "../components/badge"
|
|
6
|
+
import { DataTable } from "../components/data-table"
|
|
7
|
+
import type { AccountsViewConfig, AccountFilterTab } from "./prototype-config"
|
|
8
|
+
import type { DataRow } from "../components/data-table"
|
|
9
|
+
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
// Props
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
|
|
14
|
+
export interface PrototypeAccountsViewProps extends AccountsViewConfig {
|
|
15
|
+
headerActions?: React.ReactNode
|
|
16
|
+
onRowClick?: (row: DataRow) => void
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// Defaults
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
|
|
23
|
+
const DEFAULT_FILTER_TABS: AccountFilterTab[] = [
|
|
24
|
+
{ label: "All Accounts", count: 6, variant: "default" },
|
|
25
|
+
{ label: "Needs Attention", count: 11, variant: "attention" },
|
|
26
|
+
{ label: "Recent", count: 7, variant: "ghost" },
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// Component
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
|
|
33
|
+
export function PrototypeAccountsView({
|
|
34
|
+
filterTabs,
|
|
35
|
+
headerActions,
|
|
36
|
+
onRowClick,
|
|
37
|
+
rows,
|
|
38
|
+
filterCategories,
|
|
39
|
+
quickViews,
|
|
40
|
+
moreQuickViews,
|
|
41
|
+
quickViewFilters,
|
|
42
|
+
iconMap,
|
|
43
|
+
entityUrlBuilder,
|
|
44
|
+
onScoreFactorFeedback,
|
|
45
|
+
onScoreApproveFeedback,
|
|
46
|
+
onScoreDismissFeedback,
|
|
47
|
+
}: PrototypeAccountsViewProps) {
|
|
48
|
+
const tabs = filterTabs ?? DEFAULT_FILTER_TABS
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div className="flex flex-col h-full w-full bg-background relative">
|
|
52
|
+
{headerActions && (
|
|
53
|
+
<div className="absolute top-4 right-4 z-10">{headerActions}</div>
|
|
54
|
+
)}
|
|
55
|
+
|
|
56
|
+
<div className="px-4 py-3 border-b border-border flex items-center gap-2 overflow-x-auto shrink-0 mt-2">
|
|
57
|
+
{tabs.map((tab, i) => {
|
|
58
|
+
if (tab.variant === "attention") {
|
|
59
|
+
return (
|
|
60
|
+
<Button key={i} size="sm" className="h-7 text-xs rounded-md bg-emerald-600 hover:bg-emerald-700 text-white font-medium">
|
|
61
|
+
{tab.label}
|
|
62
|
+
{tab.count != null && (
|
|
63
|
+
<Badge variant="secondary" className="ml-2 h-4 px-1.5 text-[10px] bg-white/20 text-white border-transparent">
|
|
64
|
+
{tab.count}
|
|
65
|
+
</Badge>
|
|
66
|
+
)}
|
|
67
|
+
</Button>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
if (tab.variant === "ghost") {
|
|
71
|
+
return (
|
|
72
|
+
<Button key={i} variant="ghost" size="sm" className="h-7 text-xs rounded-md border border-border bg-transparent font-medium">
|
|
73
|
+
{tab.label}
|
|
74
|
+
{tab.count != null && (
|
|
75
|
+
<Badge variant="secondary" className="ml-2 h-4 px-1.5 text-[10px]">
|
|
76
|
+
{tab.count}
|
|
77
|
+
</Badge>
|
|
78
|
+
)}
|
|
79
|
+
</Button>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
return (
|
|
83
|
+
<Button key={i} variant="secondary" size="sm" className="h-7 text-xs rounded-md bg-muted font-medium">
|
|
84
|
+
{tab.label}
|
|
85
|
+
{tab.count != null && (
|
|
86
|
+
<Badge variant="outline" className="ml-2 h-4 px-1.5 text-[10px]">
|
|
87
|
+
{tab.count}
|
|
88
|
+
</Badge>
|
|
89
|
+
)}
|
|
90
|
+
</Button>
|
|
91
|
+
)
|
|
92
|
+
})}
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<div className="flex-1 overflow-auto">
|
|
96
|
+
<DataTable
|
|
97
|
+
onRowClick={onRowClick}
|
|
98
|
+
rows={rows}
|
|
99
|
+
filterCategories={filterCategories}
|
|
100
|
+
quickViews={quickViews}
|
|
101
|
+
moreQuickViews={moreQuickViews}
|
|
102
|
+
quickViewFilters={quickViewFilters}
|
|
103
|
+
iconMap={iconMap}
|
|
104
|
+
entityUrlBuilder={entityUrlBuilder}
|
|
105
|
+
onScoreFactorFeedback={onScoreFactorFeedback}
|
|
106
|
+
onScoreApproveFeedback={onScoreApproveFeedback}
|
|
107
|
+
onScoreDismissFeedback={onScoreDismissFeedback}
|
|
108
|
+
/>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
)
|
|
112
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Settings } from "lucide-react"
|
|
5
|
+
import { Tabs, TabsList, TabsTrigger, TabsContent } from "../components/tabs"
|
|
6
|
+
import type { AdminViewConfig } from "./prototype-config"
|
|
7
|
+
|
|
8
|
+
export interface PrototypeAdminViewProps extends AdminViewConfig {
|
|
9
|
+
headerActions?: React.ReactNode
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function PrototypeAdminView({
|
|
13
|
+
title = "Admin",
|
|
14
|
+
icon: Icon = Settings,
|
|
15
|
+
tabs,
|
|
16
|
+
defaultTab,
|
|
17
|
+
headerActions,
|
|
18
|
+
}: PrototypeAdminViewProps) {
|
|
19
|
+
const resolvedDefault = defaultTab ?? tabs[0]?.id
|
|
20
|
+
|
|
21
|
+
if (!tabs.length) return null
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div className="flex h-full w-full flex-col overflow-hidden bg-background">
|
|
25
|
+
<div className="shrink-0 border-b border-border bg-background">
|
|
26
|
+
<div className="flex items-center justify-between px-6 py-4">
|
|
27
|
+
<div className="flex items-center gap-2 text-lg font-bold text-foreground">
|
|
28
|
+
<Icon className="h-5 w-5" />
|
|
29
|
+
<span>{title}</span>
|
|
30
|
+
</div>
|
|
31
|
+
{headerActions}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div className="flex-1 overflow-auto p-8">
|
|
36
|
+
<div className="mx-auto max-w-6xl">
|
|
37
|
+
<Tabs defaultValue={resolvedDefault} className="w-full space-y-8">
|
|
38
|
+
<div className="flex justify-start">
|
|
39
|
+
<TabsList className="h-9 rounded-lg border border-border/50 bg-muted/50 p-1">
|
|
40
|
+
{tabs.map((tab) => (
|
|
41
|
+
<TabsTrigger
|
|
42
|
+
key={tab.id}
|
|
43
|
+
value={tab.id}
|
|
44
|
+
className="gap-2 rounded-md px-3 py-1.5 text-xs font-medium transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"
|
|
45
|
+
>
|
|
46
|
+
{tab.icon && <tab.icon className="h-3.5 w-3.5" />}
|
|
47
|
+
{tab.label}
|
|
48
|
+
</TabsTrigger>
|
|
49
|
+
))}
|
|
50
|
+
</TabsList>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
{tabs.map((tab) => (
|
|
54
|
+
<TabsContent
|
|
55
|
+
key={tab.id}
|
|
56
|
+
value={tab.id}
|
|
57
|
+
className="space-y-6 focus-visible:outline-none"
|
|
58
|
+
>
|
|
59
|
+
{tab.content}
|
|
60
|
+
</TabsContent>
|
|
61
|
+
))}
|
|
62
|
+
</Tabs>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import type { SidebarNavSection } from "../components/quick-action-sidebar-nav"
|
|
3
|
+
import type { ScoreFactor } from "../components/score-breakdown"
|
|
4
|
+
import type { SuggestedAction, SuggestedContact } from "../components/suggested-actions"
|
|
5
|
+
import type { SourceDef } from "../components/detail-view"
|
|
6
|
+
import type { InboxFilterCategory } from "../components/inbox-toolbar"
|
|
7
|
+
import type { DataTableFilterCategory } from "../components/data-table-filter"
|
|
8
|
+
import type { DataRow } from "../components/data-table"
|
|
9
|
+
import type { MetricCardProps } from "../components/metric-card"
|
|
10
|
+
import type {
|
|
11
|
+
PipelineStage,
|
|
12
|
+
PipelineStageMetrics,
|
|
13
|
+
PipelineStageTiming,
|
|
14
|
+
} from "../charts/pipeline-overview"
|
|
15
|
+
import type { TimelineEvent } from "../components/timeline-activity"
|
|
16
|
+
import type { LucideIcon } from "lucide-react"
|
|
17
|
+
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// Shared
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
|
|
22
|
+
export interface PrototypeBrandConfig {
|
|
23
|
+
name: string
|
|
24
|
+
logo?: string
|
|
25
|
+
assistantName?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface QueueItem {
|
|
29
|
+
id: string
|
|
30
|
+
title: string
|
|
31
|
+
details: string
|
|
32
|
+
statusColor: string
|
|
33
|
+
time: string
|
|
34
|
+
company: string
|
|
35
|
+
tag1: string
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface SignalScoreData {
|
|
39
|
+
score: number
|
|
40
|
+
factors: ScoreFactor[]
|
|
41
|
+
whyNow: string
|
|
42
|
+
evidence: string[]
|
|
43
|
+
confidence: number
|
|
44
|
+
onFactorFeedback?: (factorKey: string, type: "up" | "down" | null, detail?: string) => void
|
|
45
|
+
onApproveFeedback?: (reasons: string[], detail: string) => void
|
|
46
|
+
onDismissFeedback?: (reasons: string[], detail: string) => void
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ---------------------------------------------------------------------------
|
|
50
|
+
// Inbox
|
|
51
|
+
// ---------------------------------------------------------------------------
|
|
52
|
+
|
|
53
|
+
export interface InboxDetailSections {
|
|
54
|
+
signalBrief?: boolean
|
|
55
|
+
suggestedActions?: boolean
|
|
56
|
+
timeline?: boolean
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface InboxViewConfig {
|
|
60
|
+
items: QueueItem[]
|
|
61
|
+
filterCategories?: InboxFilterCategory[]
|
|
62
|
+
detailSections?: InboxDetailSections
|
|
63
|
+
accountContacts?: SuggestedContact[]
|
|
64
|
+
buildAccountContacts?: (item: QueueItem) => SuggestedContact[]
|
|
65
|
+
emailSignature?: string | React.ReactNode
|
|
66
|
+
buildSuggestedActions?: (item: QueueItem) => SuggestedAction[]
|
|
67
|
+
buildSourceItems?: (item: QueueItem) => SourceDef[]
|
|
68
|
+
getSignalScore?: (company: string) => SignalScoreData
|
|
69
|
+
getTimelineEvents?: (item: QueueItem) => TimelineEvent[]
|
|
70
|
+
iconMap?: Record<string, string>
|
|
71
|
+
hideToolbarActions?: boolean
|
|
72
|
+
hideHoverActions?: boolean
|
|
73
|
+
onSuggestedActionFeedback?: (actionId: number | string, feedback: string, actionTitle?: string) => void
|
|
74
|
+
buildEntityChips?: (item: QueueItem) => Array<{ id: string; label: string; avatarLetter: string; onClick?: () => void }>
|
|
75
|
+
quickFilterTabs?: Array<{ id: string; label: string; matchValue?: string; count?: number }>
|
|
76
|
+
hideAccountsButton?: boolean
|
|
77
|
+
accountDetailsLabel?: string
|
|
78
|
+
signalLabels?: {
|
|
79
|
+
approveButton?: string
|
|
80
|
+
dismissButton?: string
|
|
81
|
+
approvedStatus?: string
|
|
82
|
+
dismissedStatus?: string
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
// Insights
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
|
|
90
|
+
export interface InsightsCustomTab {
|
|
91
|
+
id: string
|
|
92
|
+
label: string
|
|
93
|
+
icon?: React.ComponentType<{ className?: string }>
|
|
94
|
+
content: React.ReactNode
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface InsightsViewConfig {
|
|
98
|
+
customTabs?: InsightsCustomTab[]
|
|
99
|
+
tabs?: {
|
|
100
|
+
overview?: boolean
|
|
101
|
+
analytics?: boolean
|
|
102
|
+
}
|
|
103
|
+
coaching?: {
|
|
104
|
+
enabled?: boolean
|
|
105
|
+
message?: string
|
|
106
|
+
}
|
|
107
|
+
metrics?: MetricCardProps[]
|
|
108
|
+
expandedMetrics?: MetricCardProps[]
|
|
109
|
+
dashboardCards?: {
|
|
110
|
+
topTasks?: boolean
|
|
111
|
+
upcomingMeetings?: boolean
|
|
112
|
+
recentlyCompleted?: boolean
|
|
113
|
+
checkIns?: boolean
|
|
114
|
+
}
|
|
115
|
+
analytics?: {
|
|
116
|
+
pipeline?: {
|
|
117
|
+
stages: PipelineStage[]
|
|
118
|
+
stageMetrics: Record<string, PipelineStageMetrics>
|
|
119
|
+
stageTimings: (PipelineStageTiming | null)[]
|
|
120
|
+
filterBreakdowns?: Record<
|
|
121
|
+
string,
|
|
122
|
+
Record<string, Record<string, number>>
|
|
123
|
+
>
|
|
124
|
+
}
|
|
125
|
+
volumeChart?: {
|
|
126
|
+
data: Record<string, unknown>[]
|
|
127
|
+
dataKeys: Array<{ key: string; color: string }>
|
|
128
|
+
filterOptions?: Array<{ label: string; value: string }>
|
|
129
|
+
}
|
|
130
|
+
donutChart?: {
|
|
131
|
+
data: Array<{ name: string; value: number; color: string }>
|
|
132
|
+
centerLabel?: number
|
|
133
|
+
}
|
|
134
|
+
trendChart?: {
|
|
135
|
+
data: Record<string, unknown>[]
|
|
136
|
+
series: Array<{ dataKey: string; color: string }>
|
|
137
|
+
xAxisKey?: string
|
|
138
|
+
height?: number
|
|
139
|
+
toggleOptions?: string[]
|
|
140
|
+
}
|
|
141
|
+
barChart?: {
|
|
142
|
+
data: Record<string, unknown>[]
|
|
143
|
+
bars: Array<{
|
|
144
|
+
dataKey: string
|
|
145
|
+
color: string
|
|
146
|
+
name: string
|
|
147
|
+
icon?: LucideIcon
|
|
148
|
+
}>
|
|
149
|
+
}
|
|
150
|
+
barList?: {
|
|
151
|
+
data: Array<{ name: string; value: number }>
|
|
152
|
+
valueFormatter?: (v: number) => string
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// ---------------------------------------------------------------------------
|
|
158
|
+
// Accounts
|
|
159
|
+
// ---------------------------------------------------------------------------
|
|
160
|
+
|
|
161
|
+
export interface AccountFilterTab {
|
|
162
|
+
label: string
|
|
163
|
+
count?: number
|
|
164
|
+
variant?: "default" | "attention" | "ghost"
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface AccountsViewConfig {
|
|
168
|
+
filterTabs?: AccountFilterTab[]
|
|
169
|
+
rows?: DataRow[]
|
|
170
|
+
filterCategories?: DataTableFilterCategory[]
|
|
171
|
+
quickViews?: string[]
|
|
172
|
+
moreQuickViews?: string[]
|
|
173
|
+
quickViewFilters?: Record<string, (row: DataRow) => boolean>
|
|
174
|
+
iconMap?: { salesforce?: string }
|
|
175
|
+
entityUrlBuilder?: (row: DataRow) => string
|
|
176
|
+
onScoreFactorFeedback?: (account: string, scoreType: string, factorKey: string, type: "up" | "down" | null, detail?: string) => void
|
|
177
|
+
onScoreApproveFeedback?: (account: string, scoreType: string, reasons: string[], detail: string) => void
|
|
178
|
+
onScoreDismissFeedback?: (account: string, scoreType: string, reasons: string[], detail: string) => void
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// ---------------------------------------------------------------------------
|
|
182
|
+
// Work Queue
|
|
183
|
+
// ---------------------------------------------------------------------------
|
|
184
|
+
|
|
185
|
+
export interface WorkQueueViewConfig {
|
|
186
|
+
// Extensible – ItemList manages its own data internally for now.
|
|
187
|
+
[key: string]: unknown
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
// Admin
|
|
192
|
+
// ---------------------------------------------------------------------------
|
|
193
|
+
|
|
194
|
+
export interface AdminTab {
|
|
195
|
+
id: string
|
|
196
|
+
label: string
|
|
197
|
+
icon?: React.ComponentType<{ className?: string }>
|
|
198
|
+
content: React.ReactNode
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface AdminViewConfig {
|
|
202
|
+
/** View title displayed in the header. Defaults to "Admin". */
|
|
203
|
+
title?: string
|
|
204
|
+
/** Icon displayed next to the title. */
|
|
205
|
+
icon?: React.ComponentType<{ className?: string }>
|
|
206
|
+
tabs: AdminTab[]
|
|
207
|
+
/** Which tab is active initially. Defaults to first tab's id. */
|
|
208
|
+
defaultTab?: string
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// ---------------------------------------------------------------------------
|
|
212
|
+
// Entity Panel
|
|
213
|
+
// ---------------------------------------------------------------------------
|
|
214
|
+
|
|
215
|
+
export interface EntityPanelSection {
|
|
216
|
+
type: "details" | "contacts" | "recentActivity" | "connectedApps" | "systemActivity"
|
|
217
|
+
props?: Record<string, unknown>
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export interface EntityPanelConfig {
|
|
221
|
+
sections?: EntityPanelSection[]
|
|
222
|
+
icons?: Record<string, string>
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// ---------------------------------------------------------------------------
|
|
226
|
+
// Top-level config
|
|
227
|
+
// ---------------------------------------------------------------------------
|
|
228
|
+
|
|
229
|
+
export interface PrototypeConfig {
|
|
230
|
+
brand?: PrototypeBrandConfig
|
|
231
|
+
sidebar: SidebarNavSection[]
|
|
232
|
+
views: {
|
|
233
|
+
inbox?: InboxViewConfig
|
|
234
|
+
insights?: InsightsViewConfig
|
|
235
|
+
accounts?: AccountsViewConfig
|
|
236
|
+
workQueue?: WorkQueueViewConfig
|
|
237
|
+
admin?: AdminViewConfig
|
|
238
|
+
}
|
|
239
|
+
defaultView: string
|
|
240
|
+
entityPanel?: EntityPanelConfig
|
|
241
|
+
/** Sidebar item IDs that trigger view navigation. Defaults to keys of `views`. */
|
|
242
|
+
navigableViews?: string[]
|
|
243
|
+
}
|