@kopexa/assistant 0.0.1
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/LICENSE +201 -0
- package/dist/chunk-OLZG7MMU.mjs +300 -0
- package/dist/chunk-S247BNPZ.mjs +94 -0
- package/dist/chunk-UIXG4SXX.mjs +103 -0
- package/dist/conversation.d.mts +34 -0
- package/dist/conversation.d.ts +34 -0
- package/dist/conversation.js +121 -0
- package/dist/conversation.mjs +14 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +519 -0
- package/dist/index.mjs +43 -0
- package/dist/message.d.mts +97 -0
- package/dist/message.d.ts +97 -0
- package/dist/message.js +328 -0
- package/dist/message.mjs +30 -0
- package/dist/prompt-input.d.mts +22 -0
- package/dist/prompt-input.d.ts +22 -0
- package/dist/prompt-input.js +123 -0
- package/dist/prompt-input.mjs +8 -0
- package/package.json +61 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Button } from '@kopexa/button';
|
|
3
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
4
|
+
import { StickToBottom } from 'use-stick-to-bottom';
|
|
5
|
+
|
|
6
|
+
type ConversationProps = ComponentProps<typeof StickToBottom>;
|
|
7
|
+
declare function Conversation({ className, ...props }: ConversationProps): react_jsx_runtime.JSX.Element;
|
|
8
|
+
declare namespace Conversation {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
type ConversationContentProps = ComponentProps<typeof StickToBottom.Content>;
|
|
12
|
+
declare function ConversationContent({ className, ...props }: ConversationContentProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
declare namespace ConversationContent {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
type ConversationEmptyStateProps = ComponentProps<"div"> & {
|
|
17
|
+
/** Title displayed in the empty state */
|
|
18
|
+
title?: string;
|
|
19
|
+
/** Description text displayed below the title */
|
|
20
|
+
description?: string;
|
|
21
|
+
/** Optional icon to display above the title */
|
|
22
|
+
icon?: ReactNode;
|
|
23
|
+
};
|
|
24
|
+
declare function ConversationEmptyState({ className, title, description, icon, children, ...props }: ConversationEmptyStateProps): react_jsx_runtime.JSX.Element;
|
|
25
|
+
declare namespace ConversationEmptyState {
|
|
26
|
+
var displayName: string;
|
|
27
|
+
}
|
|
28
|
+
type ConversationScrollButtonProps = ComponentProps<typeof Button>;
|
|
29
|
+
declare function ConversationScrollButton({ className, ...props }: ConversationScrollButtonProps): false | react_jsx_runtime.JSX.Element;
|
|
30
|
+
declare namespace ConversationScrollButton {
|
|
31
|
+
var displayName: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { Conversation, ConversationContent, type ConversationContentProps, ConversationEmptyState, type ConversationEmptyStateProps, type ConversationProps, ConversationScrollButton, type ConversationScrollButtonProps };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Button } from '@kopexa/button';
|
|
3
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
4
|
+
import { StickToBottom } from 'use-stick-to-bottom';
|
|
5
|
+
|
|
6
|
+
type ConversationProps = ComponentProps<typeof StickToBottom>;
|
|
7
|
+
declare function Conversation({ className, ...props }: ConversationProps): react_jsx_runtime.JSX.Element;
|
|
8
|
+
declare namespace Conversation {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
type ConversationContentProps = ComponentProps<typeof StickToBottom.Content>;
|
|
12
|
+
declare function ConversationContent({ className, ...props }: ConversationContentProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
declare namespace ConversationContent {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
type ConversationEmptyStateProps = ComponentProps<"div"> & {
|
|
17
|
+
/** Title displayed in the empty state */
|
|
18
|
+
title?: string;
|
|
19
|
+
/** Description text displayed below the title */
|
|
20
|
+
description?: string;
|
|
21
|
+
/** Optional icon to display above the title */
|
|
22
|
+
icon?: ReactNode;
|
|
23
|
+
};
|
|
24
|
+
declare function ConversationEmptyState({ className, title, description, icon, children, ...props }: ConversationEmptyStateProps): react_jsx_runtime.JSX.Element;
|
|
25
|
+
declare namespace ConversationEmptyState {
|
|
26
|
+
var displayName: string;
|
|
27
|
+
}
|
|
28
|
+
type ConversationScrollButtonProps = ComponentProps<typeof Button>;
|
|
29
|
+
declare function ConversationScrollButton({ className, ...props }: ConversationScrollButtonProps): false | react_jsx_runtime.JSX.Element;
|
|
30
|
+
declare namespace ConversationScrollButton {
|
|
31
|
+
var displayName: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { Conversation, ConversationContent, type ConversationContentProps, ConversationEmptyState, type ConversationEmptyStateProps, type ConversationProps, ConversationScrollButton, type ConversationScrollButtonProps };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// src/conversation.tsx
|
|
23
|
+
var conversation_exports = {};
|
|
24
|
+
__export(conversation_exports, {
|
|
25
|
+
Conversation: () => Conversation,
|
|
26
|
+
ConversationContent: () => ConversationContent,
|
|
27
|
+
ConversationEmptyState: () => ConversationEmptyState,
|
|
28
|
+
ConversationScrollButton: () => ConversationScrollButton
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(conversation_exports);
|
|
31
|
+
var import_button = require("@kopexa/button");
|
|
32
|
+
var import_icons = require("@kopexa/icons");
|
|
33
|
+
var import_shared_utils = require("@kopexa/shared-utils");
|
|
34
|
+
var import_theme = require("@kopexa/theme");
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
var import_use_stick_to_bottom = require("use-stick-to-bottom");
|
|
37
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
|
+
var styles = (0, import_theme.conversation)();
|
|
39
|
+
function Conversation({ className, ...props }) {
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
+
import_use_stick_to_bottom.StickToBottom,
|
|
42
|
+
{
|
|
43
|
+
className: (0, import_shared_utils.cn)(styles.root(), className),
|
|
44
|
+
initial: "smooth",
|
|
45
|
+
resize: "smooth",
|
|
46
|
+
role: "log",
|
|
47
|
+
"data-slot": "conversation",
|
|
48
|
+
...props
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
Conversation.displayName = "Conversation";
|
|
53
|
+
function ConversationContent({
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
}) {
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
58
|
+
import_use_stick_to_bottom.StickToBottom.Content,
|
|
59
|
+
{
|
|
60
|
+
className: (0, import_shared_utils.cn)(styles.content(), className),
|
|
61
|
+
"data-slot": "conversation-content",
|
|
62
|
+
...props
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
ConversationContent.displayName = "ConversationContent";
|
|
67
|
+
function ConversationEmptyState({
|
|
68
|
+
className,
|
|
69
|
+
title = "No messages yet",
|
|
70
|
+
description = "Start a conversation to see messages here",
|
|
71
|
+
icon,
|
|
72
|
+
children,
|
|
73
|
+
...props
|
|
74
|
+
}) {
|
|
75
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
className: (0, import_shared_utils.cn)(styles.emptyState(), className),
|
|
79
|
+
"data-slot": "conversation-empty-state",
|
|
80
|
+
...props,
|
|
81
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
82
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: styles.emptyStateIcon(), children: icon }),
|
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1", children: [
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: styles.emptyStateTitle(), children: title }),
|
|
85
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: styles.emptyStateDescription(), children: description })
|
|
86
|
+
] })
|
|
87
|
+
] })
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
ConversationEmptyState.displayName = "ConversationEmptyState";
|
|
92
|
+
function ConversationScrollButton({
|
|
93
|
+
className,
|
|
94
|
+
...props
|
|
95
|
+
}) {
|
|
96
|
+
const { isAtBottom, scrollToBottom } = (0, import_use_stick_to_bottom.useStickToBottomContext)();
|
|
97
|
+
const handleScrollToBottom = (0, import_react.useCallback)(() => {
|
|
98
|
+
scrollToBottom();
|
|
99
|
+
}, [scrollToBottom]);
|
|
100
|
+
return !isAtBottom && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
101
|
+
import_button.Button,
|
|
102
|
+
{
|
|
103
|
+
className: (0, import_shared_utils.cn)(styles.scrollButton(), className),
|
|
104
|
+
onClick: handleScrollToBottom,
|
|
105
|
+
isIconOnly: true,
|
|
106
|
+
type: "button",
|
|
107
|
+
variant: "outline",
|
|
108
|
+
"data-slot": "conversation-scroll-button",
|
|
109
|
+
...props,
|
|
110
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ArrowDown, { className: "size-4" })
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
ConversationScrollButton.displayName = "ConversationScrollButton";
|
|
115
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
116
|
+
0 && (module.exports = {
|
|
117
|
+
Conversation,
|
|
118
|
+
ConversationContent,
|
|
119
|
+
ConversationEmptyState,
|
|
120
|
+
ConversationScrollButton
|
|
121
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import {
|
|
4
|
+
Conversation,
|
|
5
|
+
ConversationContent,
|
|
6
|
+
ConversationEmptyState,
|
|
7
|
+
ConversationScrollButton
|
|
8
|
+
} from "./chunk-S247BNPZ.mjs";
|
|
9
|
+
export {
|
|
10
|
+
Conversation,
|
|
11
|
+
ConversationContent,
|
|
12
|
+
ConversationEmptyState,
|
|
13
|
+
ConversationScrollButton
|
|
14
|
+
};
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Conversation, ConversationContent, ConversationContentProps, ConversationEmptyState, ConversationEmptyStateProps, ConversationProps, ConversationScrollButton, ConversationScrollButtonProps } from './conversation.mjs';
|
|
2
|
+
export { Message, MessageAction, MessageActionProps, MessageActions, MessageActionsProps, MessageBranch, MessageBranchContent, MessageBranchContentProps, MessageBranchNext, MessageBranchNextProps, MessageBranchPage, MessageBranchPageProps, MessageBranchPrevious, MessageBranchPreviousProps, MessageBranchProps, MessageBranchSelector, MessageBranchSelectorProps, MessageContent, MessageContentProps, MessageProps, MessageResponse, MessageResponseProps, MessageRole, MessageToolbar, MessageToolbarProps } from './message.mjs';
|
|
3
|
+
export { PromptInput, PromptInputProps } from './prompt-input.mjs';
|
|
4
|
+
import 'react/jsx-runtime';
|
|
5
|
+
import '@kopexa/button';
|
|
6
|
+
import 'react';
|
|
7
|
+
import 'use-stick-to-bottom';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Conversation, ConversationContent, ConversationContentProps, ConversationEmptyState, ConversationEmptyStateProps, ConversationProps, ConversationScrollButton, ConversationScrollButtonProps } from './conversation.js';
|
|
2
|
+
export { Message, MessageAction, MessageActionProps, MessageActions, MessageActionsProps, MessageBranch, MessageBranchContent, MessageBranchContentProps, MessageBranchNext, MessageBranchNextProps, MessageBranchPage, MessageBranchPageProps, MessageBranchPrevious, MessageBranchPreviousProps, MessageBranchProps, MessageBranchSelector, MessageBranchSelectorProps, MessageContent, MessageContentProps, MessageProps, MessageResponse, MessageResponseProps, MessageRole, MessageToolbar, MessageToolbarProps } from './message.js';
|
|
3
|
+
export { PromptInput, PromptInputProps } from './prompt-input.js';
|
|
4
|
+
import 'react/jsx-runtime';
|
|
5
|
+
import '@kopexa/button';
|
|
6
|
+
import 'react';
|
|
7
|
+
import 'use-stick-to-bottom';
|