@handled-ai/design-system 0.18.46 → 0.18.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/pill.d.ts +1 -1
- package/dist/components/score-why-chips.d.ts +2 -2
- package/dist/components/signal-feedback-inline.js +28 -7
- package/dist/components/signal-feedback-inline.js.map +1 -1
- package/dist/components/signal-priority-popover.d.ts +2 -2
- package/dist/components/tabs.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/prototype/index.d.ts +2 -2
- package/dist/prototype/prototype-accounts-view.d.ts +2 -2
- package/dist/prototype/prototype-admin-view.d.ts +2 -2
- package/dist/prototype/prototype-config.d.ts +2 -2
- package/dist/prototype/prototype-inbox-view.d.ts +1 -1
- package/dist/prototype/prototype-insights-view.d.ts +2 -2
- package/dist/prototype/prototype-shell.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/__tests__/case-panel-why.test.tsx +23 -0
- package/src/components/signal-feedback-inline.tsx +33 -4
- package/src/prototype/prototype-config.ts +2 -2
- package/dist/{signal-priority-popover-DM02Eg_F.d.ts → signal-priority-popover-QJngMAj7.d.ts} +1 -1
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const badgeVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | null | undefined;
|
|
7
7
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
8
8
|
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
9
9
|
asChild?: boolean;
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | null | undefined;
|
|
7
7
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
@@ -12,7 +12,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
12
12
|
*/
|
|
13
13
|
type PillStatus = "success" | "warning" | "error" | "neutral" | "info";
|
|
14
14
|
declare const pillVariants: (props?: ({
|
|
15
|
-
variant?: "
|
|
15
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "error" | "neutral" | "info" | "success" | "warning" | null | undefined;
|
|
16
16
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
17
17
|
interface PillProps extends React.ComponentProps<"span">, VariantProps<typeof pillVariants> {
|
|
18
18
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Q as QueueItem, l as SignalScoreData, o as SignalScoreUrgencyLabel } from '../signal-priority-popover-
|
|
2
|
+
import { Q as QueueItem, l as SignalScoreData, o as SignalScoreUrgencyLabel } from '../signal-priority-popover-QJngMAj7.js';
|
|
3
3
|
import './feedback-primitives.js';
|
|
4
|
-
import './signal-feedback-inline.js';
|
|
5
4
|
import './quick-action-sidebar-nav.js';
|
|
6
5
|
import './quick-action-modal.js';
|
|
7
6
|
import './score-breakdown.js';
|
|
@@ -15,6 +14,7 @@ import './data-table.js';
|
|
|
15
14
|
import './metric-card.js';
|
|
16
15
|
import '../charts/pipeline-overview.js';
|
|
17
16
|
import './timeline-activity.js';
|
|
17
|
+
import './signal-feedback-inline.js';
|
|
18
18
|
import 'lucide-react';
|
|
19
19
|
|
|
20
20
|
declare function getSignalScoreUrgencyLabel(score: number, providedLabel?: SignalScoreUrgencyLabel): SignalScoreUrgencyLabel;
|
|
@@ -309,14 +309,18 @@ function formatAmountDraftValue(value) {
|
|
|
309
309
|
return value;
|
|
310
310
|
}
|
|
311
311
|
function buildOpportunityDraft(preview) {
|
|
312
|
-
var _a, _b, _c, _d;
|
|
312
|
+
var _a, _b, _c, _d, _e;
|
|
313
313
|
return {
|
|
314
314
|
closeDate: (_b = (_a = preview == null ? void 0 : preview.closeDateValue) != null ? _a : preview == null ? void 0 : preview.closeDate) != null ? _b : "",
|
|
315
|
-
amount: (preview == null ? void 0 : preview.amountValue) == null ? "" : formatAmountDraftValue(preview.amountValue),
|
|
316
|
-
description: (
|
|
317
|
-
churnType: (
|
|
315
|
+
amount: (preview == null ? void 0 : preview.amountValue) === void 0 ? (_c = preview == null ? void 0 : preview.amount) != null ? _c : "" : formatAmountDraftValue(preview.amountValue),
|
|
316
|
+
description: (_d = preview == null ? void 0 : preview.description) != null ? _d : "",
|
|
317
|
+
churnType: (_e = preview == null ? void 0 : preview.churnType) != null ? _e : ""
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
|
+
function hasEditableOpportunityPreview(preview) {
|
|
321
|
+
var _a;
|
|
322
|
+
return !!preview && isValidDateInput((_a = preview.closeDateValue) != null ? _a : preview.closeDate);
|
|
323
|
+
}
|
|
320
324
|
function isValidDateInput(value) {
|
|
321
325
|
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value);
|
|
322
326
|
if (!match) return false;
|
|
@@ -348,7 +352,8 @@ function Actions() {
|
|
|
348
352
|
const needsText = isTopOther || isSubOther;
|
|
349
353
|
const canSubmitDismiss = selectedTopReason !== null && (!hasSubOptions || selectedSubReason !== null) && (!needsText || detailText.trim().length > 0);
|
|
350
354
|
const canSubmitApprove = selectedReasons.length > 0 || detailText.trim().length > 0;
|
|
351
|
-
const
|
|
355
|
+
const isEditableOpportunityPreview = hasEditableOpportunityPreview(opportunityPreview);
|
|
356
|
+
const canConfirmOpportunity = !isEditableOpportunityPreview || isValidDateInput(opportunityDraft.closeDate);
|
|
352
357
|
const selectTopReason = (label) => {
|
|
353
358
|
if (selectedTopReason === label) {
|
|
354
359
|
setSelectedTopReason(null);
|
|
@@ -641,7 +646,17 @@ function Actions() {
|
|
|
641
646
|
/* @__PURE__ */ jsx("strong", { children: companyName }),
|
|
642
647
|
". Confirm?"
|
|
643
648
|
] }),
|
|
644
|
-
opportunityPreview && /* @__PURE__ */
|
|
649
|
+
opportunityPreview && !isEditableOpportunityPreview && /* @__PURE__ */ jsx("div", { className: "mt-3 space-y-2 border-t border-border/50 pt-3", children: [
|
|
650
|
+
{ label: "Opportunity", value: opportunityPreview.name },
|
|
651
|
+
{ label: "Account", value: opportunityPreview.accountName },
|
|
652
|
+
{ label: "Stage", value: opportunityPreview.stage },
|
|
653
|
+
{ label: "Close Date", value: opportunityPreview.closeDate },
|
|
654
|
+
{ label: "Amount", value: opportunityPreview.amount }
|
|
655
|
+
].map(({ label, value }) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 text-xs", children: [
|
|
656
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: label }),
|
|
657
|
+
/* @__PURE__ */ jsx("span", { className: "text-right font-medium text-foreground", children: value })
|
|
658
|
+
] }, label)) }),
|
|
659
|
+
opportunityPreview && isEditableOpportunityPreview && /* @__PURE__ */ jsxs("div", { className: "mt-3 space-y-3 border-t border-border/50 pt-3", children: [
|
|
645
660
|
[
|
|
646
661
|
{ label: "Opportunity", value: opportunityPreview.name },
|
|
647
662
|
{ label: "Account", value: opportunityPreview.accountName },
|
|
@@ -724,7 +739,13 @@ function Actions() {
|
|
|
724
739
|
"button",
|
|
725
740
|
{
|
|
726
741
|
type: "button",
|
|
727
|
-
onClick: () =>
|
|
742
|
+
onClick: () => {
|
|
743
|
+
if (!opportunityPreview) {
|
|
744
|
+
approve();
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
approve(isEditableOpportunityPreview ? opportunityDraft : void 0);
|
|
748
|
+
},
|
|
728
749
|
disabled: !canConfirmOpportunity,
|
|
729
750
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md bg-foreground px-3 text-xs font-semibold text-background transition-colors hover:bg-foreground/90 disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground",
|
|
730
751
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/signal-feedback-inline.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Check, CirclePlus, ExternalLink, Loader2, Lock, ThumbsDown } from \"lucide-react\"\n\ninterface DismissReasonNode {\n label: string\n subOptions?: string[]\n}\n\nconst dismissReasonTree: DismissReasonNode[] = [\n {\n label: \"Not relevant for this account\",\n subOptions: [\n \"Business as usual for this account\",\n \"Account in maintenance mode\",\n \"Wrong contact for this signal\",\n \"Other\",\n ],\n },\n {\n label: \"Bad timing\",\n subOptions: [\n \"Too early in the relationship\",\n \"Too soon after last outreach\",\n \"Wrong time of year for this account\",\n \"Other\",\n ],\n },\n {\n label: \"Inaccurate data\",\n subOptions: [\n \"Wrong amount or number\",\n \"Stale data\",\n \"Account info wrong\",\n \"Other\",\n ],\n },\n {\n label: \"Wrong account\",\n subOptions: [\n \"Different account meant\",\n \"Account not in scope\",\n \"Other\",\n ],\n },\n {\n label: \"Already handled\",\n subOptions: [\n \"Already in conversation\",\n \"Already an open Opportunity\",\n \"Already escalated\",\n \"Other\",\n ],\n },\n {\n label: \"Not actionable\",\n subOptions: [\n \"No clear next step\",\n \"Outside our remit\",\n \"Other\",\n ],\n },\n { label: \"Other\" },\n]\n\nconst approveReasons = [\n \"Right timing\",\n \"Accurate data\",\n \"Good prospect fit\",\n \"Actionable\",\n]\n\ntype ApprovalState = \"pending\" | \"confirming\" | \"creating\" | \"approving-feedback\" | \"dismissing\" | \"approved\" | \"dismissed\" | \"auto-approved\"\n\ninterface OpportunityPreviewOption {\n value: string\n label: string\n}\n\ninterface OpportunityPreview {\n name: string\n stage: string\n closeDate: string\n closeDateValue?: string\n amount: string\n /** Raw draft input value. Numeric values render as currency in the editable field. */\n amountValue?: string | number | null\n accountName: string\n description?: string | null\n churnType?: string | null\n churnTypeOptions?: Array<string | OpportunityPreviewOption>\n}\n\ninterface OpportunityDraft {\n closeDate: string\n amount: string\n description: string\n churnType: string\n}\n\ninterface SignalApprovalLabels {\n approveButton?: string\n dismissButton?: string\n approvedStatus?: string\n dismissedStatus?: string\n opportunityCreated?: string\n confirmPrompt?: string\n dismissPrompt?: string\n feedbackPrompt?: string\n /** Label shown while the approve action is in progress (e.g. \"Creating Opportunity...\"). */\n creatingStatus?: string\n}\n\nconst DEFAULT_LABELS: Required<SignalApprovalLabels> = {\n approveButton: \"Approve action\",\n dismissButton: \"Not Helpful\",\n approvedStatus: \"Action Approved\",\n dismissedStatus: \"Action Dismissed\",\n opportunityCreated: \"Opportunity Created\",\n confirmPrompt: \"This will approve this action for\",\n dismissPrompt: \"What\\u2019s the issue with this action?\",\n feedbackPrompt: \"Quick feedback \\u2014 what made this action useful?\",\n creatingStatus: \"Creating\\u2026\",\n}\n\ninterface SignalApprovalContextValue {\n approvalState: ApprovalState\n companyName: string\n opportunityUrl?: string\n scheduledTime?: string\n labels: Required<SignalApprovalLabels>\n hideApproveButton?: boolean\n approveButtonIconUrl?: string\n opportunityPreview?: OpportunityPreview\n requestingApproval: boolean\n approve: (draft?: OpportunityDraft) => void\n submitApproveFeedback: (reasons: string[], detail: string) => void\n skipApproveFeedback: () => void\n dismiss: (reasons: string[], detail: string, subReason?: string) => void\n requestApproval: () => void\n requestDismiss: () => void\n cancel: () => void\n}\n\nconst SignalApprovalCtx = React.createContext<SignalApprovalContextValue | null>(null)\n\nexport function useSignalApproval() {\n const ctx = React.useContext(SignalApprovalCtx)\n if (!ctx) throw new Error(\"SignalApproval components must be used within SignalApproval.Root\")\n return ctx\n}\n\ninterface RootProps {\n children: React.ReactNode\n companyName: string\n opportunityUrl?: string\n scheduledTime?: string\n initialApprovalState?: ApprovalState\n labels?: SignalApprovalLabels\n /** When true, the approve/create-opportunity button is hidden but the dismiss button remains. */\n hideApproveButton?: boolean\n /** Optional icon URL for the approve button. Renders an img instead of CirclePlus when provided. */\n approveButtonIconUrl?: string\n /** Optional structured preview data shown in the confirmation dialog. */\n opportunityPreview?: OpportunityPreview\n /**\n * Async callback fired when the user clicks the approve button, BEFORE\n * transitioning to the \"confirming\" state. While the promise is pending,\n * the button shows a loading spinner. On resolve, transitions to \"confirming\".\n * On reject, stays in \"pending\".\n */\n onRequestApproval?: () => Promise<void>\n /**\n * Called when the user confirms the approval action.\n *\n * - If the callback returns `void` (or `undefined`), the component transitions\n * directly to the feedback step (backward-compatible behavior).\n * - If the callback returns a `Promise<boolean>`, the component shows a\n * \"creating\" loading state while the promise is pending. On `true` it\n * transitions to the feedback step; on `false` it reverts to \"pending\".\n */\n onApprove?: (draft?: OpportunityDraft) => void | Promise<boolean>\n onApproveFeedback?: (reasons: string[], detail: string) => void\n onDismiss?: (reasons: string[], detail: string, subReason?: string) => void\n}\n\nfunction Root({ children, companyName, opportunityUrl, scheduledTime, initialApprovalState, labels: labelOverrides, hideApproveButton, approveButtonIconUrl, opportunityPreview, onRequestApproval, onApprove, onApproveFeedback, onDismiss }: RootProps) {\n const labels = React.useMemo(() => ({ ...DEFAULT_LABELS, ...labelOverrides }), [labelOverrides])\n const [approvalState, setApprovalState] = React.useState<ApprovalState>(initialApprovalState ?? \"pending\")\n const [requestingApproval, setRequestingApproval] = React.useState(false)\n\n // Guard against state updates after unmount (e.g. user navigates away while\n // an async onApprove promise is still in flight).\n const mountedRef = React.useRef(true)\n React.useEffect(() => {\n return () => { mountedRef.current = false }\n }, [])\n\n const requestApproval = React.useCallback(() => {\n if (onRequestApproval) {\n setRequestingApproval(true)\n onRequestApproval()\n .then(() => {\n if (mountedRef.current) {\n setRequestingApproval(false)\n setApprovalState(\"confirming\")\n }\n })\n .catch(() => {\n if (mountedRef.current) {\n setRequestingApproval(false)\n }\n })\n } else {\n setApprovalState(\"confirming\")\n }\n }, [onRequestApproval])\n\n const requestDismiss = React.useCallback(() => {\n setApprovalState(\"dismissing\")\n }, [])\n\n const cancel = React.useCallback(() => {\n setApprovalState(\"pending\")\n }, [])\n\n const approve = React.useCallback((draft?: OpportunityDraft) => {\n const result = onApprove?.(draft)\n // If the callback returns a Promise, show a loading state and wait for it.\n if (result && typeof (result as Promise<boolean>).then === \"function\") {\n setApprovalState(\"creating\")\n ;(result as Promise<boolean>).then((success) => {\n if (mountedRef.current) {\n setApprovalState(success ? \"approving-feedback\" : \"pending\")\n }\n }).catch(() => {\n if (mountedRef.current) {\n setApprovalState(\"pending\")\n }\n })\n } else {\n // Synchronous / void — transition immediately (backward-compatible).\n setApprovalState(\"approving-feedback\")\n }\n }, [onApprove])\n\n const submitApproveFeedback = React.useCallback(\n (reasons: string[], detail: string) => {\n setApprovalState(\"approved\")\n onApproveFeedback?.(reasons, detail)\n },\n [onApproveFeedback]\n )\n\n const skipApproveFeedback = React.useCallback(() => {\n setApprovalState(\"approved\")\n }, [])\n\n const dismiss = React.useCallback(\n (reasons: string[], detail: string, subReason?: string) => {\n setApprovalState(\"dismissed\")\n onDismiss?.(reasons, detail, subReason)\n },\n [onDismiss]\n )\n\n return (\n <SignalApprovalCtx.Provider\n value={{ approvalState, companyName, opportunityUrl, scheduledTime, labels, hideApproveButton, approveButtonIconUrl, opportunityPreview, requestingApproval, approve, submitApproveFeedback, skipApproveFeedback, dismiss, requestApproval, requestDismiss, cancel }}\n >\n {children}\n </SignalApprovalCtx.Provider>\n )\n}\n\n/** Shared dismiss reason picker used in both the \"editing\" and \"initial dismiss\" paths. */\nfunction DismissReasonPicker({\n selectedTopReason,\n selectedSubReason,\n selectTopReason,\n selectSubReason,\n detailText,\n setDetailText,\n needsText,\n canSubmitDismiss,\n handleDismissSubmit,\n topNode,\n submitLabel,\n onCancel,\n}: {\n selectedTopReason: string | null\n selectedSubReason: string | null\n selectTopReason: (label: string) => void\n selectSubReason: (label: string) => void\n detailText: string\n setDetailText: (value: string) => void\n needsText: boolean\n canSubmitDismiss: boolean\n handleDismissSubmit: () => void\n topNode: DismissReasonNode | undefined\n submitLabel: string\n onCancel: () => void\n}) {\n return (\n <>\n <div className=\"flex flex-wrap gap-1.5\">\n {dismissReasonTree.map((node) => {\n const selected = selectedTopReason === node.label\n return (\n <button\n key={node.label}\n type=\"button\"\n onClick={() => selectTopReason(node.label)}\n className={`rounded-full border px-2.5 py-1 text-[11px] font-medium transition-colors ${\n selected\n ? \"border-red-200 bg-red-100 text-red-700\"\n : \"border-border bg-background text-muted-foreground hover:bg-muted/50 hover:text-foreground\"\n }`}\n >\n {node.label}\n </button>\n )\n })}\n </div>\n\n {topNode?.subOptions && (\n <div className=\"ml-3 border-l-2 border-muted pl-3\">\n <div className=\"flex flex-wrap gap-1.5\">\n {topNode.subOptions.map((sub) => {\n const selected = selectedSubReason === sub\n return (\n <button\n key={sub}\n type=\"button\"\n onClick={() => selectSubReason(sub)}\n className={`rounded-full border px-2.5 py-1 text-[11px] font-medium transition-colors ${\n selected\n ? \"border-red-200 bg-red-100 text-red-700\"\n : \"border-border bg-background text-muted-foreground hover:bg-muted/50 hover:text-foreground\"\n }`}\n >\n {sub}\n </button>\n )\n })}\n </div>\n </div>\n )}\n\n {selectedTopReason && (\n <input\n type=\"text\"\n value={detailText}\n onChange={(e) => setDetailText(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && canSubmitDismiss) handleDismissSubmit()\n }}\n placeholder={needsText ? \"Please describe (required)\" : \"Add context (optional)\"}\n className=\"h-7 w-full rounded-md border border-border bg-muted/20 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n )}\n\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={handleDismissSubmit}\n disabled={!canSubmitDismiss}\n className={`inline-flex h-7 items-center gap-1.5 rounded-md px-3 text-xs font-semibold transition-colors ${\n canSubmitDismiss\n ? \"bg-foreground text-background hover:bg-foreground/90\"\n : \"cursor-not-allowed bg-muted text-muted-foreground\"\n }`}\n >\n {submitLabel}\n </button>\n <button\n type=\"button\"\n onClick={onCancel}\n className=\"inline-flex h-7 items-center rounded-md border border-border px-3 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n >\n Cancel\n </button>\n </div>\n </>\n )\n}\n\nfunction SubmittedFeedback({\n reasons,\n detail,\n subReason,\n variant,\n onEdit,\n}: {\n reasons: string[]\n detail: string\n subReason?: string\n variant: \"approve\" | \"dismiss\"\n onEdit: () => void\n}) {\n if (reasons.length === 0 && !detail) return null\n const pillClass =\n variant === \"approve\"\n ? \"border-emerald-200/60 bg-emerald-50/50 text-emerald-700/70\"\n : \"border-red-200/60 bg-red-50/50 text-red-700/70\"\n\n return (\n <button\n type=\"button\"\n onClick={onEdit}\n className=\"w-full text-left space-y-1.5 group cursor-pointer\"\n >\n {reasons.length > 0 && (\n <div className=\"flex flex-wrap gap-1\">\n {reasons.map((r) => (\n <span\n key={r}\n className={`rounded-full border px-2 py-0.5 text-[10px] font-medium transition-colors group-hover:opacity-80 ${pillClass}`}\n >\n {r}\n </span>\n ))}\n {subReason && (\n <span\n className={`rounded-full border px-2 py-0.5 text-[10px] font-medium transition-colors group-hover:opacity-80 ${pillClass}`}\n >\n {subReason}\n </span>\n )}\n </div>\n )}\n {detail && (\n <p className=\"text-[11px] text-muted-foreground/70 leading-snug group-hover:text-muted-foreground transition-colors\">{detail}</p>\n )}\n </button>\n )\n}\n\nfunction optionValue(option: string | OpportunityPreviewOption): string {\n return typeof option === \"string\" ? option : option.value\n}\n\nfunction optionLabel(option: string | OpportunityPreviewOption): string {\n return typeof option === \"string\" ? option : option.label\n}\n\nfunction formatAmountDraftValue(value: string | number | null | undefined): string {\n if (value == null || value === \"\") return \"\"\n if (typeof value === \"number\") {\n return new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n maximumFractionDigits: 0,\n }).format(value)\n }\n return value\n}\n\nfunction buildOpportunityDraft(preview?: OpportunityPreview): OpportunityDraft {\n return {\n closeDate: preview?.closeDateValue ?? preview?.closeDate ?? \"\",\n amount: preview?.amountValue == null ? \"\" : formatAmountDraftValue(preview.amountValue),\n description: preview?.description ?? \"\",\n churnType: preview?.churnType ?? \"\",\n }\n}\n\nfunction isValidDateInput(value: string): boolean {\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(value)\n if (!match) return false\n const parsed = new Date(`${value}T00:00:00Z`)\n if (Number.isNaN(parsed.getTime())) return false\n return parsed.toISOString().slice(0, 10) === value\n}\n\nfunction Actions() {\n const { approvalState, companyName, opportunityUrl, scheduledTime, labels, hideApproveButton, approveButtonIconUrl, opportunityPreview, requestingApproval, approve, submitApproveFeedback, skipApproveFeedback, dismiss, requestApproval, requestDismiss, cancel } =\n useSignalApproval()\n const [selectedTopReason, setSelectedTopReason] = React.useState<string | null>(null)\n const [selectedSubReason, setSelectedSubReason] = React.useState<string | null>(null)\n const [selectedReasons, setSelectedReasons] = React.useState<string[]>([])\n const [detailText, setDetailText] = React.useState(\"\")\n const [submittedFeedback, setSubmittedFeedback] = React.useState<{ reasons: string[]; detail: string; subReason?: string } | null>(null)\n const [isEditing, setIsEditing] = React.useState(false)\n const [opportunityDraft, setOpportunityDraft] = React.useState<OpportunityDraft>(() => buildOpportunityDraft(opportunityPreview))\n\n React.useEffect(() => {\n if (approvalState === \"confirming\") {\n setOpportunityDraft(buildOpportunityDraft(opportunityPreview))\n }\n }, [approvalState, opportunityPreview])\n\n const churnTypeOptions = opportunityPreview?.churnTypeOptions ?? []\n const hasChurnTypeOptions = churnTypeOptions.length > 0\n\n const topNode = dismissReasonTree.find((n) => n.label === selectedTopReason)\n const hasSubOptions = !!(topNode?.subOptions && topNode.subOptions.length > 0)\n const isTopOther = selectedTopReason === \"Other\" && !hasSubOptions\n const isSubOther = selectedSubReason === \"Other\"\n const needsText = isTopOther || isSubOther\n const canSubmitDismiss =\n selectedTopReason !== null &&\n (!hasSubOptions || selectedSubReason !== null) &&\n (!needsText || detailText.trim().length > 0)\n\n const canSubmitApprove = selectedReasons.length > 0 || detailText.trim().length > 0\n const canConfirmOpportunity = !opportunityPreview || isValidDateInput(opportunityDraft.closeDate)\n\n const selectTopReason = (label: string) => {\n if (selectedTopReason === label) {\n setSelectedTopReason(null)\n setSelectedSubReason(null)\n setDetailText(\"\")\n } else {\n setSelectedTopReason(label)\n setSelectedSubReason(null)\n setDetailText(\"\")\n }\n }\n\n const selectSubReason = (label: string) => {\n setSelectedSubReason(selectedSubReason === label ? null : label)\n }\n\n const toggleReason = (reason: string) => {\n setSelectedReasons((prev) =>\n prev.includes(reason) ? prev.filter((r) => r !== reason) : [...prev, reason]\n )\n }\n\n const startEditing = () => {\n if (submittedFeedback) {\n setSelectedTopReason(submittedFeedback.reasons[0] ?? null)\n setSelectedSubReason(submittedFeedback.subReason ?? null)\n // Note: selectedReasons is only used by the approve editing path.\n // For dismiss feedback this is harmless but unused — the dismiss path\n // reads selectedTopReason/selectedSubReason instead.\n setSelectedReasons([...submittedFeedback.reasons])\n setDetailText(submittedFeedback.detail)\n }\n setIsEditing(true)\n }\n\n const handleDismissSubmit = () => {\n if (!canSubmitDismiss || !selectedTopReason) return\n const fb = { reasons: [selectedTopReason], detail: detailText.trim(), subReason: selectedSubReason ?? undefined }\n setSubmittedFeedback(fb)\n dismiss([selectedTopReason], detailText.trim(), selectedSubReason ?? undefined)\n setSelectedTopReason(null)\n setSelectedSubReason(null)\n setDetailText(\"\")\n setIsEditing(false)\n }\n\n const handleApproveSubmit = () => {\n const fb = { reasons: [...selectedReasons], detail: detailText.trim() }\n setSubmittedFeedback(fb)\n submitApproveFeedback(selectedReasons, detailText.trim())\n setSelectedReasons([])\n setDetailText(\"\")\n setIsEditing(false)\n }\n\n const handleEditCancel = () => {\n setSelectedTopReason(null)\n setSelectedSubReason(null)\n setSelectedReasons([])\n setDetailText(\"\")\n setIsEditing(false)\n }\n\n const handleCancel = () => {\n cancel()\n setSelectedTopReason(null)\n setSelectedSubReason(null)\n setSelectedReasons([])\n setDetailText(\"\")\n }\n\n if (approvalState === \"creating\") {\n return (\n <div className=\"flex items-center gap-2 text-xs font-medium text-muted-foreground\">\n <svg className=\"h-3.5 w-3.5 animate-spin\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" />\n <path className=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\" />\n </svg>\n <span>{labels.creatingStatus}</span>\n </div>\n )\n }\n\n if (approvalState === \"approved\") {\n if (isEditing) {\n return (\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-1.5 text-xs font-medium text-emerald-600 mb-2\">\n <Check className=\"h-3.5 w-3.5\" />\n {opportunityUrl ? (\n <a href={opportunityUrl} target=\"_blank\" rel=\"noopener noreferrer\" className=\"inline-flex items-center gap-1 hover:underline underline-offset-2\">\n {labels.approvedStatus} <ExternalLink className=\"h-3 w-3\" />\n </a>\n ) : (\n <span>{labels.approvedStatus}</span>\n )}\n </div>\n <p className=\"text-xs font-medium text-muted-foreground\">Edit your feedback</p>\n <div className=\"flex flex-wrap gap-1.5\">\n {approveReasons.map((reason) => {\n const selected = selectedReasons.includes(reason)\n return (\n <button key={reason} type=\"button\" onClick={() => toggleReason(reason)}\n className={`rounded-full border px-2.5 py-1 text-[11px] font-medium transition-colors ${\n selected ? \"border-emerald-200 bg-emerald-100 text-emerald-700\" : \"border-border bg-background text-muted-foreground hover:bg-muted/50 hover:text-foreground\"\n }`}>{reason}</button>\n )\n })}\n </div>\n <input type=\"text\" value={detailText} onChange={(e) => setDetailText(e.target.value)}\n onKeyDown={(e) => { if (e.key === \"Enter\" && canSubmitApprove) handleApproveSubmit() }}\n placeholder=\"Tell us more (optional)\"\n className=\"h-7 w-full rounded-md border border-border bg-muted/20 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring\" />\n <div className=\"flex items-center gap-2\">\n <button type=\"button\" onClick={handleApproveSubmit} disabled={!canSubmitApprove}\n className={`inline-flex h-7 items-center gap-1.5 rounded-md px-3 text-xs font-semibold transition-colors ${canSubmitApprove ? \"bg-foreground text-background hover:bg-foreground/90\" : \"cursor-not-allowed bg-muted text-muted-foreground\"}`}>\n Save\n </button>\n <button type=\"button\" onClick={handleEditCancel}\n className=\"inline-flex h-7 items-center rounded-md border border-border px-3 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\">\n Cancel\n </button>\n </div>\n </div>\n )\n }\n\n return (\n <div className=\"space-y-2\">\n <div className=\"flex items-center gap-1.5 text-xs font-medium text-emerald-600\">\n <Check className=\"h-3.5 w-3.5\" />\n {opportunityUrl ? (\n <a\n href={opportunityUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 hover:underline underline-offset-2\"\n >\n {labels.opportunityCreated}\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n ) : (\n <span>{labels.opportunityCreated}</span>\n )}\n </div>\n {submittedFeedback && (\n <SubmittedFeedback\n reasons={submittedFeedback.reasons}\n detail={submittedFeedback.detail}\n variant=\"approve\"\n onEdit={startEditing}\n />\n )}\n </div>\n )\n }\n\n if (approvalState === \"auto-approved\") {\n return (\n <div className=\"space-y-2\">\n <div className=\"flex items-center gap-1.5 text-xs font-medium text-emerald-600\">\n <Check className=\"h-3.5 w-3.5\" />\n <span>{labels.approvedStatus}</span>\n </div>\n {scheduledTime && (\n <p className=\"text-[11px] text-muted-foreground\">Scheduled: {scheduledTime}</p>\n )}\n </div>\n )\n }\n\n if (approvalState === \"approving-feedback\") {\n return (\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-1.5 text-xs font-medium text-emerald-600 mb-2\">\n <Check className=\"h-3.5 w-3.5\" />\n {opportunityUrl ? (\n <a\n href={opportunityUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 hover:underline underline-offset-2\"\n >\n {labels.opportunityCreated}\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n ) : (\n <span>{labels.opportunityCreated}</span>\n )}\n </div>\n <p className=\"text-xs font-medium text-muted-foreground\">{labels.feedbackPrompt}</p>\n <div className=\"flex flex-wrap gap-1.5\">\n {approveReasons.map((reason) => {\n const selected = selectedReasons.includes(reason)\n return (\n <button\n key={reason}\n type=\"button\"\n onClick={() => toggleReason(reason)}\n className={`rounded-full border px-2.5 py-1 text-[11px] font-medium transition-colors ${\n selected\n ? \"border-emerald-200 bg-emerald-100 text-emerald-700\"\n : \"border-border bg-background text-muted-foreground hover:bg-muted/50 hover:text-foreground\"\n }`}\n >\n {reason}\n </button>\n )\n })}\n </div>\n\n <input\n type=\"text\"\n value={detailText}\n onChange={(e) => setDetailText(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && canSubmitApprove) handleApproveSubmit()\n }}\n placeholder=\"Tell us more (optional)\"\n className=\"h-7 w-full rounded-md border border-border bg-muted/20 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={handleApproveSubmit}\n disabled={!canSubmitApprove}\n className={`inline-flex h-7 items-center gap-1.5 rounded-md px-3 text-xs font-semibold transition-colors ${\n canSubmitApprove\n ? \"bg-foreground text-background hover:bg-foreground/90\"\n : \"cursor-not-allowed bg-muted text-muted-foreground\"\n }`}\n >\n Submit\n </button>\n <button\n type=\"button\"\n onClick={skipApproveFeedback}\n className=\"inline-flex h-7 items-center rounded-md border border-border px-3 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n >\n Skip\n </button>\n </div>\n </div>\n )\n }\n\n if (approvalState === \"dismissed\") {\n if (isEditing) {\n return (\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-1.5 text-xs text-muted-foreground mb-2\">\n <ThumbsDown className=\"h-3.5 w-3.5\" />\n <span>{labels.dismissedStatus}</span>\n </div>\n <p className=\"text-xs font-medium text-muted-foreground\">Edit your feedback</p>\n <DismissReasonPicker\n selectedTopReason={selectedTopReason}\n selectedSubReason={selectedSubReason}\n selectTopReason={selectTopReason}\n selectSubReason={selectSubReason}\n detailText={detailText}\n setDetailText={setDetailText}\n needsText={needsText}\n canSubmitDismiss={canSubmitDismiss}\n handleDismissSubmit={handleDismissSubmit}\n topNode={topNode}\n submitLabel=\"Save\"\n onCancel={handleEditCancel}\n />\n </div>\n )\n }\n\n return (\n <div className=\"space-y-2\">\n <div className=\"flex items-center gap-1.5 text-xs text-muted-foreground\">\n <ThumbsDown className=\"h-3.5 w-3.5\" />\n <span>{labels.dismissedStatus}</span>\n </div>\n {submittedFeedback && (\n <SubmittedFeedback\n reasons={submittedFeedback.reasons}\n detail={submittedFeedback.detail}\n subReason={submittedFeedback.subReason}\n variant=\"dismiss\"\n onEdit={startEditing}\n />\n )}\n </div>\n )\n }\n\n if (approvalState === \"confirming\") {\n return (\n <div className=\"space-y-3\">\n <div className=\"rounded-md border border-border bg-muted/30 p-3\">\n <p className=\"text-sm text-foreground\">\n {labels.confirmPrompt} <strong>{companyName}</strong>. Confirm?\n </p>\n {opportunityPreview && (\n <div className=\"mt-3 space-y-3 border-t border-border/50 pt-3\">\n {[\n { label: \"Opportunity\", value: opportunityPreview.name },\n { label: \"Account\", value: opportunityPreview.accountName },\n { label: \"Stage\", value: opportunityPreview.stage },\n ].map(({ label, value }) => (\n <div key={label} className=\"flex items-center justify-between gap-3 text-xs\">\n <span className=\"text-muted-foreground\">{label}</span>\n <span className=\"text-right font-medium text-foreground\">{value}</span>\n </div>\n ))}\n\n <div className=\"grid gap-2 sm:grid-cols-2\">\n <label className=\"space-y-1 text-xs\">\n <span className=\"font-medium text-muted-foreground\">Close Date</span>\n <input\n type=\"date\"\n value={opportunityDraft.closeDate}\n onChange={(event) => setOpportunityDraft((draft) => ({ ...draft, closeDate: event.target.value }))}\n aria-invalid={!canConfirmOpportunity}\n className=\"h-8 w-full rounded-md border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n {!canConfirmOpportunity && (\n <span className=\"text-[11px] text-red-600\">Enter a valid close date.</span>\n )}\n </label>\n\n <label className=\"space-y-1 text-xs\">\n <span className=\"font-medium text-muted-foreground\">Amount</span>\n <input\n type=\"text\"\n inputMode=\"decimal\"\n value={opportunityDraft.amount}\n onChange={(event) => setOpportunityDraft((draft) => ({ ...draft, amount: event.target.value }))}\n placeholder={opportunityPreview.amount}\n className=\"h-8 w-full rounded-md border border-border bg-background px-2 text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n </label>\n </div>\n\n <label className=\"space-y-1 text-xs\">\n <span className=\"font-medium text-muted-foreground\">Churn Type</span>\n {hasChurnTypeOptions ? (\n <select\n value={opportunityDraft.churnType}\n onChange={(event) => setOpportunityDraft((draft) => ({ ...draft, churnType: event.target.value }))}\n className=\"h-8 w-full rounded-md border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring\"\n >\n <option value=\"\">No churn type</option>\n {churnTypeOptions.map((option) => (\n <option key={optionValue(option)} value={optionValue(option)}>\n {optionLabel(option)}\n </option>\n ))}\n </select>\n ) : (\n <input\n type=\"text\"\n value={opportunityDraft.churnType}\n onChange={(event) => setOpportunityDraft((draft) => ({ ...draft, churnType: event.target.value }))}\n placeholder=\"No churn type\"\n className=\"h-8 w-full rounded-md border border-border bg-background px-2 text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n )}\n </label>\n\n <label className=\"space-y-1 text-xs\">\n <span className=\"font-medium text-muted-foreground\">Description</span>\n <textarea\n value={opportunityDraft.description}\n onChange={(event) => setOpportunityDraft((draft) => ({ ...draft, description: event.target.value }))}\n rows={3}\n placeholder=\"Add a short description\"\n className=\"w-full resize-none rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n </label>\n </div>\n )}\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => approve(opportunityDraft)}\n disabled={!canConfirmOpportunity}\n className=\"inline-flex h-7 items-center gap-1.5 rounded-md bg-foreground px-3 text-xs font-semibold text-background transition-colors hover:bg-foreground/90 disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground\"\n >\n <Check className=\"h-3 w-3\" />\n Confirm\n </button>\n <button\n type=\"button\"\n onClick={handleCancel}\n className=\"inline-flex h-7 items-center rounded-md border border-border px-3 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n >\n Cancel\n </button>\n </div>\n </div>\n )\n }\n\n if (approvalState === \"dismissing\") {\n return (\n <div className=\"space-y-3\">\n <p className=\"text-xs font-medium text-muted-foreground\">{labels.dismissPrompt}</p>\n <DismissReasonPicker\n selectedTopReason={selectedTopReason}\n selectedSubReason={selectedSubReason}\n selectTopReason={selectTopReason}\n selectSubReason={selectSubReason}\n detailText={detailText}\n setDetailText={setDetailText}\n needsText={needsText}\n canSubmitDismiss={canSubmitDismiss}\n handleDismissSubmit={handleDismissSubmit}\n topNode={topNode}\n submitLabel=\"Submit\"\n onCancel={handleCancel}\n />\n </div>\n )\n }\n\n return (\n <div className=\"flex items-center gap-2\">\n {!hideApproveButton && (\n <button\n type=\"button\"\n onClick={requestApproval}\n disabled={requestingApproval}\n className=\"inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-foreground px-3 text-xs font-semibold text-background shadow-none transition-colors hover:bg-foreground/90 disabled:opacity-50\"\n >\n {requestingApproval ? (\n <Loader2 className=\"h-3.5 w-3.5 animate-spin\" />\n ) : approveButtonIconUrl ? (\n <img src={approveButtonIconUrl} alt=\"\" className=\"h-3.5 w-3.5 object-contain\" draggable={false} />\n ) : (\n <CirclePlus className=\"h-3.5 w-3.5\" />\n )}\n {labels.approveButton}\n </button>\n )}\n <button\n type=\"button\"\n onClick={requestDismiss}\n className=\"inline-flex h-7 items-center gap-1.5 rounded-md border border-border px-3 text-xs font-medium text-muted-foreground shadow-none transition-colors hover:bg-muted hover:text-foreground\"\n >\n <ThumbsDown className=\"h-3.5 w-3.5\" />\n {labels.dismissButton}\n </button>\n </div>\n )\n}\n\nfunction Gate({ children }: { children: React.ReactNode }) {\n const { approvalState, hideApproveButton } = useSignalApproval()\n // When the approve button is hidden, don't lock content behind approval\n const isLocked = !hideApproveButton &&\n (approvalState === \"pending\" || approvalState === \"confirming\" || approvalState === \"creating\" || approvalState === \"dismissing\")\n\n return (\n <div className=\"relative\">\n {isLocked && (\n <div className=\"pointer-events-none absolute inset-x-0 top-4 z-10 flex justify-center\">\n <div className=\"flex items-center gap-1.5 rounded-full border border-border bg-background px-3 py-1.5 text-xs text-muted-foreground shadow-sm\">\n <Lock className=\"h-3 w-3\" />\n Approve or dismiss the signal above to unlock\n </div>\n </div>\n )}\n <div\n className={`transition-opacity duration-300 ${isLocked ? \"pointer-events-none select-none opacity-40\" : \"opacity-100\"}`}\n >\n {children}\n </div>\n </div>\n )\n}\n\nexport {\n Root as SignalApprovalRoot,\n Actions as SignalApprovalActions,\n Gate as SignalApprovalGate,\n}\nexport const SignalApproval = { Root, Actions, Gate }\nexport type { ApprovalState, OpportunityPreview, OpportunityDraft, SignalApprovalLabels, SignalApprovalContextValue, RootProps as SignalApprovalRootProps }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4QI,SAqCA,UArCA,KA+FE,YA/FF;AA1QJ,YAAY,WAAW;AACvB,SAAS,OAAO,YAAY,cAAc,SAAS,MAAM,kBAAkB;AAO3E,MAAM,oBAAyC;AAAA,EAC7C;AAAA,IACE,OAAO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AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS;AAAA,QACT,WAAU;AAAA,QAEV;AAAA,8BAAC,cAAW,WAAU,eAAc;AAAA,UACnC,OAAO;AAAA;AAAA;AAAA,IACV;AAAA,KACF;AAEJ;AAEA,SAAS,KAAK,EAAE,SAAS,GAAkC;AACzD,QAAM,EAAE,eAAe,kBAAkB,IAAI,kBAAkB;AAE/D,QAAM,WAAW,CAAC,sBACf,kBAAkB,aAAa,kBAAkB,gBAAgB,kBAAkB,cAAc,kBAAkB;AAEtH,SACE,qBAAC,SAAI,WAAU,YACZ;AAAA,gBACC,oBAAC,SAAI,WAAU,yEACb,+BAAC,SAAI,WAAU,iIACb;AAAA,0BAAC,QAAK,WAAU,WAAU;AAAA,MAAE;AAAA,OAE9B,GACF;AAAA,IAEF;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,mCAAmC,WAAW,+CAA+C,aAAa;AAAA,QAEpH;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;AAOO,MAAM,iBAAiB,EAAE,MAAM,SAAS,KAAK;","names":["_a"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/signal-feedback-inline.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Check, CirclePlus, ExternalLink, Loader2, Lock, ThumbsDown } from \"lucide-react\"\n\ninterface DismissReasonNode {\n label: string\n subOptions?: string[]\n}\n\nconst dismissReasonTree: DismissReasonNode[] = [\n {\n label: \"Not relevant for this account\",\n subOptions: [\n \"Business as usual for this account\",\n \"Account in maintenance mode\",\n \"Wrong contact for this signal\",\n \"Other\",\n ],\n },\n {\n label: \"Bad timing\",\n subOptions: [\n \"Too early in the relationship\",\n \"Too soon after last outreach\",\n \"Wrong time of year for this account\",\n \"Other\",\n ],\n },\n {\n label: \"Inaccurate data\",\n subOptions: [\n \"Wrong amount or number\",\n \"Stale data\",\n \"Account info wrong\",\n \"Other\",\n ],\n },\n {\n label: \"Wrong account\",\n subOptions: [\n \"Different account meant\",\n \"Account not in scope\",\n \"Other\",\n ],\n },\n {\n label: \"Already handled\",\n subOptions: [\n \"Already in conversation\",\n \"Already an open Opportunity\",\n \"Already escalated\",\n \"Other\",\n ],\n },\n {\n label: \"Not actionable\",\n subOptions: [\n \"No clear next step\",\n \"Outside our remit\",\n \"Other\",\n ],\n },\n { label: \"Other\" },\n]\n\nconst approveReasons = [\n \"Right timing\",\n \"Accurate data\",\n \"Good prospect fit\",\n \"Actionable\",\n]\n\ntype ApprovalState = \"pending\" | \"confirming\" | \"creating\" | \"approving-feedback\" | \"dismissing\" | \"approved\" | \"dismissed\" | \"auto-approved\"\n\ninterface OpportunityPreviewOption {\n value: string\n label: string\n}\n\ninterface OpportunityPreview {\n name: string\n stage: string\n closeDate: string\n closeDateValue?: string\n amount: string\n /** Raw draft input value. Numeric values render as currency in the editable field. */\n amountValue?: string | number | null\n accountName: string\n description?: string | null\n churnType?: string | null\n churnTypeOptions?: Array<string | OpportunityPreviewOption>\n}\n\ninterface OpportunityDraft {\n closeDate: string\n amount: string\n description: string\n churnType: string\n}\n\ninterface SignalApprovalLabels {\n approveButton?: string\n dismissButton?: string\n approvedStatus?: string\n dismissedStatus?: string\n opportunityCreated?: string\n confirmPrompt?: string\n dismissPrompt?: string\n feedbackPrompt?: string\n /** Label shown while the approve action is in progress (e.g. \"Creating Opportunity...\"). */\n creatingStatus?: string\n}\n\nconst DEFAULT_LABELS: Required<SignalApprovalLabels> = {\n approveButton: \"Approve action\",\n dismissButton: \"Not Helpful\",\n approvedStatus: \"Action Approved\",\n dismissedStatus: \"Action Dismissed\",\n opportunityCreated: \"Opportunity Created\",\n confirmPrompt: \"This will approve this action for\",\n dismissPrompt: \"What\\u2019s the issue with this action?\",\n feedbackPrompt: \"Quick feedback \\u2014 what made this action useful?\",\n creatingStatus: \"Creating\\u2026\",\n}\n\ninterface SignalApprovalContextValue {\n approvalState: ApprovalState\n companyName: string\n opportunityUrl?: string\n scheduledTime?: string\n labels: Required<SignalApprovalLabels>\n hideApproveButton?: boolean\n approveButtonIconUrl?: string\n opportunityPreview?: OpportunityPreview\n requestingApproval: boolean\n approve: (draft?: OpportunityDraft) => void\n submitApproveFeedback: (reasons: string[], detail: string) => void\n skipApproveFeedback: () => void\n dismiss: (reasons: string[], detail: string, subReason?: string) => void\n requestApproval: () => void\n requestDismiss: () => void\n cancel: () => void\n}\n\nconst SignalApprovalCtx = React.createContext<SignalApprovalContextValue | null>(null)\n\nexport function useSignalApproval() {\n const ctx = React.useContext(SignalApprovalCtx)\n if (!ctx) throw new Error(\"SignalApproval components must be used within SignalApproval.Root\")\n return ctx\n}\n\ninterface RootProps {\n children: React.ReactNode\n companyName: string\n opportunityUrl?: string\n scheduledTime?: string\n initialApprovalState?: ApprovalState\n labels?: SignalApprovalLabels\n /** When true, the approve/create-opportunity button is hidden but the dismiss button remains. */\n hideApproveButton?: boolean\n /** Optional icon URL for the approve button. Renders an img instead of CirclePlus when provided. */\n approveButtonIconUrl?: string\n /** Optional structured preview data shown in the confirmation dialog. */\n opportunityPreview?: OpportunityPreview\n /**\n * Async callback fired when the user clicks the approve button, BEFORE\n * transitioning to the \"confirming\" state. While the promise is pending,\n * the button shows a loading spinner. On resolve, transitions to \"confirming\".\n * On reject, stays in \"pending\".\n */\n onRequestApproval?: () => Promise<void>\n /**\n * Called when the user confirms the approval action.\n *\n * - If the callback returns `void` (or `undefined`), the component transitions\n * directly to the feedback step (backward-compatible behavior).\n * - If the callback returns a `Promise<boolean>`, the component shows a\n * \"creating\" loading state while the promise is pending. On `true` it\n * transitions to the feedback step; on `false` it reverts to \"pending\".\n */\n onApprove?: (draft?: OpportunityDraft) => void | Promise<boolean>\n onApproveFeedback?: (reasons: string[], detail: string) => void\n onDismiss?: (reasons: string[], detail: string, subReason?: string) => void\n}\n\nfunction Root({ children, companyName, opportunityUrl, scheduledTime, initialApprovalState, labels: labelOverrides, hideApproveButton, approveButtonIconUrl, opportunityPreview, onRequestApproval, onApprove, onApproveFeedback, onDismiss }: RootProps) {\n const labels = React.useMemo(() => ({ ...DEFAULT_LABELS, ...labelOverrides }), [labelOverrides])\n const [approvalState, setApprovalState] = React.useState<ApprovalState>(initialApprovalState ?? \"pending\")\n const [requestingApproval, setRequestingApproval] = React.useState(false)\n\n // Guard against state updates after unmount (e.g. user navigates away while\n // an async onApprove promise is still in flight).\n const mountedRef = React.useRef(true)\n React.useEffect(() => {\n return () => { mountedRef.current = false }\n }, [])\n\n const requestApproval = React.useCallback(() => {\n if (onRequestApproval) {\n setRequestingApproval(true)\n onRequestApproval()\n .then(() => {\n if (mountedRef.current) {\n setRequestingApproval(false)\n setApprovalState(\"confirming\")\n }\n })\n .catch(() => {\n if (mountedRef.current) {\n setRequestingApproval(false)\n }\n })\n } else {\n setApprovalState(\"confirming\")\n }\n }, [onRequestApproval])\n\n const requestDismiss = React.useCallback(() => {\n setApprovalState(\"dismissing\")\n }, [])\n\n const cancel = React.useCallback(() => {\n setApprovalState(\"pending\")\n }, [])\n\n const approve = React.useCallback((draft?: OpportunityDraft) => {\n const result = onApprove?.(draft)\n // If the callback returns a Promise, show a loading state and wait for it.\n if (result && typeof (result as Promise<boolean>).then === \"function\") {\n setApprovalState(\"creating\")\n ;(result as Promise<boolean>).then((success) => {\n if (mountedRef.current) {\n setApprovalState(success ? \"approving-feedback\" : \"pending\")\n }\n }).catch(() => {\n if (mountedRef.current) {\n setApprovalState(\"pending\")\n }\n })\n } else {\n // Synchronous / void — transition immediately (backward-compatible).\n setApprovalState(\"approving-feedback\")\n }\n }, [onApprove])\n\n const submitApproveFeedback = React.useCallback(\n (reasons: string[], detail: string) => {\n setApprovalState(\"approved\")\n onApproveFeedback?.(reasons, detail)\n },\n [onApproveFeedback]\n )\n\n const skipApproveFeedback = React.useCallback(() => {\n setApprovalState(\"approved\")\n }, [])\n\n const dismiss = React.useCallback(\n (reasons: string[], detail: string, subReason?: string) => {\n setApprovalState(\"dismissed\")\n onDismiss?.(reasons, detail, subReason)\n },\n [onDismiss]\n )\n\n return (\n <SignalApprovalCtx.Provider\n value={{ approvalState, companyName, opportunityUrl, scheduledTime, labels, hideApproveButton, approveButtonIconUrl, opportunityPreview, requestingApproval, approve, submitApproveFeedback, skipApproveFeedback, dismiss, requestApproval, requestDismiss, cancel }}\n >\n {children}\n </SignalApprovalCtx.Provider>\n )\n}\n\n/** Shared dismiss reason picker used in both the \"editing\" and \"initial dismiss\" paths. */\nfunction DismissReasonPicker({\n selectedTopReason,\n selectedSubReason,\n selectTopReason,\n selectSubReason,\n detailText,\n setDetailText,\n needsText,\n canSubmitDismiss,\n handleDismissSubmit,\n topNode,\n submitLabel,\n onCancel,\n}: {\n selectedTopReason: string | null\n selectedSubReason: string | null\n selectTopReason: (label: string) => void\n selectSubReason: (label: string) => void\n detailText: string\n setDetailText: (value: string) => void\n needsText: boolean\n canSubmitDismiss: boolean\n handleDismissSubmit: () => void\n topNode: DismissReasonNode | undefined\n submitLabel: string\n onCancel: () => void\n}) {\n return (\n <>\n <div className=\"flex flex-wrap gap-1.5\">\n {dismissReasonTree.map((node) => {\n const selected = selectedTopReason === node.label\n return (\n <button\n key={node.label}\n type=\"button\"\n onClick={() => selectTopReason(node.label)}\n className={`rounded-full border px-2.5 py-1 text-[11px] font-medium transition-colors ${\n selected\n ? \"border-red-200 bg-red-100 text-red-700\"\n : \"border-border bg-background text-muted-foreground hover:bg-muted/50 hover:text-foreground\"\n }`}\n >\n {node.label}\n </button>\n )\n })}\n </div>\n\n {topNode?.subOptions && (\n <div className=\"ml-3 border-l-2 border-muted pl-3\">\n <div className=\"flex flex-wrap gap-1.5\">\n {topNode.subOptions.map((sub) => {\n const selected = selectedSubReason === sub\n return (\n <button\n key={sub}\n type=\"button\"\n onClick={() => selectSubReason(sub)}\n className={`rounded-full border px-2.5 py-1 text-[11px] font-medium transition-colors ${\n selected\n ? \"border-red-200 bg-red-100 text-red-700\"\n : \"border-border bg-background text-muted-foreground hover:bg-muted/50 hover:text-foreground\"\n }`}\n >\n {sub}\n </button>\n )\n })}\n </div>\n </div>\n )}\n\n {selectedTopReason && (\n <input\n type=\"text\"\n value={detailText}\n onChange={(e) => setDetailText(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && canSubmitDismiss) handleDismissSubmit()\n }}\n placeholder={needsText ? \"Please describe (required)\" : \"Add context (optional)\"}\n className=\"h-7 w-full rounded-md border border-border bg-muted/20 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n )}\n\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={handleDismissSubmit}\n disabled={!canSubmitDismiss}\n className={`inline-flex h-7 items-center gap-1.5 rounded-md px-3 text-xs font-semibold transition-colors ${\n canSubmitDismiss\n ? \"bg-foreground text-background hover:bg-foreground/90\"\n : \"cursor-not-allowed bg-muted text-muted-foreground\"\n }`}\n >\n {submitLabel}\n </button>\n <button\n type=\"button\"\n onClick={onCancel}\n className=\"inline-flex h-7 items-center rounded-md border border-border px-3 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n >\n Cancel\n </button>\n </div>\n </>\n )\n}\n\nfunction SubmittedFeedback({\n reasons,\n detail,\n subReason,\n variant,\n onEdit,\n}: {\n reasons: string[]\n detail: string\n subReason?: string\n variant: \"approve\" | \"dismiss\"\n onEdit: () => void\n}) {\n if (reasons.length === 0 && !detail) return null\n const pillClass =\n variant === \"approve\"\n ? \"border-emerald-200/60 bg-emerald-50/50 text-emerald-700/70\"\n : \"border-red-200/60 bg-red-50/50 text-red-700/70\"\n\n return (\n <button\n type=\"button\"\n onClick={onEdit}\n className=\"w-full text-left space-y-1.5 group cursor-pointer\"\n >\n {reasons.length > 0 && (\n <div className=\"flex flex-wrap gap-1\">\n {reasons.map((r) => (\n <span\n key={r}\n className={`rounded-full border px-2 py-0.5 text-[10px] font-medium transition-colors group-hover:opacity-80 ${pillClass}`}\n >\n {r}\n </span>\n ))}\n {subReason && (\n <span\n className={`rounded-full border px-2 py-0.5 text-[10px] font-medium transition-colors group-hover:opacity-80 ${pillClass}`}\n >\n {subReason}\n </span>\n )}\n </div>\n )}\n {detail && (\n <p className=\"text-[11px] text-muted-foreground/70 leading-snug group-hover:text-muted-foreground transition-colors\">{detail}</p>\n )}\n </button>\n )\n}\n\nfunction optionValue(option: string | OpportunityPreviewOption): string {\n return typeof option === \"string\" ? option : option.value\n}\n\nfunction optionLabel(option: string | OpportunityPreviewOption): string {\n return typeof option === \"string\" ? option : option.label\n}\n\nfunction formatAmountDraftValue(value: string | number | null | undefined): string {\n if (value == null || value === \"\") return \"\"\n if (typeof value === \"number\") {\n return new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n maximumFractionDigits: 0,\n }).format(value)\n }\n return value\n}\n\nfunction buildOpportunityDraft(preview?: OpportunityPreview): OpportunityDraft {\n return {\n closeDate: preview?.closeDateValue ?? preview?.closeDate ?? \"\",\n amount: preview?.amountValue === undefined\n ? preview?.amount ?? \"\"\n : formatAmountDraftValue(preview.amountValue),\n description: preview?.description ?? \"\",\n churnType: preview?.churnType ?? \"\",\n }\n}\n\nfunction hasEditableOpportunityPreview(preview?: OpportunityPreview): boolean {\n return !!preview && isValidDateInput(preview.closeDateValue ?? preview.closeDate)\n}\n\nfunction isValidDateInput(value: string): boolean {\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(value)\n if (!match) return false\n const parsed = new Date(`${value}T00:00:00Z`)\n if (Number.isNaN(parsed.getTime())) return false\n return parsed.toISOString().slice(0, 10) === value\n}\n\nfunction Actions() {\n const { approvalState, companyName, opportunityUrl, scheduledTime, labels, hideApproveButton, approveButtonIconUrl, opportunityPreview, requestingApproval, approve, submitApproveFeedback, skipApproveFeedback, dismiss, requestApproval, requestDismiss, cancel } =\n useSignalApproval()\n const [selectedTopReason, setSelectedTopReason] = React.useState<string | null>(null)\n const [selectedSubReason, setSelectedSubReason] = React.useState<string | null>(null)\n const [selectedReasons, setSelectedReasons] = React.useState<string[]>([])\n const [detailText, setDetailText] = React.useState(\"\")\n const [submittedFeedback, setSubmittedFeedback] = React.useState<{ reasons: string[]; detail: string; subReason?: string } | null>(null)\n const [isEditing, setIsEditing] = React.useState(false)\n const [opportunityDraft, setOpportunityDraft] = React.useState<OpportunityDraft>(() => buildOpportunityDraft(opportunityPreview))\n\n React.useEffect(() => {\n if (approvalState === \"confirming\") {\n setOpportunityDraft(buildOpportunityDraft(opportunityPreview))\n }\n }, [approvalState, opportunityPreview])\n\n const churnTypeOptions = opportunityPreview?.churnTypeOptions ?? []\n const hasChurnTypeOptions = churnTypeOptions.length > 0\n\n const topNode = dismissReasonTree.find((n) => n.label === selectedTopReason)\n const hasSubOptions = !!(topNode?.subOptions && topNode.subOptions.length > 0)\n const isTopOther = selectedTopReason === \"Other\" && !hasSubOptions\n const isSubOther = selectedSubReason === \"Other\"\n const needsText = isTopOther || isSubOther\n const canSubmitDismiss =\n selectedTopReason !== null &&\n (!hasSubOptions || selectedSubReason !== null) &&\n (!needsText || detailText.trim().length > 0)\n\n const canSubmitApprove = selectedReasons.length > 0 || detailText.trim().length > 0\n const isEditableOpportunityPreview = hasEditableOpportunityPreview(opportunityPreview)\n const canConfirmOpportunity = !isEditableOpportunityPreview || isValidDateInput(opportunityDraft.closeDate)\n\n const selectTopReason = (label: string) => {\n if (selectedTopReason === label) {\n setSelectedTopReason(null)\n setSelectedSubReason(null)\n setDetailText(\"\")\n } else {\n setSelectedTopReason(label)\n setSelectedSubReason(null)\n setDetailText(\"\")\n }\n }\n\n const selectSubReason = (label: string) => {\n setSelectedSubReason(selectedSubReason === label ? null : label)\n }\n\n const toggleReason = (reason: string) => {\n setSelectedReasons((prev) =>\n prev.includes(reason) ? prev.filter((r) => r !== reason) : [...prev, reason]\n )\n }\n\n const startEditing = () => {\n if (submittedFeedback) {\n setSelectedTopReason(submittedFeedback.reasons[0] ?? null)\n setSelectedSubReason(submittedFeedback.subReason ?? null)\n // Note: selectedReasons is only used by the approve editing path.\n // For dismiss feedback this is harmless but unused — the dismiss path\n // reads selectedTopReason/selectedSubReason instead.\n setSelectedReasons([...submittedFeedback.reasons])\n setDetailText(submittedFeedback.detail)\n }\n setIsEditing(true)\n }\n\n const handleDismissSubmit = () => {\n if (!canSubmitDismiss || !selectedTopReason) return\n const fb = { reasons: [selectedTopReason], detail: detailText.trim(), subReason: selectedSubReason ?? undefined }\n setSubmittedFeedback(fb)\n dismiss([selectedTopReason], detailText.trim(), selectedSubReason ?? undefined)\n setSelectedTopReason(null)\n setSelectedSubReason(null)\n setDetailText(\"\")\n setIsEditing(false)\n }\n\n const handleApproveSubmit = () => {\n const fb = { reasons: [...selectedReasons], detail: detailText.trim() }\n setSubmittedFeedback(fb)\n submitApproveFeedback(selectedReasons, detailText.trim())\n setSelectedReasons([])\n setDetailText(\"\")\n setIsEditing(false)\n }\n\n const handleEditCancel = () => {\n setSelectedTopReason(null)\n setSelectedSubReason(null)\n setSelectedReasons([])\n setDetailText(\"\")\n setIsEditing(false)\n }\n\n const handleCancel = () => {\n cancel()\n setSelectedTopReason(null)\n setSelectedSubReason(null)\n setSelectedReasons([])\n setDetailText(\"\")\n }\n\n if (approvalState === \"creating\") {\n return (\n <div className=\"flex items-center gap-2 text-xs font-medium text-muted-foreground\">\n <svg className=\"h-3.5 w-3.5 animate-spin\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" />\n <path className=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\" />\n </svg>\n <span>{labels.creatingStatus}</span>\n </div>\n )\n }\n\n if (approvalState === \"approved\") {\n if (isEditing) {\n return (\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-1.5 text-xs font-medium text-emerald-600 mb-2\">\n <Check className=\"h-3.5 w-3.5\" />\n {opportunityUrl ? (\n <a href={opportunityUrl} target=\"_blank\" rel=\"noopener noreferrer\" className=\"inline-flex items-center gap-1 hover:underline underline-offset-2\">\n {labels.approvedStatus} <ExternalLink className=\"h-3 w-3\" />\n </a>\n ) : (\n <span>{labels.approvedStatus}</span>\n )}\n </div>\n <p className=\"text-xs font-medium text-muted-foreground\">Edit your feedback</p>\n <div className=\"flex flex-wrap gap-1.5\">\n {approveReasons.map((reason) => {\n const selected = selectedReasons.includes(reason)\n return (\n <button key={reason} type=\"button\" onClick={() => toggleReason(reason)}\n className={`rounded-full border px-2.5 py-1 text-[11px] font-medium transition-colors ${\n selected ? \"border-emerald-200 bg-emerald-100 text-emerald-700\" : \"border-border bg-background text-muted-foreground hover:bg-muted/50 hover:text-foreground\"\n }`}>{reason}</button>\n )\n })}\n </div>\n <input type=\"text\" value={detailText} onChange={(e) => setDetailText(e.target.value)}\n onKeyDown={(e) => { if (e.key === \"Enter\" && canSubmitApprove) handleApproveSubmit() }}\n placeholder=\"Tell us more (optional)\"\n className=\"h-7 w-full rounded-md border border-border bg-muted/20 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring\" />\n <div className=\"flex items-center gap-2\">\n <button type=\"button\" onClick={handleApproveSubmit} disabled={!canSubmitApprove}\n className={`inline-flex h-7 items-center gap-1.5 rounded-md px-3 text-xs font-semibold transition-colors ${canSubmitApprove ? \"bg-foreground text-background hover:bg-foreground/90\" : \"cursor-not-allowed bg-muted text-muted-foreground\"}`}>\n Save\n </button>\n <button type=\"button\" onClick={handleEditCancel}\n className=\"inline-flex h-7 items-center rounded-md border border-border px-3 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\">\n Cancel\n </button>\n </div>\n </div>\n )\n }\n\n return (\n <div className=\"space-y-2\">\n <div className=\"flex items-center gap-1.5 text-xs font-medium text-emerald-600\">\n <Check className=\"h-3.5 w-3.5\" />\n {opportunityUrl ? (\n <a\n href={opportunityUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 hover:underline underline-offset-2\"\n >\n {labels.opportunityCreated}\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n ) : (\n <span>{labels.opportunityCreated}</span>\n )}\n </div>\n {submittedFeedback && (\n <SubmittedFeedback\n reasons={submittedFeedback.reasons}\n detail={submittedFeedback.detail}\n variant=\"approve\"\n onEdit={startEditing}\n />\n )}\n </div>\n )\n }\n\n if (approvalState === \"auto-approved\") {\n return (\n <div className=\"space-y-2\">\n <div className=\"flex items-center gap-1.5 text-xs font-medium text-emerald-600\">\n <Check className=\"h-3.5 w-3.5\" />\n <span>{labels.approvedStatus}</span>\n </div>\n {scheduledTime && (\n <p className=\"text-[11px] text-muted-foreground\">Scheduled: {scheduledTime}</p>\n )}\n </div>\n )\n }\n\n if (approvalState === \"approving-feedback\") {\n return (\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-1.5 text-xs font-medium text-emerald-600 mb-2\">\n <Check className=\"h-3.5 w-3.5\" />\n {opportunityUrl ? (\n <a\n href={opportunityUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 hover:underline underline-offset-2\"\n >\n {labels.opportunityCreated}\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n ) : (\n <span>{labels.opportunityCreated}</span>\n )}\n </div>\n <p className=\"text-xs font-medium text-muted-foreground\">{labels.feedbackPrompt}</p>\n <div className=\"flex flex-wrap gap-1.5\">\n {approveReasons.map((reason) => {\n const selected = selectedReasons.includes(reason)\n return (\n <button\n key={reason}\n type=\"button\"\n onClick={() => toggleReason(reason)}\n className={`rounded-full border px-2.5 py-1 text-[11px] font-medium transition-colors ${\n selected\n ? \"border-emerald-200 bg-emerald-100 text-emerald-700\"\n : \"border-border bg-background text-muted-foreground hover:bg-muted/50 hover:text-foreground\"\n }`}\n >\n {reason}\n </button>\n )\n })}\n </div>\n\n <input\n type=\"text\"\n value={detailText}\n onChange={(e) => setDetailText(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && canSubmitApprove) handleApproveSubmit()\n }}\n placeholder=\"Tell us more (optional)\"\n className=\"h-7 w-full rounded-md border border-border bg-muted/20 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={handleApproveSubmit}\n disabled={!canSubmitApprove}\n className={`inline-flex h-7 items-center gap-1.5 rounded-md px-3 text-xs font-semibold transition-colors ${\n canSubmitApprove\n ? \"bg-foreground text-background hover:bg-foreground/90\"\n : \"cursor-not-allowed bg-muted text-muted-foreground\"\n }`}\n >\n Submit\n </button>\n <button\n type=\"button\"\n onClick={skipApproveFeedback}\n className=\"inline-flex h-7 items-center rounded-md border border-border px-3 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n >\n Skip\n </button>\n </div>\n </div>\n )\n }\n\n if (approvalState === \"dismissed\") {\n if (isEditing) {\n return (\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-1.5 text-xs text-muted-foreground mb-2\">\n <ThumbsDown className=\"h-3.5 w-3.5\" />\n <span>{labels.dismissedStatus}</span>\n </div>\n <p className=\"text-xs font-medium text-muted-foreground\">Edit your feedback</p>\n <DismissReasonPicker\n selectedTopReason={selectedTopReason}\n selectedSubReason={selectedSubReason}\n selectTopReason={selectTopReason}\n selectSubReason={selectSubReason}\n detailText={detailText}\n setDetailText={setDetailText}\n needsText={needsText}\n canSubmitDismiss={canSubmitDismiss}\n handleDismissSubmit={handleDismissSubmit}\n topNode={topNode}\n submitLabel=\"Save\"\n onCancel={handleEditCancel}\n />\n </div>\n )\n }\n\n return (\n <div className=\"space-y-2\">\n <div className=\"flex items-center gap-1.5 text-xs text-muted-foreground\">\n <ThumbsDown className=\"h-3.5 w-3.5\" />\n <span>{labels.dismissedStatus}</span>\n </div>\n {submittedFeedback && (\n <SubmittedFeedback\n reasons={submittedFeedback.reasons}\n detail={submittedFeedback.detail}\n subReason={submittedFeedback.subReason}\n variant=\"dismiss\"\n onEdit={startEditing}\n />\n )}\n </div>\n )\n }\n\n if (approvalState === \"confirming\") {\n return (\n <div className=\"space-y-3\">\n <div className=\"rounded-md border border-border bg-muted/30 p-3\">\n <p className=\"text-sm text-foreground\">\n {labels.confirmPrompt} <strong>{companyName}</strong>. Confirm?\n </p>\n {opportunityPreview && !isEditableOpportunityPreview && (\n <div className=\"mt-3 space-y-2 border-t border-border/50 pt-3\">\n {[\n { label: \"Opportunity\", value: opportunityPreview.name },\n { label: \"Account\", value: opportunityPreview.accountName },\n { label: \"Stage\", value: opportunityPreview.stage },\n { label: \"Close Date\", value: opportunityPreview.closeDate },\n { label: \"Amount\", value: opportunityPreview.amount },\n ].map(({ label, value }) => (\n <div key={label} className=\"flex items-center justify-between gap-3 text-xs\">\n <span className=\"text-muted-foreground\">{label}</span>\n <span className=\"text-right font-medium text-foreground\">{value}</span>\n </div>\n ))}\n </div>\n )}\n {opportunityPreview && isEditableOpportunityPreview && (\n <div className=\"mt-3 space-y-3 border-t border-border/50 pt-3\">\n {[\n { label: \"Opportunity\", value: opportunityPreview.name },\n { label: \"Account\", value: opportunityPreview.accountName },\n { label: \"Stage\", value: opportunityPreview.stage },\n ].map(({ label, value }) => (\n <div key={label} className=\"flex items-center justify-between gap-3 text-xs\">\n <span className=\"text-muted-foreground\">{label}</span>\n <span className=\"text-right font-medium text-foreground\">{value}</span>\n </div>\n ))}\n\n <div className=\"grid gap-2 sm:grid-cols-2\">\n <label className=\"space-y-1 text-xs\">\n <span className=\"font-medium text-muted-foreground\">Close Date</span>\n <input\n type=\"date\"\n value={opportunityDraft.closeDate}\n onChange={(event) => setOpportunityDraft((draft) => ({ ...draft, closeDate: event.target.value }))}\n aria-invalid={!canConfirmOpportunity}\n className=\"h-8 w-full rounded-md border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n {!canConfirmOpportunity && (\n <span className=\"text-[11px] text-red-600\">Enter a valid close date.</span>\n )}\n </label>\n\n <label className=\"space-y-1 text-xs\">\n <span className=\"font-medium text-muted-foreground\">Amount</span>\n <input\n type=\"text\"\n inputMode=\"decimal\"\n value={opportunityDraft.amount}\n onChange={(event) => setOpportunityDraft((draft) => ({ ...draft, amount: event.target.value }))}\n placeholder={opportunityPreview.amount}\n className=\"h-8 w-full rounded-md border border-border bg-background px-2 text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n </label>\n </div>\n\n <label className=\"space-y-1 text-xs\">\n <span className=\"font-medium text-muted-foreground\">Churn Type</span>\n {hasChurnTypeOptions ? (\n <select\n value={opportunityDraft.churnType}\n onChange={(event) => setOpportunityDraft((draft) => ({ ...draft, churnType: event.target.value }))}\n className=\"h-8 w-full rounded-md border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring\"\n >\n <option value=\"\">No churn type</option>\n {churnTypeOptions.map((option) => (\n <option key={optionValue(option)} value={optionValue(option)}>\n {optionLabel(option)}\n </option>\n ))}\n </select>\n ) : (\n <input\n type=\"text\"\n value={opportunityDraft.churnType}\n onChange={(event) => setOpportunityDraft((draft) => ({ ...draft, churnType: event.target.value }))}\n placeholder=\"No churn type\"\n className=\"h-8 w-full rounded-md border border-border bg-background px-2 text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n )}\n </label>\n\n <label className=\"space-y-1 text-xs\">\n <span className=\"font-medium text-muted-foreground\">Description</span>\n <textarea\n value={opportunityDraft.description}\n onChange={(event) => setOpportunityDraft((draft) => ({ ...draft, description: event.target.value }))}\n rows={3}\n placeholder=\"Add a short description\"\n className=\"w-full resize-none rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n </label>\n </div>\n )}\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => {\n if (!opportunityPreview) {\n approve()\n return\n }\n approve(isEditableOpportunityPreview ? opportunityDraft : undefined)\n }}\n disabled={!canConfirmOpportunity}\n className=\"inline-flex h-7 items-center gap-1.5 rounded-md bg-foreground px-3 text-xs font-semibold text-background transition-colors hover:bg-foreground/90 disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground\"\n >\n <Check className=\"h-3 w-3\" />\n Confirm\n </button>\n <button\n type=\"button\"\n onClick={handleCancel}\n className=\"inline-flex h-7 items-center rounded-md border border-border px-3 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n >\n Cancel\n </button>\n </div>\n </div>\n )\n }\n\n if (approvalState === \"dismissing\") {\n return (\n <div className=\"space-y-3\">\n <p className=\"text-xs font-medium text-muted-foreground\">{labels.dismissPrompt}</p>\n <DismissReasonPicker\n selectedTopReason={selectedTopReason}\n selectedSubReason={selectedSubReason}\n selectTopReason={selectTopReason}\n selectSubReason={selectSubReason}\n detailText={detailText}\n setDetailText={setDetailText}\n needsText={needsText}\n canSubmitDismiss={canSubmitDismiss}\n handleDismissSubmit={handleDismissSubmit}\n topNode={topNode}\n submitLabel=\"Submit\"\n onCancel={handleCancel}\n />\n </div>\n )\n }\n\n return (\n <div className=\"flex items-center gap-2\">\n {!hideApproveButton && (\n <button\n type=\"button\"\n onClick={requestApproval}\n disabled={requestingApproval}\n className=\"inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-foreground px-3 text-xs font-semibold text-background shadow-none transition-colors hover:bg-foreground/90 disabled:opacity-50\"\n >\n {requestingApproval ? (\n <Loader2 className=\"h-3.5 w-3.5 animate-spin\" />\n ) : approveButtonIconUrl ? (\n <img src={approveButtonIconUrl} alt=\"\" className=\"h-3.5 w-3.5 object-contain\" draggable={false} />\n ) : (\n <CirclePlus className=\"h-3.5 w-3.5\" />\n )}\n {labels.approveButton}\n </button>\n )}\n <button\n type=\"button\"\n onClick={requestDismiss}\n className=\"inline-flex h-7 items-center gap-1.5 rounded-md border border-border px-3 text-xs font-medium text-muted-foreground shadow-none transition-colors hover:bg-muted hover:text-foreground\"\n >\n <ThumbsDown className=\"h-3.5 w-3.5\" />\n {labels.dismissButton}\n </button>\n </div>\n )\n}\n\nfunction Gate({ children }: { children: React.ReactNode }) {\n const { approvalState, hideApproveButton } = useSignalApproval()\n // When the approve button is hidden, don't lock content behind approval\n const isLocked = !hideApproveButton &&\n (approvalState === \"pending\" || approvalState === \"confirming\" || approvalState === \"creating\" || approvalState === \"dismissing\")\n\n return (\n <div className=\"relative\">\n {isLocked && (\n <div className=\"pointer-events-none absolute inset-x-0 top-4 z-10 flex justify-center\">\n <div className=\"flex items-center gap-1.5 rounded-full border border-border bg-background px-3 py-1.5 text-xs text-muted-foreground shadow-sm\">\n <Lock className=\"h-3 w-3\" />\n Approve or dismiss the signal above to unlock\n </div>\n </div>\n )}\n <div\n className={`transition-opacity duration-300 ${isLocked ? \"pointer-events-none select-none opacity-40\" : \"opacity-100\"}`}\n >\n {children}\n </div>\n </div>\n )\n}\n\nexport {\n Root as SignalApprovalRoot,\n Actions as SignalApprovalActions,\n Gate as SignalApprovalGate,\n}\nexport const SignalApproval = { Root, Actions, Gate }\nexport type { ApprovalState, OpportunityPreview, OpportunityDraft, SignalApprovalLabels, SignalApprovalContextValue, RootProps as SignalApprovalRootProps }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4QI,SAqCA,UArCA,KA+FE,YA/FF;AA1QJ,YAAY,WAAW;AACvB,SAAS,OAAO,YAAY,cAAc,SAAS,MAAM,kBAAkB;AAO3E,MAAM,oBAAyC;AAAA,EAC7C;AAAA,IACE,OAAO;AAAA,IACP,YAAY;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,YAAY;AAAA,MACV;AAAA,MACA;AA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AAA,KACF;AAEJ;AAOO,MAAM,iBAAiB,EAAE,MAAM,SAAS,KAAK;","names":["_a"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import './feedback-primitives.js';
|
|
3
|
-
export { P as PriorityFactor, S as SignalPriorityPopover, k as SignalPriorityPopoverProps } from '../signal-priority-popover-
|
|
4
|
-
import './signal-feedback-inline.js';
|
|
3
|
+
export { P as PriorityFactor, S as SignalPriorityPopover, k as SignalPriorityPopoverProps } from '../signal-priority-popover-QJngMAj7.js';
|
|
5
4
|
import './quick-action-sidebar-nav.js';
|
|
6
5
|
import './quick-action-modal.js';
|
|
7
6
|
import './score-breakdown.js';
|
|
@@ -15,4 +14,5 @@ import './data-table.js';
|
|
|
15
14
|
import './metric-card.js';
|
|
16
15
|
import '../charts/pipeline-overview.js';
|
|
17
16
|
import './timeline-activity.js';
|
|
17
|
+
import './signal-feedback-inline.js';
|
|
18
18
|
import 'lucide-react';
|
|
@@ -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?: "
|
|
8
|
+
variant?: "default" | "line" | 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
|
@@ -38,7 +38,7 @@ export { EmptyState, EmptyStateProps } from './components/empty-state.js';
|
|
|
38
38
|
export { ActivityItem, ConnectedApps, EntityActivityItem, EntityDetails, EntityMetadataField, EntityMetadataGrid, EntityPanel, EntityPanelBrandIcons, EntityPanelHeader, EntityPanelTabs, EntitySection, PanelMode, PotentialContacts, RecentActivity, SystemActivity, useEntityPanel } from './components/entity-panel.js';
|
|
39
39
|
export { RelatedRecordActionCard, RelatedRecordActionCardKind, RelatedRecordActionCardProps, RelatedRecordActionIcon } from './components/related-record-action-card.js';
|
|
40
40
|
export { FeedbackActions, FeedbackActionsProps, FeedbackChipGroup, FeedbackChipGroupProps, FeedbackChipTree, FeedbackFooter, FeedbackFooterProps, FeedbackInput, FeedbackInputProps, FeedbackSubmitData, InlineFeedbackControl, InlineFeedbackControlProps, PersistedFeedbackData } from './components/feedback-primitives.js';
|
|
41
|
-
export { A as AccountFilterTab, a as AccountsViewConfig, b as AdminTab, c as AdminViewConfig, B as BriefStyleVariant, E as EntityPanelConfig, d as EntityPanelSection, I as InboxDetailSections, e as InboxSortOption, f as InboxViewConfig, g as InsightsCustomTab, h as InsightsViewConfig, P as PriorityFactor, i as PrototypeBrandConfig, j as PrototypeConfig, Q as QueueItem, S as SignalPriorityPopover, k as SignalPriorityPopoverProps, l as SignalScoreData, m as SignalScoreExplanationBucket, n as SignalScoreExplanationSignal, o as SignalScoreUrgencyLabel, T as TimelineSystemEventsConfig, W as WorkQueueViewConfig } from './signal-priority-popover-
|
|
41
|
+
export { A as AccountFilterTab, a as AccountsViewConfig, b as AdminTab, c as AdminViewConfig, B as BriefStyleVariant, E as EntityPanelConfig, d as EntityPanelSection, I as InboxDetailSections, e as InboxSortOption, f as InboxViewConfig, g as InsightsCustomTab, h as InsightsViewConfig, P as PriorityFactor, i as PrototypeBrandConfig, j as PrototypeConfig, Q as QueueItem, S as SignalPriorityPopover, k as SignalPriorityPopoverProps, l as SignalScoreData, m as SignalScoreExplanationBucket, n as SignalScoreExplanationSignal, o as SignalScoreUrgencyLabel, T as TimelineSystemEventsConfig, W as WorkQueueViewConfig } from './signal-priority-popover-QJngMAj7.js';
|
|
42
42
|
export { FilterChip, FilterChipProps } from './components/filter-chip.js';
|
|
43
43
|
export { InboxGroupHeader, InboxRow, InboxRowProps } from './components/inbox-row.js';
|
|
44
44
|
export { AssigneeFilter, InboxFilterCategory, InboxToolbar, InboxToolbarProps } from './components/inbox-toolbar.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AccountFilterTab, a as AccountsViewConfig, b as AdminTab, c as AdminViewConfig, B as BriefStyleVariant, E as EntityPanelConfig, d as EntityPanelSection, I as InboxDetailSections, e as InboxSortOption, f as InboxViewConfig, g as InsightsCustomTab, h as InsightsViewConfig, i as PrototypeBrandConfig, j as PrototypeConfig, Q as QueueItem, l as SignalScoreData, m as SignalScoreExplanationBucket, n as SignalScoreExplanationSignal, o as SignalScoreUrgencyLabel, T as TimelineSystemEventsConfig, W as WorkQueueViewConfig } from '../signal-priority-popover-
|
|
1
|
+
export { A as AccountFilterTab, a as AccountsViewConfig, b as AdminTab, c as AdminViewConfig, B as BriefStyleVariant, E as EntityPanelConfig, d as EntityPanelSection, I as InboxDetailSections, e as InboxSortOption, f as InboxViewConfig, g as InsightsCustomTab, h as InsightsViewConfig, i as PrototypeBrandConfig, j as PrototypeConfig, Q as QueueItem, l as SignalScoreData, m as SignalScoreExplanationBucket, n as SignalScoreExplanationSignal, o as SignalScoreUrgencyLabel, T as TimelineSystemEventsConfig, W as WorkQueueViewConfig } from '../signal-priority-popover-QJngMAj7.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';
|
|
@@ -7,7 +7,6 @@ export { PrototypeAdminView, PrototypeAdminViewProps } from './prototype-admin-v
|
|
|
7
7
|
export { PrototypeWorkQueueView, PrototypeWorkQueueViewProps } from './prototype-work-queue-view.js';
|
|
8
8
|
import 'react';
|
|
9
9
|
import '../components/feedback-primitives.js';
|
|
10
|
-
import '../components/signal-feedback-inline.js';
|
|
11
10
|
import '../components/quick-action-sidebar-nav.js';
|
|
12
11
|
import '../components/quick-action-modal.js';
|
|
13
12
|
import '../components/score-breakdown.js';
|
|
@@ -21,4 +20,5 @@ import '../components/data-table.js';
|
|
|
21
20
|
import '../components/metric-card.js';
|
|
22
21
|
import '../charts/pipeline-overview.js';
|
|
23
22
|
import '../components/timeline-activity.js';
|
|
23
|
+
import '../components/signal-feedback-inline.js';
|
|
24
24
|
import 'lucide-react';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { a as AccountsViewConfig } from '../signal-priority-popover-
|
|
2
|
+
import { a as AccountsViewConfig } from '../signal-priority-popover-QJngMAj7.js';
|
|
3
3
|
import { DataRow } from '../components/data-table.js';
|
|
4
4
|
import '../components/feedback-primitives.js';
|
|
5
|
-
import '../components/signal-feedback-inline.js';
|
|
6
5
|
import '../components/quick-action-sidebar-nav.js';
|
|
7
6
|
import '../components/quick-action-modal.js';
|
|
8
7
|
import '../components/score-breakdown.js';
|
|
@@ -15,6 +14,7 @@ import '../components/data-table-condition-filter.js';
|
|
|
15
14
|
import '../components/metric-card.js';
|
|
16
15
|
import '../charts/pipeline-overview.js';
|
|
17
16
|
import '../components/timeline-activity.js';
|
|
17
|
+
import '../components/signal-feedback-inline.js';
|
|
18
18
|
import 'lucide-react';
|
|
19
19
|
|
|
20
20
|
interface PrototypeAccountsViewProps extends AccountsViewConfig {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { c as AdminViewConfig } from '../signal-priority-popover-
|
|
2
|
+
import { c as AdminViewConfig } from '../signal-priority-popover-QJngMAj7.js';
|
|
3
3
|
import '../components/feedback-primitives.js';
|
|
4
|
-
import '../components/signal-feedback-inline.js';
|
|
5
4
|
import '../components/quick-action-sidebar-nav.js';
|
|
6
5
|
import '../components/quick-action-modal.js';
|
|
7
6
|
import '../components/score-breakdown.js';
|
|
@@ -15,6 +14,7 @@ import '../components/data-table.js';
|
|
|
15
14
|
import '../components/metric-card.js';
|
|
16
15
|
import '../charts/pipeline-overview.js';
|
|
17
16
|
import '../components/timeline-activity.js';
|
|
17
|
+
import '../components/signal-feedback-inline.js';
|
|
18
18
|
import 'lucide-react';
|
|
19
19
|
|
|
20
20
|
interface PrototypeAdminViewProps extends AdminViewConfig {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import '../components/signal-feedback-inline.js';
|
|
2
1
|
import 'react';
|
|
3
2
|
import '../components/quick-action-sidebar-nav.js';
|
|
4
3
|
import '../components/score-breakdown.js';
|
|
@@ -10,8 +9,9 @@ import '../components/data-table.js';
|
|
|
10
9
|
import '../components/metric-card.js';
|
|
11
10
|
import '../charts/pipeline-overview.js';
|
|
12
11
|
import '../components/timeline-activity.js';
|
|
12
|
+
import '../components/signal-feedback-inline.js';
|
|
13
13
|
import 'lucide-react';
|
|
14
|
-
export { A as AccountFilterTab, a as AccountsViewConfig, b as AdminTab, c as AdminViewConfig, B as BriefStyleVariant, E as EntityPanelConfig, d as EntityPanelSection, I as InboxDetailSections, e as InboxSortOption, f as InboxViewConfig, g as InsightsCustomTab, h as InsightsViewConfig, i as PrototypeBrandConfig, j as PrototypeConfig, Q as QueueItem, l as SignalScoreData, m as SignalScoreExplanationBucket, n as SignalScoreExplanationSignal, o as SignalScoreUrgencyLabel, T as TimelineSystemEventsConfig, W as WorkQueueViewConfig } from '../signal-priority-popover-
|
|
14
|
+
export { A as AccountFilterTab, a as AccountsViewConfig, b as AdminTab, c as AdminViewConfig, B as BriefStyleVariant, E as EntityPanelConfig, d as EntityPanelSection, I as InboxDetailSections, e as InboxSortOption, f as InboxViewConfig, g as InsightsCustomTab, h as InsightsViewConfig, i as PrototypeBrandConfig, j as PrototypeConfig, Q as QueueItem, l as SignalScoreData, m as SignalScoreExplanationBucket, n as SignalScoreExplanationSignal, o as SignalScoreUrgencyLabel, T as TimelineSystemEventsConfig, W as WorkQueueViewConfig } from '../signal-priority-popover-QJngMAj7.js';
|
|
15
15
|
import '../components/feedback-primitives.js';
|
|
16
16
|
import '../components/quick-action-modal.js';
|
|
17
17
|
import '../components/score-semantics.js';
|
|
@@ -3,7 +3,7 @@ import { OpportunityDraft, ApprovalState, OpportunityPreview } from '../componen
|
|
|
3
3
|
import { SourceDef } from '../components/detail-view.js';
|
|
4
4
|
import { SuggestedAction, SuggestedContact } from '../components/suggested-actions.js';
|
|
5
5
|
import { TimelineEvent } from '../components/timeline-activity.js';
|
|
6
|
-
import { Q as QueueItem, I as InboxDetailSections, l as SignalScoreData, f as InboxViewConfig, B as BriefStyleVariant, T as TimelineSystemEventsConfig } from '../signal-priority-popover-
|
|
6
|
+
import { Q as QueueItem, I as InboxDetailSections, l as SignalScoreData, f as InboxViewConfig, B as BriefStyleVariant, T as TimelineSystemEventsConfig } from '../signal-priority-popover-QJngMAj7.js';
|
|
7
7
|
import '../components/feedback-primitives.js';
|
|
8
8
|
import '../components/quick-action-sidebar-nav.js';
|
|
9
9
|
import '../components/quick-action-modal.js';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { h as InsightsViewConfig } from '../signal-priority-popover-
|
|
2
|
+
import { h as InsightsViewConfig } from '../signal-priority-popover-QJngMAj7.js';
|
|
3
3
|
import '../components/feedback-primitives.js';
|
|
4
|
-
import '../components/signal-feedback-inline.js';
|
|
5
4
|
import '../components/quick-action-sidebar-nav.js';
|
|
6
5
|
import '../components/quick-action-modal.js';
|
|
7
6
|
import '../components/score-breakdown.js';
|
|
@@ -15,6 +14,7 @@ import '../components/data-table.js';
|
|
|
15
14
|
import '../components/metric-card.js';
|
|
16
15
|
import '../charts/pipeline-overview.js';
|
|
17
16
|
import '../components/timeline-activity.js';
|
|
17
|
+
import '../components/signal-feedback-inline.js';
|
|
18
18
|
import 'lucide-react';
|
|
19
19
|
|
|
20
20
|
interface PrototypeInsightsViewProps extends InsightsViewConfig {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { j as PrototypeConfig } from '../signal-priority-popover-
|
|
2
|
+
import { j as PrototypeConfig } from '../signal-priority-popover-QJngMAj7.js';
|
|
3
3
|
import '../components/feedback-primitives.js';
|
|
4
|
-
import '../components/signal-feedback-inline.js';
|
|
5
4
|
import '../components/quick-action-sidebar-nav.js';
|
|
6
5
|
import '../components/quick-action-modal.js';
|
|
7
6
|
import '../components/score-breakdown.js';
|
|
@@ -15,6 +14,7 @@ import '../components/data-table.js';
|
|
|
15
14
|
import '../components/metric-card.js';
|
|
16
15
|
import '../charts/pipeline-overview.js';
|
|
17
16
|
import '../components/timeline-activity.js';
|
|
17
|
+
import '../components/signal-feedback-inline.js';
|
|
18
18
|
import 'lucide-react';
|
|
19
19
|
|
|
20
20
|
interface PrototypeShellProps {
|
package/package.json
CHANGED
|
@@ -185,6 +185,29 @@ describe("CasePanelSignalApprovalActions", () => {
|
|
|
185
185
|
})
|
|
186
186
|
})
|
|
187
187
|
|
|
188
|
+
it("keeps legacy display-only opportunity previews confirmable", () => {
|
|
189
|
+
const onApprove = vi.fn()
|
|
190
|
+
|
|
191
|
+
renderApprovalActions({
|
|
192
|
+
initialApprovalState: "confirming",
|
|
193
|
+
onApprove,
|
|
194
|
+
opportunityPreview: {
|
|
195
|
+
name: "Churn Risk - Northwind Systems",
|
|
196
|
+
accountName: "Northwind Systems",
|
|
197
|
+
stage: "Prospecting",
|
|
198
|
+
closeDate: "Jun 30, 2026",
|
|
199
|
+
amount: "$75,000",
|
|
200
|
+
},
|
|
201
|
+
})
|
|
202
|
+
|
|
203
|
+
expect(screen.getByText(/this will approve this action for/i)).toBeInTheDocument()
|
|
204
|
+
expect(screen.queryByLabelText("Close Date")).not.toBeInTheDocument()
|
|
205
|
+
expect(screen.getByRole("button", { name: /confirm/i })).not.toBeDisabled()
|
|
206
|
+
|
|
207
|
+
fireEvent.click(screen.getByRole("button", { name: /confirm/i }))
|
|
208
|
+
expect(onApprove).toHaveBeenCalledWith(undefined)
|
|
209
|
+
})
|
|
210
|
+
|
|
188
211
|
it("blocks confirmation until the close date is valid", () => {
|
|
189
212
|
const onApprove = vi.fn()
|
|
190
213
|
|
|
@@ -460,12 +460,18 @@ function formatAmountDraftValue(value: string | number | null | undefined): stri
|
|
|
460
460
|
function buildOpportunityDraft(preview?: OpportunityPreview): OpportunityDraft {
|
|
461
461
|
return {
|
|
462
462
|
closeDate: preview?.closeDateValue ?? preview?.closeDate ?? "",
|
|
463
|
-
amount: preview?.amountValue
|
|
463
|
+
amount: preview?.amountValue === undefined
|
|
464
|
+
? preview?.amount ?? ""
|
|
465
|
+
: formatAmountDraftValue(preview.amountValue),
|
|
464
466
|
description: preview?.description ?? "",
|
|
465
467
|
churnType: preview?.churnType ?? "",
|
|
466
468
|
}
|
|
467
469
|
}
|
|
468
470
|
|
|
471
|
+
function hasEditableOpportunityPreview(preview?: OpportunityPreview): boolean {
|
|
472
|
+
return !!preview && isValidDateInput(preview.closeDateValue ?? preview.closeDate)
|
|
473
|
+
}
|
|
474
|
+
|
|
469
475
|
function isValidDateInput(value: string): boolean {
|
|
470
476
|
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value)
|
|
471
477
|
if (!match) return false
|
|
@@ -505,7 +511,8 @@ function Actions() {
|
|
|
505
511
|
(!needsText || detailText.trim().length > 0)
|
|
506
512
|
|
|
507
513
|
const canSubmitApprove = selectedReasons.length > 0 || detailText.trim().length > 0
|
|
508
|
-
const
|
|
514
|
+
const isEditableOpportunityPreview = hasEditableOpportunityPreview(opportunityPreview)
|
|
515
|
+
const canConfirmOpportunity = !isEditableOpportunityPreview || isValidDateInput(opportunityDraft.closeDate)
|
|
509
516
|
|
|
510
517
|
const selectTopReason = (label: string) => {
|
|
511
518
|
if (selectedTopReason === label) {
|
|
@@ -807,7 +814,23 @@ function Actions() {
|
|
|
807
814
|
<p className="text-sm text-foreground">
|
|
808
815
|
{labels.confirmPrompt} <strong>{companyName}</strong>. Confirm?
|
|
809
816
|
</p>
|
|
810
|
-
{opportunityPreview && (
|
|
817
|
+
{opportunityPreview && !isEditableOpportunityPreview && (
|
|
818
|
+
<div className="mt-3 space-y-2 border-t border-border/50 pt-3">
|
|
819
|
+
{[
|
|
820
|
+
{ label: "Opportunity", value: opportunityPreview.name },
|
|
821
|
+
{ label: "Account", value: opportunityPreview.accountName },
|
|
822
|
+
{ label: "Stage", value: opportunityPreview.stage },
|
|
823
|
+
{ label: "Close Date", value: opportunityPreview.closeDate },
|
|
824
|
+
{ label: "Amount", value: opportunityPreview.amount },
|
|
825
|
+
].map(({ label, value }) => (
|
|
826
|
+
<div key={label} className="flex items-center justify-between gap-3 text-xs">
|
|
827
|
+
<span className="text-muted-foreground">{label}</span>
|
|
828
|
+
<span className="text-right font-medium text-foreground">{value}</span>
|
|
829
|
+
</div>
|
|
830
|
+
))}
|
|
831
|
+
</div>
|
|
832
|
+
)}
|
|
833
|
+
{opportunityPreview && isEditableOpportunityPreview && (
|
|
811
834
|
<div className="mt-3 space-y-3 border-t border-border/50 pt-3">
|
|
812
835
|
{[
|
|
813
836
|
{ label: "Opportunity", value: opportunityPreview.name },
|
|
@@ -890,7 +913,13 @@ function Actions() {
|
|
|
890
913
|
<div className="flex items-center gap-2">
|
|
891
914
|
<button
|
|
892
915
|
type="button"
|
|
893
|
-
onClick={() =>
|
|
916
|
+
onClick={() => {
|
|
917
|
+
if (!opportunityPreview) {
|
|
918
|
+
approve()
|
|
919
|
+
return
|
|
920
|
+
}
|
|
921
|
+
approve(isEditableOpportunityPreview ? opportunityDraft : undefined)
|
|
922
|
+
}}
|
|
894
923
|
disabled={!canConfirmOpportunity}
|
|
895
924
|
className="inline-flex h-7 items-center gap-1.5 rounded-md bg-foreground px-3 text-xs font-semibold text-background transition-colors hover:bg-foreground/90 disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground"
|
|
896
925
|
>
|
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
PipelineStageTiming,
|
|
14
14
|
} from "../charts/pipeline-overview"
|
|
15
15
|
import type { TimelineEvent } from "../components/timeline-activity"
|
|
16
|
-
import type { ApprovalState } from "../components/signal-feedback-inline"
|
|
16
|
+
import type { ApprovalState, OpportunityDraft } from "../components/signal-feedback-inline"
|
|
17
17
|
import type { LucideIcon } from "lucide-react"
|
|
18
18
|
import type { PriorityFactor } from "../components/signal-priority-popover"
|
|
19
19
|
import type { FeedbackChipTree, FeedbackSubmitData, PersistedFeedbackData } from "../components/feedback-primitives"
|
|
@@ -180,7 +180,7 @@ export interface InboxViewConfig {
|
|
|
180
180
|
quickFilterTabs?: Array<{ id: string; label: string; matchValue?: string; count?: number }>
|
|
181
181
|
hideAccountsButton?: boolean
|
|
182
182
|
accountDetailsLabel?: string
|
|
183
|
-
onSignalApprove?: (item: QueueItem, draft?:
|
|
183
|
+
onSignalApprove?: (item: QueueItem, draft?: OpportunityDraft) => void | Promise<boolean>
|
|
184
184
|
getSignalApprovalState?: (item: QueueItem) => ApprovalState | undefined
|
|
185
185
|
signalLabels?: {
|
|
186
186
|
approveButton?: string
|
package/dist/{signal-priority-popover-DM02Eg_F.d.ts → signal-priority-popover-QJngMAj7.d.ts}
RENAMED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PersistedFeedbackData, FeedbackChipTree, FeedbackSubmitData } from './components/feedback-primitives.js';
|
|
3
|
-
import { OpportunityDraft, ApprovalState } from './components/signal-feedback-inline.js';
|
|
4
3
|
import { SidebarNavSection } from './components/quick-action-sidebar-nav.js';
|
|
5
4
|
import { ScoreFactor } from './components/score-breakdown.js';
|
|
6
5
|
import { SuggestedContact, SuggestedAction } from './components/suggested-actions.js';
|
|
@@ -11,6 +10,7 @@ import { DataRow } from './components/data-table.js';
|
|
|
11
10
|
import { MetricCardProps } from './components/metric-card.js';
|
|
12
11
|
import { PipelineStage, PipelineStageMetrics, PipelineStageTiming } from './charts/pipeline-overview.js';
|
|
13
12
|
import { TimelineEvent } from './components/timeline-activity.js';
|
|
13
|
+
import { OpportunityDraft, ApprovalState } from './components/signal-feedback-inline.js';
|
|
14
14
|
import { LucideIcon } from 'lucide-react';
|
|
15
15
|
|
|
16
16
|
interface TimelineSystemEventsConfig {
|