llmasaservice-ui 0.0.1 → 0.1.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.
Files changed (83) hide show
  1. package/.storybook/main.ts +18 -0
  2. package/.storybook/preview.ts +14 -0
  3. package/README.md +2 -0
  4. package/dist/index.css +203 -0
  5. package/dist/index.d.mts +15 -1
  6. package/dist/index.d.ts +15 -1
  7. package/dist/index.js +149 -3142
  8. package/dist/index.mjs +143 -3156
  9. package/index.ts +5 -0
  10. package/package.json +25 -4
  11. package/src/ChatPanel.css +223 -0
  12. package/src/ChatPanel.tsx +201 -0
  13. package/src/stories/ChatPanel.stories.ts +59 -0
  14. package/storybook-static/227.efcd083c.iframe.bundle.js +1 -0
  15. package/storybook-static/352.65788bb6.iframe.bundle.js +95 -0
  16. package/storybook-static/352.65788bb6.iframe.bundle.js.LICENSE.txt +16 -0
  17. package/storybook-static/352.65788bb6.iframe.bundle.js.map +1 -0
  18. package/storybook-static/364.997a89c9.iframe.bundle.js +1 -0
  19. package/storybook-static/400.d2d37d9a.iframe.bundle.js +402 -0
  20. package/storybook-static/400.d2d37d9a.iframe.bundle.js.LICENSE.txt +46 -0
  21. package/storybook-static/400.d2d37d9a.iframe.bundle.js.map +1 -0
  22. package/storybook-static/461.f6b88735.iframe.bundle.js +1 -0
  23. package/storybook-static/648.10e58fb5.iframe.bundle.js +1 -0
  24. package/storybook-static/697.a454e49a.iframe.bundle.js +2 -0
  25. package/storybook-static/697.a454e49a.iframe.bundle.js.LICENSE.txt +9 -0
  26. package/storybook-static/favicon.svg +1 -0
  27. package/storybook-static/iframe.html +511 -0
  28. package/storybook-static/index.html +185 -0
  29. package/storybook-static/index.json +1 -0
  30. package/storybook-static/main.5732ddbe.iframe.bundle.js +1 -0
  31. package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
  32. package/storybook-static/nunito-sans-bold.woff2 +0 -0
  33. package/storybook-static/nunito-sans-italic.woff2 +0 -0
  34. package/storybook-static/nunito-sans-regular.woff2 +0 -0
  35. package/storybook-static/project.json +1 -0
  36. package/storybook-static/runtime~main.7bd01747.iframe.bundle.js +1 -0
  37. package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +333 -0
  38. package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +40 -0
  39. package/storybook-static/sb-addons/essentials-actions-4/manager-bundle.js +3 -0
  40. package/storybook-static/sb-addons/essentials-actions-4/manager-bundle.js.LEGAL.txt +0 -0
  41. package/storybook-static/sb-addons/essentials-backgrounds-5/manager-bundle.js +12 -0
  42. package/storybook-static/sb-addons/essentials-backgrounds-5/manager-bundle.js.LEGAL.txt +0 -0
  43. package/storybook-static/sb-addons/essentials-controls-3/manager-bundle.js +412 -0
  44. package/storybook-static/sb-addons/essentials-controls-3/manager-bundle.js.LEGAL.txt +0 -0
  45. package/storybook-static/sb-addons/essentials-measure-8/manager-bundle.js +3 -0
  46. package/storybook-static/sb-addons/essentials-measure-8/manager-bundle.js.LEGAL.txt +0 -0
  47. package/storybook-static/sb-addons/essentials-outline-9/manager-bundle.js +3 -0
  48. package/storybook-static/sb-addons/essentials-outline-9/manager-bundle.js.LEGAL.txt +0 -0
  49. package/storybook-static/sb-addons/essentials-toolbars-7/manager-bundle.js +3 -0
  50. package/storybook-static/sb-addons/essentials-toolbars-7/manager-bundle.js.LEGAL.txt +0 -0
  51. package/storybook-static/sb-addons/essentials-viewport-6/manager-bundle.js +3 -0
  52. package/storybook-static/sb-addons/essentials-viewport-6/manager-bundle.js.LEGAL.txt +0 -0
  53. package/storybook-static/sb-addons/interactions-11/manager-bundle.js +234 -0
  54. package/storybook-static/sb-addons/interactions-11/manager-bundle.js.LEGAL.txt +0 -0
  55. package/storybook-static/sb-addons/links-2/manager-bundle.js +3 -0
  56. package/storybook-static/sb-addons/links-2/manager-bundle.js.LEGAL.txt +0 -0
  57. package/storybook-static/sb-addons/onboarding-1/manager-bundle.js +129 -0
  58. package/storybook-static/sb-addons/onboarding-1/manager-bundle.js.LEGAL.txt +0 -0
  59. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
  60. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
  61. package/storybook-static/sb-common-assets/favicon.svg +1 -0
  62. package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  63. package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  64. package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  65. package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  66. package/storybook-static/sb-manager/globals-module-info.js +995 -0
  67. package/storybook-static/sb-manager/globals-runtime.js +53525 -0
  68. package/storybook-static/sb-manager/globals.js +48 -0
  69. package/storybook-static/sb-manager/runtime.js +11884 -0
  70. package/storybook-static/sb-preview/globals.js +33 -0
  71. package/storybook-static/sb-preview/runtime.js +9485 -0
  72. package/storybook-static/stories-ChatPanel-stories.0ddabb3d.iframe.bundle.js +1 -0
  73. package/tsconfig.json +2 -2
  74. package/dist/index.js.map +0 -1
  75. package/dist/index.mjs.map +0 -1
  76. package/src/components/ChatPanel/ChatPanel.js +0 -8
  77. package/src/components/ChatPanel/ChatPanel.tsx +0 -17
  78. package/src/components/ChatPanel/index.js +0 -7
  79. package/src/components/ChatPanel/index.ts +0 -2
  80. package/src/components/index.js +0 -8
  81. package/src/components/index.ts +0 -1
  82. package/src/index.js +0 -17
  83. 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;
@@ -0,0 +1,14 @@
1
+ import type { Preview } from "@storybook/react";
2
+
3
+ const preview: Preview = {
4
+ parameters: {
5
+ controls: {
6
+ matchers: {
7
+ color: /(background|color)$/i,
8
+ date: /Date$/i,
9
+ },
10
+ },
11
+ },
12
+ };
13
+
14
+ export default preview;
package/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # Prebuilt UI chat panel for LLM as a Service
2
+
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 };