@copilotkit/react-ui 0.15.0-alpha.0 → 0.15.0-alpha.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/.turbo/turbo-build.log +178 -95
- package/CHANGELOG.md +12 -1
- package/dist/chunk-47SYBLI2.mjs +110 -0
- package/dist/chunk-47SYBLI2.mjs.map +1 -0
- package/dist/chunk-6H3Y2XEI.mjs +56 -0
- package/dist/chunk-6H3Y2XEI.mjs.map +1 -0
- package/dist/chunk-7YXG7D47.mjs +191 -0
- package/dist/chunk-7YXG7D47.mjs.map +1 -0
- package/dist/{chunk-NMT7XT2R.mjs → chunk-C34L4AWW.mjs} +2 -2
- package/dist/chunk-C34L4AWW.mjs.map +1 -0
- package/dist/chunk-DN3OI5WF.mjs +72 -0
- package/dist/chunk-DN3OI5WF.mjs.map +1 -0
- package/dist/chunk-DPUPEOGG.mjs +14 -0
- package/dist/chunk-DPUPEOGG.mjs.map +1 -0
- package/dist/chunk-FZRTAML3.mjs +3 -0
- package/dist/chunk-GPEJCUWA.mjs +14 -0
- package/dist/chunk-GPEJCUWA.mjs.map +1 -0
- package/dist/chunk-NXWVWC33.mjs +117 -0
- package/dist/chunk-NXWVWC33.mjs.map +1 -0
- package/dist/chunk-P4GBO6MW.mjs +3 -0
- package/dist/chunk-P4GBO6MW.mjs.map +1 -0
- package/dist/chunk-QFASQEFJ.mjs +51 -0
- package/dist/chunk-QFASQEFJ.mjs.map +1 -0
- package/dist/chunk-UIRFLYXI.mjs +53 -0
- package/dist/chunk-UIRFLYXI.mjs.map +1 -0
- package/dist/chunk-WB3YULQ4.mjs +3 -0
- package/dist/chunk-WB3YULQ4.mjs.map +1 -0
- package/dist/chunk-WM6BS77F.mjs +53 -0
- package/dist/chunk-WM6BS77F.mjs.map +1 -0
- package/dist/chunk-X3Z2EVFV.mjs +26 -0
- package/dist/chunk-X3Z2EVFV.mjs.map +1 -0
- package/dist/chunk-X4T6ZUVM.mjs +14 -0
- package/dist/chunk-X4T6ZUVM.mjs.map +1 -0
- package/dist/{chunk-WLTEQ2FW.mjs → chunk-XGUBRIUV.mjs} +4 -12
- package/dist/chunk-XGUBRIUV.mjs.map +1 -0
- package/dist/chunk-Y2RUG4B3.mjs +21 -0
- package/dist/chunk-Y2RUG4B3.mjs.map +1 -0
- package/dist/chunk-ZVAH2Z2W.mjs +61 -0
- package/dist/chunk-ZVAH2Z2W.mjs.map +1 -0
- package/dist/components/chat/Button.d.ts +7 -0
- package/dist/components/chat/Button.mjs +6 -0
- package/dist/components/chat/Button.mjs.map +1 -0
- package/dist/components/chat/Chat.d.ts +95 -0
- package/dist/components/chat/Chat.mjs +16 -0
- package/dist/components/chat/Chat.mjs.map +1 -0
- package/dist/components/chat/ChatContext.d.ts +105 -0
- package/dist/components/chat/ChatContext.mjs +5 -0
- package/dist/components/chat/ChatContext.mjs.map +1 -0
- package/dist/components/chat/CodeBlock.d.ts +14 -0
- package/dist/components/chat/CodeBlock.mjs +6 -0
- package/dist/components/chat/CodeBlock.mjs.map +1 -0
- package/dist/components/chat/Header.d.ts +7 -0
- package/dist/components/chat/Header.mjs +6 -0
- package/dist/components/chat/Header.mjs.map +1 -0
- package/dist/components/chat/Icons.d.ts +15 -0
- package/dist/components/chat/Icons.mjs +4 -0
- package/dist/components/chat/Icons.mjs.map +1 -0
- package/dist/components/chat/Input.d.ts +7 -0
- package/dist/components/chat/Input.mjs +7 -0
- package/dist/components/chat/Input.mjs.map +1 -0
- package/dist/components/chat/Markdown.d.ts +8 -0
- package/dist/components/chat/Markdown.mjs +7 -0
- package/dist/components/chat/Markdown.mjs.map +1 -0
- package/dist/components/chat/Messages.d.ts +7 -0
- package/dist/components/chat/Messages.mjs +9 -0
- package/dist/components/chat/Messages.mjs.map +1 -0
- package/dist/components/chat/Popup.d.ts +9 -0
- package/dist/components/chat/Popup.mjs +17 -0
- package/dist/components/chat/Popup.mjs.map +1 -0
- package/dist/components/chat/Response.d.ts +7 -0
- package/dist/components/chat/Response.mjs +6 -0
- package/dist/components/chat/Response.mjs.map +1 -0
- package/dist/components/chat/Sidebar.d.ts +12 -0
- package/dist/components/chat/Sidebar.mjs +17 -0
- package/dist/components/chat/Sidebar.mjs.map +1 -0
- package/dist/components/chat/Textarea.d.ts +13 -0
- package/dist/components/chat/Textarea.mjs +4 -0
- package/dist/components/chat/Textarea.mjs.map +1 -0
- package/dist/components/chat/Window.d.ts +6 -0
- package/dist/components/chat/Window.mjs +4 -0
- package/dist/components/chat/Window.mjs.map +1 -0
- package/dist/components/chat/index.d.ts +7 -0
- package/dist/components/chat/index.mjs +20 -0
- package/dist/components/chat/index.mjs.map +1 -0
- package/dist/components/chat/props.d.ts +33 -0
- package/dist/components/chat/props.mjs +3 -0
- package/dist/components/chat/props.mjs.map +1 -0
- package/dist/components/chat-components/copilot-chat.mjs +1 -1
- package/dist/components/chat-components/ui/badge.d.ts +1 -1
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.mjs +20 -4
- package/dist/components/sidebar/copilot-sidebar-ui-provider.d.ts +1 -2
- package/dist/components/sidebar/copilot-sidebar-ui-provider.mjs +3 -3
- package/dist/components/sidebar/copilot-sidebar.d.ts +0 -1
- package/dist/components/sidebar/copilot-sidebar.mjs +2 -2
- package/dist/index.css +452 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.mjs +20 -4
- package/package.json +5 -5
- package/src/components/chat/Button.tsx +24 -0
- package/src/components/chat/Chat.tsx +186 -0
- package/src/components/chat/ChatContext.tsx +176 -0
- package/src/components/chat/CodeBlock.tsx +149 -0
- package/src/components/chat/Header.tsx +16 -0
- package/src/components/chat/Icons.tsx +179 -0
- package/src/components/chat/Input.tsx +51 -0
- package/src/components/chat/Markdown.tsx +62 -0
- package/src/components/chat/Messages.tsx +113 -0
- package/src/components/chat/Popup.tsx +10 -0
- package/src/components/chat/Response.tsx +13 -0
- package/src/components/chat/Sidebar.tsx +28 -0
- package/src/components/chat/Textarea.tsx +61 -0
- package/src/components/chat/Window.tsx +141 -0
- package/src/components/chat/index.tsx +3 -0
- package/src/components/chat/props.ts +36 -0
- package/src/components/index.ts +2 -0
- package/src/components/sidebar/copilot-sidebar-ui-provider.tsx +2 -6
- package/src/components/sidebar/copilot-sidebar.tsx +1 -2
- package/src/css/animations.css +29 -0
- package/src/css/button.css +54 -0
- package/src/css/colors.css +61 -0
- package/src/css/header.css +43 -0
- package/src/css/input.css +79 -0
- package/src/css/messages.css +57 -0
- package/src/css/popup.css +22 -0
- package/src/css/response.css +29 -0
- package/src/css/sidebar.css +34 -0
- package/src/css/window.css +58 -0
- package/src/styles.css +11 -0
- package/dist/chunk-NMT7XT2R.mjs.map +0 -1
- package/dist/chunk-U6NJWGTV.mjs +0 -3
- package/dist/chunk-WLTEQ2FW.mjs.map +0 -1
- /package/dist/{chunk-U6NJWGTV.mjs.map → chunk-FZRTAML3.mjs.map} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
.copilotKitInput {
|
|
2
|
+
border-top: 1px solid var(--copilot-kit-input-separator-color);
|
|
3
|
+
padding-left: 2rem;
|
|
4
|
+
padding-right: 2.5rem;
|
|
5
|
+
padding-top: 1rem;
|
|
6
|
+
padding-bottom: 1rem;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
cursor: text;
|
|
10
|
+
position: relative;
|
|
11
|
+
border-bottom-left-radius: 0.75rem;
|
|
12
|
+
border-bottom-right-radius: 0.75rem;
|
|
13
|
+
background-color: var(--copilot-kit-input-background-color);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.copilotKitInput > button {
|
|
17
|
+
position: absolute;
|
|
18
|
+
right: 0.5rem;
|
|
19
|
+
padding: 0.25rem;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
transition-property: transform;
|
|
22
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
23
|
+
transition-duration: 200ms;
|
|
24
|
+
transform: scale(1);
|
|
25
|
+
color: rgba(0, 0, 0, 0.25);
|
|
26
|
+
-webkit-appearance: button;
|
|
27
|
+
appearance: button;
|
|
28
|
+
background-color: transparent;
|
|
29
|
+
background-image: none;
|
|
30
|
+
text-transform: none;
|
|
31
|
+
font-family: inherit;
|
|
32
|
+
font-size: 100%;
|
|
33
|
+
font-weight: inherit;
|
|
34
|
+
line-height: inherit;
|
|
35
|
+
border: 0;
|
|
36
|
+
margin: 0;
|
|
37
|
+
text-indent: 0px;
|
|
38
|
+
text-shadow: none;
|
|
39
|
+
display: inline-block;
|
|
40
|
+
text-align: center;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.copilotKitInput > button:not([disabled]) {
|
|
44
|
+
color: var(--copilot-kit-input-send-button-color);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.copilotKitInput > button:not([disabled]):hover {
|
|
48
|
+
transform: scale(1.1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.copilotKitInput > button[disabled] {
|
|
52
|
+
color: var(--copilot-kit-input-send-button-disabled-color);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.copilotKitInput > textarea {
|
|
56
|
+
width: 100%;
|
|
57
|
+
outline: 2px solid transparent;
|
|
58
|
+
outline-offset: 2px;
|
|
59
|
+
resize: none;
|
|
60
|
+
white-space: pre-wrap;
|
|
61
|
+
overflow-wrap: break-word;
|
|
62
|
+
-webkit-font-smoothing: antialiased;
|
|
63
|
+
-moz-osx-font-smoothing: grayscale;
|
|
64
|
+
cursor: text;
|
|
65
|
+
font-size: 0.875rem;
|
|
66
|
+
line-height: 1.25rem;
|
|
67
|
+
margin: 0;
|
|
68
|
+
padding: 0;
|
|
69
|
+
font-family: inherit;
|
|
70
|
+
font-weight: inherit;
|
|
71
|
+
color: var(--copilot-kit-input-color);
|
|
72
|
+
border: 0px;
|
|
73
|
+
background-color: var(--copilot-kit-input-background-color);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.copilotKitInput > textarea::placeholder {
|
|
77
|
+
color: var(--copilot-kit-input-placeholder-color);
|
|
78
|
+
opacity: 1;
|
|
79
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
.copilotKitMessages {
|
|
2
|
+
overflow-y: scroll;
|
|
3
|
+
flex: 1;
|
|
4
|
+
padding: 1rem 2rem;
|
|
5
|
+
padding-bottom: 3rem;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
background-color: var(--copilot-kit-messages-background-color);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.copilotKitMessages::-webkit-scrollbar {
|
|
12
|
+
width: 9px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.copilotKitMessages::-webkit-scrollbar-thumb {
|
|
16
|
+
background-color: var(--copilot-kit-scrollbar-color);
|
|
17
|
+
border-radius: 10rem;
|
|
18
|
+
border: 2px solid var(--copilot-kit-messages-background-color);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.copilotKitMessages::-webkit-scrollbar-track-piece:start {
|
|
22
|
+
background: transparent;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.copilotKitMessages::-webkit-scrollbar-track-piece:end {
|
|
26
|
+
background: transparent;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.copilotKitMessage {
|
|
30
|
+
border-radius: 0.5rem;
|
|
31
|
+
padding: 1rem;
|
|
32
|
+
font-size: 0.875rem;
|
|
33
|
+
line-height: 1.25rem;
|
|
34
|
+
overflow-wrap: break-word;
|
|
35
|
+
max-width: 80%;
|
|
36
|
+
margin-bottom: 0.5rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.copilotKitMessage.copilotKitUserMessage {
|
|
40
|
+
background: var(--copilot-kit-message-user-background-color);
|
|
41
|
+
color: var(--copilot-kit-message-user-color);
|
|
42
|
+
margin-left: auto;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.copilotKitMessage.copilotKitAssistantMessage {
|
|
46
|
+
background: var(--copilot-kit-message-assistant-background-color);
|
|
47
|
+
color: var(--copilot-kit-message-assistant-color);
|
|
48
|
+
margin-right: auto;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.copilotKitMessage.copilotKitUserMessage + .copilotKitMessage.copilotKitAssistantMessage {
|
|
52
|
+
margin-top: 1.5rem;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.copilotKitMessage.copilotKitAssistantMessage + .copilotKitMessage.copilotKitUserMessage {
|
|
56
|
+
margin-top: 1.5rem;
|
|
57
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.copilotKitPopup {
|
|
2
|
+
position: fixed;
|
|
3
|
+
bottom: 1rem;
|
|
4
|
+
right: 1rem;
|
|
5
|
+
z-index: 30;
|
|
6
|
+
line-height: 1.5;
|
|
7
|
+
-webkit-text-size-adjust: 100%;
|
|
8
|
+
-moz-tab-size: 4;
|
|
9
|
+
-o-tab-size: 4;
|
|
10
|
+
tab-size: 4;
|
|
11
|
+
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
12
|
+
"Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
|
|
13
|
+
"Segoe UI Symbol", "Noto Color Emoji";
|
|
14
|
+
font-feature-settings: normal;
|
|
15
|
+
font-variation-settings: normal;
|
|
16
|
+
touch-action: manipulation;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.copilotKitPopup svg {
|
|
20
|
+
display: inline-block;
|
|
21
|
+
vertical-align: middle;
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.copilotKitResponseButton {
|
|
2
|
+
background-color: var(--copilot-kit-response-button-background-color);
|
|
3
|
+
border: 1px solid var(--copilot-kit-response-button-border-color);
|
|
4
|
+
border-radius: 4px;
|
|
5
|
+
color: var(--copilot-kit-response-button-color);
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
font-size: 14px;
|
|
8
|
+
font-weight: 500;
|
|
9
|
+
height: 32px;
|
|
10
|
+
line-height: 30px;
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding: 0 16px;
|
|
13
|
+
text-align: center;
|
|
14
|
+
text-decoration: none;
|
|
15
|
+
text-transform: none;
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
position: absolute;
|
|
18
|
+
left: 50%;
|
|
19
|
+
transform: translateX(-50%);
|
|
20
|
+
top: -44px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.copilotKitResponseButton:hover {
|
|
24
|
+
filter: brightness(95%);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.copilotKitResponseButton > span {
|
|
28
|
+
margin-right: 0.5rem;
|
|
29
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.copilotKitSidebar {
|
|
2
|
+
position: fixed;
|
|
3
|
+
bottom: 1rem;
|
|
4
|
+
right: 1rem;
|
|
5
|
+
z-index: 30;
|
|
6
|
+
line-height: 1.5;
|
|
7
|
+
-webkit-text-size-adjust: 100%;
|
|
8
|
+
-moz-tab-size: 4;
|
|
9
|
+
-o-tab-size: 4;
|
|
10
|
+
tab-size: 4;
|
|
11
|
+
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
12
|
+
"Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
|
|
13
|
+
"Segoe UI Symbol", "Noto Color Emoji";
|
|
14
|
+
font-feature-settings: normal;
|
|
15
|
+
font-variation-settings: normal;
|
|
16
|
+
touch-action: manipulation;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.copilotKitSidebar svg {
|
|
20
|
+
display: inline-block;
|
|
21
|
+
vertical-align: middle;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.copilotKitSidebarContentWrapper {
|
|
25
|
+
overflow: visible;
|
|
26
|
+
margin-right: 0px;
|
|
27
|
+
transition: margin-right 0.3s ease;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media (min-width: 640px) {
|
|
31
|
+
.copilotKitSidebarContentWrapper.sidebarExpanded {
|
|
32
|
+
margin-right: 24rem;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
.copilotKitWindow {
|
|
2
|
+
position: fixed;
|
|
3
|
+
inset: 0px;
|
|
4
|
+
transform-origin: bottom;
|
|
5
|
+
border-color: rgb(229 231 235);
|
|
6
|
+
background-color: rgb(255 255 255);
|
|
7
|
+
border-radius: 0.75rem;
|
|
8
|
+
box-shadow: rgba(0, 0, 0, 0.16) 0px 5px 40px;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
transition: opacity 100ms ease-out, transform 200ms ease-out;
|
|
11
|
+
opacity: 0;
|
|
12
|
+
transform: scale(0.95) translateY(20px);
|
|
13
|
+
display: flex;
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.copilotKitSidebar .copilotKitWindow {
|
|
18
|
+
border-radius: 0;
|
|
19
|
+
opacity: 1;
|
|
20
|
+
transform: translateX(100%);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.copilotKitWindow.open {
|
|
24
|
+
opacity: 1;
|
|
25
|
+
transform: scale(1) translateY(0);
|
|
26
|
+
pointer-events: auto;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.copilotKitSidebar .copilotKitWindow.open {
|
|
30
|
+
transform: translateX(0);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media (min-width: 640px) {
|
|
34
|
+
.copilotKitWindow {
|
|
35
|
+
transform-origin: bottom right;
|
|
36
|
+
bottom: 5rem;
|
|
37
|
+
right: 1rem;
|
|
38
|
+
top: auto;
|
|
39
|
+
left: auto;
|
|
40
|
+
border-width: 0px;
|
|
41
|
+
margin-bottom: 1rem;
|
|
42
|
+
width: 24rem;
|
|
43
|
+
height: 600px;
|
|
44
|
+
min-height: 200px;
|
|
45
|
+
max-height: calc(100% - 6rem);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.copilotKitSidebar .copilotKitWindow {
|
|
49
|
+
bottom: 0;
|
|
50
|
+
right: 0;
|
|
51
|
+
top: auto;
|
|
52
|
+
left: auto;
|
|
53
|
+
width: 28rem;
|
|
54
|
+
min-height: 100%;
|
|
55
|
+
margin-bottom: 0;
|
|
56
|
+
max-height: none;
|
|
57
|
+
}
|
|
58
|
+
}
|
package/src/styles.css
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
@import "./css/colors.css";
|
|
2
|
+
@import "./css/popup.css";
|
|
3
|
+
@import "./css/sidebar.css";
|
|
4
|
+
@import "./css/button.css";
|
|
5
|
+
@import "./css/header.css";
|
|
6
|
+
@import "./css/input.css";
|
|
7
|
+
@import "./css/messages.css";
|
|
8
|
+
@import "./css/window.css";
|
|
9
|
+
@import "./css/animations.css";
|
|
10
|
+
@import "./css/response.css";
|
|
11
|
+
|
|
1
12
|
@tailwind base;
|
|
2
13
|
@tailwind components;
|
|
3
14
|
@tailwind utilities;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/sidebar/copilot-sidebar.tsx"],"names":[],"mappings":";;;;;;;;AAoBA,SAAS,iBAAiB;AAVtB,SAIE,KAJF;AAFG,SAAS,eAAe,OAAkC;AAC/D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAO;AAAA,MAEvC;AAAA,4BAAC,2BAAW,MAAO;AAAA,QACnB,oBAAC,eAAY,mBAAmB,MAAM,mBAAmB;AAAA;AAAA;AAAA,EAC3D;AAEJ;AAIA,SAAS,OAAO,OAAkC;AAChD,SACE,qBAAC,SAAI,WAAU,0DACb;AAAA,wBAAC,QAAG,WAAU,mDAAkD,0BAAY;AAAA,IAC5E,oBAAC,SAAI,WAAU,8BACb;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,WAAU;AAAA,QACV,SAAS,MAAM,MAAM,eAAe,KAAK;AAAA,QAEzC;AAAA,8BAAC,UAAK,WAAU,WAAU,yBAAW;AAAA,UACrC,oBAAC,aAAU,WAAU,WAAU,eAAY,QAAO;AAAA;AAAA;AAAA,IACpD,GACF;AAAA,KACF;AAEJ","sourcesContent":["import React from \"react\";\nimport { CopilotChat } from \"../chat-components/copilot-chat\";\n\nexport interface SidebarProps {\n setSidebarOpen: (open: boolean) => void;\n makeSystemMessage?: (contextString: string) => string;\n}\n\nexport function CopilotSidebar(props: SidebarProps): JSX.Element {\n return (\n <div\n className=\"shadow-lg bg-gray-50 flex flex-col border-l-2\"\n style={{ width: \"100%\", height: \"100%\" }}\n >\n <TopBar {...props} />\n <CopilotChat makeSystemMessage={props.makeSystemMessage} />\n </div>\n );\n}\n\nimport { XMarkIcon } from \"@heroicons/react/24/outline\";\n\nfunction TopBar(props: SidebarProps): JSX.Element {\n return (\n <div className=\"py-6 flex bg-gray-50 items-center justify-between px-4\">\n <h1 className=\"text-base font-semibold leading-6 text-gray-900\">Copilot Chat</h1>\n <div className=\"ml-3 flex h-7 items-center\">\n <button\n type=\"button\"\n className=\"rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2\"\n onClick={() => props.setSidebarOpen(false)}\n >\n <span className=\"sr-only\">Close panel</span>\n <XMarkIcon className=\"h-6 w-6\" aria-hidden=\"true\" />\n </button>\n </div>\n </div>\n );\n}\n"]}
|
package/dist/chunk-U6NJWGTV.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/sidebar/copilot-sidebar-ui-provider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,SAA2B,mBAAmB;AAC9C,SAAS,gBAAgB;AAmBnB,mBAkBM,KAjBJ,YADF;AATC,SAAS,yBAAyB,IAAuD;AAAvD,eAAE,WAX3C,IAWyC,IAAe,kBAAf,IAAe,CAAb;AACzC,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,IAAI;AAEnD,QAAM,gBAAgB,YAAY,MAAM;AACtC,mBAAe,CAAC,SAAS,CAAC,IAAI;AAAA,EAChC,GAAG,CAAC,CAAC;AAEL,SACE,oBAAC,sBAAsB,UAAtB,EAA+B,OAAO,EAAE,eAAe,aAAa,cAAc,GACjF,0CACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,QACL,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,UAAU;AAAA,MACZ;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,cACL,WAAW;AAAA,cACX,WAAW;AAAA,cACX,QAAQ;AAAA,cACR,OAAO,cAAc,uBAAuB;AAAA,cAC5C,UAAU;AAAA,cACV,YAAY;AAAA;AAAA,YACd;AAAA,YAEA,8BAAC,UAAM,UAAS;AAAA;AAAA,QAClB;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,cACL,WAAW;AAAA,cACX,QAAQ;AAAA,cACR,OAAO;AAAA,cACP,UAAU;AAAA,cACV,OAAO,cAAc,MAAM;AAAA,cAC3B,YAAY;AAAA,YACd;AAAA,YAEA,8BAAC,mBACC;AAAA,cAAC;AAAA;AAAA,gBACC;AAAA,gBACA,mBAAmB,MAAM;AAAA;AAAA,YAC3B,GACF;AAAA;AAAA,QACF;AAAA,QACC,CAAC,eACA;AAAA,UAAC;AAAA;AAAA,YACC,SAAS;AAAA,YACT,OAAO;AAAA,cACL,UAAU;AAAA,cACV,KAAK;AAAA,cACL,OAAO;AAAA,cACP,WAAW;AAAA,cACX,YAAY;AAAA,YACd;AAAA,YACA,WAAU;AAAA,YACX;AAAA;AAAA,QAED;AAAA;AAAA;AAAA,EAEJ,GACF,GACF;AAEJ","sourcesContent":["import React, { ReactNode, useCallback } from \"react\";\nimport { useState } from \"react\";\nimport { CopilotSidebar } from \"./copilot-sidebar\";\nimport { CopilotSidebarContext } from \"./sidebar-context\";\nimport { TooltipProvider } from \"../chat-components/ui/tooltip\";\n\nexport interface CopilotSidebarUIProviderProps {\n children: ReactNode;\n makeSystemMessage?: (contextString: string) => string;\n}\n\nexport function CopilotSidebarUIProvider({ children, ...props }: CopilotSidebarUIProviderProps) {\n const [sidebarOpen, setSidebarOpen] = useState(true);\n\n const toggleSidebar = useCallback(() => {\n setSidebarOpen((prev) => !prev);\n }, []);\n\n return (\n <CopilotSidebarContext.Provider value={{ isSidebarOpen: sidebarOpen, toggleSidebar }}>\n <>\n <div\n style={{\n height: \"100vh\",\n width: \"100vw\",\n position: \"relative\",\n }}\n >\n <div\n style={{\n overflowY: \"auto\",\n overflowX: \"hidden\",\n height: \"100%\",\n width: sidebarOpen ? \"calc(100% - 450px)\" : \"100%\",\n position: \"absolute\",\n transition: \"width 0.5s ease-in-out\", // New\n }}\n >\n <main>{children}</main>\n </div>\n <div\n style={{\n overflowY: \"auto\",\n height: \"100%\",\n width: \"450px\",\n position: \"absolute\",\n right: sidebarOpen ? \"0\" : \"-450px\",\n transition: \"right 0.5s ease-in-out\",\n }}\n >\n <TooltipProvider>\n <CopilotSidebar\n setSidebarOpen={setSidebarOpen}\n makeSystemMessage={props.makeSystemMessage}\n />\n </TooltipProvider>\n </div>\n {!sidebarOpen && (\n <button\n onClick={toggleSidebar}\n style={{\n position: \"absolute\",\n top: \"5%\",\n right: \"20px\",\n transform: \"translateY(-50%)\",\n transition: \"opacity 0.5s ease-in-out\",\n }}\n className=\"bg-slate-100 ring-2 ring-slate-600 font-semibold text-black p-2 rounded-lg shadow-lg\"\n >\n Open Copilot\n </button>\n )}\n </div>\n </>\n </CopilotSidebarContext.Provider>\n );\n}\n"]}
|
|
File without changes
|