llmasaservice-ui 0.0.1 → 0.1.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/.storybook/main.ts +18 -0
- package/.storybook/preview.ts +14 -0
- package/dist/index.css +203 -0
- package/dist/index.d.mts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +149 -3142
- package/dist/index.mjs +143 -3156
- package/{src/components/index.js → index.js} +3 -2
- package/index.ts +5 -0
- package/package.json +25 -4
- package/src/ChatPanel.css +223 -0
- package/src/ChatPanel.jsx +149 -0
- package/src/ChatPanel.tsx +201 -0
- package/src/stories/ChatPanel.stories.js +57 -0
- package/src/stories/ChatPanel.stories.ts +59 -0
- package/tsconfig.json +2 -2
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/src/components/ChatPanel/ChatPanel.js +0 -8
- package/src/components/ChatPanel/ChatPanel.tsx +0 -17
- package/src/components/ChatPanel/index.js +0 -7
- package/src/components/ChatPanel/index.ts +0 -2
- package/src/components/index.ts +0 -1
- package/src/index.js +0 -17
- package/src/index.ts +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { StorybookConfig } from "@storybook/react-webpack5";
|
|
2
|
+
|
|
3
|
+
const config: StorybookConfig = {
|
|
4
|
+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
|
|
5
|
+
addons: [
|
|
6
|
+
"@storybook/addon-webpack5-compiler-swc",
|
|
7
|
+
"@storybook/addon-onboarding",
|
|
8
|
+
"@storybook/addon-links",
|
|
9
|
+
"@storybook/addon-essentials",
|
|
10
|
+
"@chromatic-com/storybook",
|
|
11
|
+
"@storybook/addon-interactions",
|
|
12
|
+
],
|
|
13
|
+
framework: {
|
|
14
|
+
name: "@storybook/react-webpack5",
|
|
15
|
+
options: {},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export default config;
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/* src/ChatPanel.css */
|
|
2
|
+
.side-panel {
|
|
3
|
+
font-family:
|
|
4
|
+
"Roboto",
|
|
5
|
+
Arial,
|
|
6
|
+
Helvetica,
|
|
7
|
+
sans-serif;
|
|
8
|
+
font-size: small;
|
|
9
|
+
color: #000;
|
|
10
|
+
width: 300px;
|
|
11
|
+
height: 100vh;
|
|
12
|
+
background-color: #eee;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
justify-content: space-between;
|
|
16
|
+
padding: 10px;
|
|
17
|
+
box-shadow: 5px 0 5px rgba(0, 0, 0, 0.1);
|
|
18
|
+
}
|
|
19
|
+
.side-panel .title {
|
|
20
|
+
font-size: 20px;
|
|
21
|
+
font-weight: bold;
|
|
22
|
+
margin-bottom: 10px;
|
|
23
|
+
text-align: center;
|
|
24
|
+
}
|
|
25
|
+
.side-panel .input-container {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
align-items: center;
|
|
29
|
+
margin-top: 5px;
|
|
30
|
+
}
|
|
31
|
+
.side-panel textarea {
|
|
32
|
+
flex: 1;
|
|
33
|
+
padding: 10px;
|
|
34
|
+
margin-right: 10px;
|
|
35
|
+
border-radius: 4px;
|
|
36
|
+
height: 50px;
|
|
37
|
+
resize: none;
|
|
38
|
+
}
|
|
39
|
+
.side-panel .send-button {
|
|
40
|
+
background-color: #007bff;
|
|
41
|
+
color: white;
|
|
42
|
+
border: none;
|
|
43
|
+
border-radius: 4px;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
height: 30px;
|
|
46
|
+
}
|
|
47
|
+
.side-panel .send-button:hover {
|
|
48
|
+
background-color: #0056b3;
|
|
49
|
+
}
|
|
50
|
+
.side-panel .history-entry {
|
|
51
|
+
background-color: #eee;
|
|
52
|
+
}
|
|
53
|
+
.side-panel .responseArea {
|
|
54
|
+
flex: 1;
|
|
55
|
+
background-color: eee;
|
|
56
|
+
border-radius: 4px;
|
|
57
|
+
overflow-y: auto;
|
|
58
|
+
}
|
|
59
|
+
.side-panel .prompt {
|
|
60
|
+
align-self: flex-start;
|
|
61
|
+
background-color: #bbb;
|
|
62
|
+
padding: 5px;
|
|
63
|
+
border-radius: 10px;
|
|
64
|
+
margin-right: 4%;
|
|
65
|
+
margin-bottom: 3px;
|
|
66
|
+
max-width: 96%;
|
|
67
|
+
}
|
|
68
|
+
.side-panel .response {
|
|
69
|
+
align-self: flex-end;
|
|
70
|
+
background-color: #ddd;
|
|
71
|
+
padding: 5px;
|
|
72
|
+
border-radius: 10px;
|
|
73
|
+
margin-left: 4%;
|
|
74
|
+
max-width: 99%;
|
|
75
|
+
margin-bottom: 5px;
|
|
76
|
+
}
|
|
77
|
+
.side-panel .copy-button {
|
|
78
|
+
font-size: 10px;
|
|
79
|
+
border: 0px solid #007bff;
|
|
80
|
+
background-color: transparent;
|
|
81
|
+
color: #007bff;
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
width: 30px;
|
|
84
|
+
height: 30px;
|
|
85
|
+
}
|
|
86
|
+
.side-panel .copy-button:hover {
|
|
87
|
+
border: 1px solid #007bff;
|
|
88
|
+
border-radius: 3px;
|
|
89
|
+
}
|
|
90
|
+
.side-panel .thumbs-button {
|
|
91
|
+
font-size: 10px;
|
|
92
|
+
border: 0px solid #007bff;
|
|
93
|
+
background-color: transparent;
|
|
94
|
+
color: #007bff;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
width: 30px;
|
|
97
|
+
height: 30px;
|
|
98
|
+
}
|
|
99
|
+
.side-panel .thumbs-button:hover {
|
|
100
|
+
border: 1px solid #007bff;
|
|
101
|
+
border-radius: 3px;
|
|
102
|
+
}
|
|
103
|
+
.side-panel-dark {
|
|
104
|
+
font-family:
|
|
105
|
+
"Roboto",
|
|
106
|
+
Arial,
|
|
107
|
+
Helvetica,
|
|
108
|
+
sans-serif;
|
|
109
|
+
font-size: small;
|
|
110
|
+
color: #eee;
|
|
111
|
+
width: 300px;
|
|
112
|
+
height: 100vh;
|
|
113
|
+
background-color: #424242;
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
justify-content: space-between;
|
|
117
|
+
padding: 10px;
|
|
118
|
+
box-shadow: 5px 0 5px rgba(0, 0, 0, 0.1);
|
|
119
|
+
}
|
|
120
|
+
.side-panel-dark .title {
|
|
121
|
+
font-size: 20px;
|
|
122
|
+
font-weight: bold;
|
|
123
|
+
margin-bottom: 10px;
|
|
124
|
+
text-align: center;
|
|
125
|
+
}
|
|
126
|
+
.side-panel-dark .input-container {
|
|
127
|
+
display: flex;
|
|
128
|
+
flex-direction: row;
|
|
129
|
+
align-items: center;
|
|
130
|
+
margin-top: 5px;
|
|
131
|
+
}
|
|
132
|
+
.side-panel-dark textarea {
|
|
133
|
+
flex: 1;
|
|
134
|
+
padding: 10px;
|
|
135
|
+
margin-right: 10px;
|
|
136
|
+
border-radius: 4px;
|
|
137
|
+
height: 50px;
|
|
138
|
+
resize: none;
|
|
139
|
+
}
|
|
140
|
+
.side-panel-dark .send-button {
|
|
141
|
+
background-color: #007bff;
|
|
142
|
+
color: white;
|
|
143
|
+
border: none;
|
|
144
|
+
border-radius: 4px;
|
|
145
|
+
cursor: pointer;
|
|
146
|
+
height: 30px;
|
|
147
|
+
}
|
|
148
|
+
.side-panel-dark .send-button:hover {
|
|
149
|
+
background-color: #0056b3;
|
|
150
|
+
}
|
|
151
|
+
.side-panel-dark .history-entry {
|
|
152
|
+
background-color: #424242;
|
|
153
|
+
}
|
|
154
|
+
.side-panel-dark .responseArea {
|
|
155
|
+
flex: 1;
|
|
156
|
+
background-color: #424242;
|
|
157
|
+
border-radius: 4px;
|
|
158
|
+
overflow-y: auto;
|
|
159
|
+
}
|
|
160
|
+
.side-panel-dark .prompt {
|
|
161
|
+
align-self: flex-start;
|
|
162
|
+
background-color: #303030;
|
|
163
|
+
padding: 5px;
|
|
164
|
+
border-radius: 10px;
|
|
165
|
+
margin-right: 4%;
|
|
166
|
+
margin-bottom: 3px;
|
|
167
|
+
max-width: 96%;
|
|
168
|
+
}
|
|
169
|
+
.side-panel-dark .response {
|
|
170
|
+
align-self: flex-end;
|
|
171
|
+
background-color: #303030;
|
|
172
|
+
padding: 5px;
|
|
173
|
+
border-radius: 10px;
|
|
174
|
+
margin-left: 4%;
|
|
175
|
+
max-width: 96%;
|
|
176
|
+
margin-bottom: 5px;
|
|
177
|
+
}
|
|
178
|
+
.side-panel-dark .copy-button {
|
|
179
|
+
font-size: 10px;
|
|
180
|
+
border: 0px solid #aaa;
|
|
181
|
+
background-color: transparent;
|
|
182
|
+
color: #aaa;
|
|
183
|
+
cursor: pointer;
|
|
184
|
+
width: 30px;
|
|
185
|
+
height: 30px;
|
|
186
|
+
}
|
|
187
|
+
.side-panel-dark .copy-button:hover {
|
|
188
|
+
border: 1px solid #aaa;
|
|
189
|
+
border-radius: 3px;
|
|
190
|
+
}
|
|
191
|
+
.side-panel-dark .thumbs-button {
|
|
192
|
+
font-size: 10px;
|
|
193
|
+
border: 0px solid #aaa;
|
|
194
|
+
background-color: transparent;
|
|
195
|
+
color: #aaa;
|
|
196
|
+
cursor: pointer;
|
|
197
|
+
width: 30px;
|
|
198
|
+
height: 30px;
|
|
199
|
+
}
|
|
200
|
+
.side-panel-dark .thumbs-button:hover {
|
|
201
|
+
border: 1px solid #aaa;
|
|
202
|
+
border-radius: 3px;
|
|
203
|
+
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
+
import { LLMAsAServiceCustomer } from 'llmasaservice-client';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
|
|
3
4
|
interface ChatPanelProps {
|
|
5
|
+
project_id: string;
|
|
6
|
+
initialPrompt: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
hideInitialPrompt?: boolean;
|
|
10
|
+
customer?: LLMAsAServiceCustomer;
|
|
11
|
+
messages?: {
|
|
12
|
+
role: "user" | "assistant";
|
|
13
|
+
content: string;
|
|
14
|
+
}[];
|
|
15
|
+
thumbsUpClick?: () => void;
|
|
16
|
+
thumbsDownClick?: () => void;
|
|
17
|
+
theme?: "light" | "dark";
|
|
4
18
|
}
|
|
5
19
|
declare const ChatPanel: React.FC<ChatPanelProps>;
|
|
6
20
|
|
|
7
|
-
export { ChatPanel };
|
|
21
|
+
export { ChatPanel, type ChatPanelProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
+
import { LLMAsAServiceCustomer } from 'llmasaservice-client';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
|
|
3
4
|
interface ChatPanelProps {
|
|
5
|
+
project_id: string;
|
|
6
|
+
initialPrompt: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
hideInitialPrompt?: boolean;
|
|
10
|
+
customer?: LLMAsAServiceCustomer;
|
|
11
|
+
messages?: {
|
|
12
|
+
role: "user" | "assistant";
|
|
13
|
+
content: string;
|
|
14
|
+
}[];
|
|
15
|
+
thumbsUpClick?: () => void;
|
|
16
|
+
thumbsDownClick?: () => void;
|
|
17
|
+
theme?: "light" | "dark";
|
|
4
18
|
}
|
|
5
19
|
declare const ChatPanel: React.FC<ChatPanelProps>;
|
|
6
20
|
|
|
7
|
-
export { ChatPanel };
|
|
21
|
+
export { ChatPanel, type ChatPanelProps };
|