@copilotkit/react-ui 0.37.0-mme-fix-textarea-css.1 → 0.37.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.
Files changed (82) hide show
  1. package/.turbo/turbo-build.log +66 -64
  2. package/CHANGELOG.md +16 -0
  3. package/dist/{chunk-7FES2IQA.mjs → chunk-23PTCJ2T.mjs} +2 -2
  4. package/dist/{chunk-VUZA5AFH.mjs → chunk-BJPGMY3I.mjs} +3 -6
  5. package/dist/{chunk-VUZA5AFH.mjs.map → chunk-BJPGMY3I.mjs.map} +1 -1
  6. package/dist/chunk-EFZPSZWO.mjs +1 -0
  7. package/dist/{chunk-MLU5AGTZ.mjs → chunk-F4KCDLRJ.mjs} +7 -7
  8. package/dist/{chunk-UN4W7WK4.mjs → chunk-GKZ5DRPT.mjs} +2 -2
  9. package/dist/{chunk-Z6NNH6PN.mjs → chunk-IEV5SYHX.mjs} +10 -10
  10. package/dist/{chunk-BL65ZC6L.mjs → chunk-LZHY5L7A.mjs} +2 -2
  11. package/dist/{chunk-7BARTDT5.mjs → chunk-MSSOYSBR.mjs} +2 -2
  12. package/dist/{chunk-PAQWLSA4.mjs → chunk-SE6DAYSX.mjs} +2 -2
  13. package/dist/{chunk-RT2XG2T7.mjs → chunk-UC3Y7MWX.mjs} +2 -2
  14. package/dist/{chunk-CE7PJAAO.mjs → chunk-XSUSSWDS.mjs} +2 -2
  15. package/dist/components/chat/Button.js.map +1 -1
  16. package/dist/components/chat/Button.mjs +2 -2
  17. package/dist/components/chat/Chat.js +2 -4
  18. package/dist/components/chat/Chat.js.map +1 -1
  19. package/dist/components/chat/Chat.mjs +5 -5
  20. package/dist/components/chat/ChatContext.js +2 -7
  21. package/dist/components/chat/ChatContext.js.map +1 -1
  22. package/dist/components/chat/ChatContext.mjs +1 -1
  23. package/dist/components/chat/Header.js.map +1 -1
  24. package/dist/components/chat/Header.mjs +2 -2
  25. package/dist/components/chat/Input.js.map +1 -1
  26. package/dist/components/chat/Input.mjs +2 -2
  27. package/dist/components/chat/Messages.js.map +1 -1
  28. package/dist/components/chat/Messages.mjs +2 -2
  29. package/dist/components/chat/Modal.js +2 -4
  30. package/dist/components/chat/Modal.js.map +1 -1
  31. package/dist/components/chat/Modal.mjs +8 -8
  32. package/dist/components/chat/Popup.js +2 -4
  33. package/dist/components/chat/Popup.js.map +1 -1
  34. package/dist/components/chat/Popup.mjs +9 -9
  35. package/dist/components/chat/Response.js.map +1 -1
  36. package/dist/components/chat/Response.mjs +2 -2
  37. package/dist/components/chat/Sidebar.js +2 -4
  38. package/dist/components/chat/Sidebar.js.map +1 -1
  39. package/dist/components/chat/Sidebar.mjs +9 -9
  40. package/dist/components/chat/index.js +2 -4
  41. package/dist/components/chat/index.js.map +1 -1
  42. package/dist/components/chat/index.mjs +11 -11
  43. package/dist/components/index.js +2 -4
  44. package/dist/components/index.js.map +1 -1
  45. package/dist/components/index.mjs +11 -11
  46. package/dist/index.css +23 -46
  47. package/dist/index.css.map +1 -1
  48. package/dist/index.d.ts +1 -0
  49. package/dist/index.js +2 -4
  50. package/dist/index.js.map +1 -1
  51. package/dist/index.mjs +12 -12
  52. package/dist/types/css.d.ts +16 -0
  53. package/dist/types/css.js +19 -0
  54. package/dist/types/css.js.map +1 -0
  55. package/dist/types/css.mjs +1 -0
  56. package/dist/types/css.mjs.map +1 -0
  57. package/dist/types/index.d.ts +2 -2
  58. package/dist/types/index.js.map +1 -1
  59. package/dist/types/index.mjs +1 -1
  60. package/package.json +6 -6
  61. package/postcss.config.js +57 -6
  62. package/src/components/chat/ChatContext.tsx +1 -1
  63. package/src/css/button.css +5 -3
  64. package/src/css/colors.css +1 -50
  65. package/src/css/header.css +4 -4
  66. package/src/css/input.css +7 -7
  67. package/src/css/messages.css +6 -6
  68. package/src/css/response.css +1 -1
  69. package/src/css/suggestions.css +2 -2
  70. package/src/types/css.ts +15 -0
  71. package/src/types/index.ts +1 -1
  72. package/dist/chunk-7NSRDJ5C.mjs +0 -1
  73. /package/dist/{chunk-7FES2IQA.mjs.map → chunk-23PTCJ2T.mjs.map} +0 -0
  74. /package/dist/{chunk-7NSRDJ5C.mjs.map → chunk-EFZPSZWO.mjs.map} +0 -0
  75. /package/dist/{chunk-MLU5AGTZ.mjs.map → chunk-F4KCDLRJ.mjs.map} +0 -0
  76. /package/dist/{chunk-UN4W7WK4.mjs.map → chunk-GKZ5DRPT.mjs.map} +0 -0
  77. /package/dist/{chunk-Z6NNH6PN.mjs.map → chunk-IEV5SYHX.mjs.map} +0 -0
  78. /package/dist/{chunk-BL65ZC6L.mjs.map → chunk-LZHY5L7A.mjs.map} +0 -0
  79. /package/dist/{chunk-7BARTDT5.mjs.map → chunk-MSSOYSBR.mjs.map} +0 -0
  80. /package/dist/{chunk-PAQWLSA4.mjs.map → chunk-SE6DAYSX.mjs.map} +0 -0
  81. /package/dist/{chunk-RT2XG2T7.mjs.map → chunk-UC3Y7MWX.mjs.map} +0 -0
  82. /package/dist/{chunk-CE7PJAAO.mjs.map → chunk-XSUSSWDS.mjs.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/css.ts"],"sourcesContent":["// autogenerated (see postcss.config.js) - do not edit\nimport { CSSProperties } from \"react\";\n\nexport interface CopilotKitCSSProperties extends CSSProperties {\n \"--copilot-kit-primary-color\"?: string;\n \"--copilot-kit-contrast-color\"?: string;\n \"--copilot-kit-secondary-color\"?: string;\n \"--copilot-kit-secondary-contrast-color\"?: string;\n \"--copilot-kit-background-color\"?: string;\n \"--copilot-kit-muted-color\"?: string;\n \"--copilot-kit-separator-color\"?: string;\n \"--copilot-kit-scrollbar-color\"?: string;\n \"--copilot-kit-response-button-color\"?: string;\n \"--copilot-kit-response-button-background-color\"?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=css.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
-
2
- export { }
1
+ export { CopilotKitCSSProperties } from './css.js';
2
+ import 'react';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export {};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export type { CopilotKitCSSProperties } from \"./css\";\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,2 +1,2 @@
1
- import "../chunk-7NSRDJ5C.mjs";
1
+ import "../chunk-EFZPSZWO.mjs";
2
2
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.37.0-mme-fix-textarea-css.1",
7
+ "version": "0.37.0",
8
8
  "sideEffects": [
9
9
  "**/*.css"
10
10
  ],
@@ -35,9 +35,9 @@
35
35
  "ts-jest": "^29.1.1",
36
36
  "tsup": "^6.7.0",
37
37
  "typescript": "^5.2.3",
38
- "eslint-config-custom": "0.12.0-mme-fix-textarea-css.1",
39
- "tailwind-config": "0.11.0-mme-fix-textarea-css.1",
40
- "tsconfig": "0.16.0-mme-fix-textarea-css.1"
38
+ "eslint-config-custom": "0.12.0",
39
+ "tailwind-config": "0.11.0",
40
+ "tsconfig": "0.16.0"
41
41
  },
42
42
  "dependencies": {
43
43
  "nanoid": "^4.0.2",
@@ -45,8 +45,8 @@
45
45
  "react-syntax-highlighter": "^15.5.0",
46
46
  "remark-gfm": "^3.0.1",
47
47
  "remark-math": "^5.1.1",
48
- "@copilotkit/shared": "0.37.0-mme-fix-textarea-css.1",
49
- "@copilotkit/react-core": "0.37.0-mme-fix-textarea-css.1"
48
+ "@copilotkit/shared": "0.37.0",
49
+ "@copilotkit/react-core": "0.37.0"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "tsup --clean",
package/postcss.config.js CHANGED
@@ -1,9 +1,60 @@
1
- // If you want to use other PostCSS plugins, see the following:
2
- // https://tailwindcss.com/docs/using-with-preprocessors
1
+ const path = require("path");
2
+ const fs = require("fs");
3
+
4
+ let didCreateInterface = false;
3
5
 
4
6
  module.exports = {
5
- plugins: {
6
- tailwindcss: {},
7
- autoprefixer: {},
8
- },
7
+ plugins: [
8
+ {
9
+ postcssPlugin: "postcss-collect-all-variables",
10
+ Once(root) {
11
+ if (didCreateInterface) return;
12
+
13
+ const filename = path.basename(root.source.input.file);
14
+ if (filename === "colors.css") {
15
+ const variables = {};
16
+
17
+ root.walkDecls((decl) => {
18
+ if (decl.prop.startsWith("--")) {
19
+ variables[decl.prop] = decl.value;
20
+ }
21
+ });
22
+
23
+ // Create TypeScript interface
24
+ const interfaceContent = generateInterface(variables);
25
+
26
+ // Ensure the directory exists
27
+ const dir = path.resolve(__dirname, "src/types");
28
+ if (!fs.existsSync(dir)) {
29
+ fs.mkdirSync(dir, { recursive: true });
30
+ }
31
+
32
+ // Write the interface to the file
33
+ const filePath = path.resolve(dir, "css.ts");
34
+ fs.writeFileSync(filePath, interfaceContent);
35
+
36
+ didCreateInterface = true;
37
+ }
38
+ },
39
+ },
40
+ // require("tailwindcss"),
41
+ // require("autoprefixer"),
42
+ ],
9
43
  };
44
+
45
+ function generateInterface(variables) {
46
+ const interfaceLines = [
47
+ "// autogenerated (see postcss.config.js) - do not edit",
48
+ 'import { CSSProperties } from "react";',
49
+ "",
50
+ "export interface CopilotKitCSSProperties extends CSSProperties {",
51
+ ];
52
+
53
+ for (const [prop, value] of Object.entries(variables)) {
54
+ interfaceLines.push(` "${prop}"?: string;`);
55
+ }
56
+
57
+ interfaceLines.push("}");
58
+
59
+ return interfaceLines.join("\n") + "\n";
60
+ }
@@ -166,7 +166,7 @@ export const ChatContextProvider = ({
166
166
  regenerateIcon: DefaultIcons.RegenerateIcon,
167
167
  pushToTalkIcon: DefaultIcons.PushToTalkIcon,
168
168
  },
169
- icons,
169
+ ...icons,
170
170
  },
171
171
  open,
172
172
  setOpen,
@@ -10,8 +10,8 @@
10
10
  position: relative;
11
11
  transform: scale(1);
12
12
  transition: transform 200ms;
13
- background-color: var(--copilot-kit-button-background-color);
14
- color: var(--copilot-kit-button-icon-color);
13
+ background-color: var(--copilot-kit-primary-color);
14
+ color: var(--copilot-kit-contrast-color);
15
15
  cursor: pointer;
16
16
  }
17
17
 
@@ -24,7 +24,9 @@
24
24
  }
25
25
 
26
26
  .copilotKitButtonIcon {
27
- transition: opacity 100ms, transform 300ms;
27
+ transition:
28
+ opacity 100ms,
29
+ transform 300ms;
28
30
  position: absolute;
29
31
  top: 50%;
30
32
  left: 50%;
@@ -1,4 +1,4 @@
1
- :root {
1
+ html {
2
2
  --copilot-kit-primary-color: rgb(59 130 246);
3
3
  --copilot-kit-contrast-color: rgb(255 255 255);
4
4
  --copilot-kit-secondary-color: rgb(243 244 246);
@@ -7,55 +7,6 @@
7
7
  --copilot-kit-muted-color: rgb(106 106 106);
8
8
  --copilot-kit-separator-color: rgba(0, 0, 0, 0.08);
9
9
  --copilot-kit-scrollbar-color: rgba(0, 0, 0, 0.2);
10
-
11
- --copilot-kit-button-background-color: var(--copilot-kit-primary-color);
12
-
13
- /* The color of the icon in the open/close button */
14
- --copilot-kit-button-icon-color: var(--copilot-kit-contrast-color);
15
-
16
- /* The background color of the header of the chat window */
17
- --copilot-kit-header-background-color: var(--copilot-kit-primary-color);
18
-
19
- /* The color of the title in the header of the chat window */
20
- --copilot-kit-header-title-color: var(--copilot-kit-contrast-color);
21
-
22
- /* The color of the close button in the header of the chat window */
23
- --copilot-kit-header-close-button-color: var(--copilot-kit-contrast-color);
24
-
25
- /* The color of the separator between the header and the messages area */
26
- --copilot-kit-header-separator-color: var(--copilot-kit-separator-color);
27
-
28
- /* The background color of the input area */
29
- --copilot-kit-input-background-color: var(--copilot-kit-background-color);
30
-
31
- /* The color of the send button */
32
- --copilot-kit-input-send-button-color: var(--copilot-kit-primary-color);
33
-
34
- /* The color of the send button when disabled */
35
- --copilot-kit-input-send-button-disabled-color: var(--copilot-kit-muted-color);
36
-
37
- /* The color of the placeholder text in the input area */
38
- --copilot-kit-input-placeholder-color: var(--copilot-kit-muted-color);
39
-
40
- /* The color of the text in the input area */
41
- --copilot-kit-input-color: var(--copilot-kit-secondary-contrast-color);
42
-
43
- /* The color of the separator between the input area and the messages area */
44
- --copilot-kit-input-separator-color: var(--copilot-kit-separator-color);
45
-
46
- /* The background color of the messages area */
47
- --copilot-kit-messages-background-color: var(--copilot-kit-background-color);
48
-
49
- /* The background color of a user message */
50
- --copilot-kit-message-user-background-color: var(--copilot-kit-primary-color);
51
- --copilot-kit-message-user-color: var(--copilot-kit-contrast-color);
52
-
53
- /* The background color of a assistant message */
54
- --copilot-kit-message-assistant-background-color: var(--copilot-kit-secondary-color);
55
- --copilot-kit-message-assistant-color: var(--copilot-kit-secondary-contrast-color);
56
-
57
- /* The color of the response control button */
58
- --copilot-kit-response-button-border-color: var(--copilot-kit-separator-color);
59
10
  --copilot-kit-response-button-color: #333;
60
11
  --copilot-kit-response-button-background-color: #fff;
61
12
  }
@@ -5,11 +5,11 @@
5
5
  justify-content: center;
6
6
  align-items: center;
7
7
  position: relative;
8
- background-color: var(--copilot-kit-header-background-color);
9
- color: var(--copilot-kit-header-title-color);
8
+ background-color: var(--copilot-kit-primary-color);
9
+ color: var(--copilot-kit-contrast-color);
10
10
  border-top-left-radius: 0;
11
11
  border-top-right-radius: 0;
12
- border-bottom: 1px solid var(--copilot-kit-header-separator-color);
12
+ border-bottom: 1px solid var(--copilot-kit-separator-color);
13
13
  }
14
14
 
15
15
  .copilotKitSidebar .copilotKitHeader {
@@ -33,7 +33,7 @@
33
33
  right: 16px;
34
34
  transform: translateY(-50%);
35
35
  outline: none;
36
- color: var(--copilot-kit-header-close-button-color);
36
+ color: var(--copilot-kit-contrast-color);
37
37
  background-color: transparent;
38
38
  cursor: pointer;
39
39
  }
package/src/css/input.css CHANGED
@@ -1,5 +1,5 @@
1
1
  .copilotKitInput {
2
- border-top: 1px solid var(--copilot-kit-input-separator-color);
2
+ border-top: 1px solid var(--copilot-kit-separator-color);
3
3
  padding-left: 2rem;
4
4
  padding-right: 1rem;
5
5
  padding-top: 1rem;
@@ -10,7 +10,7 @@
10
10
  position: relative;
11
11
  border-bottom-left-radius: 0.75rem;
12
12
  border-bottom-right-radius: 0.75rem;
13
- background-color: var(--copilot-kit-input-background-color);
13
+ background-color: var(--copilot-kit-background-color);
14
14
  }
15
15
 
16
16
  .copilotKitInput > .copilotKitInputControls > button {
@@ -40,7 +40,7 @@
40
40
  }
41
41
 
42
42
  .copilotKitInput > .copilotKitInputControls > button:not([disabled]) {
43
- color: var(--copilot-kit-input-send-button-color);
43
+ color: var(--copilot-kit-primary-color);
44
44
  }
45
45
 
46
46
  .copilotKitInput > .copilotKitInputControls > button:not([disabled]):hover {
@@ -48,7 +48,7 @@
48
48
  }
49
49
 
50
50
  .copilotKitInput > .copilotKitInputControls > button[disabled] {
51
- color: var(--copilot-kit-input-send-button-disabled-color);
51
+ color: var(--copilot-kit-muted-color);
52
52
  }
53
53
 
54
54
  .copilotKitInputControls {
@@ -71,13 +71,13 @@
71
71
  padding: 0;
72
72
  font-family: inherit;
73
73
  font-weight: inherit;
74
- color: var(--copilot-kit-input-color);
74
+ color: var(--copilot-kit-secondary-contrast-color);
75
75
  border: 0px;
76
- background-color: var(--copilot-kit-input-background-color);
76
+ background-color: var(--copilot-kit-background-color);
77
77
  }
78
78
 
79
79
  .copilotKitInput > textarea::placeholder {
80
- color: var(--copilot-kit-input-placeholder-color);
80
+ color: var(--copilot-kit-muted-color);
81
81
  opacity: 1;
82
82
  }
83
83
 
@@ -4,7 +4,7 @@
4
4
  padding: 1rem 2rem;
5
5
  display: flex;
6
6
  flex-direction: column;
7
- background-color: var(--copilot-kit-messages-background-color);
7
+ background-color: var(--copilot-kit-background-color);
8
8
  }
9
9
 
10
10
  .copilotKitMessages::-webkit-scrollbar {
@@ -14,7 +14,7 @@
14
14
  .copilotKitMessages::-webkit-scrollbar-thumb {
15
15
  background-color: var(--copilot-kit-scrollbar-color);
16
16
  border-radius: 10rem;
17
- border: 2px solid var(--copilot-kit-messages-background-color);
17
+ border: 2px solid var(--copilot-kit-background-color);
18
18
  }
19
19
 
20
20
  .copilotKitMessages::-webkit-scrollbar-track-piece:start {
@@ -36,15 +36,15 @@
36
36
  }
37
37
 
38
38
  .copilotKitMessage.copilotKitUserMessage {
39
- background: var(--copilot-kit-message-user-background-color);
40
- color: var(--copilot-kit-message-user-color);
39
+ background: var(--copilot-kit-primary-color);
40
+ color: var(--copilot-kit-contrast-color);
41
41
  margin-left: auto;
42
42
  white-space: pre-wrap;
43
43
  }
44
44
 
45
45
  .copilotKitMessage.copilotKitAssistantMessage {
46
- background: var(--copilot-kit-message-assistant-background-color);
47
- color: var(--copilot-kit-message-assistant-color);
46
+ background: var(--copilot-kit-secondary-color);
47
+ color: var(--copilot-kit-secondary-contrast-color);
48
48
  margin-right: auto;
49
49
  }
50
50
 
@@ -1,6 +1,6 @@
1
1
  .copilotKitResponseButton {
2
2
  background-color: var(--copilot-kit-response-button-background-color);
3
- border: 1px solid var(--copilot-kit-response-button-border-color);
3
+ border: 1px solid var(--copilot-kit-separator-color);
4
4
  border-radius: 4px;
5
5
  color: var(--copilot-kit-response-button-color);
6
6
  cursor: pointer;
@@ -14,8 +14,8 @@
14
14
  padding: 8px 12px;
15
15
  font-size: 0.7rem;
16
16
  border-radius: 0.5rem;
17
- background: var(--copilot-kit-message-user-background-color);
18
- color: var(--copilot-kit-message-user-color);
17
+ background: var(--copilot-kit-primary-color);
18
+ color: var(--copilot-kit-contrast-color);
19
19
  }
20
20
 
21
21
  .copilotKitMessages footer .suggestions button {
@@ -0,0 +1,15 @@
1
+ // autogenerated (see postcss.config.js) - do not edit
2
+ import { CSSProperties } from "react";
3
+
4
+ export interface CopilotKitCSSProperties extends CSSProperties {
5
+ "--copilot-kit-primary-color"?: string;
6
+ "--copilot-kit-contrast-color"?: string;
7
+ "--copilot-kit-secondary-color"?: string;
8
+ "--copilot-kit-secondary-contrast-color"?: string;
9
+ "--copilot-kit-background-color"?: string;
10
+ "--copilot-kit-muted-color"?: string;
11
+ "--copilot-kit-separator-color"?: string;
12
+ "--copilot-kit-scrollbar-color"?: string;
13
+ "--copilot-kit-response-button-color"?: string;
14
+ "--copilot-kit-response-button-background-color"?: string;
15
+ }
@@ -1 +1 @@
1
- export {};
1
+ export type { CopilotKitCSSProperties } from "./css";
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-7NSRDJ5C.mjs.map