@handled-ai/design-system 0.9.28 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account-contacts-popover.d.ts +22 -0
- package/dist/components/account-contacts-popover.js +180 -0
- package/dist/components/account-contacts-popover.js.map +1 -0
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.ts +2 -2
- package/dist/components/compliance-badge.d.ts +10 -0
- package/dist/components/compliance-badge.js +95 -0
- package/dist/components/compliance-badge.js.map +1 -0
- package/dist/components/contact-chip.d.ts +12 -0
- package/dist/components/contact-chip.js +98 -0
- package/dist/components/contact-chip.js.map +1 -0
- package/dist/components/draft-feedback-inline.d.ts +11 -0
- package/dist/components/draft-feedback-inline.js +153 -0
- package/dist/components/draft-feedback-inline.js.map +1 -0
- package/dist/components/empty-state.d.ts +11 -0
- package/dist/components/empty-state.js +46 -0
- package/dist/components/empty-state.js.map +1 -0
- package/dist/components/filter-chip.d.ts +9 -0
- package/dist/components/filter-chip.js +67 -0
- package/dist/components/filter-chip.js.map +1 -0
- package/dist/components/inline-banner.d.ts +10 -0
- package/dist/components/inline-banner.js +97 -0
- package/dist/components/inline-banner.js.map +1 -0
- package/dist/components/kbd-hint.d.ts +5 -0
- package/dist/components/kbd-hint.js +51 -0
- package/dist/components/kbd-hint.js.map +1 -0
- package/dist/components/rich-text-toolbar.d.ts +9 -0
- package/dist/components/rich-text-toolbar.js +103 -0
- package/dist/components/rich-text-toolbar.js.map +1 -0
- package/dist/components/step-timeline.d.ts +19 -0
- package/dist/components/step-timeline.js +134 -0
- package/dist/components/step-timeline.js.map +1 -0
- package/dist/components/sticky-action-bar.d.ts +10 -0
- package/dist/components/sticky-action-bar.js +56 -0
- package/dist/components/sticky-action-bar.js.map +1 -0
- package/dist/components/suggested-actions.js +2 -304
- package/dist/components/suggested-actions.js.map +1 -1
- package/dist/components/switch.d.ts +6 -0
- package/dist/components/switch.js +66 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/variable-autocomplete.d.ts +21 -0
- package/dist/components/variable-autocomplete.js +171 -0
- package/dist/components/variable-autocomplete.js.map +1 -0
- package/dist/index.d.ts +14 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/components/__tests__/compliance-badge.test.tsx +88 -0
- package/src/components/__tests__/contact-chip.test.tsx +88 -0
- package/src/components/__tests__/empty-state.test.tsx +76 -0
- package/src/components/__tests__/filter-chip.test.tsx +73 -0
- package/src/components/__tests__/inline-banner.test.tsx +110 -0
- package/src/components/__tests__/kbd-hint.test.tsx +29 -0
- package/src/components/__tests__/rich-text-toolbar.test.tsx +92 -0
- package/src/components/__tests__/step-timeline.test.tsx +174 -0
- package/src/components/__tests__/sticky-action-bar.test.tsx +52 -0
- package/src/components/__tests__/switch.test.tsx +39 -0
- package/src/components/__tests__/variable-autocomplete.test.tsx +155 -0
- package/src/components/account-contacts-popover.tsx +192 -0
- package/src/components/compliance-badge.tsx +68 -0
- package/src/components/contact-chip.tsx +68 -0
- package/src/components/draft-feedback-inline.tsx +193 -0
- package/src/components/empty-state.tsx +37 -0
- package/src/components/filter-chip.tsx +37 -0
- package/src/components/inline-banner.tsx +69 -0
- package/src/components/kbd-hint.tsx +21 -0
- package/src/components/rich-text-toolbar.tsx +90 -0
- package/src/components/step-timeline.tsx +149 -0
- package/src/components/sticky-action-bar.tsx +36 -0
- package/src/components/suggested-actions.tsx +2 -363
- package/src/components/switch.tsx +29 -0
- package/src/components/variable-autocomplete.tsx +178 -0
- package/src/index.ts +16 -1
- package/src/styles/globals.css +60 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SuggestedContact, SuggestedActionsIconMap } from './suggested-actions.js';
|
|
3
|
+
|
|
4
|
+
declare function BrandIcon({ src, alt, className }: {
|
|
5
|
+
src: string;
|
|
6
|
+
alt: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
interface AccountContactsPopoverProps {
|
|
10
|
+
contacts: SuggestedContact[];
|
|
11
|
+
onSelect: (contact: SuggestedContact) => void;
|
|
12
|
+
onSelectTo?: (contact: SuggestedContact) => void;
|
|
13
|
+
onSelectCc?: (contact: SuggestedContact) => void;
|
|
14
|
+
onSelectBcc?: (contact: SuggestedContact) => void;
|
|
15
|
+
onViewAll?: () => void;
|
|
16
|
+
onOpenRecentActivity?: () => void;
|
|
17
|
+
trigger: React.ReactNode;
|
|
18
|
+
iconMap?: SuggestedActionsIconMap;
|
|
19
|
+
}
|
|
20
|
+
declare function AccountContactsPopover({ contacts, onSelect, onSelectTo, onSelectCc, onSelectBcc, onViewAll, onOpenRecentActivity, trigger, iconMap, }: AccountContactsPopoverProps): React.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { AccountContactsPopover, type AccountContactsPopoverProps, BrandIcon };
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
"use client";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import {
|
|
7
|
+
Clock,
|
|
8
|
+
ExternalLink
|
|
9
|
+
} from "lucide-react";
|
|
10
|
+
function BrandIcon({ src, alt, className }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
"img",
|
|
13
|
+
{
|
|
14
|
+
src,
|
|
15
|
+
alt,
|
|
16
|
+
className: `${className != null ? className : ""} object-contain`,
|
|
17
|
+
draggable: false
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function AccountContactsPopover({
|
|
22
|
+
contacts,
|
|
23
|
+
onSelect,
|
|
24
|
+
onSelectTo,
|
|
25
|
+
onSelectCc,
|
|
26
|
+
onSelectBcc,
|
|
27
|
+
onViewAll,
|
|
28
|
+
onOpenRecentActivity,
|
|
29
|
+
trigger,
|
|
30
|
+
iconMap
|
|
31
|
+
}) {
|
|
32
|
+
const [open, setOpen] = React.useState(false);
|
|
33
|
+
const triggerRef = React.useRef(null);
|
|
34
|
+
const [popoverStyle, setPopoverStyle] = React.useState({});
|
|
35
|
+
React.useEffect(() => {
|
|
36
|
+
if (open && triggerRef.current) {
|
|
37
|
+
const rect = triggerRef.current.getBoundingClientRect();
|
|
38
|
+
const popoverWidth = Math.min(448, window.innerWidth - 32);
|
|
39
|
+
let left = rect.right - popoverWidth;
|
|
40
|
+
if (left < 16) left = 16;
|
|
41
|
+
if (left + popoverWidth > window.innerWidth - 16) left = window.innerWidth - 16 - popoverWidth;
|
|
42
|
+
setPopoverStyle({ position: "fixed", top: rect.bottom + 4, left });
|
|
43
|
+
}
|
|
44
|
+
}, [open]);
|
|
45
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
46
|
+
/* @__PURE__ */ jsx("div", { ref: triggerRef, onClick: () => setOpen(!open), children: trigger }),
|
|
47
|
+
open && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
48
|
+
/* @__PURE__ */ jsx("div", { className: "fixed inset-0 z-40", onClick: () => setOpen(false) }),
|
|
49
|
+
/* @__PURE__ */ jsxs("div", { style: popoverStyle, className: "fixed bg-background border border-border rounded-lg shadow-xl z-50 w-[28rem] max-w-[calc(100vw-2rem)] py-2 animate-in fade-in slide-in-from-top-1 duration-150", children: [
|
|
50
|
+
/* @__PURE__ */ jsx("div", { className: "px-3 py-1.5 text-[11px] font-medium text-muted-foreground/60 uppercase tracking-wide", children: "Account Contacts" }),
|
|
51
|
+
/* @__PURE__ */ jsx("div", { className: "max-h-48 overflow-y-auto", children: contacts.map((c, i) => {
|
|
52
|
+
var _a, _b, _c, _d, _e, _f;
|
|
53
|
+
return /* @__PURE__ */ jsxs(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
role: "button",
|
|
57
|
+
onClick: () => {
|
|
58
|
+
(onSelectTo != null ? onSelectTo : onSelect)(c);
|
|
59
|
+
setOpen(false);
|
|
60
|
+
},
|
|
61
|
+
className: "flex items-center gap-3 w-full px-3 py-2 text-left hover:bg-muted/50 transition-colors cursor-pointer",
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ jsx("div", { className: "w-7 h-7 rounded-full bg-muted flex items-center justify-center text-[10px] font-medium text-muted-foreground shrink-0", children: c.name.split(" ").map((n) => n[0]).join("") }),
|
|
64
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0 overflow-hidden", children: [
|
|
65
|
+
/* @__PURE__ */ jsx("div", { className: "truncate text-sm font-medium text-foreground", children: c.name }),
|
|
66
|
+
/* @__PURE__ */ jsxs("div", { className: "truncate text-xs text-muted-foreground leading-tight", children: [
|
|
67
|
+
c.role,
|
|
68
|
+
" \xB7 ",
|
|
69
|
+
(_f = (_e = (_c = (_b = c.email) != null ? _b : (_a = c.emails) == null ? void 0 : _a[0]) != null ? _c : c.phone) != null ? _e : (_d = c.phones) == null ? void 0 : _d[0]) != null ? _f : ""
|
|
70
|
+
] }),
|
|
71
|
+
c.lastActivity && /* @__PURE__ */ jsxs(
|
|
72
|
+
"button",
|
|
73
|
+
{
|
|
74
|
+
type: "button",
|
|
75
|
+
onClick: (e) => {
|
|
76
|
+
e.stopPropagation();
|
|
77
|
+
onOpenRecentActivity == null ? void 0 : onOpenRecentActivity();
|
|
78
|
+
setOpen(false);
|
|
79
|
+
},
|
|
80
|
+
className: "mt-1.5 flex max-w-full items-center gap-1.5 overflow-hidden rounded-md border border-border/70 bg-muted/30 px-2 py-1 text-[11px] text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ jsx(Clock, { className: "w-3 h-3 shrink-0" }),
|
|
83
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 font-medium", children: "Last activity" }),
|
|
84
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 text-muted-foreground/60", children: "\xB7" }),
|
|
85
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0", children: c.lastActivity.date }),
|
|
86
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 text-muted-foreground/60", children: "\xB7" }),
|
|
87
|
+
/* @__PURE__ */ jsx("span", { className: "truncate capitalize", children: c.lastActivity.type })
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
] }),
|
|
92
|
+
/* @__PURE__ */ jsxs("div", { className: "ml-2 flex items-center gap-1.5 shrink-0", children: [
|
|
93
|
+
onSelectTo && /* @__PURE__ */ jsx(
|
|
94
|
+
"button",
|
|
95
|
+
{
|
|
96
|
+
type: "button",
|
|
97
|
+
onClick: (e) => {
|
|
98
|
+
e.stopPropagation();
|
|
99
|
+
onSelectTo(c);
|
|
100
|
+
setOpen(false);
|
|
101
|
+
},
|
|
102
|
+
className: "h-6 rounded border border-border bg-background px-1.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted/40",
|
|
103
|
+
children: "To"
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
onSelectCc && /* @__PURE__ */ jsx(
|
|
107
|
+
"button",
|
|
108
|
+
{
|
|
109
|
+
type: "button",
|
|
110
|
+
onClick: (e) => {
|
|
111
|
+
e.stopPropagation();
|
|
112
|
+
onSelectCc(c);
|
|
113
|
+
setOpen(false);
|
|
114
|
+
},
|
|
115
|
+
className: "h-6 rounded border border-border bg-background px-1.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted/40",
|
|
116
|
+
children: "Cc"
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
onSelectBcc && /* @__PURE__ */ jsx(
|
|
120
|
+
"button",
|
|
121
|
+
{
|
|
122
|
+
type: "button",
|
|
123
|
+
onClick: (e) => {
|
|
124
|
+
e.stopPropagation();
|
|
125
|
+
onSelectBcc(c);
|
|
126
|
+
setOpen(false);
|
|
127
|
+
},
|
|
128
|
+
className: "h-6 rounded border border-border bg-background px-1.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted/40",
|
|
129
|
+
children: "Bcc"
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ jsx(
|
|
133
|
+
"button",
|
|
134
|
+
{
|
|
135
|
+
type: "button",
|
|
136
|
+
onClick: (e) => {
|
|
137
|
+
e.stopPropagation();
|
|
138
|
+
if (c.salesforceUrl) {
|
|
139
|
+
window.open(c.salesforceUrl, "_blank", "noopener,noreferrer");
|
|
140
|
+
} else {
|
|
141
|
+
onViewAll == null ? void 0 : onViewAll();
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
className: "h-7 w-7 inline-flex items-center justify-center rounded-md border border-border bg-background hover:bg-muted/40 transition-colors shrink-0",
|
|
145
|
+
"aria-label": `Open ${c.name} in Salesforce`,
|
|
146
|
+
children: (iconMap == null ? void 0 : iconMap.salesforce) ? /* @__PURE__ */ jsx(BrandIcon, { src: iconMap.salesforce, alt: "Salesforce", className: "w-3.5 h-3.5" }) : /* @__PURE__ */ jsx(ExternalLink, { className: "w-3.5 h-3.5 text-muted-foreground" })
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
] })
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
i
|
|
153
|
+
);
|
|
154
|
+
}) }),
|
|
155
|
+
onViewAll && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
156
|
+
/* @__PURE__ */ jsx("div", { className: "h-px bg-border mx-3 my-1" }),
|
|
157
|
+
/* @__PURE__ */ jsxs(
|
|
158
|
+
"button",
|
|
159
|
+
{
|
|
160
|
+
onClick: () => {
|
|
161
|
+
onViewAll();
|
|
162
|
+
setOpen(false);
|
|
163
|
+
},
|
|
164
|
+
className: "flex items-center gap-2 w-full px-3 py-2 text-left text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "w-3 h-3" }),
|
|
167
|
+
"View all contacts"
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
] })
|
|
172
|
+
] })
|
|
173
|
+
] })
|
|
174
|
+
] });
|
|
175
|
+
}
|
|
176
|
+
export {
|
|
177
|
+
AccountContactsPopover,
|
|
178
|
+
BrandIcon
|
|
179
|
+
};
|
|
180
|
+
//# sourceMappingURL=account-contacts-popover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/account-contacts-popover.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport {\n Clock,\n ExternalLink,\n} from \"lucide-react\"\nimport type { SuggestedContact, SuggestedActionsIconMap } from \"./suggested-actions\"\n\n// ---------------------------------------------------------------------------\n// BrandIcon\n// ---------------------------------------------------------------------------\n\nexport function BrandIcon({ src, alt, className }: { src: string; alt: string; className?: string }) {\n return (\n <img\n src={src}\n alt={alt}\n className={`${className ?? \"\"} object-contain`}\n draggable={false}\n />\n )\n}\n\n// ---------------------------------------------------------------------------\n// AccountContactsPopover\n// ---------------------------------------------------------------------------\n\nexport interface AccountContactsPopoverProps {\n contacts: SuggestedContact[]\n onSelect: (contact: SuggestedContact) => void\n onSelectTo?: (contact: SuggestedContact) => void\n onSelectCc?: (contact: SuggestedContact) => void\n onSelectBcc?: (contact: SuggestedContact) => void\n onViewAll?: () => void\n onOpenRecentActivity?: () => void\n trigger: React.ReactNode\n iconMap?: SuggestedActionsIconMap\n}\n\nexport function AccountContactsPopover({\n contacts,\n onSelect,\n onSelectTo,\n onSelectCc,\n onSelectBcc,\n onViewAll,\n onOpenRecentActivity,\n trigger,\n iconMap,\n}: AccountContactsPopoverProps) {\n const [open, setOpen] = React.useState(false)\n const triggerRef = React.useRef<HTMLDivElement>(null)\n const [popoverStyle, setPopoverStyle] = React.useState<React.CSSProperties>({})\n\n React.useEffect(() => {\n if (open && triggerRef.current) {\n const rect = triggerRef.current.getBoundingClientRect()\n const popoverWidth = Math.min(448, window.innerWidth - 32)\n let left = rect.right - popoverWidth\n if (left < 16) left = 16\n if (left + popoverWidth > window.innerWidth - 16) left = window.innerWidth - 16 - popoverWidth\n setPopoverStyle({ position: \"fixed\", top: rect.bottom + 4, left })\n }\n }, [open])\n\n return (\n <div>\n <div ref={triggerRef} onClick={() => setOpen(!open)}>{trigger}</div>\n {open && (\n <>\n <div className=\"fixed inset-0 z-40\" onClick={() => setOpen(false)} />\n <div style={popoverStyle} className=\"fixed bg-background border border-border rounded-lg shadow-xl z-50 w-[28rem] max-w-[calc(100vw-2rem)] py-2 animate-in fade-in slide-in-from-top-1 duration-150\">\n <div className=\"px-3 py-1.5 text-[11px] font-medium text-muted-foreground/60 uppercase tracking-wide\">\n Account Contacts\n </div>\n <div className=\"max-h-48 overflow-y-auto\">\n {contacts.map((c, i) => (\n <div\n key={i}\n role=\"button\"\n onClick={() => { (onSelectTo ?? onSelect)(c); setOpen(false) }}\n className=\"flex items-center gap-3 w-full px-3 py-2 text-left hover:bg-muted/50 transition-colors cursor-pointer\"\n >\n <div className=\"w-7 h-7 rounded-full bg-muted flex items-center justify-center text-[10px] font-medium text-muted-foreground shrink-0\">\n {c.name.split(\" \").map((n) => n[0]).join(\"\")}\n </div>\n <div className=\"flex-1 min-w-0 overflow-hidden\">\n <div className=\"truncate text-sm font-medium text-foreground\">{c.name}</div>\n <div className=\"truncate text-xs text-muted-foreground leading-tight\">\n {c.role} · {c.email ?? c.emails?.[0] ?? c.phone ?? c.phones?.[0] ?? \"\"}\n </div>\n {c.lastActivity && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n onOpenRecentActivity?.()\n setOpen(false)\n }}\n className=\"mt-1.5 flex max-w-full items-center gap-1.5 overflow-hidden rounded-md border border-border/70 bg-muted/30 px-2 py-1 text-[11px] text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors\"\n >\n <Clock className=\"w-3 h-3 shrink-0\" />\n <span className=\"shrink-0 font-medium\">Last activity</span>\n <span className=\"shrink-0 text-muted-foreground/60\">·</span>\n <span className=\"shrink-0\">{c.lastActivity.date}</span>\n <span className=\"shrink-0 text-muted-foreground/60\">·</span>\n <span className=\"truncate capitalize\">{c.lastActivity.type}</span>\n </button>\n )}\n </div>\n <div className=\"ml-2 flex items-center gap-1.5 shrink-0\">\n {onSelectTo && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n onSelectTo(c)\n setOpen(false)\n }}\n className=\"h-6 rounded border border-border bg-background px-1.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted/40\"\n >\n To\n </button>\n )}\n {onSelectCc && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n onSelectCc(c)\n setOpen(false)\n }}\n className=\"h-6 rounded border border-border bg-background px-1.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted/40\"\n >\n Cc\n </button>\n )}\n {onSelectBcc && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n onSelectBcc(c)\n setOpen(false)\n }}\n className=\"h-6 rounded border border-border bg-background px-1.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted/40\"\n >\n Bcc\n </button>\n )}\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n if (c.salesforceUrl) {\n window.open(c.salesforceUrl, \"_blank\", \"noopener,noreferrer\")\n } else {\n onViewAll?.()\n }\n }}\n className=\"h-7 w-7 inline-flex items-center justify-center rounded-md border border-border bg-background hover:bg-muted/40 transition-colors shrink-0\"\n aria-label={`Open ${c.name} in Salesforce`}\n >\n {iconMap?.salesforce ? (\n <BrandIcon src={iconMap.salesforce} alt=\"Salesforce\" className=\"w-3.5 h-3.5\" />\n ) : (\n <ExternalLink className=\"w-3.5 h-3.5 text-muted-foreground\" />\n )}\n </button>\n </div>\n </div>\n ))}\n </div>\n {onViewAll && (\n <>\n <div className=\"h-px bg-border mx-3 my-1\" />\n <button\n onClick={() => { onViewAll(); setOpen(false) }}\n className=\"flex items-center gap-2 w-full px-3 py-2 text-left text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors\"\n >\n <ExternalLink className=\"w-3 h-3\" />\n View all contacts\n </button>\n </>\n )}\n </div>\n </>\n )}\n </div>\n )\n}\n"],"mappings":";AAeI,SAgKU,UAhKV,KA0EgB,YA1EhB;AAbJ,YAAY,WAAW;AACvB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAOA,SAAS,UAAU,EAAE,KAAK,KAAK,UAAU,GAAqD;AACnG,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,WAAW,GAAG,gCAAa,EAAE;AAAA,MAC7B,WAAW;AAAA;AAAA,EACb;AAEJ;AAkBO,SAAS,uBAAuB;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAgC;AAC9B,QAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAS,KAAK;AAC5C,QAAM,aAAa,MAAM,OAAuB,IAAI;AACpD,QAAM,CAAC,cAAc,eAAe,IAAI,MAAM,SAA8B,CAAC,CAAC;AAE9E,QAAM,UAAU,MAAM;AACpB,QAAI,QAAQ,WAAW,SAAS;AAC9B,YAAM,OAAO,WAAW,QAAQ,sBAAsB;AACtD,YAAM,eAAe,KAAK,IAAI,KAAK,OAAO,aAAa,EAAE;AACzD,UAAI,OAAO,KAAK,QAAQ;AACxB,UAAI,OAAO,GAAI,QAAO;AACtB,UAAI,OAAO,eAAe,OAAO,aAAa,GAAI,QAAO,OAAO,aAAa,KAAK;AAClF,sBAAgB,EAAE,UAAU,SAAS,KAAK,KAAK,SAAS,GAAG,KAAK,CAAC;AAAA,IACnE;AAAA,EACF,GAAG,CAAC,IAAI,CAAC;AAET,SACE,qBAAC,SACC;AAAA,wBAAC,SAAI,KAAK,YAAY,SAAS,MAAM,QAAQ,CAAC,IAAI,GAAI,mBAAQ;AAAA,IAC7D,QACC,iCACE;AAAA,0BAAC,SAAI,WAAU,sBAAqB,S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A2B;AAAA,UAC1C;AAAA,YAAC;AAAA;AAAA,cACC,SAAS,MAAM;AAAE,0BAAU;AAAG,wBAAQ,KAAK;AAAA,cAAE;AAAA,cAC7C,WAAU;AAAA,cAEV;AAAA,oCAAC,gBAAa,WAAU,WAAU;AAAA,gBAAE;AAAA;AAAA;AAAA,UAEtC;AAAA,WACF;AAAA,SAEJ;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -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?: "default" | "
|
|
6
|
+
variant?: "default" | "outline" | "link" | "secondary" | "destructive" | "ghost" | 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,8 +3,8 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "default" | "
|
|
7
|
-
size?: "default" | "
|
|
6
|
+
variant?: "default" | "outline" | "link" | "secondary" | "destructive" | "ghost" | null | undefined;
|
|
7
|
+
size?: "default" | "icon" | "sm" | "lg" | 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> & {
|
|
10
10
|
asChild?: boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type ComplianceStatus = "verified" | "pending" | "changed_since_verified" | "never_verified";
|
|
4
|
+
interface ComplianceBadgeProps extends React.HTMLAttributes<HTMLElement> {
|
|
5
|
+
status: ComplianceStatus;
|
|
6
|
+
variant?: "line" | "pill";
|
|
7
|
+
}
|
|
8
|
+
declare function ComplianceBadge({ status, variant, className, ...rest }: ComplianceBadgeProps): React.JSX.Element;
|
|
9
|
+
|
|
10
|
+
export { ComplianceBadge, type ComplianceBadgeProps, type ComplianceStatus };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
"use client";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defProps = Object.defineProperties;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __objRest = (source, exclude) => {
|
|
24
|
+
var target = {};
|
|
25
|
+
for (var prop in source)
|
|
26
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
+
target[prop] = source[prop];
|
|
28
|
+
if (source != null && __getOwnPropSymbols)
|
|
29
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
};
|
|
35
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
36
|
+
import { Check, Clock, AlertTriangle, Minus } from "lucide-react";
|
|
37
|
+
import { cn } from "../lib/utils.js";
|
|
38
|
+
const statusConfig = {
|
|
39
|
+
verified: {
|
|
40
|
+
line: { icon: Check, label: "Compliance verified", classes: "text-status-active-fg" },
|
|
41
|
+
pill: { icon: Check, label: "Verified", classes: "bg-status-active-bg text-status-active-fg" }
|
|
42
|
+
},
|
|
43
|
+
pending: {
|
|
44
|
+
line: { icon: Clock, label: "Pending compliance review", classes: "text-status-pending-fg" },
|
|
45
|
+
pill: { icon: AlertTriangle, label: "Pending review", classes: "bg-status-pending-bg text-status-pending-fg" }
|
|
46
|
+
},
|
|
47
|
+
changed_since_verified: {
|
|
48
|
+
line: { icon: AlertTriangle, label: "Changed since last verification", classes: "text-status-warning-fg" },
|
|
49
|
+
pill: { icon: AlertTriangle, label: "Changed", classes: "bg-status-warning-bg text-status-warning-fg" }
|
|
50
|
+
},
|
|
51
|
+
never_verified: {
|
|
52
|
+
line: { icon: Minus, label: "Never verified", classes: "text-muted-foreground" },
|
|
53
|
+
pill: { icon: Minus, label: "Never verified", classes: "bg-muted text-muted-foreground" }
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
function ComplianceBadge(_a) {
|
|
57
|
+
var _b = _a, { status, variant = "line", className } = _b, rest = __objRest(_b, ["status", "variant", "className"]);
|
|
58
|
+
const config = statusConfig[status][variant];
|
|
59
|
+
const Icon = config.icon;
|
|
60
|
+
const iconSize = variant === "line" ? 12 : 10;
|
|
61
|
+
if (variant === "pill") {
|
|
62
|
+
return /* @__PURE__ */ jsxs(
|
|
63
|
+
"span",
|
|
64
|
+
__spreadProps(__spreadValues({
|
|
65
|
+
"data-slot": "compliance-badge",
|
|
66
|
+
"data-status": status,
|
|
67
|
+
"data-variant": "pill",
|
|
68
|
+
className: cn("text-[10px] px-2 py-0.5 rounded-full inline-flex w-fit items-center gap-1", config.classes, className)
|
|
69
|
+
}, rest), {
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsx(Icon, { size: iconSize }),
|
|
72
|
+
/* @__PURE__ */ jsx("span", { children: config.label })
|
|
73
|
+
]
|
|
74
|
+
})
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
return /* @__PURE__ */ jsxs(
|
|
78
|
+
"div",
|
|
79
|
+
__spreadProps(__spreadValues({
|
|
80
|
+
"data-slot": "compliance-badge",
|
|
81
|
+
"data-status": status,
|
|
82
|
+
"data-variant": "line",
|
|
83
|
+
className: cn("text-xs inline-flex w-fit items-center gap-1.5", config.classes, className)
|
|
84
|
+
}, rest), {
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsx(Icon, { size: iconSize }),
|
|
87
|
+
/* @__PURE__ */ jsx("span", { children: config.label })
|
|
88
|
+
]
|
|
89
|
+
})
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
ComplianceBadge
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=compliance-badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/compliance-badge.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Check, Clock, AlertTriangle, Minus } from \"lucide-react\"\n\nimport { cn } from \"../lib/utils\"\n\ntype ComplianceStatus = \"verified\" | \"pending\" | \"changed_since_verified\" | \"never_verified\"\n\ninterface ComplianceBadgeProps extends React.HTMLAttributes<HTMLElement> {\n status: ComplianceStatus\n variant?: \"line\" | \"pill\"\n}\n\nconst statusConfig = {\n verified: {\n line: { icon: Check, label: \"Compliance verified\", classes: \"text-status-active-fg\" },\n pill: { icon: Check, label: \"Verified\", classes: \"bg-status-active-bg text-status-active-fg\" },\n },\n pending: {\n line: { icon: Clock, label: \"Pending compliance review\", classes: \"text-status-pending-fg\" },\n pill: { icon: AlertTriangle, label: \"Pending review\", classes: \"bg-status-pending-bg text-status-pending-fg\" },\n },\n changed_since_verified: {\n line: { icon: AlertTriangle, label: \"Changed since last verification\", classes: \"text-status-warning-fg\" },\n pill: { icon: AlertTriangle, label: \"Changed\", classes: \"bg-status-warning-bg text-status-warning-fg\" },\n },\n never_verified: {\n line: { icon: Minus, label: \"Never verified\", classes: \"text-muted-foreground\" },\n pill: { icon: Minus, label: \"Never verified\", classes: \"bg-muted text-muted-foreground\" },\n },\n}\n\nfunction ComplianceBadge({ status, variant = \"line\", className, ...rest }: ComplianceBadgeProps) {\n const config = statusConfig[status][variant]\n const Icon = config.icon\n const iconSize = variant === \"line\" ? 12 : 10\n\n if (variant === \"pill\") {\n return (\n <span\n data-slot=\"compliance-badge\"\n data-status={status}\n data-variant=\"pill\"\n className={cn(\"text-[10px] px-2 py-0.5 rounded-full inline-flex w-fit items-center gap-1\", config.classes, className)}\n {...rest}\n >\n <Icon size={iconSize} />\n <span>{config.label}</span>\n </span>\n )\n }\n\n return (\n <div\n data-slot=\"compliance-badge\"\n data-status={status}\n data-variant=\"line\"\n className={cn(\"text-xs inline-flex w-fit items-center gap-1.5\", config.classes, className)}\n {...rest}\n >\n <Icon size={iconSize} />\n <span>{config.label}</span>\n </div>\n )\n}\n\nexport { ComplianceBadge, type ComplianceBadgeProps, type ComplianceStatus }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCM,SAOE,KAPF;AArCN,SAAS,OAAO,OAAO,eAAe,aAAa;AAEnD,SAAS,UAAU;AASnB,MAAM,eAAe;AAAA,EACnB,UAAU;AAAA,IACR,MAAM,EAAE,MAAM,OAAO,OAAO,uBAAuB,SAAS,wBAAwB;AAAA,IACpF,MAAM,EAAE,MAAM,OAAO,OAAO,YAAY,SAAS,4CAA4C;AAAA,EAC/F;AAAA,EACA,SAAS;AAAA,IACP,MAAM,EAAE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}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ContactChipProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
name: string;
|
|
5
|
+
email?: string;
|
|
6
|
+
verified?: boolean;
|
|
7
|
+
onConfirm?: () => void;
|
|
8
|
+
onRemove?: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare function ContactChip({ name, email, verified, onConfirm, onRemove, className, ...rest }: ContactChipProps): React.JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { ContactChip, type ContactChipProps };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
"use client";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defProps = Object.defineProperties;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __objRest = (source, exclude) => {
|
|
24
|
+
var target = {};
|
|
25
|
+
for (var prop in source)
|
|
26
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
+
target[prop] = source[prop];
|
|
28
|
+
if (source != null && __getOwnPropSymbols)
|
|
29
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
};
|
|
35
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
36
|
+
import { X } from "lucide-react";
|
|
37
|
+
import { cn } from "../lib/utils.js";
|
|
38
|
+
function ContactChip(_a) {
|
|
39
|
+
var _b = _a, {
|
|
40
|
+
name,
|
|
41
|
+
email,
|
|
42
|
+
verified = true,
|
|
43
|
+
onConfirm,
|
|
44
|
+
onRemove,
|
|
45
|
+
className
|
|
46
|
+
} = _b, rest = __objRest(_b, [
|
|
47
|
+
"name",
|
|
48
|
+
"email",
|
|
49
|
+
"verified",
|
|
50
|
+
"onConfirm",
|
|
51
|
+
"onRemove",
|
|
52
|
+
"className"
|
|
53
|
+
]);
|
|
54
|
+
const isVerified = verified !== false;
|
|
55
|
+
return /* @__PURE__ */ jsxs(
|
|
56
|
+
"span",
|
|
57
|
+
__spreadProps(__spreadValues({
|
|
58
|
+
"data-slot": "contact-chip",
|
|
59
|
+
"data-verified": isVerified ? "true" : "false",
|
|
60
|
+
className: cn(
|
|
61
|
+
"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs",
|
|
62
|
+
isVerified ? "border border-border bg-background" : "border border-status-warning-border bg-status-warning-bg",
|
|
63
|
+
className
|
|
64
|
+
)
|
|
65
|
+
}, rest), {
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: name }),
|
|
68
|
+
email && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: email }),
|
|
69
|
+
!isVerified && onConfirm && /* @__PURE__ */ jsx(
|
|
70
|
+
"button",
|
|
71
|
+
{
|
|
72
|
+
type: "button",
|
|
73
|
+
"data-slot": "contact-chip-confirm",
|
|
74
|
+
onClick: onConfirm,
|
|
75
|
+
"aria-label": `Confirm ${name}`,
|
|
76
|
+
className: "text-[10px] px-1.5 py-0 rounded bg-status-warning-border/50 text-status-warning-fg hover:bg-status-warning-border cursor-pointer font-medium ml-1",
|
|
77
|
+
children: "Confirm"
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
onRemove && /* @__PURE__ */ jsx(
|
|
81
|
+
"button",
|
|
82
|
+
{
|
|
83
|
+
type: "button",
|
|
84
|
+
"data-slot": "contact-chip-remove",
|
|
85
|
+
onClick: onRemove,
|
|
86
|
+
"aria-label": `Remove ${name}`,
|
|
87
|
+
className: "inline-flex size-4 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
88
|
+
children: /* @__PURE__ */ jsx(X, { size: 12 })
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
]
|
|
92
|
+
})
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
ContactChip
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=contact-chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/contact-chip.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { X } from \"lucide-react\"\n\nimport { cn } from \"../lib/utils\"\n\ninterface ContactChipProps extends React.HTMLAttributes<HTMLSpanElement> {\n name: string\n email?: string\n verified?: boolean\n onConfirm?: () => void\n onRemove?: () => void\n}\n\nfunction ContactChip({\n name,\n email,\n verified = true,\n onConfirm,\n onRemove,\n className,\n ...rest\n}: ContactChipProps) {\n const isVerified = verified !== false\n\n return (\n <span\n data-slot=\"contact-chip\"\n data-verified={isVerified ? \"true\" : \"false\"}\n className={cn(\n \"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs\",\n isVerified\n ? \"border border-border bg-background\"\n : \"border border-status-warning-border bg-status-warning-bg\",\n className\n )}\n {...rest}\n >\n <span className=\"font-medium\">{name}</span>\n {email && <span className=\"text-muted-foreground\">{email}</span>}\n {!isVerified && onConfirm && (\n <button\n type=\"button\"\n data-slot=\"contact-chip-confirm\"\n onClick={onConfirm}\n aria-label={`Confirm ${name}`}\n className=\"text-[10px] px-1.5 py-0 rounded bg-status-warning-border/50 text-status-warning-fg hover:bg-status-warning-border cursor-pointer font-medium ml-1\"\n >\n Confirm\n </button>\n )}\n {onRemove && (\n <button\n type=\"button\"\n data-slot=\"contact-chip-remove\"\n onClick={onRemove}\n aria-label={`Remove ${name}`}\n className=\"inline-flex size-4 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50\"\n >\n <X size={12} />\n </button>\n )}\n </span>\n )\n}\n\nexport { ContactChip, type ContactChipProps }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BI,SAYE,KAZF;AAxBJ,SAAS,SAAS;AAElB,SAAS,UAAU;AAUnB,SAAS,YAAY,IAQA;AARA,eACnB;AAAA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,EArBF,IAeqB,IAOhB,iBAPgB,IAOhB;AAAA,IANH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,aAAa,aAAa;AAEhC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,iBAAe,aAAa,SAAS;AAAA,MACrC,WAAW;AAAA,QACT;AAAA,QACA,aACI,uCACA;AAAA,QACJ;AAAA,MACF;AAAA,OACI,OAVL;AAAA,MAYC;AAAA,4BAAC,UAAK,WAAU,eAAe,gBAAK;AAAA,QACnC,SAAS,oBAAC,UAAK,WAAU,yBAAyB,iBAAM;AAAA,QACxD,CAAC,cAAc,aACd;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,aAAU;AAAA,YACV,SAAS;AAAA,YACT,cAAY,WAAW,IAAI;AAAA,YAC3B,WAAU;AAAA,YACX;AAAA;AAAA,QAED;AAAA,QAED,YACC;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,aAAU;AAAA,YACV,SAAS;AAAA,YACT,cAAY,UAAU,IAAI;AAAA,YAC1B,WAAU;AAAA,YAEV,8BAAC,KAAE,MAAM,IAAI;AAAA;AAAA,QACf;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface DraftFeedbackInlineProps {
|
|
4
|
+
initialDirection?: 'up' | 'down' | null;
|
|
5
|
+
onRegenerateRequest?: (pills: string[], detail: string) => void;
|
|
6
|
+
onSubmitFeedback?: (type: "up" | "down", pills: string[], detail: string) => void;
|
|
7
|
+
onDiscardRequest?: (pills: string[], detail: string) => void;
|
|
8
|
+
}
|
|
9
|
+
declare function DraftFeedbackInline({ initialDirection, onRegenerateRequest, onSubmitFeedback, onDiscardRequest, }: DraftFeedbackInlineProps): React.JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { DraftFeedbackInline, type DraftFeedbackInlineProps };
|