@handled-ai/design-system 0.16.1 → 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.
Files changed (30) hide show
  1. package/dist/components/contextual-quick-action-launcher.d.ts +32 -0
  2. package/dist/components/contextual-quick-action-launcher.js +202 -0
  3. package/dist/components/contextual-quick-action-launcher.js.map +1 -0
  4. package/dist/components/data-table-condition-filter.js +26 -9
  5. package/dist/components/data-table-condition-filter.js.map +1 -1
  6. package/dist/components/data-table-filter.js +3 -14
  7. package/dist/components/data-table-filter.js.map +1 -1
  8. package/dist/components/score-why-chips.d.ts +46 -0
  9. package/dist/components/score-why-chips.js +281 -0
  10. package/dist/components/score-why-chips.js.map +1 -0
  11. package/dist/index.d.ts +3 -1
  12. package/dist/index.js +2 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/prototype/index.d.ts +1 -1
  15. package/dist/prototype/prototype-config.d.ts +37 -1
  16. package/dist/prototype/prototype-inbox-view.d.ts +9 -3
  17. package/dist/prototype/prototype-inbox-view.js +28 -96
  18. package/dist/prototype/prototype-inbox-view.js.map +1 -1
  19. package/package.json +1 -1
  20. package/src/components/__tests__/contextual-quick-action-launcher.test.tsx +193 -0
  21. package/src/components/__tests__/data-table-condition-filter.test.tsx +26 -0
  22. package/src/components/__tests__/data-table-filter.test.tsx +21 -0
  23. package/src/components/contextual-quick-action-launcher.tsx +231 -0
  24. package/src/components/data-table-condition-filter.tsx +39 -11
  25. package/src/components/data-table-filter.tsx +3 -19
  26. package/src/components/score-why-chips.tsx +358 -0
  27. package/src/index.ts +2 -0
  28. package/src/prototype/__tests__/detail-view-score-why.test.tsx +326 -0
  29. package/src/prototype/prototype-config.ts +35 -0
  30. package/src/prototype/prototype-inbox-view.tsx +31 -104
@@ -0,0 +1,46 @@
1
+ import * as React from 'react';
2
+ import { QueueItem, SignalScoreData, SignalScoreUrgencyLabel } from '../prototype/prototype-config.js';
3
+ import './quick-action-sidebar-nav.js';
4
+ import './quick-action-modal.js';
5
+ import './score-breakdown.js';
6
+ import './suggested-actions.js';
7
+ import './detail-view.js';
8
+ import './inbox-toolbar.js';
9
+ import './data-table-filter.js';
10
+ import './data-table-condition-filter.js';
11
+ import './data-table.js';
12
+ import './metric-card.js';
13
+ import '../charts/pipeline-overview.js';
14
+ import './timeline-activity.js';
15
+ import './signal-feedback-inline.js';
16
+ import 'lucide-react';
17
+
18
+ declare function getSignalScoreUrgencyLabel(score: number, providedLabel?: SignalScoreUrgencyLabel): SignalScoreUrgencyLabel;
19
+ interface SignalPriorityChipProps {
20
+ score: number;
21
+ urgencyLabel?: SignalScoreUrgencyLabel;
22
+ isOpen?: boolean;
23
+ controlsId?: string;
24
+ onClick?: () => void;
25
+ className?: string;
26
+ }
27
+ declare function SignalPriorityChip({ score, urgencyLabel: providedLabel, isOpen, controlsId, onClick, className, }: SignalPriorityChipProps): React.JSX.Element;
28
+ interface SignalPriorityPanelProps {
29
+ signalData: SignalScoreData;
30
+ className?: string;
31
+ id?: string;
32
+ }
33
+ declare function SignalPriorityPanel({ signalData, className, id }: SignalPriorityPanelProps): React.JSX.Element;
34
+ interface ScoreWhyChipsProps {
35
+ item: QueueItem;
36
+ signalData: SignalScoreData;
37
+ onOpenSignalBucket?: (args: {
38
+ item: QueueItem;
39
+ bucketKey: string;
40
+ signalId: string;
41
+ }) => void;
42
+ className?: string;
43
+ }
44
+ declare function ScoreWhyChips({ item, signalData, onOpenSignalBucket, className, }: ScoreWhyChipsProps): React.JSX.Element | null;
45
+
46
+ export { ScoreWhyChips, type ScoreWhyChipsProps, SignalPriorityChip, type SignalPriorityChipProps, SignalPriorityPanel, type SignalPriorityPanelProps, getSignalScoreUrgencyLabel };
@@ -0,0 +1,281 @@
1
+ "use client"
2
+
3
+ "use client";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import * as React from "react";
6
+ import { Info } from "lucide-react";
7
+ import { ScoreBreakdown } from "./score-breakdown.js";
8
+ import { cn } from "../lib/utils.js";
9
+ function getSignalScoreUrgencyLabel(score, providedLabel) {
10
+ if (providedLabel) return providedLabel;
11
+ if (score >= 80) return "Urgent";
12
+ if (score >= 60) return "High";
13
+ if (score >= 35) return "Medium";
14
+ return "Low";
15
+ }
16
+ function getUrgencyChipClass(label) {
17
+ switch (label) {
18
+ case "Urgent":
19
+ 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";
20
+ case "High":
21
+ 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";
22
+ case "Medium":
23
+ 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";
24
+ case "Low":
25
+ 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";
26
+ }
27
+ }
28
+ function classificationForScore(score) {
29
+ if (score == null) return void 0;
30
+ if (score >= 80) return "Urgent";
31
+ if (score >= 60) return "High";
32
+ if (score >= 35) return "Medium";
33
+ return "Low";
34
+ }
35
+ function scoreRangeForUrgency(label) {
36
+ switch (label) {
37
+ case "Urgent":
38
+ return "80-100";
39
+ case "High":
40
+ return "60-79";
41
+ case "Medium":
42
+ return "35-59";
43
+ case "Low":
44
+ return "0-34";
45
+ }
46
+ }
47
+ function makeDomId(...parts) {
48
+ return parts.filter((part) => Boolean(part)).join("-").replace(/[^A-Za-z0-9_-]+/g, "-");
49
+ }
50
+ function scoreFactorToPriorityBucket(factor) {
51
+ var _a, _b, _c;
52
+ return {
53
+ key: factor.key,
54
+ label: factor.label,
55
+ kind: "factor",
56
+ score: (_a = factor.score) != null ? _a : void 0,
57
+ classification: (_c = factor.risk) != null ? _c : classificationForScore((_b = factor.score) != null ? _b : void 0),
58
+ rationale: factor.why,
59
+ factorKeys: [factor.key]
60
+ };
61
+ }
62
+ function bucketHasSignalRows(bucket) {
63
+ var _a, _b, _c, _d;
64
+ return ((_b = (_a = bucket.signals) == null ? void 0 : _a.length) != null ? _b : 0) > 0 || ((_d = (_c = bucket.signalIds) == null ? void 0 : _c.length) != null ? _d : 0) > 0 || Boolean(bucket.primarySignalId);
65
+ }
66
+ function getSignalScoreBuckets(signalData) {
67
+ var _a;
68
+ return ((_a = signalData.explanationBuckets) != null ? _a : []).filter(
69
+ (bucket) => bucket.kind !== "factor" && bucketHasSignalRows(bucket)
70
+ );
71
+ }
72
+ function getBucketSignals(bucket) {
73
+ if (bucket.signals && bucket.signals.length > 0) return bucket.signals;
74
+ const signalIds = bucket.signalIds && bucket.signalIds.length > 0 ? bucket.signalIds : bucket.primarySignalId ? [bucket.primarySignalId] : [];
75
+ const uniqueSignalIds = Array.from(new Set(signalIds));
76
+ return uniqueSignalIds.map((signalId) => ({
77
+ id: signalId,
78
+ label: `${bucket.label} signal`
79
+ }));
80
+ }
81
+ function getPriorityBuckets(signalData) {
82
+ if (signalData.explanationBuckets !== void 0) return signalData.explanationBuckets;
83
+ return signalData.factors.map(scoreFactorToPriorityBucket);
84
+ }
85
+ function isSameExplanation(a, b) {
86
+ return Boolean(a && b && a.trim() === b.trim());
87
+ }
88
+ function SignalPriorityChip({
89
+ score,
90
+ urgencyLabel: providedLabel,
91
+ isOpen,
92
+ controlsId,
93
+ onClick,
94
+ className
95
+ }) {
96
+ const urgencyLabel = getSignalScoreUrgencyLabel(score, providedLabel);
97
+ return /* @__PURE__ */ jsxs(
98
+ "button",
99
+ {
100
+ type: "button",
101
+ onClick,
102
+ "aria-expanded": isOpen,
103
+ "aria-controls": controlsId,
104
+ className: cn(
105
+ "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",
106
+ getUrgencyChipClass(urgencyLabel),
107
+ className
108
+ ),
109
+ children: [
110
+ urgencyLabel,
111
+ " Priority",
112
+ /* @__PURE__ */ jsx(Info, { className: "h-3 w-3" })
113
+ ]
114
+ }
115
+ );
116
+ }
117
+ function SignalPriorityPanel({ signalData, className, id }) {
118
+ var _a, _b, _c;
119
+ const urgencyLabel = getSignalScoreUrgencyLabel(signalData.score, signalData.urgencyLabel);
120
+ const buckets = React.useMemo(() => getPriorityBuckets(signalData), [signalData]);
121
+ const topBucketRationale = (_a = buckets.find((bucket) => bucket.rationale)) == null ? void 0 : _a.rationale;
122
+ const primaryUrgencyExplanation = (_c = (_b = signalData.urgencyExplanation) != null ? _b : signalData.whyNow) != null ? _c : topBucketRationale;
123
+ const whyNowSection = isSameExplanation(signalData.whyNow, primaryUrgencyExplanation) ? void 0 : signalData.whyNow;
124
+ const topFactorSection = isSameExplanation(topBucketRationale, primaryUrgencyExplanation) || isSameExplanation(topBucketRationale, whyNowSection) ? void 0 : topBucketRationale;
125
+ const scoreRange = scoreRangeForUrgency(urgencyLabel);
126
+ return /* @__PURE__ */ jsxs("div", { id, className: cn("rounded-lg border border-border bg-muted/20 p-3 text-xs", className), role: "region", "aria-label": "Priority explanation", children: [
127
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [
128
+ /* @__PURE__ */ jsxs("div", { children: [
129
+ /* @__PURE__ */ jsxs("p", { className: "font-semibold text-foreground", children: [
130
+ "Why this is ",
131
+ urgencyLabel.toLowerCase(),
132
+ " priority"
133
+ ] }),
134
+ primaryUrgencyExplanation ? /* @__PURE__ */ jsx("p", { className: "mt-1 leading-relaxed text-muted-foreground", children: primaryUrgencyExplanation }) : null
135
+ ] }),
136
+ /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 flex-wrap gap-1.5 text-[11px] text-muted-foreground", children: [
137
+ /* @__PURE__ */ jsxs("span", { className: "rounded-full bg-background px-2 py-0.5", children: [
138
+ "Score ",
139
+ signalData.score,
140
+ "/100"
141
+ ] }),
142
+ /* @__PURE__ */ jsxs("span", { className: "rounded-full bg-background px-2 py-0.5", children: [
143
+ urgencyLabel,
144
+ " range: ",
145
+ scoreRange
146
+ ] })
147
+ ] })
148
+ ] }),
149
+ (whyNowSection || topFactorSection) && /* @__PURE__ */ jsxs("div", { className: "mt-3 grid gap-2 text-xs text-muted-foreground sm:grid-cols-2", children: [
150
+ whyNowSection ? /* @__PURE__ */ jsxs("div", { className: "rounded-md bg-background/80 p-2", children: [
151
+ /* @__PURE__ */ jsx("p", { className: "font-medium text-foreground", children: "Why now" }),
152
+ /* @__PURE__ */ jsx("p", { className: "mt-0.5 leading-relaxed", children: whyNowSection })
153
+ ] }) : null,
154
+ topFactorSection ? /* @__PURE__ */ jsxs("div", { className: "rounded-md bg-background/80 p-2", children: [
155
+ /* @__PURE__ */ jsx("p", { className: "font-medium text-foreground", children: "Top factor" }),
156
+ /* @__PURE__ */ jsx("p", { className: "mt-0.5 leading-relaxed", children: topFactorSection })
157
+ ] }) : null
158
+ ] }),
159
+ signalData.factors.length > 0 ? /* @__PURE__ */ jsx(
160
+ ScoreBreakdown,
161
+ {
162
+ className: "mt-3",
163
+ factors: signalData.factors,
164
+ onFactorFeedback: signalData.onFactorFeedback,
165
+ initialFeedback: signalData.initialFactorFeedback
166
+ }
167
+ ) : null
168
+ ] });
169
+ }
170
+ function SignalRow({ item, bucketKey, signal, onOpenSignalBucket }) {
171
+ const rowContent = /* @__PURE__ */ jsxs(Fragment, { children: [
172
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
173
+ /* @__PURE__ */ jsx("p", { className: "font-medium text-foreground", children: signal.label }),
174
+ signal.time ? /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[11px] text-muted-foreground/70", children: signal.time }) : null
175
+ ] }),
176
+ signal.description ? /* @__PURE__ */ jsx("p", { className: "mt-1 leading-relaxed text-muted-foreground", children: signal.description }) : null,
177
+ (signal.source || signal.metric) && /* @__PURE__ */ jsxs("div", { className: "mt-1.5 flex flex-wrap gap-1.5 text-[11px] text-muted-foreground/80", children: [
178
+ signal.source ? /* @__PURE__ */ jsx("span", { className: "rounded-full bg-muted px-2 py-0.5", children: signal.source }) : null,
179
+ signal.metric ? /* @__PURE__ */ jsx("span", { className: "rounded-full bg-muted px-2 py-0.5", children: signal.metric }) : null
180
+ ] })
181
+ ] });
182
+ if (signal.id && onOpenSignalBucket) {
183
+ return /* @__PURE__ */ jsx(
184
+ "button",
185
+ {
186
+ type: "button",
187
+ 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",
188
+ onClick: () => onOpenSignalBucket({ item, bucketKey, signalId: signal.id }),
189
+ children: rowContent
190
+ }
191
+ );
192
+ }
193
+ return /* @__PURE__ */ jsx("div", { className: "rounded-md bg-background/80 p-2 text-xs", children: rowContent });
194
+ }
195
+ function ScoreWhyChips({
196
+ item,
197
+ signalData,
198
+ onOpenSignalBucket,
199
+ className
200
+ }) {
201
+ var _a, _b;
202
+ const [selectedBucketKey, setSelectedBucketKey] = React.useState(null);
203
+ React.useEffect(() => {
204
+ setSelectedBucketKey(null);
205
+ }, [item.id]);
206
+ const reactId = React.useId();
207
+ const idPrefix = makeDomId("score-why", reactId, item.id);
208
+ const buckets = React.useMemo(() => getSignalScoreBuckets(signalData), [signalData]);
209
+ const selectedBucket = (_a = buckets.find((bucket) => bucket.key === selectedBucketKey)) != null ? _a : null;
210
+ const selectedBucketSignals = selectedBucket ? getBucketSignals(selectedBucket) : [];
211
+ const selectedPanelId = selectedBucket ? `${idPrefix}-panel-${makeDomId(selectedBucket.key)}` : void 0;
212
+ if (buckets.length === 0) return null;
213
+ return /* @__PURE__ */ jsxs("div", { className: cn("mt-4", className), children: [
214
+ /* @__PURE__ */ jsx("div", { className: "mb-2 flex items-center gap-2", children: /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold uppercase tracking-wider text-muted-foreground", children: "Why" }) }),
215
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5", children: buckets.map((bucket) => {
216
+ const isSelected = selectedBucketKey === bucket.key;
217
+ const panelId = `${idPrefix}-panel-${makeDomId(bucket.key)}`;
218
+ return /* @__PURE__ */ jsxs(
219
+ "button",
220
+ {
221
+ type: "button",
222
+ onClick: () => setSelectedBucketKey((prev) => prev === bucket.key ? null : bucket.key),
223
+ "aria-expanded": isSelected,
224
+ "aria-controls": panelId,
225
+ className: cn(
226
+ "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",
227
+ isSelected ? "border-foreground/30 bg-foreground text-background" : "border-border bg-background text-muted-foreground hover:bg-muted/60 hover:text-foreground"
228
+ ),
229
+ children: [
230
+ bucket.label,
231
+ bucket.signalCount && bucket.signalCount > 1 ? /* @__PURE__ */ jsxs("span", { className: cn("rounded-full px-1.5 py-0 text-[10px]", isSelected ? "bg-background/20" : "bg-muted"), children: [
232
+ "\xD7",
233
+ bucket.signalCount
234
+ ] }) : null
235
+ ]
236
+ },
237
+ bucket.key
238
+ );
239
+ }) }),
240
+ selectedBucket && /* @__PURE__ */ jsxs(
241
+ "div",
242
+ {
243
+ id: selectedPanelId,
244
+ className: "mt-3 rounded-lg border border-border bg-muted/20 p-3",
245
+ role: "region",
246
+ "aria-label": `${selectedBucket.label} details`,
247
+ children: [
248
+ /* @__PURE__ */ jsx("div", { className: "flex items-start justify-between gap-3", children: /* @__PURE__ */ jsxs("div", { children: [
249
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold text-foreground", children: selectedBucket.label }),
250
+ /* @__PURE__ */ jsx("div", { className: "mt-1 flex flex-wrap gap-1.5 text-[11px] text-muted-foreground", children: /* @__PURE__ */ jsxs("span", { className: "rounded-full bg-background px-2 py-0.5", children: [
251
+ (_b = selectedBucket.signalCount) != null ? _b : selectedBucketSignals.length,
252
+ " signals"
253
+ ] }) })
254
+ ] }) }),
255
+ selectedBucketSignals.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "mt-3 space-y-2", "aria-label": "Matching signals", children: selectedBucketSignals.map((signal, index) => {
256
+ var _a2;
257
+ return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
258
+ SignalRow,
259
+ {
260
+ item,
261
+ bucketKey: selectedBucket.key,
262
+ signal,
263
+ onOpenSignalBucket
264
+ }
265
+ ) }, (_a2 = signal.id) != null ? _a2 : `${selectedBucket.key}-signal-${index}`);
266
+ }) }) : selectedBucket.evidence && selectedBucket.evidence.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "mt-3 space-y-1.5", "aria-label": "Matching signals", children: selectedBucket.evidence.map((evidence, index) => /* @__PURE__ */ jsxs("li", { className: "flex gap-2 text-xs text-muted-foreground", children: [
267
+ /* @__PURE__ */ jsx("span", { className: "mt-1.5 h-1 w-1 shrink-0 rounded-full bg-primary" }),
268
+ /* @__PURE__ */ jsx("span", { className: "leading-relaxed", children: evidence })
269
+ ] }, `${selectedBucket.key}-evidence-${index}`)) }) : null
270
+ ]
271
+ }
272
+ )
273
+ ] });
274
+ }
275
+ export {
276
+ ScoreWhyChips,
277
+ SignalPriorityChip,
278
+ SignalPriorityPanel,
279
+ getSignalScoreUrgencyLabel
280
+ };
281
+ //# sourceMappingURL=score-why-chips.js.map
@@ -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\" />\n <span className=\"leading-relaxed\">{evidence}</span>\n </li>\n ))}\n </ul>\n ) : null}\n\n </div>\n )}\n </div>\n )\n}\n"],"mappings":";AAuII,SA6FA,UAjFE,KAZF;AArIJ,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,sBAAwC;AACjD,SAAS,UAAU;AASZ,SAAS,2BACd,OACA,eACyB;AACzB,MAAI,cAAe,QAAO;AAC1B,MAAI,SAAS,GAAI,QAAO;AACxB,MAAI,SAAS,GAAI,QAAO;AACxB,MAAI,SAAS,GAAI,QAAO;AACxB,SAAO;AACT;AAEA,SAAS,oBAAoB,OAAgC;AAC3D,UAAQ,OAAO;AAAA,IACb,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAA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C3E,oBAAC,SAAI,WAAU,iEACb,+BAAC,UAAK,WAAU,0CACb;AAAA,mCAAe,gBAAf,YAA8B,sBAAsB;AAAA,cAAO;AAAA,eAC9D,GACF;AAAA,aACF,GACF;AAAA,UAEC,sBAAsB,SAAS,IAC9B,oBAAC,QAAG,WAAU,kBAAiB,cAAW,oBACvC,gCAAsB,IAAI,CAAC,QAAQ,UAAO;AA3UzD,gBAAAA;AA4UgB,uCAAC,QACC;AAAA,cAAC;AAAA;AAAA,gBACC;AAAA,gBACA,WAAW,eAAe;AAAA,gBAC1B;AAAA,gBACA;AAAA;AAAA,YACF,MANOA,MAAA,OAAO,OAAP,OAAAA,MAAa,GAAG,eAAe,GAAG,WAAW,KAAK,EAO3D;AAAA,WACD,GACH,IACE,eAAe,YAAY,eAAe,SAAS,SAAS,IAC9D,oBAAC,QAAG,WAAU,oBAAmB,cAAW,oBACzC,yBAAe,SAAS,IAAI,CAAC,UAAU,UACtC,qBAAC,QAAmD,WAAU,4CAC5D;AAAA,gCAAC,UAAK,WAAU,mDAAkD;AAAA,YAClE,oBAAC,UAAK,WAAU,mBAAmB,oBAAS;AAAA,eAFrC,GAAG,eAAe,GAAG,aAAa,KAAK,EAGhD,CACD,GACH,IACE;AAAA;AAAA;AAAA,IAEN;AAAA,KAEJ;AAEJ;","names":["_a"]}
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 };