acai-ui-library 0.1.21 → 0.1.22
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/app-launcher.cjs +231 -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 +197 -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 +580 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +615 -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 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/help-widget/consent-dialog.tsx","../../../src/components/alert-dialog.tsx","../../../src/lib/utils.ts","../../../src/components/button.tsx"],"sourcesContent":["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 * 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","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,SAAuB;AACvB,2BAAsC;;;ACDtC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACJA,YAAuB;AACvB,wBAAqB;AACrB,sCAAuC;AACvC,0BAAwB;AA4ElB;AAzEN,IAAM,qBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OACE;AAAA,QACF,MACE;AAAA,QACF,SACE;AAAA,MACJ;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,WAAW;AAAA,MACb;AAAA,MACA,OAAO;AAAA,QACL,SAAS;AAAA,QACT,SAAS;AAAA,QACT,MAAM;AAAA,QACN,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,EACF;AACF;AAWA,IAAM,SAAe;AAAA,EACnB,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AA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
|
|
3
|
+
interface ConsentDialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
/** Fires only from the Allow button's onClick. No other code path may call this. */
|
|
6
|
+
onAllow: () => void;
|
|
7
|
+
onDeny: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Allow/Deny gate for a support AI session (acai-ai-platform#2831).
|
|
11
|
+
*
|
|
12
|
+
* Consent is recorded only by a click on AlertDialogAction ("Allow"): nothing in this
|
|
13
|
+
* component, or in HelpWidget, grants consent from spoken or typed chat content.
|
|
14
|
+
*/
|
|
15
|
+
declare function ConsentDialog({ open, onAllow, onDeny }: ConsentDialogProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { ConsentDialog, type ConsentDialogProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface ConsentDialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
/** Fires only from the Allow button's onClick. No other code path may call this. */
|
|
6
|
+
onAllow: () => void;
|
|
7
|
+
onDeny: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Allow/Deny gate for a support AI session (acai-ai-platform#2831).
|
|
11
|
+
*
|
|
12
|
+
* Consent is recorded only by a click on AlertDialogAction ("Allow"): nothing in this
|
|
13
|
+
* component, or in HelpWidget, grants consent from spoken or typed chat content.
|
|
14
|
+
*/
|
|
15
|
+
declare function ConsentDialog({ open, onAllow, onDeny }: ConsentDialogProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { ConsentDialog, type ConsentDialogProps };
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
// src/components/alert-dialog.tsx
|
|
2
|
+
import * as React2 from "react";
|
|
3
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
4
|
+
|
|
5
|
+
// src/lib/utils.ts
|
|
6
|
+
import { clsx } from "clsx";
|
|
7
|
+
import { twMerge } from "tailwind-merge";
|
|
8
|
+
function cn(...inputs) {
|
|
9
|
+
return twMerge(clsx(inputs));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// src/components/button.tsx
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
15
|
+
import { cva } from "class-variance-authority";
|
|
16
|
+
import { Loader2 } from "lucide-react";
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var buttonVariants = cva(
|
|
19
|
+
"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",
|
|
20
|
+
{
|
|
21
|
+
variants: {
|
|
22
|
+
variant: {
|
|
23
|
+
default: "bg-primary text-primary-foreground hover:bg-primary-hover",
|
|
24
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive-hover",
|
|
25
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
26
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-hover",
|
|
27
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
28
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
29
|
+
success: "bg-success text-success-foreground hover:bg-success-hover"
|
|
30
|
+
},
|
|
31
|
+
size: {
|
|
32
|
+
xs: "h-7 px-2.5 text-xs",
|
|
33
|
+
sm: "h-9 px-3",
|
|
34
|
+
default: "h-10 px-4 py-2",
|
|
35
|
+
lg: "h-11 px-8",
|
|
36
|
+
icon: "h-10 w-10",
|
|
37
|
+
"icon-sm": "h-8 w-8"
|
|
38
|
+
},
|
|
39
|
+
shape: {
|
|
40
|
+
default: "rounded-md",
|
|
41
|
+
rounded: "rounded-lg",
|
|
42
|
+
pill: "rounded-full",
|
|
43
|
+
square: "rounded-none"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
defaultVariants: {
|
|
47
|
+
variant: "default",
|
|
48
|
+
size: "default",
|
|
49
|
+
shape: "default"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
var Button = React.forwardRef(
|
|
54
|
+
({
|
|
55
|
+
className,
|
|
56
|
+
variant,
|
|
57
|
+
size,
|
|
58
|
+
shape,
|
|
59
|
+
asChild = false,
|
|
60
|
+
loading = false,
|
|
61
|
+
prefixIcon,
|
|
62
|
+
suffixIcon,
|
|
63
|
+
children,
|
|
64
|
+
disabled,
|
|
65
|
+
...props
|
|
66
|
+
}, ref) => {
|
|
67
|
+
const Comp = asChild ? Slot : "button";
|
|
68
|
+
const isDisabled = disabled || loading;
|
|
69
|
+
return /* @__PURE__ */ jsxs(
|
|
70
|
+
Comp,
|
|
71
|
+
{
|
|
72
|
+
className: cn(buttonVariants({ variant, size, shape, className })),
|
|
73
|
+
ref,
|
|
74
|
+
disabled: isDisabled,
|
|
75
|
+
...props,
|
|
76
|
+
children: [
|
|
77
|
+
loading && /* @__PURE__ */ jsx(Loader2, { className: "animate-spin" }),
|
|
78
|
+
!loading && prefixIcon,
|
|
79
|
+
children,
|
|
80
|
+
suffixIcon
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
Button.displayName = "Button";
|
|
87
|
+
|
|
88
|
+
// src/components/alert-dialog.tsx
|
|
89
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
90
|
+
var AlertDialogSizeContext = React2.createContext("default");
|
|
91
|
+
var AlertDialog = AlertDialogPrimitive.Root;
|
|
92
|
+
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
93
|
+
var AlertDialogOverlay = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
94
|
+
AlertDialogPrimitive.Overlay,
|
|
95
|
+
{
|
|
96
|
+
className: cn(
|
|
97
|
+
"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",
|
|
98
|
+
className
|
|
99
|
+
),
|
|
100
|
+
...props,
|
|
101
|
+
ref
|
|
102
|
+
}
|
|
103
|
+
));
|
|
104
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
105
|
+
var AlertDialogContent = React2.forwardRef(({ className, size = "default", ...props }, ref) => /* @__PURE__ */ jsx2(AlertDialogSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxs2(AlertDialogPortal, { children: [
|
|
106
|
+
/* @__PURE__ */ jsx2(AlertDialogOverlay, {}),
|
|
107
|
+
/* @__PURE__ */ jsx2(
|
|
108
|
+
AlertDialogPrimitive.Content,
|
|
109
|
+
{
|
|
110
|
+
ref,
|
|
111
|
+
className: cn(
|
|
112
|
+
"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",
|
|
113
|
+
size === "sm" ? "max-w-sm p-5" : "max-w-lg p-6",
|
|
114
|
+
className
|
|
115
|
+
),
|
|
116
|
+
...props
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
] }) }));
|
|
120
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
121
|
+
var AlertDialogMedia = React2.forwardRef(({ className, tone = "primary", children, ...props }, ref) => {
|
|
122
|
+
const size = React2.useContext(AlertDialogSizeContext);
|
|
123
|
+
const tones = {
|
|
124
|
+
primary: "bg-[var(--hc-primary-100)] text-[var(--hc-primary-600)]",
|
|
125
|
+
destructive: "bg-[color-mix(in_srgb,var(--hc-color-destructive)_12%,transparent)] text-[var(--hc-color-destructive)]",
|
|
126
|
+
success: "bg-[var(--hc-banner-success-bg)] text-[var(--hc-color-success)]",
|
|
127
|
+
warning: "bg-[var(--hc-banner-warning-bg)] text-[var(--hc-color-warning)]",
|
|
128
|
+
muted: "bg-muted text-foreground"
|
|
129
|
+
};
|
|
130
|
+
return /* @__PURE__ */ jsx2(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
ref,
|
|
134
|
+
"data-slot": "media",
|
|
135
|
+
className: cn(
|
|
136
|
+
"flex shrink-0 items-center justify-center self-center rounded-full",
|
|
137
|
+
size === "sm" ? "h-9 w-9 [&>svg]:size-[18px]" : "h-10 w-10 [&>svg]:size-5",
|
|
138
|
+
tones[tone],
|
|
139
|
+
className
|
|
140
|
+
),
|
|
141
|
+
...props,
|
|
142
|
+
children
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
});
|
|
146
|
+
AlertDialogMedia.displayName = "AlertDialogMedia";
|
|
147
|
+
var AlertDialogHeader = ({ className, children, ...props }) => {
|
|
148
|
+
const size = React2.useContext(AlertDialogSizeContext);
|
|
149
|
+
const hasMedia = React2.Children.toArray(children).some(
|
|
150
|
+
(c) => React2.isValidElement(c) && c.type?.displayName === "AlertDialogMedia"
|
|
151
|
+
);
|
|
152
|
+
return /* @__PURE__ */ jsx2(
|
|
153
|
+
"div",
|
|
154
|
+
{
|
|
155
|
+
className: cn(
|
|
156
|
+
"flex flex-col gap-2",
|
|
157
|
+
hasMedia || size === "sm" ? "items-center text-center" : "text-center sm:text-left",
|
|
158
|
+
className
|
|
159
|
+
),
|
|
160
|
+
...props,
|
|
161
|
+
children
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
};
|
|
165
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
166
|
+
var AlertDialogFooter = ({ className, ...props }) => {
|
|
167
|
+
const size = React2.useContext(AlertDialogSizeContext);
|
|
168
|
+
return /* @__PURE__ */ jsx2(
|
|
169
|
+
"div",
|
|
170
|
+
{
|
|
171
|
+
className: cn(
|
|
172
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:space-x-0 sm:[&>button]:min-w-[96px]",
|
|
173
|
+
// Center if small or when the Content has a media slot
|
|
174
|
+
size === "sm" ? "sm:justify-center" : "sm:justify-end group-has-[[data-slot=media]]/alert-dialog-content:sm:justify-center",
|
|
175
|
+
className
|
|
176
|
+
),
|
|
177
|
+
...props
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
};
|
|
181
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
182
|
+
var AlertDialogTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
183
|
+
AlertDialogPrimitive.Title,
|
|
184
|
+
{
|
|
185
|
+
ref,
|
|
186
|
+
className: cn("text-lg font-semibold leading-tight tracking-tight text-foreground", className),
|
|
187
|
+
...props
|
|
188
|
+
}
|
|
189
|
+
));
|
|
190
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
191
|
+
var AlertDialogDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
192
|
+
AlertDialogPrimitive.Description,
|
|
193
|
+
{
|
|
194
|
+
ref,
|
|
195
|
+
className: cn("text-sm leading-relaxed text-muted-foreground", className),
|
|
196
|
+
...props
|
|
197
|
+
}
|
|
198
|
+
));
|
|
199
|
+
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
200
|
+
var AlertDialogAction = React2.forwardRef(({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
201
|
+
AlertDialogPrimitive.Action,
|
|
202
|
+
{
|
|
203
|
+
ref,
|
|
204
|
+
className: cn(
|
|
205
|
+
buttonVariants({ variant: variant === "destructive" ? "destructive" : "default" }),
|
|
206
|
+
className
|
|
207
|
+
),
|
|
208
|
+
...props
|
|
209
|
+
}
|
|
210
|
+
));
|
|
211
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
212
|
+
var AlertDialogCancel = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
213
|
+
AlertDialogPrimitive.Cancel,
|
|
214
|
+
{
|
|
215
|
+
ref,
|
|
216
|
+
className: cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className),
|
|
217
|
+
...props
|
|
218
|
+
}
|
|
219
|
+
));
|
|
220
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
221
|
+
|
|
222
|
+
// src/components/help-widget/consent-dialog.tsx
|
|
223
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
224
|
+
function ConsentDialog({ open, onAllow, onDeny }) {
|
|
225
|
+
return /* @__PURE__ */ jsx3(AlertDialog, { open, children: /* @__PURE__ */ jsxs3(AlertDialogContent, { size: "sm", children: [
|
|
226
|
+
/* @__PURE__ */ jsxs3(AlertDialogHeader, { children: [
|
|
227
|
+
/* @__PURE__ */ jsx3(AlertDialogTitle, { children: "Start a support session?" }),
|
|
228
|
+
/* @__PURE__ */ jsx3(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." })
|
|
229
|
+
] }),
|
|
230
|
+
/* @__PURE__ */ jsxs3(AlertDialogFooter, { children: [
|
|
231
|
+
/* @__PURE__ */ jsx3(AlertDialogCancel, { onClick: onDeny, children: "Deny" }),
|
|
232
|
+
/* @__PURE__ */ jsx3(AlertDialogAction, { onClick: onAllow, children: "Allow" })
|
|
233
|
+
] })
|
|
234
|
+
] }) });
|
|
235
|
+
}
|
|
236
|
+
export {
|
|
237
|
+
ConsentDialog
|
|
238
|
+
};
|
|
239
|
+
//# sourceMappingURL=consent-dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/alert-dialog.tsx","../../../src/lib/utils.ts","../../../src/components/button.tsx","../../../src/components/help-widget/consent-dialog.tsx"],"sourcesContent":["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","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\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"],"mappings":";AAAA,YAAYA,YAAW;AACvB,YAAY,0BAA0B;;;ACDtC,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACJA,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;AACvC,SAAS,eAAe;AA4ElB,SAMc,KANd;AAzEN,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OACE;AAAA,QACF,MACE;AAAA,QACF,SACE;AAAA,MACJ;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,WAAW;AAAA,MACb;AAAA,MACA,OAAO;AAAA,QACL,SAAS;AAAA,QACT,SAAS;AAAA,QACT,MAAM;AAAA,QACN,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,EACF;AACF;AAWA,IAAM,SAAe;AAAA,EACnB,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;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BAAAC,MAAC,qBACC;AAAA,sBAAAD,KAAC,qBAAkB,SAAS,QAAQ,kBAAI;AAAA,MACxC,gBAAAA,KAAC,qBAAkB,SAAS,SAAS,mBAAK;AAAA,OAC5C;AAAA,KACF,GACF;AAEJ;","names":["React","jsx","jsxs","jsx","jsxs","jsx","jsxs"]}
|
|
@@ -0,0 +1,85 @@
|
|
|
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-session-banner.tsx
|
|
31
|
+
var help_session_banner_exports = {};
|
|
32
|
+
__export(help_session_banner_exports, {
|
|
33
|
+
HelpSessionBanner: () => HelpSessionBanner
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(help_session_banner_exports);
|
|
36
|
+
var React = __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/help-widget/help-session-banner.tsx
|
|
46
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
47
|
+
var HelpSessionBanner = React.forwardRef(
|
|
48
|
+
({ onRevoke, className }, ref) => {
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "aria-hidden": "true", className: "h-12", "data-help-session-spacer": "" }),
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
ref,
|
|
55
|
+
role: "status",
|
|
56
|
+
"data-help-session-banner": "",
|
|
57
|
+
className: cn(
|
|
58
|
+
"fixed inset-x-0 top-0 z-[2147483000]",
|
|
59
|
+
"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",
|
|
60
|
+
className
|
|
61
|
+
),
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.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" }),
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "min-w-0 flex-1 truncate", children: "AI support is active on this page and may be recorded." }),
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
66
|
+
"button",
|
|
67
|
+
{
|
|
68
|
+
type: "button",
|
|
69
|
+
onClick: onRevoke,
|
|
70
|
+
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",
|
|
71
|
+
children: "Stop"
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
] });
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
HelpSessionBanner.displayName = "HelpSessionBanner";
|
|
81
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
82
|
+
0 && (module.exports = {
|
|
83
|
+
HelpSessionBanner
|
|
84
|
+
});
|
|
85
|
+
//# sourceMappingURL=help-session-banner.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/help-widget/help-session-banner.tsx","../../../src/lib/utils.ts"],"sourcesContent":["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 { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;;;ACAvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADcM;AAHN,IAAM,oBAA0B;AAAA,EAC9B,CAAC,EAAE,UAAU,UAAU,GAAG,QAAQ;AAChC,WACE,4EACE;AAAA,kDAAC,SAAI,eAAY,QAAO,WAAU,QAAO,4BAAyB,IAAG;AAAA,MACrE;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,MAAK;AAAA,UACL,4BAAyB;AAAA,UACzB,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UAEA;AAAA,wDAAC,UAAK,WAAU,8FAA6F,6BAE7G;AAAA,YACA,4CAAC,OAAE,WAAU,2BAA0B,oEAAsD;AAAA,YAC7F;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAS;AAAA,gBACT,WAAU;AAAA,gBACX;AAAA;AAAA,YAED;AAAA;AAAA;AAAA,MACF;AAAA,OACF;AAAA,EAEJ;AACF;AACA,kBAAkB,cAAc;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface HelpSessionBannerProps {
|
|
4
|
+
/** Ends the session: calls the caller's revoke, then the app unmounts the banner. */
|
|
5
|
+
onRevoke: () => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Persistent banner shown while a support AI session is active (acai-ai-platform#2831).
|
|
10
|
+
*
|
|
11
|
+
* Same fixed, non-dismissible bar shape as ImpersonationBanner (acai-ai-platform#1274) -
|
|
12
|
+
* there is no close control; Stop is the only way out, and it calls onRevoke rather than
|
|
13
|
+
* hiding itself, so the caller is always the one that ends the session.
|
|
14
|
+
*/
|
|
15
|
+
declare const HelpSessionBanner: React.ForwardRefExoticComponent<HelpSessionBannerProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
|
|
17
|
+
export { HelpSessionBanner, type HelpSessionBannerProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface HelpSessionBannerProps {
|
|
4
|
+
/** Ends the session: calls the caller's revoke, then the app unmounts the banner. */
|
|
5
|
+
onRevoke: () => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Persistent banner shown while a support AI session is active (acai-ai-platform#2831).
|
|
10
|
+
*
|
|
11
|
+
* Same fixed, non-dismissible bar shape as ImpersonationBanner (acai-ai-platform#1274) -
|
|
12
|
+
* there is no close control; Stop is the only way out, and it calls onRevoke rather than
|
|
13
|
+
* hiding itself, so the caller is always the one that ends the session.
|
|
14
|
+
*/
|
|
15
|
+
declare const HelpSessionBanner: React.ForwardRefExoticComponent<HelpSessionBannerProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
|
|
17
|
+
export { HelpSessionBanner, type HelpSessionBannerProps };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/components/help-widget/help-session-banner.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
// src/lib/utils.ts
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
|
+
import { twMerge } from "tailwind-merge";
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// src/components/help-widget/help-session-banner.tsx
|
|
12
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
var HelpSessionBanner = React.forwardRef(
|
|
14
|
+
({ onRevoke, className }, ref) => {
|
|
15
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: "h-12", "data-help-session-spacer": "" }),
|
|
17
|
+
/* @__PURE__ */ jsxs(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
ref,
|
|
21
|
+
role: "status",
|
|
22
|
+
"data-help-session-banner": "",
|
|
23
|
+
className: cn(
|
|
24
|
+
"fixed inset-x-0 top-0 z-[2147483000]",
|
|
25
|
+
"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",
|
|
26
|
+
className
|
|
27
|
+
),
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ 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" }),
|
|
30
|
+
/* @__PURE__ */ jsx("p", { className: "min-w-0 flex-1 truncate", children: "AI support is active on this page and may be recorded." }),
|
|
31
|
+
/* @__PURE__ */ jsx(
|
|
32
|
+
"button",
|
|
33
|
+
{
|
|
34
|
+
type: "button",
|
|
35
|
+
onClick: onRevoke,
|
|
36
|
+
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",
|
|
37
|
+
children: "Stop"
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
HelpSessionBanner.displayName = "HelpSessionBanner";
|
|
47
|
+
export {
|
|
48
|
+
HelpSessionBanner
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=help-session-banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/help-widget/help-session-banner.tsx","../../../src/lib/utils.ts"],"sourcesContent":["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 { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";AAAA,YAAY,WAAW;;;ACAvB,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADcM,mBACE,KACA,YAFF;AAHN,IAAM,oBAA0B;AAAA,EAC9B,CAAC,EAAE,UAAU,UAAU,GAAG,QAAQ;AAChC,WACE,iCACE;AAAA,0BAAC,SAAI,eAAY,QAAO,WAAU,QAAO,4BAAyB,IAAG;AAAA,MACrE;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,MAAK;AAAA,UACL,4BAAyB;AAAA,UACzB,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UAEA;AAAA,gCAAC,UAAK,WAAU,8FAA6F,6BAE7G;AAAA,YACA,oBAAC,OAAE,WAAU,2BAA0B,oEAAsD;AAAA,YAC7F;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAS;AAAA,gBACT,WAAU;AAAA,gBACX;AAAA;AAAA,YAED;AAAA;AAAA;AAAA,MACF;AAAA,OACF;AAAA,EAEJ;AACF;AACA,kBAAkB,cAAc;","names":[]}
|