@handled-ai/design-system 0.16.2 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/score-why-chips.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Info } from \"lucide-react\"\nimport { ScoreBreakdown, type ScoreFactor } from \"./score-breakdown\"\nimport { cn } from \"../lib/utils\"\nimport type {\n QueueItem,\n SignalScoreData,\n SignalScoreExplanationBucket,\n SignalScoreExplanationSignal,\n SignalScoreUrgencyLabel,\n} from \"../prototype/prototype-config\"\n\nexport function getSignalScoreUrgencyLabel(\n score: number,\n providedLabel?: SignalScoreUrgencyLabel,\n): SignalScoreUrgencyLabel {\n if (providedLabel) return providedLabel\n if (score >= 80) return \"Urgent\"\n if (score >= 60) return \"High\"\n if (score >= 35) return \"Medium\"\n return \"Low\"\n}\n\nfunction getUrgencyChipClass(label: SignalScoreUrgencyLabel) {\n switch (label) {\n case \"Urgent\":\n return \"border-red-200 bg-red-50 text-red-700 hover:bg-red-100 dark:border-red-900/50 dark:bg-red-950/30 dark:text-red-300\"\n case \"High\":\n return \"border-orange-200 bg-orange-50 text-orange-700 hover:bg-orange-100 dark:border-orange-900/50 dark:bg-orange-950/30 dark:text-orange-300\"\n case \"Medium\":\n return \"border-amber-200 bg-amber-50 text-amber-700 hover:bg-amber-100 dark:border-amber-900/50 dark:bg-amber-950/30 dark:text-amber-300\"\n case \"Low\":\n return \"border-emerald-200 bg-emerald-50 text-emerald-700 hover:bg-emerald-100 dark:border-emerald-900/50 dark:bg-emerald-950/30 dark:text-emerald-300\"\n }\n}\n\nfunction classificationForScore(score?: number): string | undefined {\n if (score == null) return undefined\n if (score >= 80) return \"Urgent\"\n if (score >= 60) return \"High\"\n if (score >= 35) return \"Medium\"\n return \"Low\"\n}\n\nfunction scoreRangeForUrgency(label: SignalScoreUrgencyLabel): string {\n switch (label) {\n case \"Urgent\":\n return \"80-100\"\n case \"High\":\n return \"60-79\"\n case \"Medium\":\n return \"35-59\"\n case \"Low\":\n return \"0-34\"\n }\n}\n\nfunction makeDomId(...parts: Array<string | undefined>): string {\n return parts\n .filter((part): part is string => Boolean(part))\n .join(\"-\")\n .replace(/[^A-Za-z0-9_-]+/g, \"-\")\n}\n\nfunction scoreFactorToPriorityBucket(factor: ScoreFactor): SignalScoreExplanationBucket {\n return {\n key: factor.key,\n label: factor.label,\n kind: \"factor\",\n score: factor.score ?? undefined,\n classification: factor.risk ?? classificationForScore(factor.score ?? undefined),\n rationale: factor.why,\n factorKeys: [factor.key],\n }\n}\n\nfunction bucketHasSignalRows(bucket: SignalScoreExplanationBucket): boolean {\n return (\n (bucket.signals?.length ?? 0) > 0 ||\n (bucket.signalIds?.length ?? 0) > 0 ||\n Boolean(bucket.primarySignalId)\n )\n}\n\nfunction getSignalScoreBuckets(signalData: SignalScoreData): SignalScoreExplanationBucket[] {\n return (signalData.explanationBuckets ?? []).filter(\n (bucket) => bucket.kind !== \"factor\" && bucketHasSignalRows(bucket),\n )\n}\n\nfunction getBucketSignals(bucket: SignalScoreExplanationBucket): SignalScoreExplanationSignal[] {\n if (bucket.signals && bucket.signals.length > 0) return bucket.signals\n\n const signalIds = bucket.signalIds && bucket.signalIds.length > 0 ? bucket.signalIds : bucket.primarySignalId ? [bucket.primarySignalId] : []\n const uniqueSignalIds = Array.from(new Set(signalIds))\n\n return uniqueSignalIds.map((signalId) => ({\n id: signalId,\n label: `${bucket.label} signal`,\n }))\n}\n\nfunction getPriorityBuckets(signalData: SignalScoreData): SignalScoreExplanationBucket[] {\n if (signalData.explanationBuckets !== undefined) return signalData.explanationBuckets\n // Legacy fallback for consumers that still provide score factors but have not\n // migrated to explanation buckets. WHY chips intentionally do not use this.\n return signalData.factors.map(scoreFactorToPriorityBucket)\n}\n\nfunction isSameExplanation(a?: string, b?: string): boolean {\n return Boolean(a && b && a.trim() === b.trim())\n}\n\nexport interface SignalPriorityChipProps {\n score: number\n urgencyLabel?: SignalScoreUrgencyLabel\n isOpen?: boolean\n controlsId?: string\n onClick?: () => void\n className?: string\n}\n\nexport function SignalPriorityChip({\n score,\n urgencyLabel: providedLabel,\n isOpen,\n controlsId,\n onClick,\n className,\n}: SignalPriorityChipProps) {\n const urgencyLabel = getSignalScoreUrgencyLabel(score, providedLabel)\n\n return (\n <button\n type=\"button\"\n onClick={onClick}\n aria-expanded={isOpen}\n aria-controls={controlsId}\n className={cn(\n \"inline-flex items-center gap-1 rounded-md border px-2.5 py-1 text-xs font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n getUrgencyChipClass(urgencyLabel),\n className,\n )}\n >\n {urgencyLabel} Priority\n <Info className=\"h-3 w-3\" />\n </button>\n )\n}\n\nexport interface SignalPriorityPanelProps {\n signalData: SignalScoreData\n className?: string\n id?: string\n}\n\nexport function SignalPriorityPanel({ signalData, className, id }: SignalPriorityPanelProps) {\n const urgencyLabel = getSignalScoreUrgencyLabel(signalData.score, signalData.urgencyLabel)\n const buckets = React.useMemo(() => getPriorityBuckets(signalData), [signalData])\n const topBucketRationale = buckets.find((bucket) => bucket.rationale)?.rationale\n const primaryUrgencyExplanation = signalData.urgencyExplanation ?? signalData.whyNow ?? topBucketRationale\n const whyNowSection = isSameExplanation(signalData.whyNow, primaryUrgencyExplanation) ? undefined : signalData.whyNow\n const topFactorSection =\n isSameExplanation(topBucketRationale, primaryUrgencyExplanation) || isSameExplanation(topBucketRationale, whyNowSection)\n ? undefined\n : topBucketRationale\n const scoreRange = scoreRangeForUrgency(urgencyLabel)\n\n return (\n <div id={id} className={cn(\"rounded-lg border border-border bg-muted/20 p-3 text-xs\", className)} role=\"region\" aria-label=\"Priority explanation\">\n <div className=\"flex flex-wrap items-start justify-between gap-3\">\n <div>\n <p className=\"font-semibold text-foreground\">Why this is {urgencyLabel.toLowerCase()} priority</p>\n {primaryUrgencyExplanation ? <p className=\"mt-1 leading-relaxed text-muted-foreground\">{primaryUrgencyExplanation}</p> : null}\n </div>\n <div className=\"flex shrink-0 flex-wrap gap-1.5 text-[11px] text-muted-foreground\">\n <span className=\"rounded-full bg-background px-2 py-0.5\">Score {signalData.score}/100</span>\n <span className=\"rounded-full bg-background px-2 py-0.5\">{urgencyLabel} range: {scoreRange}</span>\n </div>\n </div>\n\n {(whyNowSection || topFactorSection) && (\n <div className=\"mt-3 grid gap-2 text-xs text-muted-foreground sm:grid-cols-2\">\n {whyNowSection ? (\n <div className=\"rounded-md bg-background/80 p-2\">\n <p className=\"font-medium text-foreground\">Why now</p>\n <p className=\"mt-0.5 leading-relaxed\">{whyNowSection}</p>\n </div>\n ) : null}\n {topFactorSection ? (\n <div className=\"rounded-md bg-background/80 p-2\">\n <p className=\"font-medium text-foreground\">Top factor</p>\n <p className=\"mt-0.5 leading-relaxed\">{topFactorSection}</p>\n </div>\n ) : null}\n </div>\n )}\n\n {signalData.factors.length > 0 ? (\n <ScoreBreakdown\n className=\"mt-3\"\n factors={signalData.factors}\n onFactorFeedback={signalData.onFactorFeedback}\n initialFeedback={signalData.initialFactorFeedback}\n />\n ) : null}\n </div>\n )\n}\n\nexport interface ScoreWhyChipsProps {\n item: QueueItem\n signalData: SignalScoreData\n onOpenSignalBucket?: (args: { item: QueueItem; bucketKey: string; signalId: string }) => void\n className?: string\n}\n\ninterface SignalRowProps {\n item: QueueItem\n bucketKey: string\n signal: SignalScoreExplanationSignal\n onOpenSignalBucket?: ScoreWhyChipsProps[\"onOpenSignalBucket\"]\n}\n\nfunction SignalRow({ item, bucketKey, signal, onOpenSignalBucket }: SignalRowProps) {\n const rowContent = (\n <>\n <div className=\"flex items-start justify-between gap-2\">\n <p className=\"font-medium text-foreground\">{signal.label}</p>\n {signal.time ? <span className=\"shrink-0 text-[11px] text-muted-foreground/70\">{signal.time}</span> : null}\n </div>\n {signal.description ? <p className=\"mt-1 leading-relaxed text-muted-foreground\">{signal.description}</p> : null}\n {(signal.source || signal.metric) && (\n <div className=\"mt-1.5 flex flex-wrap gap-1.5 text-[11px] text-muted-foreground/80\">\n {signal.source ? <span className=\"rounded-full bg-muted px-2 py-0.5\">{signal.source}</span> : null}\n {signal.metric ? <span className=\"rounded-full bg-muted px-2 py-0.5\">{signal.metric}</span> : null}\n </div>\n )}\n </>\n )\n\n if (signal.id && onOpenSignalBucket) {\n return (\n <button\n type=\"button\"\n className=\"w-full rounded-md bg-background/80 p-2 text-left text-xs transition-colors hover:bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n onClick={() => onOpenSignalBucket({ item, bucketKey, signalId: signal.id! })}\n >\n {rowContent}\n </button>\n )\n }\n\n return <div className=\"rounded-md bg-background/80 p-2 text-xs\">{rowContent}</div>\n}\n\nexport function ScoreWhyChips({\n item,\n signalData,\n onOpenSignalBucket,\n className,\n}: ScoreWhyChipsProps) {\n const [selectedBucketKey, setSelectedBucketKey] = React.useState<string | null>(null)\n\n React.useEffect(() => {\n setSelectedBucketKey(null)\n }, [item.id])\n\n const reactId = React.useId()\n const idPrefix = makeDomId(\"score-why\", reactId, item.id)\n const buckets = React.useMemo(() => getSignalScoreBuckets(signalData), [signalData])\n const selectedBucket = buckets.find((bucket) => bucket.key === selectedBucketKey) ?? null\n const selectedBucketSignals = selectedBucket ? getBucketSignals(selectedBucket) : []\n const selectedPanelId = selectedBucket ? `${idPrefix}-panel-${makeDomId(selectedBucket.key)}` : undefined\n\n if (buckets.length === 0) return null\n\n return (\n <div className={cn(\"mt-4\", className)}>\n <div className=\"mb-2 flex items-center gap-2\">\n <span className=\"text-[10px] font-bold uppercase tracking-wider text-muted-foreground\">Why</span>\n </div>\n <div className=\"flex flex-wrap gap-1.5\">\n {buckets.map((bucket) => {\n const isSelected = selectedBucketKey === bucket.key\n const panelId = `${idPrefix}-panel-${makeDomId(bucket.key)}`\n return (\n <button\n key={bucket.key}\n type=\"button\"\n onClick={() => setSelectedBucketKey((prev) => (prev === bucket.key ? null : bucket.key))}\n aria-expanded={isSelected}\n aria-controls={panelId}\n className={cn(\n \"inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11px] font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n isSelected\n ? \"border-foreground/30 bg-foreground text-background\"\n : \"border-border bg-background text-muted-foreground hover:bg-muted/60 hover:text-foreground\",\n )}\n >\n {bucket.label}\n {bucket.signalCount && bucket.signalCount > 1 ? (\n <span className={cn(\"rounded-full px-1.5 py-0 text-[10px]\", isSelected ? \"bg-background/20\" : \"bg-muted\")}>×{bucket.signalCount}</span>\n ) : null}\n </button>\n )\n })}\n </div>\n\n {selectedBucket && (\n <div\n id={selectedPanelId}\n className=\"mt-3 rounded-lg border border-border bg-muted/20 p-3\"\n role=\"region\"\n aria-label={`${selectedBucket.label} details`}\n >\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <p className=\"text-sm font-semibold text-foreground\">{selectedBucket.label}</p>\n <div className=\"mt-1 flex flex-wrap gap-1.5 text-[11px] text-muted-foreground\">\n <span className=\"rounded-full bg-background px-2 py-0.5\">\n {selectedBucket.signalCount ?? selectedBucketSignals.length} signals\n </span>\n </div>\n </div>\n </div>\n\n {selectedBucketSignals.length > 0 ? (\n <ul className=\"mt-3 space-y-2\" aria-label=\"Matching signals\">\n {selectedBucketSignals.map((signal, index) => (\n <li key={signal.id ?? `${selectedBucket.key}-signal-${index}`}>\n <SignalRow\n item={item}\n bucketKey={selectedBucket.key}\n signal={signal}\n onOpenSignalBucket={onOpenSignalBucket}\n />\n </li>\n ))}\n </ul>\n ) : selectedBucket.evidence && selectedBucket.evidence.length > 0 ? (\n <ul className=\"mt-3 space-y-1.5\" aria-label=\"Matching signals\">\n {selectedBucket.evidence.map((evidence, index) => (\n <li key={`${selectedBucket.key}-evidence-${index}`} className=\"flex gap-2 text-xs text-muted-foreground\">\n <span className=\"mt-1.5 h-1 w-1 shrink-0 rounded-full bg-primary\"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AAG,eAAe,GAAG,aAAa,KAAK,EAGhD,CACD,GACH,IACE;AAAA;AAAA;AAAA,IAEN;AAAA,KAEJ;AAEJ;","names":["_a"]}
@@ -5,7 +5,7 @@ import { Tabs as Tabs$1 } from 'radix-ui';
5
5
 
6
6
  declare function Tabs({ className, orientation, ...props }: React.ComponentProps<typeof Tabs$1.Root>): React.JSX.Element;
7
7
  declare const tabsListVariants: (props?: ({
8
- variant?: "default" | "line" | null | undefined;
8
+ variant?: "line" | "default" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  declare function TabsList({ className, variant, ...props }: React.ComponentProps<typeof Tabs$1.List> & VariantProps<typeof tabsListVariants>): React.JSX.Element;
11
11
  declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof Tabs$1.Trigger>): React.JSX.Element;
package/dist/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export { CollapsibleSection, CollapsibleSectionProps } from './components/collap
13
13
  export { ComplianceBadge, ComplianceBadgeProps, ComplianceStatus } from './components/compliance-badge.js';
14
14
  export { ContactChip, ContactChipProps } from './components/contact-chip.js';
15
15
  export { ContactChannel, ContactItem, ContactList, ContactListProps } from './components/contact-list.js';
16
+ export { ContextualQuickActionContextLabel, ContextualQuickActionContextLabelProps, ContextualQuickActionItem, ContextualQuickActionLauncher, ContextualQuickActionLauncherProps } from './components/contextual-quick-action-launcher.js';
16
17
  export { CheckInsCard, RecentlyCompletedCard, TopTasksCard, UpcomingMeetingsCard } from './components/dashboard-cards.js';
17
18
  export { DataRow, DataTable, DataTableProps } from './components/data-table.js';
18
19
  export { ConditionFieldDef, ConditionFilterValue, ConditionOperator, DEFAULT_OPERATORS, DataTableConditionFilter, DataTableConditionFilterProps, OPERATOR_LABELS, generateConditionId, getOperators } from './components/data-table-condition-filter.js';
@@ -51,6 +52,7 @@ export { RichTextAction, RichTextToolbar, RichTextToolbarProps } from './compone
51
52
  export { ScoreAnalysisModal, ScoreAnalysisModalProps, ScoreAnalysisPanel } from './components/score-analysis-modal.js';
52
53
  export { ScoreBreakdown, ScoreBreakdownProps, ScoreFactor } from './components/score-breakdown.js';
53
54
  export { ScoreFeedback, useScoreFeedback } from './components/score-feedback.js';
55
+ export { ScoreWhyChips, ScoreWhyChipsProps, SignalPriorityChip, SignalPriorityChipProps, SignalPriorityPanel, SignalPriorityPanelProps, getSignalScoreUrgencyLabel } from './components/score-why-chips.js';
54
56
  export { ScoreRing, ScoreRingProps, getScoreColor } from './components/score-ring.js';
55
57
  export { ScrollArea, ScrollBar } from './components/scroll-area.js';
56
58
  export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from './components/select.js';
@@ -86,7 +88,7 @@ export { VolumeAnalysisChart, VolumeAnalysisChartProps, VolumeDataKey } from './
86
88
  export { MetricCardData, TopLineMetrics, TopLineMetricsProps } from './charts/top-line-metrics.js';
87
89
  export { PipelineFilterBreakdown, PipelineOverview, PipelineOverviewProps, PipelineStage, PipelineStageMetrics, PipelineStageTiming } from './charts/pipeline-overview.js';
88
90
  export { SankeyChart, SankeyData, SankeyDropOff, SankeyHoverCardData, SankeyLink, SankeyNode, SankeyStageMetrics } from './charts/sankey-chart.js';
89
- export { AccountFilterTab, AccountsViewConfig, AdminTab, AdminViewConfig, BriefStyleVariant, EntityPanelConfig, EntityPanelSection, InboxDetailSections, InboxSortOption, InboxViewConfig, InsightsCustomTab, InsightsViewConfig, PrototypeBrandConfig, PrototypeConfig, QueueItem, SignalScoreData, WorkQueueViewConfig } from './prototype/prototype-config.js';
91
+ export { AccountFilterTab, AccountsViewConfig, AdminTab, AdminViewConfig, BriefStyleVariant, EntityPanelConfig, EntityPanelSection, InboxDetailSections, InboxSortOption, InboxViewConfig, InsightsCustomTab, InsightsViewConfig, PrototypeBrandConfig, PrototypeConfig, QueueItem, SignalScoreData, SignalScoreExplanationBucket, SignalScoreExplanationSignal, SignalScoreUrgencyLabel, WorkQueueViewConfig } from './prototype/prototype-config.js';
90
92
  export { PrototypeShell, PrototypeShellProps } from './prototype/prototype-shell.js';
91
93
  export { DetailView, DetailViewProps, PrototypeInboxView, PrototypeInboxViewProps } from './prototype/prototype-inbox-view.js';
92
94
  export { PrototypeInsightsView, PrototypeInsightsViewProps } from './prototype/prototype-insights-view.js';
package/dist/index.js CHANGED
@@ -13,6 +13,7 @@ import { CollapsibleSection } from "./components/collapsible-section.js";
13
13
  export * from "./components/compliance-badge.js";
14
14
  export * from "./components/contact-chip.js";
15
15
  export * from "./components/contact-list.js";
16
+ export * from "./components/contextual-quick-action-launcher.js";
16
17
  export * from "./components/dashboard-cards.js";
17
18
  export * from "./components/data-table.js";
18
19
  export * from "./components/data-table-condition-filter.js";
@@ -53,6 +54,7 @@ export * from "./components/rich-text-toolbar.js";
53
54
  export * from "./components/score-analysis-modal.js";
54
55
  export * from "./components/score-breakdown.js";
55
56
  export * from "./components/score-feedback.js";
57
+ export * from "./components/score-why-chips.js";
56
58
  export * from "./components/score-ring.js";
57
59
  export * from "./components/scroll-area.js";
58
60
  export * from "./components/select.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @handled-ai/design-system\n * UI components and utilities (shadcn-style, New York)\n */\n\n// Utilities\nexport { cn } from \"./lib/utils\"\nexport { BRAND_ICONS, BRAND_GRAPHICS } from \"./lib/icons\"\n\n// Hooks\nexport { useIsMobile } from \"./hooks/use-mobile\"\n\n// Components (light — no recharts/nivo/three transitive deps)\nexport * from \"./components/activity-detail\"\nexport * from \"./components/activity-log\"\nexport * from \"./components/agent-popover\"\nexport * from \"./components/agent-widget\"\nexport * from \"./components/avatar\"\nexport * from \"./components/badge\"\nexport * from \"./components/button\"\nexport * from \"./components/card\"\nexport { CollapsibleSection, type CollapsibleSectionProps } from \"./components/collapsible-section\"\nexport * from \"./components/compliance-badge\"\nexport * from \"./components/contact-chip\"\nexport * from \"./components/contact-list\"\nexport * from \"./components/dashboard-cards\"\nexport * from \"./components/data-table\"\nexport * from \"./components/data-table-condition-filter\"\nexport * from \"./components/data-table-display\"\nexport * from \"./components/data-table-filter\"\nexport * from \"./components/data-table-quick-views\"\nexport * from \"./components/data-table-toolbar\"\nexport * from \"./components/detail-view\"\nexport * from \"./components/dialog\"\nexport * from \"./components/dropdown-menu\"\nexport * from \"./components/empty-state\"\nexport * from \"./components/entity-panel\"\nexport * from \"./components/filter-chip\"\nexport * from \"./components/inbox-row\"\nexport * from \"./components/inbox-toolbar\"\nexport * from \"./components/inline-banner\"\nexport * from \"./components/input\"\nexport * from \"./components/insights-filter-bar\"\nexport * from \"./components/item-list\"\nexport * from \"./components/item-list-display\"\nexport * from \"./components/item-list-filter\"\nexport * from \"./components/item-list-toolbar\"\nexport * from \"./components/kbd-hint\"\nexport * from \"./components/label\"\nexport * from \"./components/message\"\nexport * from \"./components/metric-card\"\nexport * from \"./components/performance-metrics-table\"\nexport * from \"./components/preview-list\"\nexport * from \"./components/progress\"\nexport * from \"./components/quick-action-chat-area\"\nexport {\n QuickActionModal,\n type QuickActionPriority,\n type QuickActionTaskDraft,\n type QuickActionTemplate,\n} from \"./components/quick-action-modal\"\nexport * from \"./components/quick-action-sidebar-nav\"\nexport * from \"./components/recommended-actions-section\"\nexport * from \"./components/report-card\"\nexport * from \"./components/rich-text-toolbar\"\nexport * from \"./components/score-analysis-modal\"\nexport * from \"./components/score-breakdown\"\nexport * from \"./components/score-feedback\"\nexport * from \"./components/score-ring\"\nexport * from \"./components/scroll-area\"\nexport * from \"./components/select\"\nexport * from \"./components/separator\"\nexport * from \"./components/sheet\"\nexport * from \"./components/sidebar\"\nexport * from \"./components/signal-feedback-inline\"\nexport * from \"./components/simple-data-table\"\nexport * from \"./components/skeleton\"\nexport * from \"./components/status-badge\"\nexport * from \"./components/step-timeline\"\nexport * from \"./components/sticky-action-bar\"\nexport * from \"./components/styled-bar-list\"\nexport { DraftFeedbackInline } from \"./components/draft-feedback-inline\"\nexport type { DraftFeedbackInlineProps } from \"./components/draft-feedback-inline\"\nexport { AccountContactsPopover, BrandIcon } from \"./components/account-contacts-popover\"\nexport type { AccountContactsPopoverProps } from \"./components/account-contacts-popover\"\nexport * from \"./components/suggested-actions\"\nexport * from \"./components/switch\"\nexport * from \"./components/table\"\nexport * from \"./components/tabs\"\nexport * from \"./components/textarea\"\nexport * from \"./components/timeline-activity\"\nexport * from \"./components/tooltip\"\nexport * from \"./components/variable-autocomplete\"\nexport * from \"./components/view-mode-toggle\"\nexport * from \"./components/virtualized-data-table\"\nexport type { ColumnSizingState } from \"@tanstack/react-table\"\n\n// Charts (re-exported for backward compatibility with root imports)\nexport * from \"./charts/index\"\n\n// Prototype template system (re-exported for backward compatibility)\nexport * from \"./prototype/prototype-config\"\nexport * from \"./prototype/prototype-shell\"\nexport * from \"./prototype/prototype-inbox-view\"\nexport * from \"./prototype/prototype-insights-view\"\nexport * from \"./prototype/prototype-accounts-view\"\nexport * from \"./prototype/prototype-admin-view\"\nexport * from \"./prototype/prototype-work-queue-view\"\n"],"mappings":"AAMA,SAAS,UAAU;AACnB,SAAS,aAAa,sBAAsB;AAG5C,SAAS,mBAAmB;AAG5B,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,0BAAwD;AACjE,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd;AAAA,EACE;AAAA,OAIK;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,2BAA2B;AAEpC,SAAS,wBAAwB,iBAAiB;AAElD,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAId,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @handled-ai/design-system\n * UI components and utilities (shadcn-style, New York)\n */\n\n// Utilities\nexport { cn } from \"./lib/utils\"\nexport { BRAND_ICONS, BRAND_GRAPHICS } from \"./lib/icons\"\n\n// Hooks\nexport { useIsMobile } from \"./hooks/use-mobile\"\n\n// Components (light — no recharts/nivo/three transitive deps)\nexport * from \"./components/activity-detail\"\nexport * from \"./components/activity-log\"\nexport * from \"./components/agent-popover\"\nexport * from \"./components/agent-widget\"\nexport * from \"./components/avatar\"\nexport * from \"./components/badge\"\nexport * from \"./components/button\"\nexport * from \"./components/card\"\nexport { CollapsibleSection, type CollapsibleSectionProps } from \"./components/collapsible-section\"\nexport * from \"./components/compliance-badge\"\nexport * from \"./components/contact-chip\"\nexport * from \"./components/contact-list\"\nexport * from \"./components/contextual-quick-action-launcher\"\nexport * from \"./components/dashboard-cards\"\nexport * from \"./components/data-table\"\nexport * from \"./components/data-table-condition-filter\"\nexport * from \"./components/data-table-display\"\nexport * from \"./components/data-table-filter\"\nexport * from \"./components/data-table-quick-views\"\nexport * from \"./components/data-table-toolbar\"\nexport * from \"./components/detail-view\"\nexport * from \"./components/dialog\"\nexport * from \"./components/dropdown-menu\"\nexport * from \"./components/empty-state\"\nexport * from \"./components/entity-panel\"\nexport * from \"./components/filter-chip\"\nexport * from \"./components/inbox-row\"\nexport * from \"./components/inbox-toolbar\"\nexport * from \"./components/inline-banner\"\nexport * from \"./components/input\"\nexport * from \"./components/insights-filter-bar\"\nexport * from \"./components/item-list\"\nexport * from \"./components/item-list-display\"\nexport * from \"./components/item-list-filter\"\nexport * from \"./components/item-list-toolbar\"\nexport * from \"./components/kbd-hint\"\nexport * from \"./components/label\"\nexport * from \"./components/message\"\nexport * from \"./components/metric-card\"\nexport * from \"./components/performance-metrics-table\"\nexport * from \"./components/preview-list\"\nexport * from \"./components/progress\"\nexport * from \"./components/quick-action-chat-area\"\nexport {\n QuickActionModal,\n type QuickActionPriority,\n type QuickActionTaskDraft,\n type QuickActionTemplate,\n} from \"./components/quick-action-modal\"\nexport * from \"./components/quick-action-sidebar-nav\"\nexport * from \"./components/recommended-actions-section\"\nexport * from \"./components/report-card\"\nexport * from \"./components/rich-text-toolbar\"\nexport * from \"./components/score-analysis-modal\"\nexport * from \"./components/score-breakdown\"\nexport * from \"./components/score-feedback\"\nexport * from \"./components/score-why-chips\"\nexport * from \"./components/score-ring\"\nexport * from \"./components/scroll-area\"\nexport * from \"./components/select\"\nexport * from \"./components/separator\"\nexport * from \"./components/sheet\"\nexport * from \"./components/sidebar\"\nexport * from \"./components/signal-feedback-inline\"\nexport * from \"./components/simple-data-table\"\nexport * from \"./components/skeleton\"\nexport * from \"./components/status-badge\"\nexport * from \"./components/step-timeline\"\nexport * from \"./components/sticky-action-bar\"\nexport * from \"./components/styled-bar-list\"\nexport { DraftFeedbackInline } from \"./components/draft-feedback-inline\"\nexport type { DraftFeedbackInlineProps } from \"./components/draft-feedback-inline\"\nexport { AccountContactsPopover, BrandIcon } from \"./components/account-contacts-popover\"\nexport type { AccountContactsPopoverProps } from \"./components/account-contacts-popover\"\nexport * from \"./components/suggested-actions\"\nexport * from \"./components/switch\"\nexport * from \"./components/table\"\nexport * from \"./components/tabs\"\nexport * from \"./components/textarea\"\nexport * from \"./components/timeline-activity\"\nexport * from \"./components/tooltip\"\nexport * from \"./components/variable-autocomplete\"\nexport * from \"./components/view-mode-toggle\"\nexport * from \"./components/virtualized-data-table\"\nexport type { ColumnSizingState } from \"@tanstack/react-table\"\n\n// Charts (re-exported for backward compatibility with root imports)\nexport * from \"./charts/index\"\n\n// Prototype template system (re-exported for backward compatibility)\nexport * from \"./prototype/prototype-config\"\nexport * from \"./prototype/prototype-shell\"\nexport * from \"./prototype/prototype-inbox-view\"\nexport * from \"./prototype/prototype-insights-view\"\nexport * from \"./prototype/prototype-accounts-view\"\nexport * from \"./prototype/prototype-admin-view\"\nexport * from \"./prototype/prototype-work-queue-view\"\n"],"mappings":"AAMA,SAAS,UAAU;AACnB,SAAS,aAAa,sBAAsB;AAG5C,SAAS,mBAAmB;AAG5B,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,0BAAwD;AACjE,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd;AAAA,EACE;AAAA,OAIK;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,2BAA2B;AAEpC,SAAS,wBAAwB,iBAAiB;AAElD,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAId,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -1,4 +1,4 @@
1
- export { AccountFilterTab, AccountsViewConfig, AdminTab, AdminViewConfig, BriefStyleVariant, EntityPanelConfig, EntityPanelSection, InboxDetailSections, InboxSortOption, InboxViewConfig, InsightsCustomTab, InsightsViewConfig, PrototypeBrandConfig, PrototypeConfig, QueueItem, SignalScoreData, WorkQueueViewConfig } from './prototype-config.js';
1
+ export { AccountFilterTab, AccountsViewConfig, AdminTab, AdminViewConfig, BriefStyleVariant, EntityPanelConfig, EntityPanelSection, InboxDetailSections, InboxSortOption, InboxViewConfig, InsightsCustomTab, InsightsViewConfig, PrototypeBrandConfig, PrototypeConfig, QueueItem, SignalScoreData, SignalScoreExplanationBucket, SignalScoreExplanationSignal, SignalScoreUrgencyLabel, WorkQueueViewConfig } from './prototype-config.js';
2
2
  export { PrototypeShell, PrototypeShellProps } from './prototype-shell.js';
3
3
  export { DetailView, DetailViewProps, PrototypeInboxView, PrototypeInboxViewProps } from './prototype-inbox-view.js';
4
4
  export { PrototypeInsightsView, PrototypeInsightsViewProps } from './prototype-insights-view.js';
@@ -28,16 +28,46 @@ interface QueueItem {
28
28
  company: string;
29
29
  tag1: string;
30
30
  }
31
+ type SignalScoreUrgencyLabel = "Low" | "Medium" | "High" | "Urgent";
32
+ interface SignalScoreExplanationSignal {
33
+ id?: string;
34
+ label: string;
35
+ description?: string;
36
+ source?: string;
37
+ time?: string;
38
+ metric?: string;
39
+ }
40
+ interface SignalScoreExplanationBucket {
41
+ key: string;
42
+ label: string;
43
+ kind: "signal" | "factor" | "merged";
44
+ score?: number;
45
+ classification?: string;
46
+ rationale?: string;
47
+ evidence?: string[];
48
+ signals?: SignalScoreExplanationSignal[];
49
+ primaryMetricLabel?: string;
50
+ primaryMetricValue?: string;
51
+ signalCount?: number;
52
+ signalIds?: string[];
53
+ primarySignalId?: string;
54
+ factorKeys?: string[];
55
+ }
31
56
  interface SignalScoreData {
32
57
  score: number;
33
58
  factors: ScoreFactor[];
34
59
  whyNow: string;
35
60
  evidence: string[];
36
61
  confidence: number;
62
+ urgencyLabel?: SignalScoreUrgencyLabel;
63
+ urgencyExplanation?: string;
64
+ explanationBuckets?: SignalScoreExplanationBucket[];
37
65
  onFactorFeedback?: (factorKey: string, type: "up" | "down" | null, detail?: string) => void;
66
+ /** @deprecated The compact score UX no longer renders score-level thumbs by default. */
38
67
  onScoreFeedback?: (type: "up" | "down", pills: string[], detail: string) => void;
39
68
  onApproveFeedback?: (reasons: string[], detail: string) => void;
40
69
  onDismissFeedback?: (reasons: string[], detail: string, subReason?: string) => void;
70
+ /** @deprecated The compact score UX no longer renders score-level thumbs by default. */
41
71
  initialScoreFeedback?: {
42
72
  type: "up" | "down";
43
73
  pills: string[];
@@ -80,7 +110,13 @@ interface InboxViewConfig {
80
110
  hideToolbarActions?: boolean;
81
111
  hideHoverActions?: boolean;
82
112
  onSuggestedActionFeedback?: (actionId: number | string, feedback: string, actionTitle?: string) => void;
113
+ /** @deprecated The compact score UX no longer renders score-level thumbs by default. */
83
114
  onScoreFeedback?: (type: "up" | "down", pills: string[], detail: string) => void;
115
+ onOpenSignalBucket?: (args: {
116
+ item: QueueItem;
117
+ bucketKey: string;
118
+ signalId: string;
119
+ }) => void;
84
120
  buildEntityChips?: (item: QueueItem) => Array<{
85
121
  id: string;
86
122
  label: string;
@@ -291,4 +327,4 @@ interface PrototypeConfig {
291
327
  navigableViews?: string[];
292
328
  }
293
329
 
294
- export type { AccountFilterTab, AccountsViewConfig, AdminTab, AdminViewConfig, BriefStyleVariant, EntityPanelConfig, EntityPanelSection, InboxDetailSections, InboxSortOption, InboxViewConfig, InsightsCustomTab, InsightsViewConfig, PrototypeBrandConfig, PrototypeConfig, QueueItem, SignalScoreData, WorkQueueViewConfig };
330
+ export type { AccountFilterTab, AccountsViewConfig, AdminTab, AdminViewConfig, BriefStyleVariant, EntityPanelConfig, EntityPanelSection, InboxDetailSections, InboxSortOption, InboxViewConfig, InsightsCustomTab, InsightsViewConfig, PrototypeBrandConfig, PrototypeConfig, QueueItem, SignalScoreData, SignalScoreExplanationBucket, SignalScoreExplanationSignal, SignalScoreUrgencyLabel, WorkQueueViewConfig };
@@ -37,6 +37,8 @@ interface DetailViewProps {
37
37
  onOpenEntityPanel?: () => void;
38
38
  onOpenRecentActivity?: () => void;
39
39
  onSuggestedActionFeedback?: (actionId: number | string, feedback: string, actionTitle?: string) => void;
40
+ /** @deprecated The compact score UX no longer renders score-level thumbs by default. */
41
+ onScoreFeedback?: (type: "up" | "down", pills: string[], detail: string) => void;
40
42
  onSignalApprove?: (item: QueueItem) => void | Promise<boolean>;
41
43
  getSignalApprovalState?: (item: QueueItem) => ApprovalState | undefined;
42
44
  signalLabels?: InboxViewConfig["signalLabels"];
@@ -51,14 +53,18 @@ interface DetailViewProps {
51
53
  lastActivityTime?: string;
52
54
  /** Render extra metadata chips (e.g. assignee) inside the chips row below the title. */
53
55
  renderMetadataExtra?: (item: QueueItem) => React.ReactNode;
54
- onScoreFeedback?: (type: "up" | "down", pills: string[], detail: string) => void;
56
+ onOpenSignalBucket?: (args: {
57
+ item: QueueItem;
58
+ bucketKey: string;
59
+ signalId: string;
60
+ }) => void;
55
61
  approveButtonIconUrl?: string;
56
62
  opportunityPreview?: OpportunityPreview;
57
63
  onRequestApproval?: () => Promise<void>;
58
64
  /** Number of important/attention-worthy events to highlight on the collapsed timeline header. */
59
65
  attentionCount?: number;
60
66
  }
61
- declare function DetailView({ item, sections, getSignalScore, buildSuggestedActions, buildSourceItems, getTimelineEvents, accountContacts, emailSignature, iconMap, onOpenEntityPanel, onOpenRecentActivity, onSuggestedActionFeedback: _onSuggestedActionFeedback, onSignalApprove, getSignalApprovalState, signalLabels, hideApproveButton, signalBriefCopy, briefStyleVariant, renderDetailExtra, renderBeforeScore, renderAfterScore, lastActivityTime, renderMetadataExtra, onScoreFeedback, approveButtonIconUrl, opportunityPreview, onRequestApproval, attentionCount, }: DetailViewProps): React.JSX.Element;
62
- declare function PrototypeInboxView({ items, filterCategories, detailSections, accountContacts, buildAccountContacts, emailSignature, buildSuggestedActions: buildSuggestedActionsProp, buildSourceItems: buildSourceItemsProp, getSignalScore: getSignalScoreProp, getTimelineEvents, iconMap, hideToolbarActions, hideHoverActions, onSuggestedActionFeedback, onScoreFeedback, headerActions, onOpenEntityPanel, onOpenRecentActivity, onItemSelect, defaultViewMode, buildEntityChips, quickFilterTabs, hideAccountsButton, accountDetailsLabel, onSignalApprove, getSignalApprovalState, signalLabels, hideApproveButton, signalBriefCopy, briefStyleVariant, renderDetailExtra, renderBeforeScore, renderAfterScore, lastActivityTime, sortOptions, activeSortId, onSortChange, }: PrototypeInboxViewProps): React.JSX.Element;
67
+ declare function DetailView({ item, sections, getSignalScore, buildSuggestedActions, buildSourceItems: _buildSourceItems, getTimelineEvents, accountContacts, emailSignature, iconMap, onOpenEntityPanel, onOpenRecentActivity, onSuggestedActionFeedback: _onSuggestedActionFeedback, onScoreFeedback: _onScoreFeedback, onSignalApprove, getSignalApprovalState, signalLabels, hideApproveButton, signalBriefCopy, briefStyleVariant, renderDetailExtra, renderBeforeScore, renderAfterScore, lastActivityTime, renderMetadataExtra, onOpenSignalBucket, approveButtonIconUrl, opportunityPreview, onRequestApproval, attentionCount, }: DetailViewProps): React.JSX.Element;
68
+ declare function PrototypeInboxView({ items, filterCategories, detailSections, accountContacts, buildAccountContacts, emailSignature, buildSuggestedActions: buildSuggestedActionsProp, buildSourceItems: buildSourceItemsProp, getSignalScore: getSignalScoreProp, getTimelineEvents, iconMap, hideToolbarActions, hideHoverActions, onSuggestedActionFeedback, onScoreFeedback, onOpenSignalBucket, headerActions, onOpenEntityPanel, onOpenRecentActivity, onItemSelect, defaultViewMode, buildEntityChips, quickFilterTabs, hideAccountsButton, accountDetailsLabel, onSignalApprove, getSignalApprovalState, signalLabels, hideApproveButton, signalBriefCopy, briefStyleVariant, renderDetailExtra, renderBeforeScore, renderAfterScore, lastActivityTime, sortOptions, activeSortId, onSortChange, }: PrototypeInboxViewProps): React.JSX.Element;
63
69
 
64
70
  export { DetailView, type DetailViewProps, PrototypeInboxView, type PrototypeInboxViewProps };
@@ -55,9 +55,7 @@ import {
55
55
  } from "../components/inbox-toolbar.js";
56
56
  import { GroupedListView } from "../components/item-list.js";
57
57
  import { SignalApproval } from "../components/signal-feedback-inline.js";
58
- import { ScoreFeedback } from "../components/score-feedback.js";
59
- import { ScoreBreakdown } from "../components/score-breakdown.js";
60
- import { Citation } from "../components/detail-view.js";
58
+ import { ScoreWhyChips, SignalPriorityChip, SignalPriorityPanel } from "../components/score-why-chips.js";
61
59
  import {
62
60
  SuggestedActions
63
61
  } from "../components/suggested-actions.js";
@@ -92,7 +90,7 @@ function DetailView({
92
90
  sections,
93
91
  getSignalScore,
94
92
  buildSuggestedActions,
95
- buildSourceItems,
93
+ buildSourceItems: _buildSourceItems,
96
94
  getTimelineEvents,
97
95
  accountContacts,
98
96
  emailSignature,
@@ -100,6 +98,7 @@ function DetailView({
100
98
  onOpenEntityPanel,
101
99
  onOpenRecentActivity,
102
100
  onSuggestedActionFeedback: _onSuggestedActionFeedback,
101
+ onScoreFeedback: _onScoreFeedback,
103
102
  onSignalApprove,
104
103
  getSignalApprovalState,
105
104
  signalLabels,
@@ -111,30 +110,30 @@ function DetailView({
111
110
  renderAfterScore,
112
111
  lastActivityTime,
113
112
  renderMetadataExtra,
114
- onScoreFeedback,
113
+ onOpenSignalBucket,
115
114
  approveButtonIconUrl,
116
115
  opportunityPreview,
117
116
  onRequestApproval,
118
117
  attentionCount
119
118
  }) {
120
119
  var _a, _b, _c;
121
- const [evidenceExpanded, setEvidenceExpanded] = React.useState(false);
122
120
  const [showTimeline, setShowTimeline] = React.useState(false);
123
121
  const [extraActions, setExtraActions] = React.useState([]);
122
+ const [priorityOpen, setPriorityOpen] = React.useState(false);
123
+ const priorityPanelId = React.useId();
124
124
  React.useEffect(() => {
125
125
  setShowTimeline(false);
126
- setEvidenceExpanded(false);
127
126
  setExtraActions([]);
127
+ setPriorityOpen(false);
128
128
  }, [item.id]);
129
129
  const signalData = React.useMemo(
130
130
  () => getSignalScore(item.company, item),
131
- [getSignalScore, item.company, item]
131
+ [getSignalScore, item]
132
132
  );
133
133
  const suggestedActions = React.useMemo(
134
134
  () => [...buildSuggestedActions(item), ...extraActions],
135
135
  [buildSuggestedActions, item, extraActions]
136
136
  );
137
- const sourceItems = React.useMemo(() => buildSourceItems(item), [buildSourceItems, item]);
138
137
  const timelineEvents = React.useMemo(
139
138
  () => {
140
139
  var _a2;
@@ -193,12 +192,16 @@ function DetailView({
193
192
  ] }),
194
193
  /* @__PURE__ */ jsx("h1", { className: "mb-3 text-2xl font-bold tracking-tight text-foreground", children: item.title }),
195
194
  /* @__PURE__ */ jsxs("div", { className: "mb-6 flex flex-wrap items-center gap-2", children: [
196
- (item.statusColor === "red" || item.statusColor === "orange") && /* @__PURE__ */ jsxs("div", { className: `inline-flex items-center gap-1 rounded-md px-2.5 py-1 text-xs font-semibold ${item.statusColor === "red" ? "bg-red-50 text-red-700" : "bg-orange-50 text-orange-700"}`, children: [
197
- /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold", children: "!" }),
198
- " ",
199
- item.tag1.charAt(0).toUpperCase() + item.tag1.slice(1)
200
- ] }),
201
- /* @__PURE__ */ jsx("div", { className: "inline-flex items-center gap-1 rounded-md bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground", children: item.tag1 }),
195
+ /* @__PURE__ */ jsx(
196
+ SignalPriorityChip,
197
+ {
198
+ score: signalData.score,
199
+ urgencyLabel: signalData.urgencyLabel,
200
+ isOpen: priorityOpen,
201
+ controlsId: priorityPanelId,
202
+ onClick: () => setPriorityOpen((prev) => !prev)
203
+ }
204
+ ),
202
205
  signalData.timeChipLabel && /* @__PURE__ */ jsx(Badge, { variant: "outline", title: (_a = signalData.timeChipDetail) != null ? _a : void 0, children: signalData.timeChipLabel }),
203
206
  /* @__PURE__ */ jsxs(
204
207
  "button",
@@ -215,32 +218,9 @@ function DetailView({
215
218
  ),
216
219
  renderMetadataExtra == null ? void 0 : renderMetadataExtra(item)
217
220
  ] }),
221
+ priorityOpen && /* @__PURE__ */ jsx(SignalPriorityPanel, { id: priorityPanelId, signalData, className: "mb-6" }),
218
222
  sections.signalBrief && (() => {
219
- var _a2, _b2;
220
- const pct = signalData.score;
221
- const scoreColor = pct >= 70 ? "text-emerald-600" : pct >= 40 ? "text-amber-600" : "text-red-600";
222
- const barColor = pct >= 70 ? "bg-emerald-500" : pct >= 40 ? "bg-amber-500" : "bg-red-500";
223
- const scoreLabel = pct >= 70 ? "HIGH" : pct >= 40 ? "MEDIUM" : "LOW";
224
- const evidenceWithCitations = sourceItems.length >= 4 ? [
225
- /* @__PURE__ */ jsxs(Fragment, { children: [
226
- "There are ",
227
- /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: "3 unusual signals" }),
228
- " including a large balance outflow and reduced login frequency",
229
- /* @__PURE__ */ jsx(Citation, { number: 1, source: sourceItems[0] }),
230
- /* @__PURE__ */ jsx(Citation, { number: 2, source: sourceItems[1] }),
231
- /* @__PURE__ */ jsx(Citation, { number: 3, source: sourceItems[2] })
232
- ] }),
233
- /* @__PURE__ */ jsxs(Fragment, { children: [
234
- "Scott mentioned in ",
235
- /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: "#treasury-questions" }),
236
- " that they are actively looking for treasury management options",
237
- /* @__PURE__ */ jsx(Citation, { number: 4, source: sourceItems[2] })
238
- ] }),
239
- /* @__PURE__ */ jsxs(Fragment, { children: [
240
- "You have a recent email thread regarding optimization options that hasn't been replied to",
241
- /* @__PURE__ */ jsx(Citation, { number: 5, source: sourceItems[3] })
242
- ] })
243
- ] : signalData.evidence.map((ev, i) => /* @__PURE__ */ jsx("span", { children: ev }, i));
223
+ var _a2;
244
224
  const briefHeading = (_a2 = signalBriefCopy == null ? void 0 : signalBriefCopy.heading) != null ? _a2 : "Signal brief";
245
225
  const introOpt = signalBriefCopy == null ? void 0 : signalBriefCopy.intro;
246
226
  const briefIntro = introOpt === null ? null : typeof introOpt === "function" ? introOpt(item) : introOpt != null ? introOpt : `Signals indicate a potential opportunity for ${item.company}.`;
@@ -251,64 +231,14 @@ function DetailView({
251
231
  signalData.signalBrief ? /* @__PURE__ */ jsx("p", { className: isProminent ? "text-base text-foreground leading-relaxed mb-4" : "text-sm text-foreground/90 leading-relaxed mb-4", children: signalData.signalBrief }) : /* @__PURE__ */ jsx("p", { className: isProminent ? "text-base text-foreground leading-relaxed mb-4" : "text-sm text-foreground/90 leading-relaxed mb-4", children: signalData.whyNow }),
252
232
  renderBeforeScore == null ? void 0 : renderBeforeScore(item),
253
233
  /* @__PURE__ */ jsx(
254
- ScoreFeedback.Root,
234
+ ScoreWhyChips,
255
235
  {
256
- onSubmitFeedback: (type, pills, detail) => {
257
- var _a3, _b3;
258
- return (_b3 = (_a3 = signalData.onScoreFeedback) != null ? _a3 : onScoreFeedback) == null ? void 0 : _b3(type, pills, detail);
259
- },
260
- initialFeedback: signalData.initialScoreFeedback,
261
- children: /* @__PURE__ */ jsxs("div", { className: "mb-5 rounded-md border border-border bg-muted/20 p-3", children: [
262
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-1.5", children: [
263
- /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold text-muted-foreground uppercase tracking-wider", children: "Signal Score" }),
264
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
265
- /* @__PURE__ */ jsxs("span", { className: "text-sm font-bold text-foreground", children: [
266
- signalData.score,
267
- "/100"
268
- ] }),
269
- /* @__PURE__ */ jsx("span", { className: `text-[10px] font-bold uppercase ${scoreColor}`, children: scoreLabel }),
270
- /* @__PURE__ */ jsx(ScoreFeedback.Trigger, {})
271
- ] })
272
- ] }),
273
- /* @__PURE__ */ jsx(ScoreFeedback.Panel, {}),
274
- /* @__PURE__ */ jsx("div", { className: "h-1.5 bg-muted rounded-full overflow-hidden mb-2", children: /* @__PURE__ */ jsx(
275
- "div",
276
- {
277
- className: `h-full rounded-full transition-all duration-500 ${barColor}`,
278
- style: { width: `${signalData.score}%` }
279
- }
280
- ) }),
281
- /* @__PURE__ */ jsxs(
282
- "button",
283
- {
284
- type: "button",
285
- onClick: () => setEvidenceExpanded((prev) => !prev),
286
- className: "flex items-center gap-1 text-[11px] font-medium text-muted-foreground hover:text-foreground transition-colors",
287
- children: [
288
- /* @__PURE__ */ jsx(ChevronDown, { className: `h-3 w-3 transition-transform duration-200 ${evidenceExpanded ? "rotate-180" : ""}` }),
289
- "View more"
290
- ]
291
- }
292
- ),
293
- evidenceExpanded && /* @__PURE__ */ jsxs("div", { className: "mt-3 space-y-3", children: [
294
- /* @__PURE__ */ jsx("ul", { className: "space-y-2", children: evidenceWithCitations.map((ev, index) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2 text-sm", children: [
295
- /* @__PURE__ */ jsx("div", { className: "w-1.5 h-1.5 bg-primary rounded-full mt-2 flex-shrink-0" }),
296
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground leading-relaxed", children: ev })
297
- ] }, index)) }),
298
- /* @__PURE__ */ jsx(
299
- ScoreBreakdown,
300
- {
301
- factors: signalData.factors,
302
- onFactorFeedback: (_b2 = signalData.onFactorFeedback) != null ? _b2 : ((key, type, detail) => console.log("Signal factor feedback:", { company: item.company, factor: key, type, detail })),
303
- initialFeedback: signalData.initialFactorFeedback
304
- }
305
- ),
306
- /* @__PURE__ */ jsx(SignalApproval.Actions, {})
307
- ] })
308
- ] })
236
+ item,
237
+ signalData,
238
+ onOpenSignalBucket
309
239
  }
310
240
  ),
311
- !evidenceExpanded && /* @__PURE__ */ jsx(SignalApproval.Actions, {})
241
+ /* @__PURE__ */ jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsx(SignalApproval.Actions, {}) })
312
242
  ] });
313
243
  })(),
314
244
  renderAfterScore == null ? void 0 : renderAfterScore(item),
@@ -383,6 +313,7 @@ function PrototypeInboxView({
383
313
  hideHoverActions,
384
314
  onSuggestedActionFeedback,
385
315
  onScoreFeedback,
316
+ onOpenSignalBucket,
386
317
  headerActions,
387
318
  onOpenEntityPanel,
388
319
  onOpenRecentActivity,
@@ -586,6 +517,7 @@ function PrototypeInboxView({
586
517
  onOpenEntityPanel,
587
518
  onOpenRecentActivity,
588
519
  onSuggestedActionFeedback,
520
+ onScoreFeedback,
589
521
  onSignalApprove,
590
522
  getSignalApprovalState,
591
523
  signalLabels,
@@ -596,7 +528,7 @@ function PrototypeInboxView({
596
528
  renderBeforeScore,
597
529
  renderAfterScore,
598
530
  lastActivityTime,
599
- onScoreFeedback
531
+ onOpenSignalBucket
600
532
  };
601
533
  return /* @__PURE__ */ jsxs("div", { className: "flex h-full w-full flex-col", children: [
602
534
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-b border-border bg-background px-4 py-3 shrink-0", children: [