acai-ui-library 0.1.21 → 0.1.23
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/ai-chatbot-logo-glyph.cjs +31 -0
- package/dist/components/ai-chatbot-logo-glyph.cjs.map +1 -0
- package/dist/components/ai-chatbot-logo-glyph.d.cts +3 -0
- package/dist/components/ai-chatbot-logo-glyph.d.ts +3 -0
- package/dist/components/ai-chatbot-logo-glyph.js +6 -0
- package/dist/components/ai-chatbot-logo-glyph.js.map +1 -0
- package/dist/components/ai-chatbot-logo.cjs +136 -0
- package/dist/components/ai-chatbot-logo.cjs.map +1 -0
- package/dist/components/ai-chatbot-logo.d.cts +13 -0
- package/dist/components/ai-chatbot-logo.d.ts +13 -0
- package/dist/components/ai-chatbot-logo.js +102 -0
- package/dist/components/ai-chatbot-logo.js.map +1 -0
- package/dist/components/app-launcher.cjs +224 -0
- package/dist/components/app-launcher.cjs.map +1 -0
- package/dist/components/app-launcher.d.cts +24 -0
- package/dist/components/app-launcher.d.ts +24 -0
- package/dist/components/app-launcher.js +190 -0
- package/dist/components/app-launcher.js.map +1 -0
- package/dist/components/calendar.cjs +13 -5
- package/dist/components/calendar.cjs.map +1 -1
- package/dist/components/calendar.js +15 -7
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/date-picker.cjs +17 -7
- package/dist/components/date-picker.cjs.map +1 -1
- package/dist/components/date-picker.js +23 -13
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/date-time-picker.cjs +13 -5
- package/dist/components/date-time-picker.cjs.map +1 -1
- package/dist/components/date-time-picker.js +28 -20
- package/dist/components/date-time-picker.js.map +1 -1
- package/dist/components/help-widget/app-id-typecheck.cjs +34 -0
- package/dist/components/help-widget/app-id-typecheck.cjs.map +1 -0
- package/dist/components/help-widget/app-id-typecheck.d.cts +17 -0
- package/dist/components/help-widget/app-id-typecheck.d.ts +17 -0
- package/dist/components/help-widget/app-id-typecheck.js +8 -0
- package/dist/components/help-widget/app-id-typecheck.js.map +1 -0
- package/dist/components/help-widget/consent-dialog.cjs +276 -0
- package/dist/components/help-widget/consent-dialog.cjs.map +1 -0
- package/dist/components/help-widget/consent-dialog.d.cts +17 -0
- package/dist/components/help-widget/consent-dialog.d.ts +17 -0
- package/dist/components/help-widget/consent-dialog.js +239 -0
- package/dist/components/help-widget/consent-dialog.js.map +1 -0
- package/dist/components/help-widget/help-session-banner.cjs +85 -0
- package/dist/components/help-widget/help-session-banner.cjs.map +1 -0
- package/dist/components/help-widget/help-session-banner.d.cts +17 -0
- package/dist/components/help-widget/help-session-banner.d.ts +17 -0
- package/dist/components/help-widget/help-session-banner.js +50 -0
- package/dist/components/help-widget/help-session-banner.js.map +1 -0
- package/dist/components/help-widget/help-widget.cjs +503 -0
- package/dist/components/help-widget/help-widget.cjs.map +1 -0
- package/dist/components/help-widget/help-widget.d.cts +32 -0
- package/dist/components/help-widget/help-widget.d.ts +32 -0
- package/dist/components/help-widget/help-widget.js +468 -0
- package/dist/components/help-widget/help-widget.js.map +1 -0
- package/dist/components/help-widget/highlight-overlay.cjs +84 -0
- package/dist/components/help-widget/highlight-overlay.cjs.map +1 -0
- package/dist/components/help-widget/highlight-overlay.d.cts +24 -0
- package/dist/components/help-widget/highlight-overlay.d.ts +24 -0
- package/dist/components/help-widget/highlight-overlay.js +49 -0
- package/dist/components/help-widget/highlight-overlay.js.map +1 -0
- package/dist/components/help-widget/use-help-session.cjs +85 -0
- package/dist/components/help-widget/use-help-session.cjs.map +1 -0
- package/dist/components/help-widget/use-help-session.d.cts +46 -0
- package/dist/components/help-widget/use-help-session.d.ts +46 -0
- package/dist/components/help-widget/use-help-session.js +50 -0
- package/dist/components/help-widget/use-help-session.js.map +1 -0
- package/dist/index.cjs +665 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +699 -126
- package/dist/index.js.map +1 -1
- package/dist/lib/app-ids.cjs +58 -0
- package/dist/lib/app-ids.cjs.map +1 -0
- package/dist/lib/app-ids.d.cts +12 -0
- package/dist/lib/app-ids.d.ts +12 -0
- package/dist/lib/app-ids.js +32 -0
- package/dist/lib/app-ids.js.map +1 -0
- package/dist/lib/mask-snapshot.cjs +66 -0
- package/dist/lib/mask-snapshot.cjs.map +1 -0
- package/dist/lib/mask-snapshot.d.cts +16 -0
- package/dist/lib/mask-snapshot.d.ts +16 -0
- package/dist/lib/mask-snapshot.js +41 -0
- package/dist/lib/mask-snapshot.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/components/help-widget/help-widget.tsx
|
|
31
|
+
var help_widget_exports = {};
|
|
32
|
+
__export(help_widget_exports, {
|
|
33
|
+
HelpWidget: () => HelpWidget
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(help_widget_exports);
|
|
36
|
+
var React6 = __toESM(require("react"), 1);
|
|
37
|
+
|
|
38
|
+
// src/lib/utils.ts
|
|
39
|
+
var import_clsx = require("clsx");
|
|
40
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
41
|
+
function cn(...inputs) {
|
|
42
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// src/components/alert-dialog.tsx
|
|
46
|
+
var React2 = __toESM(require("react"), 1);
|
|
47
|
+
var AlertDialogPrimitive = __toESM(require("@radix-ui/react-alert-dialog"), 1);
|
|
48
|
+
|
|
49
|
+
// src/components/button.tsx
|
|
50
|
+
var React = __toESM(require("react"), 1);
|
|
51
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
52
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
53
|
+
var import_lucide_react = require("lucide-react");
|
|
54
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
55
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
56
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4",
|
|
57
|
+
{
|
|
58
|
+
variants: {
|
|
59
|
+
variant: {
|
|
60
|
+
default: "bg-primary text-primary-foreground hover:bg-primary-hover",
|
|
61
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive-hover",
|
|
62
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
63
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-hover",
|
|
64
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
65
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
66
|
+
success: "bg-success text-success-foreground hover:bg-success-hover"
|
|
67
|
+
},
|
|
68
|
+
size: {
|
|
69
|
+
xs: "h-7 px-2.5 text-xs",
|
|
70
|
+
sm: "h-9 px-3",
|
|
71
|
+
default: "h-10 px-4 py-2",
|
|
72
|
+
lg: "h-11 px-8",
|
|
73
|
+
icon: "h-10 w-10",
|
|
74
|
+
"icon-sm": "h-8 w-8"
|
|
75
|
+
},
|
|
76
|
+
shape: {
|
|
77
|
+
default: "rounded-md",
|
|
78
|
+
rounded: "rounded-lg",
|
|
79
|
+
pill: "rounded-full",
|
|
80
|
+
square: "rounded-none"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
defaultVariants: {
|
|
84
|
+
variant: "default",
|
|
85
|
+
size: "default",
|
|
86
|
+
shape: "default"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
var Button = React.forwardRef(
|
|
91
|
+
({
|
|
92
|
+
className,
|
|
93
|
+
variant,
|
|
94
|
+
size,
|
|
95
|
+
shape,
|
|
96
|
+
asChild = false,
|
|
97
|
+
loading = false,
|
|
98
|
+
prefixIcon,
|
|
99
|
+
suffixIcon,
|
|
100
|
+
children,
|
|
101
|
+
disabled,
|
|
102
|
+
...props
|
|
103
|
+
}, ref) => {
|
|
104
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
105
|
+
const isDisabled = disabled || loading;
|
|
106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
107
|
+
Comp,
|
|
108
|
+
{
|
|
109
|
+
className: cn(buttonVariants({ variant, size, shape, className })),
|
|
110
|
+
ref,
|
|
111
|
+
disabled: isDisabled,
|
|
112
|
+
...props,
|
|
113
|
+
children: [
|
|
114
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "animate-spin" }),
|
|
115
|
+
!loading && prefixIcon,
|
|
116
|
+
children,
|
|
117
|
+
suffixIcon
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
Button.displayName = "Button";
|
|
124
|
+
|
|
125
|
+
// src/components/alert-dialog.tsx
|
|
126
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
127
|
+
var AlertDialogSizeContext = React2.createContext("default");
|
|
128
|
+
var AlertDialog = AlertDialogPrimitive.Root;
|
|
129
|
+
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
130
|
+
var AlertDialogOverlay = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
131
|
+
AlertDialogPrimitive.Overlay,
|
|
132
|
+
{
|
|
133
|
+
className: cn(
|
|
134
|
+
"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
135
|
+
className
|
|
136
|
+
),
|
|
137
|
+
...props,
|
|
138
|
+
ref
|
|
139
|
+
}
|
|
140
|
+
));
|
|
141
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
142
|
+
var AlertDialogContent = React2.forwardRef(({ className, size = "default", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AlertDialogSizeContext.Provider, { value: size, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(AlertDialogPortal, { children: [
|
|
143
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AlertDialogOverlay, {}),
|
|
144
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
145
|
+
AlertDialogPrimitive.Content,
|
|
146
|
+
{
|
|
147
|
+
ref,
|
|
148
|
+
className: cn(
|
|
149
|
+
"group/alert-dialog-content fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
150
|
+
size === "sm" ? "max-w-sm p-5" : "max-w-lg p-6",
|
|
151
|
+
className
|
|
152
|
+
),
|
|
153
|
+
...props
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
] }) }));
|
|
157
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
158
|
+
var AlertDialogMedia = React2.forwardRef(({ className, tone = "primary", children, ...props }, ref) => {
|
|
159
|
+
const size = React2.useContext(AlertDialogSizeContext);
|
|
160
|
+
const tones = {
|
|
161
|
+
primary: "bg-[var(--hc-primary-100)] text-[var(--hc-primary-600)]",
|
|
162
|
+
destructive: "bg-[color-mix(in_srgb,var(--hc-color-destructive)_12%,transparent)] text-[var(--hc-color-destructive)]",
|
|
163
|
+
success: "bg-[var(--hc-banner-success-bg)] text-[var(--hc-color-success)]",
|
|
164
|
+
warning: "bg-[var(--hc-banner-warning-bg)] text-[var(--hc-color-warning)]",
|
|
165
|
+
muted: "bg-muted text-foreground"
|
|
166
|
+
};
|
|
167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
168
|
+
"div",
|
|
169
|
+
{
|
|
170
|
+
ref,
|
|
171
|
+
"data-slot": "media",
|
|
172
|
+
className: cn(
|
|
173
|
+
"flex shrink-0 items-center justify-center self-center rounded-full",
|
|
174
|
+
size === "sm" ? "h-9 w-9 [&>svg]:size-[18px]" : "h-10 w-10 [&>svg]:size-5",
|
|
175
|
+
tones[tone],
|
|
176
|
+
className
|
|
177
|
+
),
|
|
178
|
+
...props,
|
|
179
|
+
children
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
});
|
|
183
|
+
AlertDialogMedia.displayName = "AlertDialogMedia";
|
|
184
|
+
var AlertDialogHeader = ({ className, children, ...props }) => {
|
|
185
|
+
const size = React2.useContext(AlertDialogSizeContext);
|
|
186
|
+
const hasMedia = React2.Children.toArray(children).some(
|
|
187
|
+
(c) => React2.isValidElement(c) && c.type?.displayName === "AlertDialogMedia"
|
|
188
|
+
);
|
|
189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
190
|
+
"div",
|
|
191
|
+
{
|
|
192
|
+
className: cn(
|
|
193
|
+
"flex flex-col gap-2",
|
|
194
|
+
hasMedia || size === "sm" ? "items-center text-center" : "text-center sm:text-left",
|
|
195
|
+
className
|
|
196
|
+
),
|
|
197
|
+
...props,
|
|
198
|
+
children
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
};
|
|
202
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
203
|
+
var AlertDialogFooter = ({ className, ...props }) => {
|
|
204
|
+
const size = React2.useContext(AlertDialogSizeContext);
|
|
205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
206
|
+
"div",
|
|
207
|
+
{
|
|
208
|
+
className: cn(
|
|
209
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:space-x-0 sm:[&>button]:min-w-[96px]",
|
|
210
|
+
// Center if small or when the Content has a media slot
|
|
211
|
+
size === "sm" ? "sm:justify-center" : "sm:justify-end group-has-[[data-slot=media]]/alert-dialog-content:sm:justify-center",
|
|
212
|
+
className
|
|
213
|
+
),
|
|
214
|
+
...props
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
};
|
|
218
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
219
|
+
var AlertDialogTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
220
|
+
AlertDialogPrimitive.Title,
|
|
221
|
+
{
|
|
222
|
+
ref,
|
|
223
|
+
className: cn("text-lg font-semibold leading-tight tracking-tight text-foreground", className),
|
|
224
|
+
...props
|
|
225
|
+
}
|
|
226
|
+
));
|
|
227
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
228
|
+
var AlertDialogDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
229
|
+
AlertDialogPrimitive.Description,
|
|
230
|
+
{
|
|
231
|
+
ref,
|
|
232
|
+
className: cn("text-sm leading-relaxed text-muted-foreground", className),
|
|
233
|
+
...props
|
|
234
|
+
}
|
|
235
|
+
));
|
|
236
|
+
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
237
|
+
var AlertDialogAction = React2.forwardRef(({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
238
|
+
AlertDialogPrimitive.Action,
|
|
239
|
+
{
|
|
240
|
+
ref,
|
|
241
|
+
className: cn(
|
|
242
|
+
buttonVariants({ variant: variant === "destructive" ? "destructive" : "default" }),
|
|
243
|
+
className
|
|
244
|
+
),
|
|
245
|
+
...props
|
|
246
|
+
}
|
|
247
|
+
));
|
|
248
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
249
|
+
var AlertDialogCancel = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
250
|
+
AlertDialogPrimitive.Cancel,
|
|
251
|
+
{
|
|
252
|
+
ref,
|
|
253
|
+
className: cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className),
|
|
254
|
+
...props
|
|
255
|
+
}
|
|
256
|
+
));
|
|
257
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
258
|
+
|
|
259
|
+
// src/components/help-widget/consent-dialog.tsx
|
|
260
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
261
|
+
function ConsentDialog({ open, onAllow, onDeny }) {
|
|
262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AlertDialog, { open, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(AlertDialogContent, { size: "sm", children: [
|
|
263
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(AlertDialogHeader, { children: [
|
|
264
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AlertDialogTitle, { children: "Start a support session?" }),
|
|
265
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AlertDialogDescription, { children: "An AI assistant will see this page and may be recorded (chat and voice). A human can join for anything it cannot resolve. You can stop the session at any time." })
|
|
266
|
+
] }),
|
|
267
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(AlertDialogFooter, { children: [
|
|
268
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AlertDialogCancel, { onClick: onDeny, children: "Deny" }),
|
|
269
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AlertDialogAction, { onClick: onAllow, children: "Allow" })
|
|
270
|
+
] })
|
|
271
|
+
] }) });
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// src/components/help-widget/help-session-banner.tsx
|
|
275
|
+
var React3 = __toESM(require("react"), 1);
|
|
276
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
277
|
+
var HelpSessionBanner = React3.forwardRef(
|
|
278
|
+
({ onRevoke, className }, ref) => {
|
|
279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
280
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { "aria-hidden": "true", className: "h-12", "data-help-session-spacer": "" }),
|
|
281
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
282
|
+
"div",
|
|
283
|
+
{
|
|
284
|
+
ref,
|
|
285
|
+
role: "status",
|
|
286
|
+
"data-help-session-banner": "",
|
|
287
|
+
className: cn(
|
|
288
|
+
"fixed inset-x-0 top-0 z-[2147483000]",
|
|
289
|
+
"flex h-12 items-center gap-3 border-b-2 border-border bg-primary px-4 text-sm font-medium text-primary-foreground shadow-md",
|
|
290
|
+
className
|
|
291
|
+
),
|
|
292
|
+
children: [
|
|
293
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "shrink-0 rounded px-2 py-0.5 text-xs font-bold uppercase tracking-wide ring-1 ring-current", children: "Support session" }),
|
|
294
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "min-w-0 flex-1 truncate", children: "AI support is active on this page and may be recorded." }),
|
|
295
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
296
|
+
"button",
|
|
297
|
+
{
|
|
298
|
+
type: "button",
|
|
299
|
+
onClick: onRevoke,
|
|
300
|
+
className: "shrink-0 rounded-md bg-background px-3 py-1 text-sm font-semibold text-foreground hover:bg-background/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
301
|
+
children: "Stop"
|
|
302
|
+
}
|
|
303
|
+
)
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
)
|
|
307
|
+
] });
|
|
308
|
+
}
|
|
309
|
+
);
|
|
310
|
+
HelpSessionBanner.displayName = "HelpSessionBanner";
|
|
311
|
+
|
|
312
|
+
// src/components/help-widget/highlight-overlay.tsx
|
|
313
|
+
var React4 = __toESM(require("react"), 1);
|
|
314
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
315
|
+
function findTarget({ selector, role, name }) {
|
|
316
|
+
if (selector) return document.querySelector(selector);
|
|
317
|
+
if (role) {
|
|
318
|
+
const candidates = document.querySelectorAll(`[role="${role}"]`);
|
|
319
|
+
for (const el of candidates) {
|
|
320
|
+
const accessibleName = el.getAttribute("aria-label") ?? el.textContent?.trim() ?? "";
|
|
321
|
+
if (!name || accessibleName.includes(name)) return el;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return null;
|
|
325
|
+
}
|
|
326
|
+
function HighlightOverlay({ target, onDismiss }) {
|
|
327
|
+
const [rect, setRect] = React4.useState(null);
|
|
328
|
+
React4.useEffect(() => {
|
|
329
|
+
if (!target) {
|
|
330
|
+
setRect(null);
|
|
331
|
+
onDismiss?.();
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
const el = findTarget(target);
|
|
335
|
+
setRect(el ? el.getBoundingClientRect() : null);
|
|
336
|
+
}, [target, onDismiss]);
|
|
337
|
+
if (!target || !rect) return null;
|
|
338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
339
|
+
"div",
|
|
340
|
+
{
|
|
341
|
+
"data-help-widget-highlight": "",
|
|
342
|
+
role: "presentation",
|
|
343
|
+
"aria-hidden": "true",
|
|
344
|
+
style: {
|
|
345
|
+
position: "fixed",
|
|
346
|
+
left: rect.left - 4,
|
|
347
|
+
top: rect.top - 4,
|
|
348
|
+
width: rect.width + 8,
|
|
349
|
+
height: rect.height + 8,
|
|
350
|
+
pointerEvents: "none",
|
|
351
|
+
zIndex: 2147483e3
|
|
352
|
+
},
|
|
353
|
+
className: "rounded-md ring-2 ring-primary ring-offset-2"
|
|
354
|
+
}
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// src/components/help-widget/use-help-session.ts
|
|
359
|
+
var React5 = __toESM(require("react"), 1);
|
|
360
|
+
function defaultCreateSession(baseUrl) {
|
|
361
|
+
return async (request) => {
|
|
362
|
+
const res = await fetch(`${baseUrl}/support/ai/session`, {
|
|
363
|
+
method: "POST",
|
|
364
|
+
headers: { "Content-Type": "application/json" },
|
|
365
|
+
body: JSON.stringify(request)
|
|
366
|
+
});
|
|
367
|
+
if (!res.ok) throw new Error(`support/ai/session failed: ${res.status}`);
|
|
368
|
+
return await res.json();
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
async function defaultConnectRoom(session) {
|
|
372
|
+
const { Room } = await import("livekit-client");
|
|
373
|
+
const room = new Room();
|
|
374
|
+
await room.connect(session.url, session.token);
|
|
375
|
+
return { disconnect: () => room.disconnect() };
|
|
376
|
+
}
|
|
377
|
+
function useHelpSession({
|
|
378
|
+
appId,
|
|
379
|
+
route,
|
|
380
|
+
createSession,
|
|
381
|
+
connectRoom = defaultConnectRoom,
|
|
382
|
+
baseUrl = ""
|
|
383
|
+
}) {
|
|
384
|
+
const [status, setStatus] = React5.useState("idle");
|
|
385
|
+
const [language, setLanguage] = React5.useState("en");
|
|
386
|
+
const connectionRef = React5.useRef(null);
|
|
387
|
+
const createSessionRef = React5.useRef(createSession ?? defaultCreateSession(baseUrl));
|
|
388
|
+
createSessionRef.current = createSession ?? defaultCreateSession(baseUrl);
|
|
389
|
+
const requestSession = React5.useCallback(() => setStatus("consent-pending"), []);
|
|
390
|
+
const deny = React5.useCallback(() => setStatus("idle"), []);
|
|
391
|
+
const allow = React5.useCallback(async () => {
|
|
392
|
+
const session = await createSessionRef.current({ appId, language, route });
|
|
393
|
+
connectionRef.current = await connectRoom(session);
|
|
394
|
+
setStatus("active");
|
|
395
|
+
}, [appId, language, route, connectRoom]);
|
|
396
|
+
const stop = React5.useCallback(() => {
|
|
397
|
+
connectionRef.current?.disconnect();
|
|
398
|
+
connectionRef.current = null;
|
|
399
|
+
setStatus("idle");
|
|
400
|
+
}, []);
|
|
401
|
+
React5.useEffect(() => () => connectionRef.current?.disconnect(), []);
|
|
402
|
+
return { status, language, setLanguage, requestSession, allow, deny, stop };
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// src/components/help-widget/help-widget.tsx
|
|
406
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
407
|
+
var LANGUAGE_LABELS = {
|
|
408
|
+
en: "English",
|
|
409
|
+
hi: "Hindi",
|
|
410
|
+
mr: "Marathi"
|
|
411
|
+
};
|
|
412
|
+
function HelpWidget({
|
|
413
|
+
appId,
|
|
414
|
+
route,
|
|
415
|
+
defaultLanguage = "en",
|
|
416
|
+
createSession,
|
|
417
|
+
connectRoom,
|
|
418
|
+
baseUrl,
|
|
419
|
+
highlightTarget = null,
|
|
420
|
+
className
|
|
421
|
+
}) {
|
|
422
|
+
const [open, setOpen] = React6.useState(false);
|
|
423
|
+
const { status, language, setLanguage, requestSession, allow, deny, stop } = useHelpSession({
|
|
424
|
+
appId,
|
|
425
|
+
route,
|
|
426
|
+
createSession,
|
|
427
|
+
connectRoom,
|
|
428
|
+
baseUrl
|
|
429
|
+
});
|
|
430
|
+
React6.useEffect(() => {
|
|
431
|
+
setLanguage(defaultLanguage);
|
|
432
|
+
}, []);
|
|
433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: cn("relative", className), "data-help-widget": "", children: [
|
|
434
|
+
status === "active" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HelpSessionBanner, { onRevoke: stop }) : null,
|
|
435
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HighlightOverlay, { target: status === "active" ? highlightTarget : null }),
|
|
436
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
437
|
+
"button",
|
|
438
|
+
{
|
|
439
|
+
type: "button",
|
|
440
|
+
"aria-haspopup": "dialog",
|
|
441
|
+
"aria-expanded": open,
|
|
442
|
+
onClick: () => {
|
|
443
|
+
setOpen(true);
|
|
444
|
+
if (status === "idle") requestSession();
|
|
445
|
+
},
|
|
446
|
+
className: "fixed bottom-6 end-6 z-[2147482999] rounded-full bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground shadow-lg hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
447
|
+
children: "Help"
|
|
448
|
+
}
|
|
449
|
+
),
|
|
450
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
451
|
+
ConsentDialog,
|
|
452
|
+
{
|
|
453
|
+
open: open && status === "consent-pending",
|
|
454
|
+
onAllow: () => {
|
|
455
|
+
void allow();
|
|
456
|
+
},
|
|
457
|
+
onDeny: () => {
|
|
458
|
+
deny();
|
|
459
|
+
setOpen(false);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
),
|
|
463
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
464
|
+
"div",
|
|
465
|
+
{
|
|
466
|
+
role: "dialog",
|
|
467
|
+
"aria-label": "Help chat",
|
|
468
|
+
"data-help-widget-panel": "",
|
|
469
|
+
className: "fixed bottom-20 end-6 z-[2147482999] flex h-96 w-80 flex-col gap-3 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-xl",
|
|
470
|
+
children: [
|
|
471
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
472
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: "help-widget-language", className: "text-xs font-medium text-muted-foreground", children: "Language" }),
|
|
473
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
474
|
+
"select",
|
|
475
|
+
{
|
|
476
|
+
id: "help-widget-language",
|
|
477
|
+
value: language,
|
|
478
|
+
onChange: (e) => setLanguage(e.target.value),
|
|
479
|
+
className: "rounded border border-border bg-background px-2 py-1 text-xs",
|
|
480
|
+
children: Object.entries(LANGUAGE_LABELS).map(([value, label]) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value, children: label }, value))
|
|
481
|
+
}
|
|
482
|
+
)
|
|
483
|
+
] }),
|
|
484
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { "data-help-widget-chat": "", className: "flex-1 overflow-y-auto text-sm text-muted-foreground", children: status === "active" ? "Chat and voice are active." : "Waiting for consent." }),
|
|
485
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
486
|
+
"button",
|
|
487
|
+
{
|
|
488
|
+
type: "button",
|
|
489
|
+
onClick: () => setOpen(false),
|
|
490
|
+
className: "self-end rounded-md px-3 py-1 text-sm font-medium text-muted-foreground hover:text-foreground",
|
|
491
|
+
children: "Close"
|
|
492
|
+
}
|
|
493
|
+
)
|
|
494
|
+
]
|
|
495
|
+
}
|
|
496
|
+
) : null
|
|
497
|
+
] });
|
|
498
|
+
}
|
|
499
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
500
|
+
0 && (module.exports = {
|
|
501
|
+
HelpWidget
|
|
502
|
+
});
|
|
503
|
+
//# sourceMappingURL=help-widget.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/help-widget/help-widget.tsx","../../../src/lib/utils.ts","../../../src/components/alert-dialog.tsx","../../../src/components/button.tsx","../../../src/components/help-widget/consent-dialog.tsx","../../../src/components/help-widget/help-session-banner.tsx","../../../src/components/help-widget/highlight-overlay.tsx","../../../src/components/help-widget/use-help-session.ts"],"sourcesContent":["import * as React from \"react\"\nimport { cn } from \"../../lib/utils\"\nimport type { SupportAppId } from \"../../lib/app-ids\"\nimport { ConsentDialog } from \"./consent-dialog\"\nimport { HelpSessionBanner } from \"./help-session-banner\"\nimport { HighlightOverlay, type HighlightTarget } from \"./highlight-overlay\"\nimport {\n useHelpSession,\n type ConnectSupportRoom,\n type CreateSupportSession,\n type SupportLanguage,\n} from \"./use-help-session\"\n\nconst LANGUAGE_LABELS: Record<SupportLanguage, string> = {\n en: \"English\",\n hi: \"Hindi\",\n mr: \"Marathi\",\n}\n\nexport interface HelpWidgetProps {\n /** Canonical product app id. An unknown id fails type check. */\n appId: SupportAppId\n /** Current route, sent as page context with each turn. */\n route: string\n /** Default language, from the user's locale; changeable in the widget. */\n defaultLanguage?: SupportLanguage\n createSession?: CreateSupportSession\n connectRoom?: ConnectSupportRoom\n baseUrl?: string\n /** Agent-driven highlight target, forwarded from the data channel by the caller. */\n highlightTarget?: HighlightTarget | null\n className?: string\n}\n\n/**\n * Shared Help entry point for every product frontend (acai-ai-platform#2831), replacing\n * the 15 copied `support-widget.tsx` files (see MIGRATION.md).\n *\n * Chat and voice (LiveKit) start only after a click on the consent dialog's Allow button;\n * nothing in the chat or voice path can grant consent. Page context sent to the agent is\n * masked with `maskSnapshot` by the caller before it is sent over the data channel - this\n * component does not read the page itself.\n */\nexport function HelpWidget({\n appId,\n route,\n defaultLanguage = \"en\",\n createSession,\n connectRoom,\n baseUrl,\n highlightTarget = null,\n className,\n}: HelpWidgetProps) {\n const [open, setOpen] = React.useState(false)\n const { status, language, setLanguage, requestSession, allow, deny, stop } = useHelpSession({\n appId,\n route,\n createSession,\n connectRoom,\n baseUrl,\n })\n\n React.useEffect(() => {\n setLanguage(defaultLanguage)\n // Only seed the initial language from the caller; the selector owns it after that.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n return (\n <div className={cn(\"relative\", className)} data-help-widget=\"\">\n {status === \"active\" ? <HelpSessionBanner onRevoke={stop} /> : null}\n <HighlightOverlay target={status === \"active\" ? highlightTarget : null} />\n\n <button\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onClick={() => {\n setOpen(true)\n if (status === \"idle\") requestSession()\n }}\n className=\"fixed bottom-6 end-6 z-[2147482999] rounded-full bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground shadow-lg hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n >\n Help\n </button>\n\n <ConsentDialog\n open={open && status === \"consent-pending\"}\n onAllow={() => {\n void allow()\n }}\n onDeny={() => {\n deny()\n setOpen(false)\n }}\n />\n\n {open ? (\n <div\n role=\"dialog\"\n aria-label=\"Help chat\"\n data-help-widget-panel=\"\"\n className=\"fixed bottom-20 end-6 z-[2147482999] flex h-96 w-80 flex-col gap-3 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-xl\"\n >\n <div className=\"flex items-center justify-between gap-2\">\n <label htmlFor=\"help-widget-language\" className=\"text-xs font-medium text-muted-foreground\">\n Language\n </label>\n <select\n id=\"help-widget-language\"\n value={language}\n onChange={(e) => setLanguage(e.target.value as SupportLanguage)}\n className=\"rounded border border-border bg-background px-2 py-1 text-xs\"\n >\n {Object.entries(LANGUAGE_LABELS).map(([value, label]) => (\n <option key={value} value={value}>\n {label}\n </option>\n ))}\n </select>\n </div>\n <div data-help-widget-chat=\"\" className=\"flex-1 overflow-y-auto text-sm text-muted-foreground\">\n {status === \"active\" ? \"Chat and voice are active.\" : \"Waiting for consent.\"}\n </div>\n <button\n type=\"button\"\n onClick={() => setOpen(false)}\n className=\"self-end rounded-md px-3 py-1 text-sm font-medium text-muted-foreground hover:text-foreground\"\n >\n Close\n </button>\n </div>\n ) : null}\n </div>\n )\n}\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\"\nimport { cn } from \"../lib/utils\"\nimport { buttonVariants } from \"./button\"\n\ntype AlertDialogSize = \"default\" | \"sm\"\n\nconst AlertDialogSizeContext = React.createContext<AlertDialogSize>(\"default\")\n\nconst AlertDialog = AlertDialogPrimitive.Root\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger\nconst AlertDialogPortal = AlertDialogPrimitive.Portal\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n ref={ref}\n />\n))\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName\n\nconst AlertDialogContent = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> & {\n size?: AlertDialogSize\n }\n>(({ className, size = \"default\", ...props }, ref) => (\n <AlertDialogSizeContext.Provider value={size}>\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n \"group/alert-dialog-content fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n size === \"sm\" ? \"max-w-sm p-5\" : \"max-w-lg p-6\",\n className\n )}\n {...props}\n />\n </AlertDialogPortal>\n </AlertDialogSizeContext.Provider>\n))\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName\n\nconst AlertDialogMedia = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & {\n tone?: \"primary\" | \"destructive\" | \"success\" | \"warning\" | \"muted\"\n }\n>(({ className, tone = \"primary\", children, ...props }, ref) => {\n const size = React.useContext(AlertDialogSizeContext)\n const tones: Record<NonNullable<typeof tone>, string> = {\n primary: \"bg-[var(--hc-primary-100)] text-[var(--hc-primary-600)]\",\n destructive: \"bg-[color-mix(in_srgb,var(--hc-color-destructive)_12%,transparent)] text-[var(--hc-color-destructive)]\",\n success: \"bg-[var(--hc-banner-success-bg)] text-[var(--hc-color-success)]\",\n warning: \"bg-[var(--hc-banner-warning-bg)] text-[var(--hc-color-warning)]\",\n muted: \"bg-muted text-foreground\",\n }\n return (\n <div\n ref={ref}\n data-slot=\"media\"\n className={cn(\n \"flex shrink-0 items-center justify-center self-center rounded-full\",\n size === \"sm\" ? \"h-9 w-9 [&>svg]:size-[18px]\" : \"h-10 w-10 [&>svg]:size-5\",\n tones[tone],\n className\n )}\n {...props}\n >\n {children}\n </div>\n )\n})\nAlertDialogMedia.displayName = \"AlertDialogMedia\"\n\nconst AlertDialogHeader = ({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>) => {\n const size = React.useContext(AlertDialogSizeContext)\n const hasMedia = React.Children.toArray(children).some(\n (c) => React.isValidElement(c) && (c.type as any)?.displayName === \"AlertDialogMedia\"\n )\n return (\n <div\n className={cn(\n \"flex flex-col gap-2\",\n hasMedia || size === \"sm\" ? \"items-center text-center\" : \"text-center sm:text-left\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n )\n}\nAlertDialogHeader.displayName = \"AlertDialogHeader\"\n\nconst AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => {\n const size = React.useContext(AlertDialogSizeContext)\n return (\n <div\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:space-x-0 sm:[&>button]:min-w-[96px]\",\n // Center if small or when the Content has a media slot\n size === \"sm\"\n ? \"sm:justify-center\"\n : \"sm:justify-end group-has-[[data-slot=media]]/alert-dialog-content:sm:justify-center\",\n className\n )}\n {...props}\n />\n )\n}\nAlertDialogFooter.displayName = \"AlertDialogFooter\"\n\nconst AlertDialogTitle = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-tight tracking-tight text-foreground\", className)}\n {...props}\n />\n))\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName\n\nconst AlertDialogDescription = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm leading-relaxed text-muted-foreground\", className)}\n {...props}\n />\n))\nAlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName\n\nconst AlertDialogAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action> & {\n variant?: \"default\" | \"destructive\"\n }\n>(({ className, variant = \"default\", ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={cn(\n buttonVariants({ variant: variant === \"destructive\" ? \"destructive\" : \"default\" }),\n className\n )}\n {...props}\n />\n))\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName\n\nconst AlertDialogCancel = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(buttonVariants({ variant: \"outline\" }), \"mt-2 sm:mt-0\", className)}\n {...props}\n />\n))\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogMedia,\n}\n","\nimport * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { Loader2 } from \"lucide-react\"\nimport { cn } from \"../lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground hover:bg-primary-hover\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive-hover\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary-hover\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground\",\n link:\n \"text-primary underline-offset-4 hover:underline\",\n success:\n \"bg-success text-success-foreground hover:bg-success-hover\",\n },\n size: {\n xs: \"h-7 px-2.5 text-xs\",\n sm: \"h-9 px-3\",\n default: \"h-10 px-4 py-2\",\n lg: \"h-11 px-8\",\n icon: \"h-10 w-10\",\n \"icon-sm\": \"h-8 w-8\",\n },\n shape: {\n default: \"rounded-md\",\n rounded: \"rounded-lg\",\n pill: \"rounded-full\",\n square: \"rounded-none\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n shape: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n loading?: boolean\n prefixIcon?: React.ReactNode\n suffixIcon?: React.ReactNode\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n shape,\n asChild = false,\n loading = false,\n prefixIcon,\n suffixIcon,\n children,\n disabled,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n const isDisabled = disabled || loading\n\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, shape, className }))}\n ref={ref}\n disabled={isDisabled}\n {...props}\n >\n {loading && <Loader2 className=\"animate-spin\" />}\n {!loading && prefixIcon}\n {children}\n {suffixIcon}\n </Comp>\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"../alert-dialog\"\n\nexport interface ConsentDialogProps {\n open: boolean\n /** Fires only from the Allow button's onClick. No other code path may call this. */\n onAllow: () => void\n onDeny: () => void\n}\n\n/**\n * Allow/Deny gate for a support AI session (acai-ai-platform#2831).\n *\n * Consent is recorded only by a click on AlertDialogAction (\"Allow\"): nothing in this\n * component, or in HelpWidget, grants consent from spoken or typed chat content.\n */\nexport function ConsentDialog({ open, onAllow, onDeny }: ConsentDialogProps) {\n return (\n <AlertDialog open={open}>\n <AlertDialogContent size=\"sm\">\n <AlertDialogHeader>\n <AlertDialogTitle>Start a support session?</AlertDialogTitle>\n <AlertDialogDescription>\n An AI assistant will see this page and may be recorded (chat and voice). A human\n can join for anything it cannot resolve. You can stop the session at any time.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel onClick={onDeny}>Deny</AlertDialogCancel>\n <AlertDialogAction onClick={onAllow}>Allow</AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n )\n}\n","import * as React from \"react\"\nimport { cn } from \"../../lib/utils\"\n\nexport interface HelpSessionBannerProps {\n /** Ends the session: calls the caller's revoke, then the app unmounts the banner. */\n onRevoke: () => void\n className?: string\n}\n\n/**\n * Persistent banner shown while a support AI session is active (acai-ai-platform#2831).\n *\n * Same fixed, non-dismissible bar shape as ImpersonationBanner (acai-ai-platform#1274) -\n * there is no close control; Stop is the only way out, and it calls onRevoke rather than\n * hiding itself, so the caller is always the one that ends the session.\n */\nconst HelpSessionBanner = React.forwardRef<HTMLDivElement, HelpSessionBannerProps>(\n ({ onRevoke, className }, ref) => {\n return (\n <>\n <div aria-hidden=\"true\" className=\"h-12\" data-help-session-spacer=\"\" />\n <div\n ref={ref}\n role=\"status\"\n data-help-session-banner=\"\"\n className={cn(\n \"fixed inset-x-0 top-0 z-[2147483000]\",\n \"flex h-12 items-center gap-3 border-b-2 border-border bg-primary px-4 text-sm font-medium text-primary-foreground shadow-md\",\n className\n )}\n >\n <span className=\"shrink-0 rounded px-2 py-0.5 text-xs font-bold uppercase tracking-wide ring-1 ring-current\">\n Support session\n </span>\n <p className=\"min-w-0 flex-1 truncate\">AI support is active on this page and may be recorded.</p>\n <button\n type=\"button\"\n onClick={onRevoke}\n className=\"shrink-0 rounded-md bg-background px-3 py-1 text-sm font-semibold text-foreground hover:bg-background/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n >\n Stop\n </button>\n </div>\n </>\n )\n }\n)\nHelpSessionBanner.displayName = \"HelpSessionBanner\"\n\nexport { HelpSessionBanner }\n","import * as React from \"react\"\n\nexport interface HighlightTarget {\n /** A CSS selector the agent asked to highlight. Takes precedence over role/name. */\n selector?: string\n /** Accessible role, matched with an accessible-name fallback when there is no selector. */\n role?: string\n name?: string\n}\n\nexport interface HighlightOverlayProps {\n /** The current target, or null to clear the highlight. */\n target: HighlightTarget | null\n /** Called after the overlay clears itself (target becomes null). */\n onDismiss?: () => void\n}\n\nfunction findTarget({ selector, role, name }: HighlightTarget): HTMLElement | null {\n if (selector) return document.querySelector<HTMLElement>(selector)\n if (role) {\n const candidates = document.querySelectorAll<HTMLElement>(`[role=\"${role}\"]`)\n for (const el of candidates) {\n const accessibleName = el.getAttribute(\"aria-label\") ?? el.textContent?.trim() ?? \"\"\n if (!name || accessibleName.includes(name)) return el\n }\n }\n return null\n}\n\n/**\n * Draws an outline + tooltip around the element the support agent names (acai-ai-platform#2831).\n *\n * It only ever points at something - it never dispatches a click or any other interaction on\n * the user's behalf.\n */\nexport function HighlightOverlay({ target, onDismiss }: HighlightOverlayProps) {\n const [rect, setRect] = React.useState<DOMRect | null>(null)\n\n React.useEffect(() => {\n if (!target) {\n setRect(null)\n onDismiss?.()\n return\n }\n const el = findTarget(target)\n setRect(el ? el.getBoundingClientRect() : null)\n }, [target, onDismiss])\n\n if (!target || !rect) return null\n\n return (\n <div\n data-help-widget-highlight=\"\"\n role=\"presentation\"\n aria-hidden=\"true\"\n style={{\n position: \"fixed\",\n left: rect.left - 4,\n top: rect.top - 4,\n width: rect.width + 8,\n height: rect.height + 8,\n pointerEvents: \"none\",\n zIndex: 2147483000,\n }}\n className=\"rounded-md ring-2 ring-primary ring-offset-2\"\n />\n )\n}\n","import * as React from \"react\"\nimport type { SupportAppId } from \"../../lib/app-ids\"\n\nexport type SupportLanguage = \"en\" | \"hi\" | \"mr\"\n\nexport interface SupportSessionRequest {\n appId: SupportAppId\n language: SupportLanguage\n route: string\n}\n\nexport interface SupportSession {\n url: string\n token: string\n}\n\nexport interface SupportRoomConnection {\n disconnect: () => void\n}\n\nexport type CreateSupportSession = (request: SupportSessionRequest) => Promise<SupportSession>\n\nexport type ConnectSupportRoom = (session: SupportSession) => Promise<SupportRoomConnection>\n\nexport type HelpSessionStatus = \"idle\" | \"consent-pending\" | \"active\"\n\nexport interface UseHelpSessionOptions {\n appId: SupportAppId\n route: string\n /** Defaults to POSTing to `${baseUrl}/support/ai/session`. Override in tests, or to point at a different host. */\n createSession?: CreateSupportSession\n /** Defaults to connecting a LiveKit Room. Override in tests - jsdom cannot open a real room. */\n connectRoom?: ConnectSupportRoom\n baseUrl?: string\n}\n\nfunction defaultCreateSession(baseUrl: string): CreateSupportSession {\n return async (request) => {\n const res = await fetch(`${baseUrl}/support/ai/session`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(request),\n })\n if (!res.ok) throw new Error(`support/ai/session failed: ${res.status}`)\n return (await res.json()) as SupportSession\n }\n}\n\nasync function defaultConnectRoom(session: SupportSession): Promise<SupportRoomConnection> {\n const { Room } = await import(\"livekit-client\")\n const room = new Room()\n await room.connect(session.url, session.token)\n return { disconnect: () => room.disconnect() }\n}\n\n/**\n * Session/consent/voice state for HelpWidget (acai-ai-platform#2831).\n *\n * `allow()` is the only function that starts a session - it is wired to the consent\n * dialog's Allow button and nothing else calls it, so no code path from chat or voice\n * content can grant consent.\n */\nexport function useHelpSession({\n appId,\n route,\n createSession,\n connectRoom = defaultConnectRoom,\n baseUrl = \"\",\n}: UseHelpSessionOptions) {\n const [status, setStatus] = React.useState<HelpSessionStatus>(\"idle\")\n const [language, setLanguage] = React.useState<SupportLanguage>(\"en\")\n const connectionRef = React.useRef<SupportRoomConnection | null>(null)\n const createSessionRef = React.useRef(createSession ?? defaultCreateSession(baseUrl))\n createSessionRef.current = createSession ?? defaultCreateSession(baseUrl)\n\n const requestSession = React.useCallback(() => setStatus(\"consent-pending\"), [])\n\n const deny = React.useCallback(() => setStatus(\"idle\"), [])\n\n const allow = React.useCallback(async () => {\n const session = await createSessionRef.current({ appId, language, route })\n connectionRef.current = await connectRoom(session)\n setStatus(\"active\")\n }, [appId, language, route, connectRoom])\n\n const stop = React.useCallback(() => {\n connectionRef.current?.disconnect()\n connectionRef.current = null\n setStatus(\"idle\")\n }, [])\n\n React.useEffect(() => () => connectionRef.current?.disconnect(), [])\n\n return { status, language, setLanguage, requestSession, allow, deny, stop }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,SAAuB;;;ACAvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACLA,IAAAC,SAAuB;AACvB,2BAAsC;;;ACAtC,YAAuB;AACvB,wBAAqB;AACrB,sCAAuC;AACvC,0BAAwB;AA4ElB;AAzEN,IAAM,qBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU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W;AAAA,QACX,0BAAuB;AAAA,QACvB,WAAU;AAAA,QAEV;AAAA,wDAAC,SAAI,WAAU,2CACb;AAAA,yDAAC,WAAM,SAAQ,wBAAuB,WAAU,6CAA4C,sBAE5F;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,IAAG;AAAA,gBACH,OAAO;AAAA,gBACP,UAAU,CAAC,MAAM,YAAY,EAAE,OAAO,KAAwB;AAAA,gBAC9D,WAAU;AAAA,gBAET,iBAAO,QAAQ,eAAe,EAAE,IAAI,CAAC,CAAC,OAAO,KAAK,MACjD,6CAAC,YAAmB,OACjB,mBADU,KAEb,CACD;AAAA;AAAA,YACH;AAAA,aACF;AAAA,UACA,6CAAC,SAAI,yBAAsB,IAAG,WAAU,wDACrC,qBAAW,WAAW,+BAA+B,wBACxD;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,SAAS,MAAM,QAAQ,KAAK;AAAA,cAC5B,WAAU;AAAA,cACX;AAAA;AAAA,UAED;AAAA;AAAA;AAAA,IACF,IACE;AAAA,KACN;AAEJ;","names":["React","React","import_jsx_runtime","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { SupportAppId } from '../../lib/app-ids.cjs';
|
|
3
|
+
import { HighlightTarget } from './highlight-overlay.cjs';
|
|
4
|
+
import { SupportLanguage, CreateSupportSession, ConnectSupportRoom } from './use-help-session.cjs';
|
|
5
|
+
import 'react';
|
|
6
|
+
|
|
7
|
+
interface HelpWidgetProps {
|
|
8
|
+
/** Canonical product app id. An unknown id fails type check. */
|
|
9
|
+
appId: SupportAppId;
|
|
10
|
+
/** Current route, sent as page context with each turn. */
|
|
11
|
+
route: string;
|
|
12
|
+
/** Default language, from the user's locale; changeable in the widget. */
|
|
13
|
+
defaultLanguage?: SupportLanguage;
|
|
14
|
+
createSession?: CreateSupportSession;
|
|
15
|
+
connectRoom?: ConnectSupportRoom;
|
|
16
|
+
baseUrl?: string;
|
|
17
|
+
/** Agent-driven highlight target, forwarded from the data channel by the caller. */
|
|
18
|
+
highlightTarget?: HighlightTarget | null;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Shared Help entry point for every product frontend (acai-ai-platform#2831), replacing
|
|
23
|
+
* the 15 copied `support-widget.tsx` files (see MIGRATION.md).
|
|
24
|
+
*
|
|
25
|
+
* Chat and voice (LiveKit) start only after a click on the consent dialog's Allow button;
|
|
26
|
+
* nothing in the chat or voice path can grant consent. Page context sent to the agent is
|
|
27
|
+
* masked with `maskSnapshot` by the caller before it is sent over the data channel - this
|
|
28
|
+
* component does not read the page itself.
|
|
29
|
+
*/
|
|
30
|
+
declare function HelpWidget({ appId, route, defaultLanguage, createSession, connectRoom, baseUrl, highlightTarget, className, }: HelpWidgetProps): react_jsx_runtime.JSX.Element;
|
|
31
|
+
|
|
32
|
+
export { HelpWidget, type HelpWidgetProps };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { SupportAppId } from '../../lib/app-ids.js';
|
|
3
|
+
import { HighlightTarget } from './highlight-overlay.js';
|
|
4
|
+
import { SupportLanguage, CreateSupportSession, ConnectSupportRoom } from './use-help-session.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
|
|
7
|
+
interface HelpWidgetProps {
|
|
8
|
+
/** Canonical product app id. An unknown id fails type check. */
|
|
9
|
+
appId: SupportAppId;
|
|
10
|
+
/** Current route, sent as page context with each turn. */
|
|
11
|
+
route: string;
|
|
12
|
+
/** Default language, from the user's locale; changeable in the widget. */
|
|
13
|
+
defaultLanguage?: SupportLanguage;
|
|
14
|
+
createSession?: CreateSupportSession;
|
|
15
|
+
connectRoom?: ConnectSupportRoom;
|
|
16
|
+
baseUrl?: string;
|
|
17
|
+
/** Agent-driven highlight target, forwarded from the data channel by the caller. */
|
|
18
|
+
highlightTarget?: HighlightTarget | null;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Shared Help entry point for every product frontend (acai-ai-platform#2831), replacing
|
|
23
|
+
* the 15 copied `support-widget.tsx` files (see MIGRATION.md).
|
|
24
|
+
*
|
|
25
|
+
* Chat and voice (LiveKit) start only after a click on the consent dialog's Allow button;
|
|
26
|
+
* nothing in the chat or voice path can grant consent. Page context sent to the agent is
|
|
27
|
+
* masked with `maskSnapshot` by the caller before it is sent over the data channel - this
|
|
28
|
+
* component does not read the page itself.
|
|
29
|
+
*/
|
|
30
|
+
declare function HelpWidget({ appId, route, defaultLanguage, createSession, connectRoom, baseUrl, highlightTarget, className, }: HelpWidgetProps): react_jsx_runtime.JSX.Element;
|
|
31
|
+
|
|
32
|
+
export { HelpWidget, type HelpWidgetProps };
|