@talk2view/sdk 0.16.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assistant-ui/index.d.ts +13 -2
- package/dist/assistant-ui/index.d.ts.map +1 -1
- package/dist/assistant-ui/index.js +19 -4
- package/dist/assistant-ui/index.js.map +1 -1
- package/dist/chat/chat.d.ts.map +1 -1
- package/dist/chat/chat.js +8 -3
- package/dist/chat/chat.js.map +1 -1
- package/dist/chat/lib/conversation-store.d.ts +105 -0
- package/dist/chat/lib/conversation-store.d.ts.map +1 -0
- package/dist/chat/lib/conversation-store.js +278 -0
- package/dist/chat/lib/conversation-store.js.map +1 -0
- package/dist/chat/lib/use-conversations.d.ts +13 -0
- package/dist/chat/lib/use-conversations.d.ts.map +1 -0
- package/dist/chat/lib/use-conversations.js +365 -0
- package/dist/chat/lib/use-conversations.js.map +1 -0
- package/dist/chat/provider.d.ts.map +1 -1
- package/dist/chat/provider.js +6 -0
- package/dist/chat/provider.js.map +1 -1
- package/dist/chat/ui/avatar.d.ts +7 -8
- package/dist/chat/ui/avatar.d.ts.map +1 -1
- package/dist/chat/ui/avatar.js +30 -18
- package/dist/chat/ui/avatar.js.map +1 -1
- package/dist/chat/ui/button.d.ts +5 -2
- package/dist/chat/ui/button.d.ts.map +1 -1
- package/dist/chat/ui/button.js +10 -3
- package/dist/chat/ui/button.js.map +1 -1
- package/dist/chat/ui/collapsible.d.ts +4 -4
- package/dist/chat/ui/collapsible.d.ts.map +1 -1
- package/dist/chat/ui/collapsible.js +18 -9
- package/dist/chat/ui/collapsible.js.map +1 -1
- package/dist/chat/ui/dialog.d.ts +11 -11
- package/dist/chat/ui/dialog.d.ts.map +1 -1
- package/dist/chat/ui/dialog.js +49 -28
- package/dist/chat/ui/dialog.js.map +1 -1
- package/dist/chat/ui/input.d.ts +1 -1
- package/dist/chat/ui/input.d.ts.map +1 -1
- package/dist/chat/ui/input.js +10 -3
- package/dist/chat/ui/input.js.map +1 -1
- package/dist/chat/ui/skeleton.d.ts +2 -1
- package/dist/chat/ui/skeleton.d.ts.map +1 -1
- package/dist/chat/ui/skeleton.js +10 -3
- package/dist/chat/ui/skeleton.js.map +1 -1
- package/dist/chat/ui/textarea.d.ts +1 -1
- package/dist/chat/ui/textarea.d.ts.map +1 -1
- package/dist/chat/ui/textarea.js +10 -3
- package/dist/chat/ui/textarea.js.map +1 -1
- package/dist/chat/ui/tooltip.d.ts +3 -2
- package/dist/chat/ui/tooltip.d.ts.map +1 -1
- package/dist/chat/ui/tooltip.js +25 -8
- package/dist/chat/ui/tooltip.js.map +1 -1
- package/dist/chat/vendor/thread-list.aui.d.ts +3 -3
- package/dist/chat/vendor/thread-list.aui.d.ts.map +1 -1
- package/dist/chat/vendor/thread-list.aui.js +7 -7
- package/dist/chat/vendor/thread-list.aui.js.map +1 -1
- package/dist/chat-css.js +1 -1
- package/dist/chat.css +1 -1
- package/dist/chat.isolated.css +3 -0
- package/dist/chat.raw.css +3 -0
- package/dist/index.d.ts +56 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +104 -6
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +20 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare
|
|
3
|
-
declare
|
|
4
|
-
declare
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Collapsible: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/collapsible").CollapsibleRootProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CollapsibleTrigger: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/collapsible").CollapsibleTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
declare const CollapsibleContent: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/collapsible").CollapsiblePanelProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
6
6
|
//# sourceMappingURL=collapsible.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../src/chat/ui/collapsible.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../src/chat/ui/collapsible.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,QAAA,MAAM,WAAW,+IAOf,CAAA;AAGF,QAAA,MAAM,kBAAkB,qJAWtB,CAAA;AAGF,QAAA,MAAM,kBAAkB,gJAWtB,CAAA;AAGF,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Every component in this directory that renders a DOM element is wrapped in
|
|
3
|
+
// `forwardRef`. React 19 lets a plain function component read `ref` out of its
|
|
4
|
+
// props; React 18 — which this package still supports — strips it, warns, and
|
|
5
|
+
// the ref reaches nothing. Base UI hands refs to whatever it renders, so a
|
|
6
|
+
// plain function here loses them silently. See tests/chat/ui-refs.test.tsx.
|
|
7
|
+
import * as React from "react";
|
|
2
8
|
import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
|
|
3
|
-
function Collapsible({ ...props }) {
|
|
4
|
-
return _jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
9
|
+
const Collapsible = React.forwardRef(function Collapsible({ ...props }, ref) {
|
|
10
|
+
return (_jsx(CollapsiblePrimitive.Root, { ref: ref, "data-slot": "collapsible", ...props }));
|
|
11
|
+
});
|
|
12
|
+
Collapsible.displayName = "Collapsible";
|
|
13
|
+
const CollapsibleTrigger = React.forwardRef(function CollapsibleTrigger({ ...props }, ref) {
|
|
14
|
+
return (_jsx(CollapsiblePrimitive.Trigger, { ref: ref, "data-slot": "collapsible-trigger", ...props }));
|
|
15
|
+
});
|
|
16
|
+
CollapsibleTrigger.displayName = "CollapsibleTrigger";
|
|
17
|
+
const CollapsibleContent = React.forwardRef(function CollapsibleContent({ ...props }, ref) {
|
|
18
|
+
return (_jsx(CollapsiblePrimitive.Panel, { ref: ref, "data-slot": "collapsible-content", ...props }));
|
|
19
|
+
});
|
|
20
|
+
CollapsibleContent.displayName = "CollapsibleContent";
|
|
12
21
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
13
22
|
//# sourceMappingURL=collapsible.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsible.js","sourceRoot":"","sources":["../../../src/chat/ui/collapsible.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAEhF,SAAS,WAAW,CAAC,EAAE,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"collapsible.js","sourceRoot":"","sources":["../../../src/chat/ui/collapsible.tsx"],"names":[],"mappings":";AAAA,6EAA6E;AAC7E,+EAA+E;AAC/E,8EAA8E;AAC9E,2EAA2E;AAC3E,4EAA4E;AAC5E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAEhF,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAGlC,SAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IACtC,OAAO,CACL,KAAC,oBAAoB,CAAC,IAAI,IAAC,GAAG,EAAE,GAAG,eAAY,aAAa,KAAK,KAAK,GAAI,CAC3E,CAAA;AACH,CAAC,CAAC,CAAA;AACF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAA;AAEvC,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CAGzC,SAAS,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IAC7C,OAAO,CACL,KAAC,oBAAoB,CAAC,OAAO,IAC3B,GAAG,EAAE,GAAG,eACE,qBAAqB,KAC3B,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AACF,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAA;AAErD,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CAGzC,SAAS,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IAC7C,OAAO,CACL,KAAC,oBAAoB,CAAC,KAAK,IACzB,GAAG,EAAE,GAAG,eACE,qBAAqB,KAC3B,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AACF,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAA;AAErD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAA"}
|
package/dist/chat/ui/dialog.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
3
3
|
declare function Dialog({ ...props }: DialogPrimitive.Root.Props): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare
|
|
5
|
-
declare
|
|
6
|
-
declare
|
|
7
|
-
declare
|
|
8
|
-
declare
|
|
4
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<DialogPrimitive.Trigger.Props<unknown>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DialogPortal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const DialogClose: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const DialogContent: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogPopupProps & {
|
|
9
9
|
showCloseButton?: boolean;
|
|
10
|
-
}
|
|
11
|
-
declare
|
|
12
|
-
declare
|
|
10
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const DialogHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const DialogFooter: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
13
13
|
showCloseButton?: boolean;
|
|
14
|
-
}
|
|
15
|
-
declare
|
|
16
|
-
declare
|
|
14
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
16
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
17
17
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
18
18
|
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/chat/ui/dialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/chat/ui/dialog.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAOjE,iBAAS,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,2CAEvD;AAED,QAAA,MAAM,aAAa,+HAOjB,CAAA;AAGF,QAAA,MAAM,YAAY,uIAiBhB,CAAA;AAGF,QAAA,MAAM,WAAW,yIAKf,CAAA;AAGF,QAAA,MAAM,aAAa,yIAejB,CAAA;AAGF,QAAA,MAAM,aAAa;sBAGG,OAAO;gDAsC3B,CAAA;AAGF,QAAA,MAAM,YAAY,mKAYhB,CAAA;AAGF,QAAA,MAAM,YAAY;sBAGI,OAAO;gDAwB3B,CAAA;AAGF,QAAA,MAAM,WAAW,0IAef,CAAA;AAGF,QAAA,MAAM,iBAAiB,kJAerB,CAAA;AAGF,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAA"}
|
package/dist/chat/ui/dialog.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
// Every component in this directory that renders a DOM element is wrapped in
|
|
4
|
+
// `forwardRef`. React 19 lets a plain function component read `ref` out of its
|
|
5
|
+
// props; React 18 — which this package still supports — strips it, warns, and
|
|
6
|
+
// the ref reaches nothing. Base UI hands refs to whatever it renders, so a
|
|
7
|
+
// plain function here loses them silently. See tests/chat/ui-refs.test.tsx.
|
|
8
|
+
//
|
|
9
|
+
// `Dialog` is the exception: Base UI's `Dialog.Root` renders no element of its
|
|
10
|
+
// own and takes no `ref`, and so neither does this. Wrapping it would advertise
|
|
11
|
+
// a ref that nothing could ever attach.
|
|
12
|
+
import * as React from "react";
|
|
3
13
|
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
4
14
|
import { cn } from "../lib/cn.js";
|
|
5
15
|
import { usePortalHost } from "../lib/portal-host.js";
|
|
@@ -8,35 +18,46 @@ import { XIcon } from "lucide-react";
|
|
|
8
18
|
function Dialog({ ...props }) {
|
|
9
19
|
return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
10
20
|
}
|
|
11
|
-
function DialogTrigger({ ...props }) {
|
|
12
|
-
return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
13
|
-
}
|
|
14
|
-
|
|
21
|
+
const DialogTrigger = React.forwardRef(function DialogTrigger({ ...props }, ref) {
|
|
22
|
+
return (_jsx(DialogPrimitive.Trigger, { ref: ref, "data-slot": "dialog-trigger", ...props }));
|
|
23
|
+
});
|
|
24
|
+
DialogTrigger.displayName = "DialogTrigger";
|
|
25
|
+
const DialogPortal = React.forwardRef(function DialogPortal({ ...props }, ref) {
|
|
15
26
|
// Into the chat's portal host, so the dialog is inside the scope the whole
|
|
16
|
-
// stylesheet is written against.
|
|
27
|
+
// stylesheet is written against. Outside a chat the hook returns null, which
|
|
28
|
+
// Base UI reads as "not resolved yet" and renders nothing — undefined is what
|
|
29
|
+
// asks for the default of <body>.
|
|
17
30
|
const portalHost = usePortalHost();
|
|
18
|
-
return _jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", container: portalHost, ...props });
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
function
|
|
30
|
-
return (_jsx(
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
return (_jsx(DialogPrimitive.Portal, { ref: ref, "data-slot": "dialog-portal", container: portalHost ?? undefined, ...props }));
|
|
32
|
+
});
|
|
33
|
+
DialogPortal.displayName = "DialogPortal";
|
|
34
|
+
const DialogClose = React.forwardRef(function DialogClose({ ...props }, ref) {
|
|
35
|
+
return _jsx(DialogPrimitive.Close, { ref: ref, "data-slot": "dialog-close", ...props });
|
|
36
|
+
});
|
|
37
|
+
DialogClose.displayName = "DialogClose";
|
|
38
|
+
const DialogOverlay = React.forwardRef(function DialogOverlay({ className, ...props }, ref) {
|
|
39
|
+
return (_jsx(DialogPrimitive.Backdrop, { ref: ref, "data-slot": "dialog-overlay", className: cn("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className), ...props }));
|
|
40
|
+
});
|
|
41
|
+
DialogOverlay.displayName = "DialogOverlay";
|
|
42
|
+
const DialogContent = React.forwardRef(function DialogContent({ className, children, showCloseButton = true, ...props }, ref) {
|
|
43
|
+
return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Popup, { ref: ref, "data-slot": "dialog-content", className: cn("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props, children: [children, showCloseButton && (_jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", render: _jsx(Button, { variant: "ghost", className: "absolute top-2 right-2", size: "icon-sm" }), children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: "Close" })] }))] })] }));
|
|
44
|
+
});
|
|
45
|
+
DialogContent.displayName = "DialogContent";
|
|
46
|
+
const DialogHeader = React.forwardRef(function DialogHeader({ className, ...props }, ref) {
|
|
47
|
+
return (_jsx("div", { ref: ref, "data-slot": "dialog-header", className: cn("flex flex-col gap-2", className), ...props }));
|
|
48
|
+
});
|
|
49
|
+
DialogHeader.displayName = "DialogHeader";
|
|
50
|
+
const DialogFooter = React.forwardRef(function DialogFooter({ className, showCloseButton = false, children, ...props }, ref) {
|
|
51
|
+
return (_jsxs("div", { ref: ref, "data-slot": "dialog-footer", className: cn("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end", className), ...props, children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { render: _jsx(Button, { variant: "outline" }), children: "Close" }))] }));
|
|
52
|
+
});
|
|
53
|
+
DialogFooter.displayName = "DialogFooter";
|
|
54
|
+
const DialogTitle = React.forwardRef(function DialogTitle({ className, ...props }, ref) {
|
|
55
|
+
return (_jsx(DialogPrimitive.Title, { ref: ref, "data-slot": "dialog-title", className: cn("font-heading text-base leading-none font-medium", className), ...props }));
|
|
56
|
+
});
|
|
57
|
+
DialogTitle.displayName = "DialogTitle";
|
|
58
|
+
const DialogDescription = React.forwardRef(function DialogDescription({ className, ...props }, ref) {
|
|
59
|
+
return (_jsx(DialogPrimitive.Description, { ref: ref, "data-slot": "dialog-description", className: cn("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className), ...props }));
|
|
60
|
+
});
|
|
61
|
+
DialogDescription.displayName = "DialogDescription";
|
|
41
62
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
42
63
|
//# sourceMappingURL=dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../../src/chat/ui/dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;
|
|
1
|
+
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../../src/chat/ui/dialog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CAAC,WAAW,GAAG,aAAa,CAAA;AAEvC,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CAGxC,SAAS,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IACvD,OAAO,CACL,KAAC,eAAe,CAAC,WAAW,IAC1B,GAAG,EAAE,GAAG,eACE,oBAAoB,EAC9B,SAAS,EAAE,EAAE,CACX,oGAAoG,EACpG,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AACF,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAEnD,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAA"}
|
package/dist/chat/ui/input.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare
|
|
2
|
+
declare const Input: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
3
3
|
export { Input };
|
|
4
4
|
//# sourceMappingURL=input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/chat/ui/input.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/chat/ui/input.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,QAAA,MAAM,KAAK,8KAeV,CAAA;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
package/dist/chat/ui/input.js
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Every component in this directory is wrapped in `forwardRef`. React 19 lets a
|
|
3
|
+
// plain function component read `ref` out of its props; React 18 — which this
|
|
4
|
+
// package still supports — strips it, warns, and the ref reaches nothing. Base
|
|
5
|
+
// UI hands refs to whatever it renders, so a plain function here loses them
|
|
6
|
+
// silently. See tests/chat/ui-refs.test.tsx.
|
|
7
|
+
import * as React from "react";
|
|
2
8
|
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
3
9
|
import { cn } from "../lib/cn.js";
|
|
4
|
-
function Input({ className, type, ...props }) {
|
|
5
|
-
return (_jsx(InputPrimitive, { type: type, "data-slot": "input", className: cn("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className), ...props }));
|
|
6
|
-
}
|
|
10
|
+
const Input = React.forwardRef(function Input({ className, type, ...props }, ref) {
|
|
11
|
+
return (_jsx(InputPrimitive, { ref: ref, type: type, "data-slot": "input", className: cn("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className), ...props }));
|
|
12
|
+
});
|
|
13
|
+
Input.displayName = "Input";
|
|
7
14
|
export { Input };
|
|
8
15
|
//# sourceMappingURL=input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/chat/ui/input.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/chat/ui/input.tsx"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,8EAA8E;AAC9E,+EAA+E;AAC/E,4EAA4E;AAC5E,6CAA6C;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAEjC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAC5B,SAAS,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IAC/C,OAAO,CACL,KAAC,cAAc,IACb,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,eACA,OAAO,EACjB,SAAS,EAAE,EAAE,CACX,6oBAA6oB,EAC7oB,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC,CACF,CAAA;AACD,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA;AAE3B,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Skeleton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
2
3
|
export { Skeleton };
|
|
3
4
|
//# sourceMappingURL=skeleton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/chat/ui/skeleton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/chat/ui/skeleton.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,QAAA,MAAM,QAAQ,mKAWb,CAAA;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
package/dist/chat/ui/skeleton.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Every component in this directory is wrapped in `forwardRef`. React 19 lets a
|
|
3
|
+
// plain function component read `ref` out of its props; React 18 — which this
|
|
4
|
+
// package still supports — strips it, warns, and the ref reaches nothing. Its
|
|
5
|
+
// props type advertises a `ref`, so a plain function here breaks that promise
|
|
6
|
+
// on 18. See tests/chat/ui-refs.test.tsx.
|
|
7
|
+
import * as React from "react";
|
|
2
8
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
function Skeleton({ className, ...props }) {
|
|
4
|
-
return (_jsx("div", { "data-slot": "skeleton", className: cn("animate-pulse rounded-md bg-muted", className), ...props }));
|
|
5
|
-
}
|
|
9
|
+
const Skeleton = React.forwardRef(function Skeleton({ className, ...props }, ref) {
|
|
10
|
+
return (_jsx("div", { ref: ref, "data-slot": "skeleton", className: cn("animate-pulse rounded-md bg-muted", className), ...props }));
|
|
11
|
+
});
|
|
12
|
+
Skeleton.displayName = "Skeleton";
|
|
6
13
|
export { Skeleton };
|
|
7
14
|
//# sourceMappingURL=skeleton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.js","sourceRoot":"","sources":["../../../src/chat/ui/skeleton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAEjC,SAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"skeleton.js","sourceRoot":"","sources":["../../../src/chat/ui/skeleton.tsx"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,0CAA0C;AAC1C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAEjC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAC/B,SAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IAC5C,OAAO,CACL,cACE,GAAG,EAAE,GAAG,eACE,UAAU,EACpB,SAAS,EAAE,EAAE,CAAC,mCAAmC,EAAE,SAAS,CAAC,KACzD,KAAK,GACT,CACH,CAAA;AACH,CAAC,CACF,CAAA;AACD,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAA;AAEjC,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare
|
|
2
|
+
declare const Textarea: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
3
3
|
export { Textarea };
|
|
4
4
|
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/chat/ui/textarea.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/chat/ui/textarea.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,QAAA,MAAM,QAAQ,0LAeZ,CAAA;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
package/dist/chat/ui/textarea.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Every component in this directory is wrapped in `forwardRef`. React 19 lets a
|
|
3
|
+
// plain function component read `ref` out of its props; React 18 — which this
|
|
4
|
+
// package still supports — strips it, warns, and the ref reaches nothing. Its
|
|
5
|
+
// props type advertises a `ref`, so a plain function here breaks that promise
|
|
6
|
+
// on 18. See tests/chat/ui-refs.test.tsx.
|
|
7
|
+
import * as React from "react";
|
|
2
8
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
function Textarea({ className, ...props }) {
|
|
4
|
-
return (_jsx("textarea", { "data-slot": "textarea", className: cn("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className), ...props }));
|
|
5
|
-
}
|
|
9
|
+
const Textarea = React.forwardRef(function Textarea({ className, ...props }, ref) {
|
|
10
|
+
return (_jsx("textarea", { ref: ref, "data-slot": "textarea", className: cn("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className), ...props }));
|
|
11
|
+
});
|
|
12
|
+
Textarea.displayName = "Textarea";
|
|
6
13
|
export { Textarea };
|
|
7
14
|
//# sourceMappingURL=textarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../src/chat/ui/textarea.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../src/chat/ui/textarea.tsx"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,0CAA0C;AAC1C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAEjC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAG/B,SAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IAC9C,OAAO,CACL,mBACE,GAAG,EAAE,GAAG,eACE,UAAU,EACpB,SAAS,EAAE,EAAE,CACX,whBAAwhB,EACxhB,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AACF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAA;AAEjC,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
2
3
|
declare function TooltipProvider({ delay, ...props }: TooltipPrimitive.Provider.Props): import("react/jsx-runtime").JSX.Element;
|
|
3
4
|
declare function Tooltip({ ...props }: TooltipPrimitive.Root.Props): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare
|
|
5
|
-
declare
|
|
5
|
+
declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.Trigger.Props<unknown>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const TooltipContent: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/tooltip").TooltipPopupProps & Pick<import("@base-ui/react/tooltip").TooltipPositionerProps, "align" | "alignOffset" | "side" | "sideOffset">, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
7
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
7
8
|
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/chat/ui/tooltip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/chat/ui/tooltip.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAIpE,iBAAS,eAAe,CAAC,EACvB,KAAS,EACT,GAAG,KAAK,EACT,EAAE,gBAAgB,CAAC,QAAQ,CAAC,KAAK,2CAQjC;AAED,iBAAS,OAAO,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAAK,2CAEzD;AAED,QAAA,MAAM,cAAc,gIAWlB,CAAA;AAGF,QAAA,MAAM,cAAc,yPAmDlB,CAAA;AAGF,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,CAAA"}
|
package/dist/chat/ui/tooltip.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Every component in this directory that renders a DOM element is wrapped in
|
|
3
|
+
// `forwardRef`. React 19 lets a plain function component read `ref` out of its
|
|
4
|
+
// props; React 18 — which this package still supports — strips it, warns, and
|
|
5
|
+
// the ref reaches nothing. Base UI hands refs to whatever it renders, so a
|
|
6
|
+
// plain function here loses them silently. See tests/chat/ui-refs.test.tsx.
|
|
7
|
+
//
|
|
8
|
+
// `TooltipProvider` and `Tooltip` are the exceptions: Base UI's `Tooltip.Provider`
|
|
9
|
+
// and `Tooltip.Root` render no element of their own, take no `ref`, and so
|
|
10
|
+
// neither do these. Wrapping them would advertise a ref that nothing could ever
|
|
11
|
+
// attach.
|
|
12
|
+
import * as React from "react";
|
|
2
13
|
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
3
14
|
import { cn } from "../lib/cn.js";
|
|
4
15
|
import { usePortalHost } from "../lib/portal-host.js";
|
|
@@ -8,15 +19,21 @@ function TooltipProvider({ delay = 0, ...props }) {
|
|
|
8
19
|
function Tooltip({ ...props }) {
|
|
9
20
|
return _jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
|
|
10
21
|
}
|
|
11
|
-
function TooltipTrigger({ ...props }) {
|
|
12
|
-
return _jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
13
|
-
}
|
|
14
|
-
|
|
22
|
+
const TooltipTrigger = React.forwardRef(function TooltipTrigger({ ...props }, ref) {
|
|
23
|
+
return (_jsx(TooltipPrimitive.Trigger, { ref: ref, "data-slot": "tooltip-trigger", ...props }));
|
|
24
|
+
});
|
|
25
|
+
TooltipTrigger.displayName = "TooltipTrigger";
|
|
26
|
+
const TooltipContent = React.forwardRef(function TooltipContent({ className, side = "top", sideOffset = 4, align = "center", alignOffset = 0, children, ...props }, ref) {
|
|
15
27
|
// Portals default to <body>, outside the element the whole stylesheet is
|
|
16
|
-
// scoped to — a tooltip there would render unstyled
|
|
17
|
-
//
|
|
28
|
+
// scoped to — a tooltip there would render unstyled — so inside a chat this
|
|
29
|
+
// goes to its portal host instead. Outside one the hook returns null, and an
|
|
30
|
+
// explicit null container is NOT the same as omitting it: Base UI reads it as
|
|
31
|
+
// a container it has not resolved yet and renders nothing at all. Passing
|
|
32
|
+
// undefined is what actually asks for the default. See
|
|
33
|
+
// tests/chat/ui-standalone.test.tsx, which fails without the coalesce.
|
|
18
34
|
const portalHost = usePortalHost();
|
|
19
|
-
return (_jsx(TooltipPrimitive.Portal, { container: portalHost, children: _jsx(TooltipPrimitive.Positioner, { align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, className: "isolate z-50", children: _jsxs(TooltipPrimitive.Popup, { "data-slot": "tooltip-content", className: cn("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props, children: [children, _jsx(TooltipPrimitive.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })] }) }) }));
|
|
20
|
-
}
|
|
35
|
+
return (_jsx(TooltipPrimitive.Portal, { container: portalHost ?? undefined, children: _jsx(TooltipPrimitive.Positioner, { align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, className: "isolate z-50", children: _jsxs(TooltipPrimitive.Popup, { ref: ref, "data-slot": "tooltip-content", className: cn("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props, children: [children, _jsx(TooltipPrimitive.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })] }) }) }));
|
|
36
|
+
});
|
|
37
|
+
TooltipContent.displayName = "TooltipContent";
|
|
21
38
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
22
39
|
//# sourceMappingURL=tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../src/chat/ui/tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACpE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,uBA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itive } from "@assistant-ui/react";
|
|
2
2
|
import { type ComponentPropsWithoutRef, type FC } from "react";
|
|
3
3
|
export declare const ThreadList: FC;
|
|
4
|
-
export declare const ThreadListSearch: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").
|
|
4
|
+
export declare const ThreadListSearch: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>, "ref">, "value" | "onChange"> & {
|
|
5
5
|
value: string;
|
|
6
6
|
onValueChange: (value: string) => void;
|
|
7
7
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -27,10 +27,10 @@ export declare const useThreadListGroups: (searchQuery?: string) => {
|
|
|
27
27
|
filteredIndices: number[];
|
|
28
28
|
groups: ThreadListGroup[];
|
|
29
29
|
};
|
|
30
|
-
export declare const ThreadListNew: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ButtonProps & import("class-variance-authority").VariantProps<(props?: ({
|
|
30
|
+
export declare const ThreadListNew: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ButtonProps & import("class-variance-authority").VariantProps<(props?: ({
|
|
31
31
|
variant?: "default" | "link" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
32
32
|
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
33
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string>, "ref"> & {
|
|
33
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string>, "ref"> & import("react").RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
34
34
|
labelClassName?: string;
|
|
35
35
|
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
36
36
|
export declare const ThreadListItem: FC;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread-list.aui.d.ts","sourceRoot":"","sources":["../../../src/chat/vendor/thread-list.aui.tsx"],"names":[],"mappings":"AAOA,OAAO,EAIL,mBAAmB,EAGpB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"thread-list.aui.d.ts","sourceRoot":"","sources":["../../../src/chat/vendor/thread-list.aui.tsx"],"names":[],"mappings":"AAOA,OAAO,EAIL,mBAAmB,EAGpB,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EAOL,KAAK,wBAAwB,EAC7B,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;AAEf,eAAO,MAAM,UAAU,EAAE,EAaxB,CAAC;AAEF,eAAO,MAAM,gBAAgB;WAGlB,MAAM;mBACE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;oDAqBxC,CAAC;AAIH,eAAO,MAAM,cAAc,EAAE,EAAE,CAC7B,wBAAwB,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAS1D,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,EAAE,CAC9B,wBAAwB,CAAC,KAAK,CAAC,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAgB3D,CAAC;AAaF,MAAM,MAAM,eAAe,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEnE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,oBAAgB;;;;;;;;CA6CnD,CAAC;AAiDF,eAAO,MAAM,aAAa;;;;qBAEqC,MAAM;qDA2BnE,CAAC;AAyBH,eAAO,MAAM,cAAc,EAAE,EAiD5B,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { Skeleton } from "../ui/skeleton.js";
|
|
|
6
6
|
import { cn } from "../lib/cn.js";
|
|
7
7
|
import { usePortalHost } from "../lib/portal-host.js";
|
|
8
8
|
import { AuiIf, ThreadListItemMorePrimitive, ThreadListItemPrimitive, ThreadListPrimitive, useAui, useAuiState, } from "@assistant-ui/react";
|
|
9
|
-
import {
|
|
9
|
+
import { Loader2Icon, MoreHorizontalIcon, PencilIcon, PlusIcon, SearchIcon, TrashIcon, } from "lucide-react";
|
|
10
10
|
import { forwardRef, Fragment, useEffect, useMemo, useRef, useState, } from "react";
|
|
11
11
|
export const ThreadList = () => {
|
|
12
12
|
const [search, setSearch] = useState("");
|
|
@@ -14,7 +14,7 @@ export const ThreadList = () => {
|
|
|
14
14
|
return (_jsxs(ThreadListRoot, { children: [_jsx(ThreadListNew, {}), hasThreads && (_jsx(ThreadListSearch, { value: search, onValueChange: setSearch })), _jsx(ThreadListItems, { searchQuery: hasThreads ? search : "" })] }));
|
|
15
15
|
};
|
|
16
16
|
export const ThreadListSearch = forwardRef(({ className, value, onValueChange, ...props }, ref) => {
|
|
17
|
-
return (_jsxs("div", { "data-slot": "aui_thread-list-search", className: "relative px-0.5 py-1", children: [_jsx(SearchIcon, { "data-slot": "aui_thread-list-search-icon", className: "text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2" }), _jsx(Input, { ref: ref, type: "search", value: value, onChange: (event) => onValueChange(event.target.value), "aria-label": "Search
|
|
17
|
+
return (_jsxs("div", { "data-slot": "aui_thread-list-search", className: "relative px-0.5 py-1", children: [_jsx(SearchIcon, { "data-slot": "aui_thread-list-search-icon", className: "text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2" }), _jsx(Input, { ref: ref, type: "search", value: value, onChange: (event) => onValueChange(event.target.value), "aria-label": "Search chats", placeholder: "Search chats", className: cn("h-8 ps-8 text-sm", className), ...props })] }));
|
|
18
18
|
});
|
|
19
19
|
ThreadListSearch.displayName = "ThreadListSearch";
|
|
20
20
|
export const ThreadListRoot = ({ className, ...props }) => {
|
|
@@ -46,7 +46,7 @@ export const useThreadListGroups = (searchQuery = "") => {
|
|
|
46
46
|
const filteredIndices = threadIds
|
|
47
47
|
.map((id, index) => ({ id, index }))
|
|
48
48
|
.filter(({ id }) => !query ||
|
|
49
|
-
(itemsById.get(id)?.title || "New
|
|
49
|
+
(itemsById.get(id)?.title || "New chat")
|
|
50
50
|
.toLowerCase()
|
|
51
51
|
.includes(query))
|
|
52
52
|
.map(({ index }) => index);
|
|
@@ -75,7 +75,7 @@ const ThreadListItemGroups = ({ searchQuery = "", }) => {
|
|
|
75
75
|
const { threadIds, filteredIndices, groups } = useThreadListGroups(searchQuery);
|
|
76
76
|
const query = searchQuery.trim();
|
|
77
77
|
if (query && filteredIndices.length === 0) {
|
|
78
|
-
return (_jsx("div", { "data-slot": "aui_thread-list-empty", className: "text-muted-foreground px-2.5 py-4 text-sm", children: "No
|
|
78
|
+
return (_jsx("div", { "data-slot": "aui_thread-list-empty", className: "text-muted-foreground px-2.5 py-4 text-sm", children: "No chats found" }));
|
|
79
79
|
}
|
|
80
80
|
if (!groups) {
|
|
81
81
|
return filteredIndices.map((index) => (_jsx(ThreadListPrimitive.ItemByIndex, { index: index, components: { ThreadListItem } }, threadIds[index])));
|
|
@@ -83,7 +83,7 @@ const ThreadListItemGroups = ({ searchQuery = "", }) => {
|
|
|
83
83
|
return groups.map((group) => (_jsxs(Fragment, { children: [_jsx("div", { "data-slot": "aui_thread-list-group-label", className: "text-muted-foreground px-2.5 pt-3 pb-1 text-xs font-medium", children: group.label }), group.indices.map((index) => (_jsx(ThreadListPrimitive.ItemByIndex, { index: index, components: { ThreadListItem } }, threadIds[index])))] }, group.label)));
|
|
84
84
|
};
|
|
85
85
|
export const ThreadListNew = forwardRef(({ className, labelClassName, children, ...props }, ref) => {
|
|
86
|
-
return (_jsx(ThreadListPrimitive.New, { render: _jsx(Button, { ref: ref, variant: "ghost", "data-slot": "aui_thread-list-new", className: cn("hover:bg-muted data-active:bg-muted h-8 justify-start gap-2 rounded-md px-2.5 text-sm font-normal", className), ...props }), children: children ?? (_jsxs(_Fragment, { children: [_jsx(PlusIcon, { "data-slot": "aui_thread-list-new-icon", className: "size-4 shrink-0" }), _jsx("span", { "data-slot": "aui_thread-list-new-label", className: cn("whitespace-nowrap", labelClassName), children: "New
|
|
86
|
+
return (_jsx(ThreadListPrimitive.New, { render: _jsx(Button, { ref: ref, variant: "ghost", "data-slot": "aui_thread-list-new", className: cn("hover:bg-muted data-active:bg-muted h-8 justify-start gap-2 rounded-md px-2.5 text-sm font-normal", className), ...props }), children: children ?? (_jsxs(_Fragment, { children: [_jsx(PlusIcon, { "data-slot": "aui_thread-list-new-icon", className: "size-4 shrink-0" }), _jsx("span", { "data-slot": "aui_thread-list-new-label", className: cn("whitespace-nowrap", labelClassName), children: "New chat" })] })) }));
|
|
87
87
|
});
|
|
88
88
|
ThreadListNew.displayName = "ThreadListNew";
|
|
89
89
|
const ThreadListSkeleton = () => {
|
|
@@ -103,7 +103,7 @@ export const ThreadListItem = () => {
|
|
|
103
103
|
return (_jsxs(ThreadListItemPrimitive.Root, { "data-slot": "aui_thread-list-item", className: "group hover:bg-muted focus-visible:bg-muted data-active:bg-muted has-focus-visible:bg-muted has-data-[state=open]:bg-muted relative flex h-8 items-center rounded-md transition-colors focus-visible:outline-none", children: [isRenaming ? (_jsx(ThreadListItemRename, { onDone: (restoreFocus) => {
|
|
104
104
|
restoreFocusRef.current = restoreFocus;
|
|
105
105
|
setIsRenaming(false);
|
|
106
|
-
} })) : (_jsxs(ThreadListItemPrimitive.Trigger, { ref: triggerRef, "data-slot": "aui_thread-list-item-trigger", className: "focus-visible:ring-ring/50 flex h-full min-w-0 flex-1 items-center rounded-md px-2.5 text-start text-sm outline-none group-hover:pe-9 group-has-focus-visible:pe-9 group-has-data-[state=open]:pe-9 group-data-active:pe-9 focus-visible:ring-1", children: [isRunning && (_jsx(Loader2Icon, { "aria-hidden": true, "data-slot": "aui_thread-list-item-running", className: "text-muted-foreground me-1.5 size-3.5 shrink-0 animate-spin" })), _jsx("span", { "data-slot": "aui_thread-list-item-title", className: "min-w-0 flex-1 truncate", children: _jsx(ThreadListItemPrimitive.Title, { fallback: "New
|
|
106
|
+
} })) : (_jsxs(ThreadListItemPrimitive.Trigger, { ref: triggerRef, "data-slot": "aui_thread-list-item-trigger", className: "focus-visible:ring-ring/50 flex h-full min-w-0 flex-1 items-center rounded-md px-2.5 text-start text-sm outline-none group-hover:pe-9 group-has-focus-visible:pe-9 group-has-data-[state=open]:pe-9 group-data-active:pe-9 focus-visible:ring-1", children: [isRunning && (_jsx(Loader2Icon, { "aria-hidden": true, "data-slot": "aui_thread-list-item-running", className: "text-muted-foreground me-1.5 size-3.5 shrink-0 animate-spin" })), _jsx("span", { "data-slot": "aui_thread-list-item-title", className: "min-w-0 flex-1 truncate", children: _jsx(ThreadListItemPrimitive.Title, { fallback: "New chat" }) }), isRunning && _jsx("span", { className: "sr-only", children: "Running" })] })), _jsx(ThreadListItemMore, { onRename: () => setIsRenaming(true) })] }));
|
|
107
107
|
};
|
|
108
108
|
const ThreadListItemRename = ({ onDone }) => {
|
|
109
109
|
const aui = useAui();
|
|
@@ -153,6 +153,6 @@ const ThreadListItemMore = ({ onRename }) => {
|
|
|
153
153
|
// Radix portals this menu to <body>, outside the chat's scoped stylesheet,
|
|
154
154
|
// so without a container it renders with no background, border or padding.
|
|
155
155
|
const portalHost = usePortalHost();
|
|
156
|
-
return (_jsxs(ThreadListItemMorePrimitive.Root, { sharedFocusGroup: true, children: [_jsxs(ThreadListItemMorePrimitive.Trigger, { render: _jsx(Button, { variant: "ghost", size: "icon", "data-slot": "aui_thread-list-item-more", className: "data-[state=open]:bg-accent absolute end-1.5 top-1/2 size-6 -translate-y-1/2 p-0 opacity-0 group-hover:opacity-100 group-has-focus-visible:opacity-100 group-data-active:opacity-100 data-[state=open]:opacity-100" }), children: [_jsx(MoreHorizontalIcon, { className: "size-3.5" }), _jsx("span", { className: "sr-only", children: "More options" })] }), _jsxs(ThreadListItemMorePrimitive.Content, { portalProps: { container: portalHost }, side: "right", align: "start", sideOffset: 6, "data-slot": "aui_thread-list-item-more-content", className: "bg-popover text-popover-foreground data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-xl border p-1.5", children: [_jsxs(ThreadListItemMorePrimitive.Item, { "data-slot": "aui_thread-list-item-more-item", className: "hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm outline-none select-none", onSelect: onRename, children: [_jsx(PencilIcon, { className: "size-4" }), "Rename"] }), _jsxs(ThreadListItemPrimitive.
|
|
156
|
+
return (_jsxs(ThreadListItemMorePrimitive.Root, { sharedFocusGroup: true, children: [_jsxs(ThreadListItemMorePrimitive.Trigger, { render: _jsx(Button, { variant: "ghost", size: "icon", "data-slot": "aui_thread-list-item-more", className: "data-[state=open]:bg-accent absolute end-1.5 top-1/2 size-6 -translate-y-1/2 p-0 opacity-0 group-hover:opacity-100 group-has-focus-visible:opacity-100 group-data-active:opacity-100 data-[state=open]:opacity-100" }), children: [_jsx(MoreHorizontalIcon, { className: "size-3.5" }), _jsx("span", { className: "sr-only", children: "More options" })] }), _jsxs(ThreadListItemMorePrimitive.Content, { portalProps: { container: portalHost }, side: "right", align: "start", sideOffset: 6, "data-slot": "aui_thread-list-item-more-content", className: "bg-popover text-popover-foreground data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-xl border p-1.5", children: [_jsxs(ThreadListItemMorePrimitive.Item, { "data-slot": "aui_thread-list-item-more-item", className: "hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm outline-none select-none", onSelect: onRename, children: [_jsx(PencilIcon, { className: "size-4" }), "Rename"] }), _jsxs(ThreadListItemPrimitive.Delete, { render: _jsx(ThreadListItemMorePrimitive.Item, { "data-slot": "aui_thread-list-item-more-item", className: "text-destructive hover:bg-destructive/10 hover:text-destructive focus:bg-destructive/10 focus:text-destructive flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm outline-none select-none" }), children: [_jsx(TrashIcon, { className: "size-4" }), "Delete"] })] })] }));
|
|
157
157
|
};
|
|
158
158
|
//# sourceMappingURL=thread-list.aui.js.map
|