@handled-ai/design-system 0.2.1 → 0.3.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/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { clsx } from 'clsx';
2
2
  import { twMerge } from 'tailwind-merge';
3
3
  import * as React52 from 'react';
4
- import { AlertCircle, Phone, Mail, MessageSquare, ArrowLeft, ExternalLink, ChevronDown, ArrowRight, Plus, Square, Video, Clock, Eye, CheckCircle2, CheckSquare, CheckIcon, CircleIcon, ChevronRightIcon, X, ListFilter, Search, ChevronDownIcon, ChevronUpIcon, LayoutGrid, ArrowUpDown, ArrowDown, ArrowUp, XIcon, ThumbsUp, ThumbsDown, Check, CirclePlus, Lock, ChevronUp, Briefcase, History, Calendar, DollarSign, Users, TrendingUp, User, Link, SearchX, CalendarDays, Minimize2, Maximize2, MessageCircle, FileText, Building2, List, Filter, SlidersHorizontal, LayoutTemplate, ArrowDownAZ, ArrowUpAZ, RotateCcw, Info, ChevronLeft, ChevronRight, Paperclip, Inbox, Building, Activity, BarChart2, MoreHorizontal, Settings, Code, LogOut, PanelLeftOpen, PanelLeftClose, MoreVertical, HelpCircle, SkipForward, PanelLeftIcon, Heart, Scale, AlertTriangle, Undo2, Copy, RefreshCw, Redo2, Bold, Italic, Underline, AlignLeft, Trash, PenLine, Sparkles } from 'lucide-react';
4
+ import { AlertCircle, Phone, Mail, MessageSquare, ArrowLeft, ExternalLink, ChevronDown, ArrowRight, Plus, Square, Video, Clock, Eye, CheckCircle2, CheckSquare, CheckIcon, CircleIcon, ChevronRightIcon, X, ListFilter, Search, ChevronDownIcon, ChevronUpIcon, LayoutGrid, ArrowUpDown, ArrowDown, ArrowUp, XIcon, ThumbsUp, ThumbsDown, Check, CirclePlus, Lock, ChevronUp, Briefcase, History, Calendar, DollarSign, Users, TrendingUp, User, Link, SearchX, CalendarDays, Minimize2, Maximize2, MessageCircle, FileText, Building2, List, Filter, SlidersHorizontal, LayoutTemplate, ArrowDownAZ, ArrowUpAZ, RotateCcw, Info, ChevronLeft, ChevronRight, Paperclip, Inbox, Building, Activity, BarChart2, MoreHorizontal, Settings, Code, LogOut, PanelLeftOpen, PanelLeftClose, MoreVertical, HelpCircle, SkipForward, PanelLeftIcon, Tag, Columns2, LayoutList, Heart, Scale, AlertTriangle, Undo2, Copy, RefreshCw, Redo2, Bold, Italic, Underline, AlignLeft, Trash, PenLine, Sparkles } from 'lucide-react';
5
5
  import { cva } from 'class-variance-authority';
6
6
  import { Slot, Avatar as Avatar$1, DropdownMenu as DropdownMenu$1, Select as Select$1, Dialog as Dialog$1, HoverCard as HoverCard$1, Separator as Separator$1, Popover, ScrollArea as ScrollArea$1, Tooltip as Tooltip$1, Progress as Progress$1, Tabs as Tabs$1 } from 'radix-ui';
7
7
  import { format } from 'date-fns';
@@ -5878,8 +5878,11 @@ function NavItemRow({
5878
5878
  item,
5879
5879
  isActive,
5880
5880
  isCollapsed,
5881
+ activeVariant = "default",
5881
5882
  onClick
5882
5883
  }) {
5884
+ const activeClasses = activeVariant === "gradient" ? "bg-gradient-to-r from-primary/10 to-transparent text-primary" : "bg-sidebar-accent text-sidebar-accent-foreground";
5885
+ const iconActiveClasses = activeVariant === "gradient" ? "text-primary" : "";
5883
5886
  const content = /* @__PURE__ */ React52.createElement(
5884
5887
  "button",
5885
5888
  {
@@ -5888,10 +5891,10 @@ function NavItemRow({
5888
5891
  className: cn(
5889
5892
  "flex w-full items-center gap-3 rounded-lg text-sm font-medium transition-colors",
5890
5893
  isCollapsed ? "justify-center p-2" : "px-3 py-2",
5891
- isActive ? "bg-sidebar-accent text-sidebar-accent-foreground" : "text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent"
5894
+ isActive ? activeClasses : "text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent"
5892
5895
  )
5893
5896
  },
5894
- /* @__PURE__ */ React52.createElement(item.icon, { className: cn("shrink-0", isCollapsed ? "w-5 h-5" : "w-4 h-4") }),
5897
+ /* @__PURE__ */ React52.createElement(item.icon, { className: cn("shrink-0", isCollapsed ? "w-5 h-5" : "w-4 h-4", isActive && iconActiveClasses) }),
5895
5898
  !isCollapsed && /* @__PURE__ */ React52.createElement("span", { className: "flex-1 truncate text-left" }, item.label)
5896
5899
  );
5897
5900
  if (isCollapsed) {
@@ -5903,6 +5906,7 @@ function NavSection({
5903
5906
  section,
5904
5907
  activeItemId,
5905
5908
  isCollapsed,
5909
+ activeVariant = "default",
5906
5910
  onNavigate
5907
5911
  }) {
5908
5912
  var _a;
@@ -5932,6 +5936,7 @@ function NavSection({
5932
5936
  item,
5933
5937
  isActive: activeItemId === item.id,
5934
5938
  isCollapsed,
5939
+ activeVariant,
5935
5940
  onClick: () => onNavigate == null ? void 0 : onNavigate(item.id)
5936
5941
  }
5937
5942
  )), !isCollapsed && section.moreItems && section.moreItems.length > 0 && /* @__PURE__ */ React52.createElement(DropdownMenu, null, /* @__PURE__ */ React52.createElement(DropdownMenuTrigger, { className: "flex items-center gap-3 w-full px-3 py-2 rounded-lg text-sm font-medium text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent transition-colors outline-none" }, /* @__PURE__ */ React52.createElement(MoreHorizontal, { className: "shrink-0 w-4 h-4" }), /* @__PURE__ */ React52.createElement("span", { className: "flex-1 text-left" }, "More")), /* @__PURE__ */ React52.createElement(DropdownMenuContent, { align: "start", side: "bottom", className: "w-48" }, section.moreItems.map((item) => /* @__PURE__ */ React52.createElement(
@@ -5950,6 +5955,7 @@ function NavSection({
5950
5955
  item,
5951
5956
  isActive: activeItemId === item.id,
5952
5957
  isCollapsed,
5958
+ activeVariant,
5953
5959
  onClick: () => onNavigate == null ? void 0 : onNavigate(item.id)
5954
5960
  }
5955
5961
  )))));
@@ -5961,6 +5967,7 @@ function QuickActionSidebarNav(_a) {
5961
5967
  brandSubtitle = "Placeholder",
5962
5968
  navSections = DEFAULT_NAV_SECTIONS,
5963
5969
  activeItemId = "inbox",
5970
+ activeVariant = "default",
5964
5971
  onNavigate,
5965
5972
  user = DEFAULT_USER,
5966
5973
  userMenuItems = DEFAULT_USER_MENU,
@@ -5973,6 +5980,7 @@ function QuickActionSidebarNav(_a) {
5973
5980
  "brandSubtitle",
5974
5981
  "navSections",
5975
5982
  "activeItemId",
5983
+ "activeVariant",
5976
5984
  "onNavigate",
5977
5985
  "user",
5978
5986
  "userMenuItems",
@@ -6024,6 +6032,7 @@ function QuickActionSidebarNav(_a) {
6024
6032
  section,
6025
6033
  activeItemId,
6026
6034
  isCollapsed,
6035
+ activeVariant,
6027
6036
  onNavigate
6028
6037
  }
6029
6038
  ));
@@ -8765,7 +8774,701 @@ function VolumeAnalysisChart({
8765
8774
  ))
8766
8775
  ))));
8767
8776
  }
8777
+ var DEFAULT_DETAIL_SECTIONS = {
8778
+ signalBrief: true,
8779
+ suggestedActions: true,
8780
+ timeline: true
8781
+ };
8782
+ var DEFAULT_SIGNAL_SCORE = {
8783
+ score: 65,
8784
+ factors: [
8785
+ { key: "trigger", label: "Trigger strength", score: 70, why: "Moderate signal detected based on account activity" },
8786
+ { key: "fit", label: "Company fit", score: 65, why: "Reasonable fit based on company profile" },
8787
+ { key: "timing", label: "Timing", score: 58, why: "Within general evaluation window" }
8788
+ ],
8789
+ whyNow: "Moderate signals detected that warrant review and potential outreach.",
8790
+ evidence: [
8791
+ "Activity patterns suggest potential opportunity",
8792
+ "Company profile aligns with target segment"
8793
+ ],
8794
+ confidence: 72
8795
+ };
8796
+ function DetailView({
8797
+ item,
8798
+ sections,
8799
+ getSignalScore,
8800
+ buildSuggestedActions,
8801
+ buildSourceItems,
8802
+ getTimelineEvents,
8803
+ accountContacts,
8804
+ emailSignature,
8805
+ iconMap,
8806
+ onOpenEntityPanel,
8807
+ onOpenRecentActivity
8808
+ }) {
8809
+ const [evidenceExpanded, setEvidenceExpanded] = React52.useState(false);
8810
+ const [showTimeline, setShowTimeline] = React52.useState(false);
8811
+ const [extraActions, setExtraActions] = React52.useState([]);
8812
+ React52.useEffect(() => {
8813
+ setShowTimeline(false);
8814
+ setEvidenceExpanded(false);
8815
+ setExtraActions([]);
8816
+ }, [item.id]);
8817
+ const suggestedActions = React52.useMemo(
8818
+ () => [...buildSuggestedActions(item), ...extraActions],
8819
+ [buildSuggestedActions, item, extraActions]
8820
+ );
8821
+ const sourceItems = React52.useMemo(() => buildSourceItems(item), [buildSourceItems, item]);
8822
+ const timelineEvents = React52.useMemo(
8823
+ () => {
8824
+ var _a;
8825
+ return (_a = getTimelineEvents == null ? void 0 : getTimelineEvents(item)) != null ? _a : [];
8826
+ },
8827
+ [getTimelineEvents, item]
8828
+ );
8829
+ const handleDuplicate = React52.useCallback(
8830
+ (id) => {
8831
+ const base = suggestedActions.find((a) => a.id === id);
8832
+ if (!base || base.type !== "email") return;
8833
+ const clone = __spreadProps(__spreadValues({}, base), {
8834
+ id: `${base.id}-dup-${Date.now()}`,
8835
+ emailMeta: base.emailMeta ? __spreadProps(__spreadValues({}, base.emailMeta), { to: void 0 }) : void 0
8836
+ });
8837
+ setExtraActions((prev) => [...prev, clone]);
8838
+ },
8839
+ [suggestedActions]
8840
+ );
8841
+ return /* @__PURE__ */ React52.createElement(
8842
+ SignalApproval.Root,
8843
+ {
8844
+ companyName: item.company,
8845
+ opportunityUrl: `https://acme.lightning.force.com/lightning/r/Opportunity/006${item.id}/view`,
8846
+ onApprove: () => {
8847
+ console.log("Approved signal:", { taskId: item.id, company: item.company });
8848
+ },
8849
+ onApproveFeedback: (reasons, detail) => {
8850
+ console.log("Approval feedback:", { taskId: item.id, company: item.company, reasons, detail });
8851
+ },
8852
+ onDismiss: (reasons, detail) => {
8853
+ console.log("Dismissed signal:", { taskId: item.id, reasons, detail });
8854
+ }
8855
+ },
8856
+ /* @__PURE__ */ React52.createElement("div", { className: "mx-auto w-full max-w-3xl p-6 pb-12 md:p-8" }, /* @__PURE__ */ React52.createElement("div", { className: "pb-8" }, /* @__PURE__ */ React52.createElement("div", { className: "mb-4 flex items-center gap-2" }, /* @__PURE__ */ React52.createElement(
8857
+ "button",
8858
+ {
8859
+ type: "button",
8860
+ className: "flex items-center gap-1.5 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground"
8861
+ },
8862
+ /* @__PURE__ */ React52.createElement(ArrowLeft, { className: "h-3.5 w-3.5" }),
8863
+ "Back"
8864
+ ), /* @__PURE__ */ React52.createElement("span", { className: "text-muted-foreground/40" }, "\xB7"), /* @__PURE__ */ React52.createElement("span", { className: "text-xs text-muted-foreground" }, item.company)), /* @__PURE__ */ React52.createElement("h1", { className: "mb-3 text-2xl font-bold tracking-tight text-foreground" }, item.title), /* @__PURE__ */ React52.createElement("div", { className: "mb-6 flex flex-wrap items-center gap-2" }, item.statusColor === "red" && /* @__PURE__ */ React52.createElement("div", { className: "inline-flex items-center gap-1 rounded-md bg-red-50 px-2.5 py-1 text-xs font-semibold text-red-700" }, /* @__PURE__ */ React52.createElement("span", { className: "text-[10px] font-bold" }, "!"), " Urgent"), /* @__PURE__ */ React52.createElement("div", { className: "inline-flex items-center gap-1 rounded-md bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground" }, item.tag1), /* @__PURE__ */ React52.createElement(
8865
+ "button",
8866
+ {
8867
+ type: "button",
8868
+ onClick: onOpenEntityPanel,
8869
+ className: "ml-1 inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-muted/30 px-2 py-1 transition-colors hover:bg-muted/50"
8870
+ },
8871
+ /* @__PURE__ */ React52.createElement("div", { className: "flex h-4 w-4 items-center justify-center rounded bg-muted-foreground/10 text-[9px] font-semibold text-muted-foreground" }, item.company.substring(0, 1)),
8872
+ /* @__PURE__ */ React52.createElement("span", { className: "text-xs font-medium text-foreground" }, item.company),
8873
+ /* @__PURE__ */ React52.createElement(ChevronRight, { className: "h-3 w-3 text-muted-foreground/50" })
8874
+ )), sections.signalBrief && (() => {
8875
+ const signalData = getSignalScore(item.company);
8876
+ const pct = signalData.score;
8877
+ const scoreColor = pct >= 70 ? "text-emerald-600" : pct >= 40 ? "text-amber-600" : "text-red-600";
8878
+ const barColor = pct >= 70 ? "bg-emerald-500" : pct >= 40 ? "bg-amber-500" : "bg-red-500";
8879
+ const scoreLabel = pct >= 70 ? "HIGH" : pct >= 40 ? "MEDIUM" : "LOW";
8880
+ const evidenceWithCitations = sourceItems.length >= 4 ? [
8881
+ /* @__PURE__ */ React52.createElement(React52.Fragment, null, "There are ", /* @__PURE__ */ React52.createElement("span", { className: "font-medium text-foreground" }, "3 unusual signals"), " including a large balance outflow and reduced login frequency", /* @__PURE__ */ React52.createElement(Citation, { number: 1, source: sourceItems[0] }), /* @__PURE__ */ React52.createElement(Citation, { number: 2, source: sourceItems[1] }), /* @__PURE__ */ React52.createElement(Citation, { number: 3, source: sourceItems[2] })),
8882
+ /* @__PURE__ */ React52.createElement(React52.Fragment, null, "Scott mentioned in ", /* @__PURE__ */ React52.createElement("span", { className: "font-medium text-foreground" }, "#treasury-questions"), " that they are actively looking for treasury management options", /* @__PURE__ */ React52.createElement(Citation, { number: 4, source: sourceItems[2] })),
8883
+ /* @__PURE__ */ React52.createElement(React52.Fragment, null, "You have a recent email thread regarding optimization options that hasn't been replied to", /* @__PURE__ */ React52.createElement(Citation, { number: 5, source: sourceItems[3] }))
8884
+ ] : signalData.evidence.map((ev, i) => /* @__PURE__ */ React52.createElement("span", { key: i }, ev));
8885
+ return /* @__PURE__ */ React52.createElement("div", { className: "mb-8" }, /* @__PURE__ */ React52.createElement("h3", { className: "text-xs font-bold text-muted-foreground uppercase tracking-wider mb-3" }, "Signal brief"), /* @__PURE__ */ React52.createElement("p", { className: "text-sm text-muted-foreground leading-relaxed mb-2" }, "We detected signals that suggest a potential opportunity with ", item.company, "."), /* @__PURE__ */ React52.createElement("p", { className: "text-sm text-foreground/90 leading-relaxed mb-4" }, signalData.whyNow), /* @__PURE__ */ React52.createElement("div", { className: "mb-5 rounded-md border border-border bg-muted/20 p-3" }, /* @__PURE__ */ React52.createElement("div", { className: "flex items-center justify-between mb-1.5" }, /* @__PURE__ */ React52.createElement("span", { className: "text-[10px] font-bold text-muted-foreground uppercase tracking-wider" }, "Signal Score"), /* @__PURE__ */ React52.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React52.createElement("span", { className: "text-sm font-bold text-foreground" }, signalData.score, "/100"), /* @__PURE__ */ React52.createElement("span", { className: `text-[10px] font-bold uppercase ${scoreColor}` }, scoreLabel))), /* @__PURE__ */ React52.createElement("div", { className: "h-1.5 bg-muted rounded-full overflow-hidden mb-2" }, /* @__PURE__ */ React52.createElement(
8886
+ "div",
8887
+ {
8888
+ className: `h-full rounded-full transition-all duration-500 ${barColor}`,
8889
+ style: { width: `${signalData.score}%` }
8890
+ }
8891
+ )), /* @__PURE__ */ React52.createElement(
8892
+ "button",
8893
+ {
8894
+ type: "button",
8895
+ onClick: () => setEvidenceExpanded((prev) => !prev),
8896
+ className: "flex items-center gap-1 text-[11px] font-medium text-muted-foreground hover:text-foreground transition-colors"
8897
+ },
8898
+ /* @__PURE__ */ React52.createElement(ChevronDown, { className: `h-3 w-3 transition-transform duration-200 ${evidenceExpanded ? "rotate-180" : ""}` }),
8899
+ "View more"
8900
+ ), evidenceExpanded && /* @__PURE__ */ React52.createElement("div", { className: "mt-3 space-y-3" }, /* @__PURE__ */ React52.createElement("ul", { className: "space-y-2" }, evidenceWithCitations.map((ev, index) => /* @__PURE__ */ React52.createElement("li", { key: index, className: "flex items-start gap-2 text-sm" }, /* @__PURE__ */ React52.createElement("div", { className: "w-1.5 h-1.5 bg-primary rounded-full mt-2 flex-shrink-0" }), /* @__PURE__ */ React52.createElement("span", { className: "text-muted-foreground leading-relaxed" }, ev)))), /* @__PURE__ */ React52.createElement(
8901
+ ScoreBreakdown,
8902
+ {
8903
+ factors: signalData.factors,
8904
+ onFactorFeedback: (key, type, detail) => console.log("Signal factor feedback:", { company: item.company, factor: key, type, detail })
8905
+ }
8906
+ ), /* @__PURE__ */ React52.createElement(SignalApproval.Actions, null))), !evidenceExpanded && /* @__PURE__ */ React52.createElement(SignalApproval.Actions, null));
8907
+ })(), sections.timeline && timelineEvents.length > 0 && /* @__PURE__ */ React52.createElement("div", { className: "mb-8" }, /* @__PURE__ */ React52.createElement(
8908
+ "button",
8909
+ {
8910
+ type: "button",
8911
+ onClick: () => setShowTimeline((prev) => !prev),
8912
+ className: "group/timeline flex w-full items-center justify-between gap-2 py-2 rounded-md transition-colors hover:bg-muted/40 -mx-2 px-2 cursor-pointer"
8913
+ },
8914
+ /* @__PURE__ */ React52.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React52.createElement("h3", { className: "text-xs font-bold text-muted-foreground uppercase tracking-wider group-hover/timeline:text-foreground transition-colors" }, "Activity timeline"), !showTimeline && /* @__PURE__ */ React52.createElement("span", { className: "text-[11px] text-muted-foreground/60" }, "\xB7 Last activity 1d ago")),
8915
+ /* @__PURE__ */ React52.createElement("div", { className: "flex items-center gap-1.5" }, /* @__PURE__ */ React52.createElement("span", { className: "text-[11px] font-medium text-muted-foreground" }, timelineEvents.length, " events"), /* @__PURE__ */ React52.createElement(ChevronDown, { className: `h-3.5 w-3.5 text-muted-foreground transition-transform duration-200 ${showTimeline ? "rotate-180" : ""}` }))
8916
+ ), showTimeline && /* @__PURE__ */ React52.createElement("div", { className: "mt-3" }, /* @__PURE__ */ React52.createElement(TimelineActivity, { events: timelineEvents })))), sections.suggestedActions && /* @__PURE__ */ React52.createElement(SignalApproval.Gate, null, /* @__PURE__ */ React52.createElement(
8917
+ SuggestedActions,
8918
+ {
8919
+ actions: suggestedActions,
8920
+ accountContacts,
8921
+ signature: emailSignature,
8922
+ iconMap,
8923
+ onDismiss: (id) => console.log("Dismiss action:", id),
8924
+ onSend: (id) => console.log("Send action:", id),
8925
+ onSaveDraft: (id) => console.log("Save draft:", id),
8926
+ onDuplicate: handleDuplicate,
8927
+ onOpenAccountDetails: onOpenEntityPanel,
8928
+ onOpenRecentActivity,
8929
+ onMarkComplete: (id) => console.log("Mark complete:", id),
8930
+ onDispatchAgent: (id) => console.log("Dispatch agent:", id)
8931
+ }
8932
+ )))
8933
+ );
8934
+ }
8935
+ function PrototypeInboxView({
8936
+ items,
8937
+ filterCategories,
8938
+ detailSections,
8939
+ accountContacts = [],
8940
+ emailSignature = "",
8941
+ buildSuggestedActions: buildSuggestedActionsProp,
8942
+ buildSourceItems: buildSourceItemsProp,
8943
+ getSignalScore: getSignalScoreProp,
8944
+ getTimelineEvents,
8945
+ iconMap = {},
8946
+ headerActions,
8947
+ onOpenEntityPanel,
8948
+ onOpenRecentActivity
8949
+ }) {
8950
+ const [inboxViewMode, setInboxViewMode] = React52.useState("inbox");
8951
+ const [previousViewMode, setPreviousViewMode] = React52.useState("inbox");
8952
+ const [selectedTask, setSelectedTask] = React52.useState(items[0]);
8953
+ const [inboxAssignee, setInboxAssignee] = React52.useState("me");
8954
+ const [inboxFilters, setInboxFilters] = React52.useState({});
8955
+ const sections = React52.useMemo(
8956
+ () => __spreadValues(__spreadValues({}, DEFAULT_DETAIL_SECTIONS), detailSections),
8957
+ [detailSections]
8958
+ );
8959
+ const resolvedFilterCategories = React52.useMemo(
8960
+ () => filterCategories != null ? filterCategories : [
8961
+ {
8962
+ id: "category",
8963
+ label: "Category",
8964
+ icon: /* @__PURE__ */ React52.createElement(Tag, { className: "h-3.5 w-3.5 text-muted-foreground" }),
8965
+ options: [...new Set(items.map((i) => i.tag1))]
8966
+ },
8967
+ {
8968
+ id: "account",
8969
+ label: "Account",
8970
+ icon: /* @__PURE__ */ React52.createElement(Building, { className: "h-3.5 w-3.5 text-muted-foreground" }),
8971
+ options: [...new Set(items.map((i) => i.company))]
8972
+ }
8973
+ ],
8974
+ [filterCategories, items]
8975
+ );
8976
+ const buildSuggestedActions = React52.useMemo(
8977
+ () => buildSuggestedActionsProp != null ? buildSuggestedActionsProp : (() => []),
8978
+ [buildSuggestedActionsProp]
8979
+ );
8980
+ const buildSourceItems = React52.useMemo(
8981
+ () => buildSourceItemsProp != null ? buildSourceItemsProp : (() => []),
8982
+ [buildSourceItemsProp]
8983
+ );
8984
+ const getSignalScore = React52.useMemo(
8985
+ () => getSignalScoreProp != null ? getSignalScoreProp : (() => DEFAULT_SIGNAL_SCORE),
8986
+ [getSignalScoreProp]
8987
+ );
8988
+ const inboxGroups = React52.useMemo(() => {
8989
+ const urgent = items.filter((i) => i.statusColor === "red");
8990
+ const active = items.filter((i) => i.statusColor !== "red");
8991
+ return [
8992
+ { key: "urgent", label: "Urgent", items: urgent },
8993
+ { key: "active", label: "Active", items: active }
8994
+ ].filter((g) => g.items.length > 0);
8995
+ }, [items]);
8996
+ const renderInboxRow = React52.useCallback(
8997
+ (item) => /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement("span", { className: `h-2 w-2 shrink-0 rounded-full ${item.statusColor === "red" ? "bg-[#f43f5e]" : "bg-[#3b82f6]"}` }), /* @__PURE__ */ React52.createElement("span", { className: "w-[80px] shrink-0 font-mono text-xs text-muted-foreground/80" }, item.id), /* @__PURE__ */ React52.createElement("span", { className: "shrink-0 rounded-md border border-border bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground whitespace-nowrap" }, item.tag1), /* @__PURE__ */ React52.createElement("span", { className: "min-w-0 flex-1 truncate text-sm font-semibold text-foreground" }, item.title), /* @__PURE__ */ React52.createElement("span", { className: "w-[120px] shrink-0 truncate text-xs font-medium text-foreground" }, item.company), /* @__PURE__ */ React52.createElement("span", { className: "w-[80px] shrink-0 text-right text-xs text-muted-foreground" }, item.time)),
8998
+ []
8999
+ );
9000
+ const handleInboxItemSelect = React52.useCallback(
9001
+ (item) => {
9002
+ setSelectedTask(item);
9003
+ if (inboxViewMode === "list") {
9004
+ setPreviousViewMode("list");
9005
+ setInboxViewMode("detail");
9006
+ }
9007
+ },
9008
+ [inboxViewMode]
9009
+ );
9010
+ const handleBackFromDetail = React52.useCallback(() => {
9011
+ setInboxViewMode(previousViewMode);
9012
+ }, [previousViewMode]);
9013
+ const handleViewModeChange = React52.useCallback((id) => {
9014
+ const mode = id;
9015
+ if (mode !== "detail") {
9016
+ setPreviousViewMode(mode);
9017
+ }
9018
+ setInboxViewMode(mode);
9019
+ }, []);
9020
+ React52.useEffect(() => {
9021
+ const mql = window.matchMedia("(max-width: 768px)");
9022
+ function handleChange(e) {
9023
+ if (e.matches && inboxViewMode === "inbox") {
9024
+ setPreviousViewMode("inbox");
9025
+ setInboxViewMode("detail");
9026
+ }
9027
+ }
9028
+ handleChange(mql);
9029
+ mql.addEventListener("change", handleChange);
9030
+ return () => mql.removeEventListener("change", handleChange);
9031
+ }, [inboxViewMode]);
9032
+ const detailViewProps = {
9033
+ item: selectedTask,
9034
+ sections,
9035
+ getSignalScore,
9036
+ buildSuggestedActions,
9037
+ buildSourceItems,
9038
+ getTimelineEvents,
9039
+ accountContacts,
9040
+ emailSignature,
9041
+ iconMap,
9042
+ onOpenEntityPanel,
9043
+ onOpenRecentActivity
9044
+ };
9045
+ return /* @__PURE__ */ React52.createElement("div", { className: "flex h-full w-full flex-col" }, /* @__PURE__ */ React52.createElement("div", { className: "flex items-center justify-between border-b border-border bg-background px-4 py-3 shrink-0" }, /* @__PURE__ */ React52.createElement("div", { className: "flex items-center gap-3" }, inboxViewMode === "detail" ? /* @__PURE__ */ React52.createElement(
9046
+ "button",
9047
+ {
9048
+ type: "button",
9049
+ onClick: handleBackFromDetail,
9050
+ className: "flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors"
9051
+ },
9052
+ /* @__PURE__ */ React52.createElement(ArrowLeft, { className: "h-4 w-4" }),
9053
+ "Back"
9054
+ ) : null, /* @__PURE__ */ React52.createElement("h2", { className: "text-lg font-semibold text-foreground" }, "Inbox"), /* @__PURE__ */ React52.createElement(Badge, { variant: "secondary", className: "bg-muted text-muted-foreground hover:bg-muted font-medium text-[11px] px-2 py-0.5 rounded-md" }, items.length)), /* @__PURE__ */ React52.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React52.createElement(
9055
+ ViewModeToggle,
9056
+ {
9057
+ modes: [
9058
+ { id: "inbox", icon: /* @__PURE__ */ React52.createElement(Columns2, { className: "h-3.5 w-3.5" }), label: "Split View" },
9059
+ { id: "list", icon: /* @__PURE__ */ React52.createElement(LayoutList, { className: "h-3.5 w-3.5" }), label: "List View" },
9060
+ { id: "detail", icon: /* @__PURE__ */ React52.createElement(Square, { className: "h-3.5 w-3.5" }), label: "Detail View" }
9061
+ ],
9062
+ activeMode: inboxViewMode,
9063
+ onModeChange: handleViewModeChange
9064
+ }
9065
+ ), headerActions)), inboxViewMode === "detail" ? /* @__PURE__ */ React52.createElement("div", { className: "flex h-full flex-1 flex-col overflow-hidden bg-background" }, /* @__PURE__ */ React52.createElement("div", { className: "flex-1 overflow-y-auto" }, /* @__PURE__ */ React52.createElement(DetailView, __spreadValues({}, detailViewProps)))) : inboxViewMode === "list" ? /* @__PURE__ */ React52.createElement("div", { className: "flex-1 overflow-y-auto bg-background" }, /* @__PURE__ */ React52.createElement(
9066
+ InboxToolbar,
9067
+ {
9068
+ assignee: inboxAssignee,
9069
+ onAssigneeChange: setInboxAssignee,
9070
+ filterCategories: resolvedFilterCategories,
9071
+ selectedFilters: inboxFilters,
9072
+ onFilterChange: (catId, val) => setInboxFilters((prev) => __spreadProps(__spreadValues({}, prev), { [catId]: val })),
9073
+ onClearFilters: () => setInboxFilters({})
9074
+ }
9075
+ ), /* @__PURE__ */ React52.createElement(
9076
+ GroupedListView,
9077
+ {
9078
+ groups: inboxGroups,
9079
+ renderRow: renderInboxRow,
9080
+ getItemKey: (item) => item.id,
9081
+ selectedKey: selectedTask.id,
9082
+ onItemClick: handleInboxItemSelect,
9083
+ emptyMessage: "No inbox items"
9084
+ }
9085
+ )) : (
9086
+ /* Split view */
9087
+ /* @__PURE__ */ React52.createElement("div", { className: "flex h-full min-h-0 w-full flex-1" }, /* @__PURE__ */ React52.createElement("div", { className: "flex h-full min-w-[380px] w-[380px] flex-col border-r border-border bg-background shadow-sm z-10" }, /* @__PURE__ */ React52.createElement("div", { className: "flex flex-col gap-4 border-b border-border p-4 shrink-0" }, /* @__PURE__ */ React52.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React52.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React52.createElement(Button, { variant: "outline", size: "icon", className: "h-8 w-8 text-muted-foreground" }, /* @__PURE__ */ React52.createElement(Eye, { className: "w-4 h-4" })), /* @__PURE__ */ React52.createElement(Button, { variant: "outline", size: "icon", className: "h-8 w-8 text-muted-foreground" }, /* @__PURE__ */ React52.createElement(FileText, { className: "w-4 h-4" })), /* @__PURE__ */ React52.createElement(Button, { variant: "outline", size: "icon", className: "h-8 w-8 text-muted-foreground" }, /* @__PURE__ */ React52.createElement(Clock, { className: "w-4 h-4" })), /* @__PURE__ */ React52.createElement(Button, { variant: "outline", size: "icon", className: "h-8 w-8 text-muted-foreground" }, /* @__PURE__ */ React52.createElement(CheckSquare, { className: "w-4 h-4" }))), /* @__PURE__ */ React52.createElement(Button, { size: "sm", className: "h-8 px-4 bg-foreground text-background hover:bg-foreground/90 text-xs font-semibold gap-1.5 rounded-md" }, /* @__PURE__ */ React52.createElement(Plus, { className: "w-4 h-4" }), " Add Task")), /* @__PURE__ */ React52.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React52.createElement("div", { className: "relative flex-1" }, /* @__PURE__ */ React52.createElement(Filter, { className: "absolute left-2.5 top-1.5 w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React52.createElement(Input, { className: "h-8 pl-8 text-xs bg-background border-border rounded-md shadow-none", placeholder: "Categories" })), /* @__PURE__ */ React52.createElement(Button, { variant: "outline", size: "sm", className: "h-8 text-xs font-medium rounded-md shadow-none" }, /* @__PURE__ */ React52.createElement(Building, { className: "w-3.5 h-3.5 mr-1.5" }), " Accounts")), /* @__PURE__ */ React52.createElement("div", { className: "flex items-center gap-1.5 overflow-x-auto pb-1 mt-1 scrollbar-hide" }, /* @__PURE__ */ React52.createElement(Button, { size: "sm", className: "h-7 rounded-full px-3.5 text-[11px] font-semibold bg-foreground text-background hover:bg-foreground/90 shadow-none" }, "All"), /* @__PURE__ */ React52.createElement(Button, { variant: "outline", size: "sm", className: "h-7 rounded-full px-3.5 text-[11px] font-medium bg-transparent border-border text-muted-foreground hover:text-foreground shadow-none" }, "Outbound (10)"), /* @__PURE__ */ React52.createElement(Button, { variant: "outline", size: "sm", className: "h-7 rounded-full px-3.5 text-[11px] font-medium bg-transparent border-border text-muted-foreground hover:text-foreground shadow-none" }, "Retention (12)"), /* @__PURE__ */ React52.createElement(Button, { variant: "outline", size: "sm", className: "h-7 rounded-full px-3.5 text-[11px] font-medium bg-transparent border-border text-muted-foreground hover:text-foreground shadow-none" }, "Relationship (9)"))), /* @__PURE__ */ React52.createElement("div", { className: "flex-1 overflow-y-auto" }, items.map((item) => /* @__PURE__ */ React52.createElement(
9088
+ "div",
9089
+ {
9090
+ key: item.id,
9091
+ onClick: () => setSelectedTask(item),
9092
+ className: `cursor-pointer border-b border-border p-4 transition-colors group relative border-l-2 ${selectedTask.id === item.id ? "bg-muted/30 border-l-brand-purple" : "bg-transparent border-l-transparent hover:bg-muted/10"}`
9093
+ },
9094
+ /* @__PURE__ */ React52.createElement("div", { className: "mb-1.5 flex items-center gap-2" }, /* @__PURE__ */ React52.createElement("span", { className: "min-w-0 truncate text-[13px] font-semibold text-foreground leading-tight" }, item.title), selectedTask.id !== item.id && item.tag1 && /* @__PURE__ */ React52.createElement("span", { className: "shrink-0 rounded-md border border-border bg-muted/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground" }, item.tag1), /* @__PURE__ */ React52.createElement("span", { className: "ml-auto shrink-0 text-[10px] font-medium text-muted-foreground/80" }, item.time)),
9095
+ /* @__PURE__ */ React52.createElement("div", { className: "flex items-start gap-2 mt-2" }, /* @__PURE__ */ React52.createElement("span", { className: `w-1.5 h-1.5 rounded-full shrink-0 mt-1.5 ${item.statusColor === "red" ? "bg-[#f43f5e]" : "bg-[#3b82f6]"}` }), /* @__PURE__ */ React52.createElement("span", { className: "text-xs text-muted-foreground leading-tight" }, item.details)),
9096
+ /* @__PURE__ */ React52.createElement("div", { className: `absolute right-4 bottom-4 flex items-center gap-1.5 bg-background shadow-sm rounded-md px-1 py-0.5 border border-border ${selectedTask.id === item.id ? "opacity-100" : "opacity-0 group-hover:opacity-100 transition-opacity"}` }, /* @__PURE__ */ React52.createElement(Button, { variant: "ghost", size: "icon", className: "h-6 w-6 rounded text-muted-foreground hover:text-foreground" }, /* @__PURE__ */ React52.createElement(CheckSquare, { className: "w-3.5 h-3.5" })), /* @__PURE__ */ React52.createElement(Button, { variant: "ghost", size: "icon", className: "h-6 w-6 rounded text-muted-foreground hover:text-foreground" }, /* @__PURE__ */ React52.createElement(Clock, { className: "w-3.5 h-3.5" })))
9097
+ )), /* @__PURE__ */ React52.createElement("div", { className: "p-4" }, /* @__PURE__ */ React52.createElement(Button, { variant: "outline", size: "sm", className: "h-8 text-xs font-semibold rounded-md shadow-none" }, "See more")))), /* @__PURE__ */ React52.createElement("div", { className: "flex h-full flex-1 flex-col overflow-hidden bg-background" }, /* @__PURE__ */ React52.createElement("div", { className: "flex-1 overflow-y-auto" }, /* @__PURE__ */ React52.createElement(DetailView, __spreadValues({}, detailViewProps)))))
9098
+ ));
9099
+ }
9100
+ var DEFAULT_METRICS = [
9101
+ {
9102
+ title: "Referrals at Risk",
9103
+ value: 28,
9104
+ change: { value: "2 vs last week", direction: "up", isGood: false },
9105
+ showExternalLink: true,
9106
+ showInfo: true,
9107
+ dataPoints: [
9108
+ { label: "No Contact", value: 6, color: "#166534" },
9109
+ { label: "Stalled", value: 4, color: "#22c55e" },
9110
+ { label: "Needs Attn", value: 8, color: "#6ee7b7" },
9111
+ { label: "Auth Delay", value: 5, color: "#ccfbf1" },
9112
+ { label: "DCS Hold", value: 3, color: "#99f6e4" },
9113
+ { label: "Expired Referral", value: 2, color: "#f1f5f9" }
9114
+ ]
9115
+ },
9116
+ {
9117
+ title: "Dropped from Pipeline",
9118
+ value: 47,
9119
+ change: { value: "12 vs last week", direction: "down", isGood: true },
9120
+ showExternalLink: true,
9121
+ showInfo: true,
9122
+ dataPoints: [
9123
+ { label: "No Contact", value: 12, color: "#166534" },
9124
+ { label: "Ins. Denied", value: 15, color: "#22c55e" },
9125
+ { label: "Refused", value: 6, color: "#6ee7b7" },
9126
+ { label: "Intake Stalled", value: 8, color: "#ccfbf1" },
9127
+ { label: "Other", value: 6, color: "#f1f5f9" }
9128
+ ]
9129
+ },
9130
+ {
9131
+ title: "Time to Schedule",
9132
+ value: "4.2 days",
9133
+ subtitle: "median, referrals \u2192 scheduled",
9134
+ change: { value: "0.8d vs last week", direction: "down", isGood: true },
9135
+ footerText: "Slowest stage: Contact \u2192 Intake (1.5d)",
9136
+ showInfo: true
9137
+ },
9138
+ {
9139
+ title: "Conversion Rate",
9140
+ value: "53%",
9141
+ subtitle: "referrals \u2192 scheduled",
9142
+ change: { value: "3% vs last week", direction: "up", isGood: true },
9143
+ footerText: "Largest drop-off: No Contact (22%)",
9144
+ showInfo: true
9145
+ }
9146
+ ];
9147
+ var DEFAULT_EXPANDED_METRICS = [
9148
+ {
9149
+ title: "Avg Handle Time",
9150
+ value: "1.2",
9151
+ unit: "days",
9152
+ change: { value: "0.3d vs last week", direction: "down", isGood: true },
9153
+ footerText: "Fastest stage: Verification (0.2d)",
9154
+ showInfo: true
9155
+ },
9156
+ {
9157
+ title: "Conversion Rate",
9158
+ value: "78%",
9159
+ change: { value: "2% vs last week", direction: "up", isGood: true },
9160
+ footerText: "Top source: Internal Referrals (85%)",
9161
+ showInfo: true
9162
+ },
9163
+ {
9164
+ title: "Pending Intakes",
9165
+ value: "124",
9166
+ change: { value: "15 vs last week", direction: "up", isGood: false },
9167
+ footerText: "Requires immediate attention: 32",
9168
+ showInfo: true
9169
+ },
9170
+ {
9171
+ title: "Patient Satisfaction",
9172
+ value: "4.8",
9173
+ unit: "/ 5",
9174
+ change: { value: "0.1 vs last month", direction: "up", isGood: true },
9175
+ footerText: "Based on 450 recent surveys",
9176
+ showInfo: true
9177
+ }
9178
+ ];
9179
+ function PrototypeInsightsView({
9180
+ tabs,
9181
+ coaching,
9182
+ metrics,
9183
+ expandedMetrics,
9184
+ dashboardCards,
9185
+ analytics,
9186
+ assistantName,
9187
+ headerActions,
9188
+ onNavigateToInbox
9189
+ }) {
9190
+ var _a, _b, _c, _d, _e, _f;
9191
+ const showOverview = (tabs == null ? void 0 : tabs.overview) !== false;
9192
+ const showAnalytics = (tabs == null ? void 0 : tabs.analytics) !== false;
9193
+ const [insightsTab, setInsightsTab] = React52.useState(
9194
+ showOverview ? "overview" : "analytics"
9195
+ );
9196
+ const [showAllMetrics, setShowAllMetrics] = React52.useState(false);
9197
+ const [showCoaching, setShowCoaching] = React52.useState((coaching == null ? void 0 : coaching.enabled) !== false);
9198
+ const resolvedMetrics = metrics != null ? metrics : DEFAULT_METRICS;
9199
+ const resolvedExpandedMetrics = expandedMetrics != null ? expandedMetrics : DEFAULT_EXPANDED_METRICS;
9200
+ const cards = {
9201
+ topTasks: (dashboardCards == null ? void 0 : dashboardCards.topTasks) !== false,
9202
+ upcomingMeetings: (dashboardCards == null ? void 0 : dashboardCards.upcomingMeetings) !== false,
9203
+ recentlyCompleted: (dashboardCards == null ? void 0 : dashboardCards.recentlyCompleted) !== false,
9204
+ checkIns: (dashboardCards == null ? void 0 : dashboardCards.checkIns) !== false
9205
+ };
9206
+ return /* @__PURE__ */ React52.createElement("div", { className: "mx-auto max-w-7xl space-y-8 p-6 md:p-8" }, /* @__PURE__ */ React52.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React52.createElement("div", null, /* @__PURE__ */ React52.createElement("h2", { className: "mb-1 text-xl font-bold tracking-tight text-foreground" }, "Insights & Overview"), /* @__PURE__ */ React52.createElement("p", { className: "text-sm text-muted-foreground" }, "Monitor your key performance indicators and daily tasks.")), /* @__PURE__ */ React52.createElement("div", { className: "flex items-center gap-3" }, assistantName && /* @__PURE__ */ React52.createElement(Button, { variant: "outline", size: "sm", className: "h-8 gap-2 text-xs font-semibold rounded-full px-4 border-foreground text-foreground hover:bg-muted/50" }, /* @__PURE__ */ React52.createElement(MessageCircle, { className: "w-3.5 h-3.5" }), "Talk to ", assistantName), headerActions)), showOverview && showAnalytics && /* @__PURE__ */ React52.createElement("div", { className: "flex items-center gap-1 border-b border-border" }, /* @__PURE__ */ React52.createElement(
9207
+ "button",
9208
+ {
9209
+ type: "button",
9210
+ onClick: () => setInsightsTab("overview"),
9211
+ className: `relative px-4 py-2 text-sm font-medium transition-colors ${insightsTab === "overview" ? "text-foreground" : "text-muted-foreground hover:text-foreground"}`
9212
+ },
9213
+ /* @__PURE__ */ React52.createElement("span", { className: "flex items-center gap-2" }, /* @__PURE__ */ React52.createElement(BarChart2, { className: "h-3.5 w-3.5" }), "Overview"),
9214
+ insightsTab === "overview" && /* @__PURE__ */ React52.createElement("span", { className: "absolute bottom-0 left-0 right-0 h-0.5 bg-foreground rounded-full" })
9215
+ ), /* @__PURE__ */ React52.createElement(
9216
+ "button",
9217
+ {
9218
+ type: "button",
9219
+ onClick: () => setInsightsTab("analytics"),
9220
+ className: `relative px-4 py-2 text-sm font-medium transition-colors ${insightsTab === "analytics" ? "text-foreground" : "text-muted-foreground hover:text-foreground"}`
9221
+ },
9222
+ /* @__PURE__ */ React52.createElement("span", { className: "flex items-center gap-2" }, /* @__PURE__ */ React52.createElement(TrendingUp, { className: "h-3.5 w-3.5" }), "Analytics"),
9223
+ insightsTab === "analytics" && /* @__PURE__ */ React52.createElement("span", { className: "absolute bottom-0 left-0 right-0 h-0.5 bg-foreground rounded-full" })
9224
+ )), insightsTab === "overview" && showOverview && /* @__PURE__ */ React52.createElement(React52.Fragment, null, showCoaching && /* @__PURE__ */ React52.createElement("div", { className: "border border-border rounded-xl p-6 relative bg-card shadow-sm" }, /* @__PURE__ */ React52.createElement(
9225
+ Button,
9226
+ {
9227
+ variant: "ghost",
9228
+ size: "icon",
9229
+ className: "absolute top-4 right-4 h-6 w-6 text-muted-foreground hover:text-foreground",
9230
+ onClick: () => setShowCoaching(false)
9231
+ },
9232
+ /* @__PURE__ */ React52.createElement(X, { className: "w-4 h-4" })
9233
+ ), /* @__PURE__ */ React52.createElement("div", { className: "flex items-center gap-2 mb-2" }, /* @__PURE__ */ React52.createElement("h3", { className: "font-bold text-foreground text-sm" }, "Daily Coaching Insight")), /* @__PURE__ */ React52.createElement("p", { className: "text-sm text-muted-foreground leading-relaxed mb-4 max-w-4xl" }, "We analyze your pipeline activity, recent communications, and account health to provide personalized recommendations for your day."), /* @__PURE__ */ React52.createElement("div", { className: "bg-brand-purple/10 rounded-lg p-5 text-[13px] text-foreground font-medium italic border border-brand-purple/20 relative" }, /* @__PURE__ */ React52.createElement("div", { className: "absolute top-0 left-0 w-1 h-full bg-brand-purple rounded-l-lg" }), (_a = coaching == null ? void 0 : coaching.message) != null ? _a : "\u201CGreat job catching the churn risk on Lunchclub yesterday. Today, focus on pushing the stalled intake pipeline. Try making 2 more touches on accounts that have gone dark this week.\u201D"), /* @__PURE__ */ React52.createElement("div", { className: "mt-4 flex items-center gap-2" }, /* @__PURE__ */ React52.createElement(Button, { variant: "outline", size: "sm", className: "h-7 text-xs text-muted-foreground hover:text-foreground shadow-none" }, /* @__PURE__ */ React52.createElement(ThumbsUp, { className: "w-3.5 h-3.5 mr-1.5" }), " Helpful"), /* @__PURE__ */ React52.createElement(Button, { variant: "outline", size: "sm", className: "h-7 text-xs text-muted-foreground hover:text-foreground shadow-none" }, /* @__PURE__ */ React52.createElement(ThumbsDown, { className: "w-3.5 h-3.5 mr-1.5" }), " Not Helpful"), /* @__PURE__ */ React52.createElement("div", { className: "relative max-w-sm ml-2 flex-1" }, /* @__PURE__ */ React52.createElement(Input, { placeholder: "Provide additional feedback...", className: "h-7 text-xs shadow-none border-border bg-muted/20 w-full" })))), /* @__PURE__ */ React52.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React52.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React52.createElement("h3", { className: "text-sm font-semibold text-foreground uppercase tracking-wider" }, "Key Metrics"), resolvedExpandedMetrics.length > 0 && /* @__PURE__ */ React52.createElement(
9234
+ Button,
9235
+ {
9236
+ variant: "ghost",
9237
+ size: "sm",
9238
+ className: "text-xs text-muted-foreground hover:text-foreground",
9239
+ onClick: () => setShowAllMetrics(!showAllMetrics)
9240
+ },
9241
+ showAllMetrics ? "Hide additional metrics" : "Show more metrics"
9242
+ )), /* @__PURE__ */ React52.createElement("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4" }, resolvedMetrics.map((m, i) => /* @__PURE__ */ React52.createElement(MetricCard, __spreadValues({ key: i }, m))), showAllMetrics && resolvedExpandedMetrics.map((m, i) => /* @__PURE__ */ React52.createElement(MetricCard, __spreadValues({ key: `exp-${i}` }, m))))), /* @__PURE__ */ React52.createElement("div", { className: "grid grid-cols-1 lg:grid-cols-3 gap-6 mt-8" }, /* @__PURE__ */ React52.createElement("div", { className: "lg:col-span-2 space-y-6" }, cards.topTasks && /* @__PURE__ */ React52.createElement(TopTasksCard, { onViewAll: onNavigateToInbox }), /* @__PURE__ */ React52.createElement("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6" }, cards.upcomingMeetings && /* @__PURE__ */ React52.createElement(UpcomingMeetingsCard, null), cards.recentlyCompleted && /* @__PURE__ */ React52.createElement(RecentlyCompletedCard, null))), /* @__PURE__ */ React52.createElement("div", { className: "space-y-6" }, cards.checkIns && /* @__PURE__ */ React52.createElement(CheckInsCard, null)))), insightsTab === "analytics" && showAnalytics && /* @__PURE__ */ React52.createElement("div", { className: "space-y-6" }, (analytics == null ? void 0 : analytics.pipeline) && /* @__PURE__ */ React52.createElement(
9243
+ PipelineOverview,
9244
+ {
9245
+ stages: analytics.pipeline.stages,
9246
+ stageMetrics: analytics.pipeline.stageMetrics,
9247
+ stageTimings: analytics.pipeline.stageTimings,
9248
+ filterBreakdowns: analytics.pipeline.filterBreakdowns
9249
+ }
9250
+ ), (analytics == null ? void 0 : analytics.volumeChart) && /* @__PURE__ */ React52.createElement(
9251
+ ReportCard,
9252
+ {
9253
+ title: "Volume Analysis",
9254
+ subtitle: "Referral volume broken down by facility over time",
9255
+ filterOptions: analytics.volumeChart.filterOptions,
9256
+ selectedFilter: (_c = (_b = analytics.volumeChart.filterOptions) == null ? void 0 : _b[0]) == null ? void 0 : _c.value
9257
+ },
9258
+ /* @__PURE__ */ React52.createElement(
9259
+ VolumeAnalysisChart,
9260
+ {
9261
+ data: analytics.volumeChart.data,
9262
+ dataKeys: analytics.volumeChart.dataKeys
9263
+ }
9264
+ )
9265
+ ), /* @__PURE__ */ React52.createElement("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6" }, (analytics == null ? void 0 : analytics.donutChart) && /* @__PURE__ */ React52.createElement(ReportCard, { title: "Risk Breakdown", subtitle: "Referrals at risk by category" }, /* @__PURE__ */ React52.createElement("div", { className: "flex items-center justify-center" }, /* @__PURE__ */ React52.createElement(
9266
+ DonutChart,
9267
+ {
9268
+ data: analytics.donutChart.data,
9269
+ centerLabel: analytics.donutChart.centerLabel,
9270
+ showLegend: true
9271
+ }
9272
+ ))), (analytics == null ? void 0 : analytics.trendChart) && /* @__PURE__ */ React52.createElement(
9273
+ ReportCard,
9274
+ {
9275
+ title: "Referrals Over Time",
9276
+ subtitle: "Weekly appointment trends",
9277
+ toggleOptions: analytics.trendChart.toggleOptions,
9278
+ selectedToggle: (_d = analytics.trendChart.toggleOptions) == null ? void 0 : _d[0]
9279
+ },
9280
+ /* @__PURE__ */ React52.createElement(
9281
+ TrendAreaChart,
9282
+ {
9283
+ data: analytics.trendChart.data,
9284
+ series: analytics.trendChart.series,
9285
+ xAxisKey: (_e = analytics.trendChart.xAxisKey) != null ? _e : "name",
9286
+ height: (_f = analytics.trendChart.height) != null ? _f : 220
9287
+ }
9288
+ )
9289
+ )), ((analytics == null ? void 0 : analytics.barChart) || (analytics == null ? void 0 : analytics.barList)) && /* @__PURE__ */ React52.createElement("div", { className: "grid grid-cols-1 lg:grid-cols-3 gap-6" }, (analytics == null ? void 0 : analytics.barChart) && /* @__PURE__ */ React52.createElement(
9290
+ ReportCard,
9291
+ {
9292
+ title: "Outreach Activity",
9293
+ subtitle: "Daily outreach by channel",
9294
+ className: "lg:col-span-2"
9295
+ },
9296
+ /* @__PURE__ */ React52.createElement(
9297
+ BarChartComponent,
9298
+ {
9299
+ data: analytics.barChart.data,
9300
+ bars: analytics.barChart.bars
9301
+ }
9302
+ )
9303
+ ), (analytics == null ? void 0 : analytics.barList) && /* @__PURE__ */ React52.createElement(ReportCard, { title: "Top Activity Types", subtitle: "By completion percentage" }, /* @__PURE__ */ React52.createElement(
9304
+ StyledBarList,
9305
+ {
9306
+ data: analytics.barList.data,
9307
+ valueFormatter: analytics.barList.valueFormatter
9308
+ }
9309
+ )))));
9310
+ }
9311
+ var DEFAULT_FILTER_TABS = [
9312
+ { label: "All Accounts", count: 6, variant: "default" },
9313
+ { label: "Needs Attention", count: 11, variant: "attention" },
9314
+ { label: "Recent", count: 7, variant: "ghost" }
9315
+ ];
9316
+ function PrototypeAccountsView({
9317
+ filterTabs,
9318
+ headerActions,
9319
+ onRowClick
9320
+ }) {
9321
+ const tabs = filterTabs != null ? filterTabs : DEFAULT_FILTER_TABS;
9322
+ return /* @__PURE__ */ React52.createElement("div", { className: "flex flex-col h-full w-full bg-background relative" }, headerActions && /* @__PURE__ */ React52.createElement("div", { className: "absolute top-4 right-4 z-10" }, headerActions), /* @__PURE__ */ React52.createElement("div", { className: "px-4 py-3 border-b border-border flex items-center gap-2 overflow-x-auto shrink-0 mt-2" }, tabs.map((tab, i) => {
9323
+ if (tab.variant === "attention") {
9324
+ return /* @__PURE__ */ React52.createElement(Button, { key: i, size: "sm", className: "h-7 text-xs rounded-md bg-emerald-600 hover:bg-emerald-700 text-white font-medium" }, tab.label, tab.count != null && /* @__PURE__ */ React52.createElement(Badge, { variant: "secondary", className: "ml-2 h-4 px-1.5 text-[10px] bg-white/20 text-white border-transparent" }, tab.count));
9325
+ }
9326
+ if (tab.variant === "ghost") {
9327
+ return /* @__PURE__ */ React52.createElement(Button, { key: i, variant: "ghost", size: "sm", className: "h-7 text-xs rounded-md border border-border bg-transparent font-medium" }, tab.label, tab.count != null && /* @__PURE__ */ React52.createElement(Badge, { variant: "secondary", className: "ml-2 h-4 px-1.5 text-[10px]" }, tab.count));
9328
+ }
9329
+ return /* @__PURE__ */ React52.createElement(Button, { key: i, variant: "secondary", size: "sm", className: "h-7 text-xs rounded-md bg-muted font-medium" }, tab.label, tab.count != null && /* @__PURE__ */ React52.createElement(Badge, { variant: "outline", className: "ml-2 h-4 px-1.5 text-[10px]" }, tab.count));
9330
+ })), /* @__PURE__ */ React52.createElement("div", { className: "flex-1 overflow-auto" }, /* @__PURE__ */ React52.createElement(DataTable, { onRowClick })));
9331
+ }
9332
+ function PrototypeWorkQueueView({
9333
+ headerActions
9334
+ }) {
9335
+ return /* @__PURE__ */ React52.createElement("div", { className: "relative flex h-full w-full flex-col bg-background" }, headerActions && /* @__PURE__ */ React52.createElement("div", { className: "absolute top-4 right-4 z-10" }, headerActions), /* @__PURE__ */ React52.createElement("div", { className: "flex-1 overflow-auto" }, /* @__PURE__ */ React52.createElement(ItemList, null)));
9336
+ }
9337
+
9338
+ // registry/new-york/ui/prototype-shell.tsx
9339
+ var VIEW_KEY_MAP = {
9340
+ inbox: "inbox",
9341
+ dashboard: "insights",
9342
+ insights: "insights",
9343
+ accounts: "accounts",
9344
+ activity: "workQueue",
9345
+ workQueue: "workQueue",
9346
+ "work-queue": "workQueue"
9347
+ };
9348
+ var DEFAULT_ENTITY_SECTIONS = [
9349
+ { type: "details" },
9350
+ { type: "contacts" },
9351
+ { type: "recentActivity" },
9352
+ { type: "connectedApps" },
9353
+ { type: "systemActivity" }
9354
+ ];
9355
+ function PrototypeShell({
9356
+ config,
9357
+ headerActions,
9358
+ entityPanelChildren,
9359
+ onNavigate
9360
+ }) {
9361
+ var _a, _b, _c, _d, _e, _f, _g;
9362
+ const [currentView, setCurrentView] = React52.useState(config.defaultView);
9363
+ const [isEntityPanelOpen, setIsEntityPanelOpen] = React52.useState(false);
9364
+ const navigableViews = React52.useMemo(() => {
9365
+ if (config.navigableViews) return config.navigableViews;
9366
+ const keys = [];
9367
+ if (config.views.inbox) keys.push("inbox");
9368
+ if (config.views.accounts) keys.push("accounts");
9369
+ if (config.views.workQueue) keys.push("activity", "workQueue", "work-queue");
9370
+ if (config.views.insights) keys.push("dashboard", "insights");
9371
+ return keys;
9372
+ }, [config.navigableViews, config.views]);
9373
+ const handleNavigate = React52.useCallback(
9374
+ (id) => {
9375
+ if (navigableViews.includes(id)) {
9376
+ setCurrentView(id);
9377
+ }
9378
+ onNavigate == null ? void 0 : onNavigate(id);
9379
+ },
9380
+ [navigableViews, onNavigate]
9381
+ );
9382
+ const handleOpenEntityPanel = React52.useCallback(() => setIsEntityPanelOpen(true), []);
9383
+ const handleOpenRecentActivity = React52.useCallback(() => {
9384
+ setIsEntityPanelOpen(true);
9385
+ setTimeout(() => {
9386
+ var _a2;
9387
+ (_a2 = document.getElementById("entity-recent-activity")) == null ? void 0 : _a2.scrollIntoView({ behavior: "smooth", block: "start" });
9388
+ }, 150);
9389
+ }, []);
9390
+ const resolvedViewKey = (_a = VIEW_KEY_MAP[currentView]) != null ? _a : currentView;
9391
+ const entitySections = (_c = (_b = config.entityPanel) == null ? void 0 : _b.sections) != null ? _c : DEFAULT_ENTITY_SECTIONS;
9392
+ const entityIcons = (_e = (_d = config.entityPanel) == null ? void 0 : _d.icons) != null ? _e : {};
9393
+ return /* @__PURE__ */ React52.createElement("div", { className: "flex h-screen w-full overflow-hidden bg-background font-sans" }, /* @__PURE__ */ React52.createElement(
9394
+ QuickActionSidebarNav,
9395
+ {
9396
+ className: "z-20 h-screen shrink-0",
9397
+ navSections: config.sidebar,
9398
+ activeItemId: currentView,
9399
+ onNavigate: handleNavigate,
9400
+ onCreateTask: (draft) => {
9401
+ console.log("Quick action created:", draft);
9402
+ }
9403
+ }
9404
+ ), /* @__PURE__ */ React52.createElement("main", { className: "flex min-w-0 flex-1 flex-col overflow-hidden bg-background" }, /* @__PURE__ */ React52.createElement("div", { className: "relative h-full flex-1 overflow-auto" }, resolvedViewKey === "insights" && config.views.insights ? /* @__PURE__ */ React52.createElement(
9405
+ PrototypeInsightsView,
9406
+ __spreadProps(__spreadValues({}, config.views.insights), {
9407
+ assistantName: (_f = config.brand) == null ? void 0 : _f.assistantName,
9408
+ headerActions,
9409
+ onNavigateToInbox: () => setCurrentView("inbox")
9410
+ })
9411
+ ) : resolvedViewKey === "inbox" && config.views.inbox ? /* @__PURE__ */ React52.createElement(
9412
+ PrototypeInboxView,
9413
+ __spreadProps(__spreadValues({}, config.views.inbox), {
9414
+ headerActions,
9415
+ onOpenEntityPanel: handleOpenEntityPanel,
9416
+ onOpenRecentActivity: handleOpenRecentActivity
9417
+ })
9418
+ ) : resolvedViewKey === "accounts" && config.views.accounts ? /* @__PURE__ */ React52.createElement(
9419
+ PrototypeAccountsView,
9420
+ __spreadProps(__spreadValues({}, config.views.accounts), {
9421
+ headerActions,
9422
+ onRowClick: handleOpenEntityPanel
9423
+ })
9424
+ ) : resolvedViewKey === "workQueue" && config.views.workQueue ? /* @__PURE__ */ React52.createElement(
9425
+ PrototypeWorkQueueView,
9426
+ {
9427
+ headerActions
9428
+ }
9429
+ ) : null)), /* @__PURE__ */ React52.createElement(EntityPanel, { isOpen: isEntityPanelOpen, onClose: setIsEntityPanelOpen }, (_g = typeof entityPanelChildren === "function" ? entityPanelChildren({ onClose: () => setIsEntityPanelOpen(false) }) : entityPanelChildren) != null ? _g : /* @__PURE__ */ React52.createElement(React52.Fragment, null, entitySections.map((section, i) => {
9430
+ var _a2, _b2;
9431
+ switch (section.type) {
9432
+ case "details":
9433
+ return /* @__PURE__ */ React52.createElement(EntityDetails, { key: i, onClose: () => setIsEntityPanelOpen(false) });
9434
+ case "contacts":
9435
+ return /* @__PURE__ */ React52.createElement(
9436
+ PotentialContacts,
9437
+ {
9438
+ key: i,
9439
+ icons: {
9440
+ linkedin: entityIcons.linkedin,
9441
+ gmail: entityIcons.gmail
9442
+ }
9443
+ }
9444
+ );
9445
+ case "recentActivity":
9446
+ return /* @__PURE__ */ React52.createElement(
9447
+ RecentActivity,
9448
+ {
9449
+ key: i,
9450
+ items: (_b2 = (_a2 = section.props) == null ? void 0 : _a2.items) != null ? _b2 : []
9451
+ }
9452
+ );
9453
+ case "connectedApps":
9454
+ return /* @__PURE__ */ React52.createElement(
9455
+ ConnectedApps,
9456
+ {
9457
+ key: i,
9458
+ icons: {
9459
+ slack: entityIcons.slack,
9460
+ gdoc: entityIcons.gdoc
9461
+ }
9462
+ }
9463
+ );
9464
+ case "systemActivity":
9465
+ return /* @__PURE__ */ React52.createElement(SystemActivity, { key: i });
9466
+ default:
9467
+ return null;
9468
+ }
9469
+ }))));
9470
+ }
8768
9471
 
8769
- export { ActivityDetail, ActivityLog, ActivityRow, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BarChartComponent, Button, CHART_CURSOR_STYLE, CHART_TOOLTIP_STYLE, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, CheckInsCard, Citation, ConnectedApps, ContactList, DataTable, DataTableDisplay, DataTableFilter, DataTableQuickViews, DataTableToolbar, DetailViewHeader, DetailViewSummary, DetailViewThread, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DonutChart, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EntityActivityItem, EntityDetails, EntityMetadataGrid, EntityPanel, EntityPanelHeader, EntityPanelTabs, EntitySection, GroupedListView, InboxGroupHeader, InboxRow, InboxToolbar, Input, ItemList, ItemListDisplay, ItemListFilter, ItemListToolbar, Label2 as Label, MetricCard, PerformanceMetricsTable, PipelineOverview, PotentialContacts, PreviewList, PreviewListItem, Progress, QuickActionChatArea, QuickActionModal, QuickActionSidebarNav, RecentActivity, RecentlyCompletedCard, RecommendedActionsSection, ReportCard, SankeyChart, ScoreAnalysisModal, ScoreAnalysisPanel, ScoreBreakdown, ScoreFeedback, ScoreRing, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SignalApproval, Actions as SignalApprovalActions, Gate as SignalApprovalGate, Root as SignalApprovalRoot, SimpleChartTooltip, Skeleton, SourceList, StyledBarList, SuggestedActions, SystemActivity, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThreadMessage, TimelineActivity, Tooltip4 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopLineMetrics, TopTasksCard, TrendAreaChart, UpcomingMeetingsCard, ViewModeToggle, VolumeAnalysisChart, badgeVariants, buttonVariants, cn, getScoreColor, tabsListVariants, useIsMobile, useScoreFeedback, useSidebar, useSignalApproval };
9472
+ export { ActivityDetail, ActivityLog, ActivityRow, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BarChartComponent, Button, CHART_CURSOR_STYLE, CHART_TOOLTIP_STYLE, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, CheckInsCard, Citation, ConnectedApps, ContactList, DataTable, DataTableDisplay, DataTableFilter, DataTableQuickViews, DataTableToolbar, DetailViewHeader, DetailViewSummary, DetailViewThread, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DonutChart, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EntityActivityItem, EntityDetails, EntityMetadataGrid, EntityPanel, EntityPanelHeader, EntityPanelTabs, EntitySection, GroupedListView, InboxGroupHeader, InboxRow, InboxToolbar, Input, ItemList, ItemListDisplay, ItemListFilter, ItemListToolbar, Label2 as Label, MetricCard, PerformanceMetricsTable, PipelineOverview, PotentialContacts, PreviewList, PreviewListItem, Progress, PrototypeAccountsView, PrototypeInboxView, PrototypeInsightsView, PrototypeShell, PrototypeWorkQueueView, QuickActionChatArea, QuickActionModal, QuickActionSidebarNav, RecentActivity, RecentlyCompletedCard, RecommendedActionsSection, ReportCard, SankeyChart, ScoreAnalysisModal, ScoreAnalysisPanel, ScoreBreakdown, ScoreFeedback, ScoreRing, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SignalApproval, Actions as SignalApprovalActions, Gate as SignalApprovalGate, Root as SignalApprovalRoot, SimpleChartTooltip, Skeleton, SourceList, StyledBarList, SuggestedActions, SystemActivity, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThreadMessage, TimelineActivity, Tooltip4 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopLineMetrics, TopTasksCard, TrendAreaChart, UpcomingMeetingsCard, ViewModeToggle, VolumeAnalysisChart, badgeVariants, buttonVariants, cn, getScoreColor, tabsListVariants, useIsMobile, useScoreFeedback, useSidebar, useSignalApproval };
8770
9473
  //# sourceMappingURL=index.js.map
8771
9474
  //# sourceMappingURL=index.js.map