@gravity-ui/aikit 1.6.0 → 1.8.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/README.md +0 -2
- package/dist/adapters/openai/helpers/mapOpenAIConversationsToChats.d.ts +3 -0
- package/dist/adapters/openai/helpers/mapOpenAIConversationsToChats.js +22 -0
- package/dist/adapters/openai/index.d.ts +5 -2
- package/dist/adapters/openai/index.js +2 -0
- package/dist/adapters/openai/types/index.d.ts +4 -1
- package/dist/adapters/openai/types/openAiTypes.d.ts +6 -0
- package/dist/adapters/openai/useOpenAIConversationsAdapter.d.ts +9 -0
- package/dist/adapters/openai/useOpenAIConversationsAdapter.js +15 -0
- package/dist/adapters/openai/useOpenAIResponsesAdapter.d.ts +1 -1
- package/dist/adapters/openai/useOpenAIResponsesAdapter.js +3 -3
- package/dist/components/atoms/Alert/Alert.css +28 -0
- package/dist/components/atoms/ChatDate/ChatDate.css +9 -0
- package/dist/components/atoms/ContextIndicator/ContextIndicator.css +66 -0
- package/dist/components/atoms/DiffStat/DiffStat.css +23 -0
- package/dist/components/atoms/Disclaimer/Disclaimer.css +7 -0
- package/dist/components/atoms/IntersectionContainer/IntersectionContainer.css +3 -0
- package/dist/components/atoms/Loader/Loader.css +48 -0
- package/dist/components/atoms/MarkdownRenderer/MarkdownRenderer.css +5 -0
- package/dist/components/atoms/MessageBalloon/MessageBalloon.css +7 -0
- package/dist/components/atoms/Shimmer/Shimmer.css +18 -0
- package/dist/components/atoms/SubmitButton/SubmitButton.css +20 -0
- package/dist/components/atoms/ToolIndicator/ToolIndicator.css +9 -0
- package/dist/components/molecules/BaseMessage/BaseMessage.css +26 -0
- package/dist/components/molecules/ButtonGroup/ButtonGroup.css +13 -0
- package/dist/components/molecules/PromptInputBody/PromptInputBody.css +15 -0
- package/dist/components/molecules/PromptInputFooter/PromptInputFooter.css +18 -0
- package/dist/components/molecules/PromptInputHeader/PromptInputHeader.css +21 -0
- package/dist/components/molecules/PromptInputPanel/PromptInputPanel.css +7 -0
- package/dist/components/molecules/Suggestions/Suggestions.css +71 -0
- package/dist/components/molecules/Tabs/Tabs.css +35 -0
- package/dist/components/molecules/ToolFooter/ToolFooter.css +10 -0
- package/dist/components/molecules/ToolHeader/ToolHeader.css +18 -0
- package/dist/components/molecules/ToolStatus/ToolStatus.css +1 -0
- package/dist/components/organisms/AssistantMessage/AssistantMessage.css +6 -0
- package/dist/components/organisms/Header/Header.css +40 -0
- package/dist/components/organisms/MessageList/MessageList.css +26 -0
- package/dist/components/organisms/PromptInput/PromptInput.css +50 -0
- package/dist/components/organisms/ThinkingMessage/ThinkingMessage.css +20 -0
- package/dist/components/organisms/ToolMessage/ToolMessage.css +13 -0
- package/dist/components/organisms/UserMessage/UserMessage.css +10 -0
- package/dist/components/pages/ChatContainer/ChatContainer.css +49 -0
- package/dist/components/templates/ChatContent/ChatContent.css +23 -0
- package/dist/components/templates/EmptyContainer/EmptyContainer.css +64 -0
- package/dist/components/templates/History/History.css +81 -0
- package/dist/demo/ContentWrapper/ContentWrapper.css +6 -0
- package/dist/demo/DocsDecorator/DocsDecorator.css +87 -0
- package/dist/demo/Showcase/Showcase.css +34 -0
- package/dist/demo/ShowcaseItem/ShowcaseItem.css +7 -0
- package/dist/demo/SwapArea/SwapArea.css +11 -0
- package/dist/styles/variables.css +1 -0
- package/package.json +5 -5
- package/dist/components/atoms/Alert/Alert.scss +0 -39
- package/dist/components/atoms/ChatDate/ChatDate.scss +0 -15
- package/dist/components/atoms/ContextIndicator/ContextIndicator.scss +0 -93
- package/dist/components/atoms/DiffStat/DiffStat.scss +0 -36
- package/dist/components/atoms/Disclaimer/Disclaimer.scss +0 -13
- package/dist/components/atoms/IntersectionContainer/IntersectionContainer.scss +0 -7
- package/dist/components/atoms/Loader/Loader.scss +0 -72
- package/dist/components/atoms/MarkdownRenderer/MarkdownRenderer.scss +0 -10
- package/dist/components/atoms/MessageBalloon/MessageBalloon.scss +0 -11
- package/dist/components/atoms/Shimmer/Shimmer.scss +0 -32
- package/dist/components/atoms/SubmitButton/SubmitButton.scss +0 -29
- package/dist/components/atoms/ToolIndicator/ToolIndicator.scss +0 -15
- package/dist/components/molecules/BaseMessage/BaseMessage.scss +0 -41
- package/dist/components/molecules/ButtonGroup/ButtonGroup.scss +0 -19
- package/dist/components/molecules/PromptInputBody/PromptInputBody.scss +0 -22
- package/dist/components/molecules/PromptInputFooter/PromptInputFooter.scss +0 -25
- package/dist/components/molecules/PromptInputHeader/PromptInputHeader.scss +0 -27
- package/dist/components/molecules/PromptInputPanel/PromptInputPanel.scss +0 -11
- package/dist/components/molecules/Suggestions/Suggestions.scss +0 -90
- package/dist/components/molecules/Tabs/Tabs.scss +0 -46
- package/dist/components/molecules/ToolFooter/ToolFooter.scss +0 -15
- package/dist/components/molecules/ToolHeader/ToolHeader.scss +0 -24
- package/dist/components/molecules/ToolStatus/ToolStatus.scss +0 -6
- package/dist/components/organisms/AssistantMessage/AssistantMessage.scss +0 -10
- package/dist/components/organisms/Header/Header.scss +0 -51
- package/dist/components/organisms/MessageList/MessageList.scss +0 -35
- package/dist/components/organisms/PromptInput/PromptInput.scss +0 -77
- package/dist/components/organisms/ThinkingMessage/ThinkingMessage.scss +0 -27
- package/dist/components/organisms/ToolMessage/ToolMessage.scss +0 -19
- package/dist/components/organisms/UserMessage/UserMessage.scss +0 -14
- package/dist/components/pages/ChatContainer/ChatContainer.scss +0 -60
- package/dist/components/templates/ChatContent/ChatContent.scss +0 -30
- package/dist/components/templates/EmptyContainer/EmptyContainer.scss +0 -86
- package/dist/components/templates/History/History.scss +0 -103
- package/dist/styles/_functions.scss +0 -5
- package/dist/styles/variables.scss +0 -1
- /package/dist/styles/{styles.scss → styles.css} +0 -0
package/README.md
CHANGED
|
@@ -185,10 +185,8 @@ If you're on Linux, you can run tests locally:
|
|
|
185
185
|
```bash
|
|
186
186
|
# Install Playwright browsers (run once)
|
|
187
187
|
npm run playwright:install
|
|
188
|
-
|
|
189
188
|
# Run all component tests
|
|
190
189
|
npm run playwright
|
|
191
|
-
|
|
192
190
|
# Update screenshot baselines
|
|
193
191
|
npm run playwright:update
|
|
194
192
|
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const DEFAULT_CHAT_NAME = 'Chat';
|
|
2
|
+
function getConversationName(metadata) {
|
|
3
|
+
var _a;
|
|
4
|
+
const title = (_a = metadata === null || metadata === void 0 ? void 0 : metadata.title) !== null && _a !== void 0 ? _a : metadata === null || metadata === void 0 ? void 0 : metadata.name;
|
|
5
|
+
return title && title.trim() ? title.trim() : DEFAULT_CHAT_NAME;
|
|
6
|
+
}
|
|
7
|
+
export function mapOpenAIConversationsToChats(conversations) {
|
|
8
|
+
if (!Array.isArray(conversations)) {
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
return conversations.map((conv) => {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
const createTime = conv.created_at ? new Date(conv.created_at * 1000).toISOString() : null;
|
|
14
|
+
return {
|
|
15
|
+
id: conv.id,
|
|
16
|
+
name: getConversationName(conv.metadata),
|
|
17
|
+
createTime,
|
|
18
|
+
lastMessage: ((_a = conv.metadata) === null || _a === void 0 ? void 0 : _a.last_message) || undefined,
|
|
19
|
+
metadata: (_b = conv.metadata) !== null && _b !== void 0 ? _b : undefined,
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export { fetchResponseToStreamEvents } from './helpers/fetchResponseToStreamEvents';
|
|
2
2
|
export { getTextDeltaFromStreamEvent } from './helpers/getTextDeltaFromStreamEvent';
|
|
3
3
|
export { isFetchResponse } from './helpers/isFetchResponse';
|
|
4
|
+
export { mapOpenAIConversationsToChats } from './helpers/mapOpenAIConversationsToChats';
|
|
4
5
|
export { isOutputItemDoneEvent } from './helpers/isOutputItemDoneEvent';
|
|
5
6
|
export { isStreamEndOrErrorEvent } from './helpers/isStreamEndOrErrorEvent';
|
|
6
7
|
export { openAIResponseToMessages } from './helpers/openAIResponseToMessages';
|
|
8
|
+
export { useOpenAIConversationsAdapter } from './useOpenAIConversationsAdapter';
|
|
7
9
|
export { useOpenAIResponsesAdapter, useOpenAIStreamAdapter } from './useOpenAIResponsesAdapter';
|
|
8
|
-
export type { OpenAIStreamAdapterOptions, OpenAIStreamAdapterResult, OpenAIStreamSource, } from './types';
|
|
10
|
+
export type { OpenAIStreamAdapterOptions, OpenAIStreamAdapterResult, OpenAIStreamAdapterStatus, OpenAIStreamSource, } from './types';
|
|
9
11
|
export type { FetchResponseLike, OpenAIStreamEventLike } from './types';
|
|
10
|
-
export type { OpenAIResponseLike } from './types/openAiTypes';
|
|
12
|
+
export type { OpenAIResponseLike, OpenAIConversationLike } from './types/openAiTypes';
|
|
13
|
+
export type { OpenAIConversationsListResponseLike, UseOpenAIConversationsAdapterResult, } from './useOpenAIConversationsAdapter';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { fetchResponseToStreamEvents } from './helpers/fetchResponseToStreamEvents';
|
|
2
2
|
export { getTextDeltaFromStreamEvent } from './helpers/getTextDeltaFromStreamEvent';
|
|
3
3
|
export { isFetchResponse } from './helpers/isFetchResponse';
|
|
4
|
+
export { mapOpenAIConversationsToChats } from './helpers/mapOpenAIConversationsToChats';
|
|
4
5
|
export { isOutputItemDoneEvent } from './helpers/isOutputItemDoneEvent';
|
|
5
6
|
export { isStreamEndOrErrorEvent } from './helpers/isStreamEndOrErrorEvent';
|
|
6
7
|
export { openAIResponseToMessages } from './helpers/openAIResponseToMessages';
|
|
8
|
+
export { useOpenAIConversationsAdapter } from './useOpenAIConversationsAdapter';
|
|
7
9
|
export { useOpenAIResponsesAdapter, useOpenAIStreamAdapter } from './useOpenAIResponsesAdapter';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TChatMessage } from '../../../types';
|
|
2
|
+
import type { ChatStatus } from '../../../types/chat';
|
|
2
3
|
import type { OpenAIStreamEventLike } from './openAiTypes';
|
|
3
4
|
export type FetchResponseLike = {
|
|
4
5
|
body?: ReadableStream<Uint8Array> | null;
|
|
@@ -12,9 +13,11 @@ export type OpenAIStreamAdapterOptions = {
|
|
|
12
13
|
assistantMessageId?: string;
|
|
13
14
|
onStreamEnd?: (messages: TChatMessage[]) => void;
|
|
14
15
|
};
|
|
16
|
+
/** Status from useOpenAIStreamAdapter. Subset of ChatStatus (no 'submitted'); safe to pass to ChatContainer. */
|
|
17
|
+
export type OpenAIStreamAdapterStatus = Exclude<ChatStatus, 'submitted'>;
|
|
15
18
|
export type OpenAIStreamAdapterResult = {
|
|
16
19
|
messages: TChatMessage[];
|
|
17
|
-
status:
|
|
20
|
+
status: OpenAIStreamAdapterStatus;
|
|
18
21
|
error: Error | null;
|
|
19
22
|
};
|
|
20
23
|
export type OpenAIStreamSource = AsyncIterable<OpenAIStreamEventLike> | FetchResponseLike;
|
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
* raw SSE and partial API responses.
|
|
7
7
|
*/
|
|
8
8
|
import type { ResponseOutputRefusal, ResponseOutputText } from 'openai/resources/responses/responses';
|
|
9
|
+
export type OpenAIConversationLike = {
|
|
10
|
+
id: string;
|
|
11
|
+
created_at: number;
|
|
12
|
+
metadata?: Record<string, string> | null;
|
|
13
|
+
object?: 'conversation';
|
|
14
|
+
};
|
|
9
15
|
/** Minimal response shape (Response subset); all optional for partial/SSE. */
|
|
10
16
|
export type OpenAIResponseLike = {
|
|
11
17
|
id?: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChatType } from '../../types';
|
|
2
|
+
import type { OpenAIConversationLike } from './types/openAiTypes';
|
|
3
|
+
export type OpenAIConversationsListResponseLike = {
|
|
4
|
+
data?: OpenAIConversationLike[] | null;
|
|
5
|
+
};
|
|
6
|
+
export type UseOpenAIConversationsAdapterResult = {
|
|
7
|
+
chats: ChatType[];
|
|
8
|
+
};
|
|
9
|
+
export declare function useOpenAIConversationsAdapter(conversations: OpenAIConversationLike[] | OpenAIConversationsListResponseLike | null | undefined): UseOpenAIConversationsAdapterResult;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { mapOpenAIConversationsToChats } from './helpers/mapOpenAIConversationsToChats';
|
|
3
|
+
function getConversationsList(input) {
|
|
4
|
+
var _a;
|
|
5
|
+
if (!input || Array.isArray(input))
|
|
6
|
+
return input;
|
|
7
|
+
if (typeof input === 'object' && 'data' in input)
|
|
8
|
+
return (_a = input.data) !== null && _a !== void 0 ? _a : null;
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
export function useOpenAIConversationsAdapter(conversations) {
|
|
12
|
+
const list = getConversationsList(conversations);
|
|
13
|
+
const chats = useMemo(() => mapOpenAIConversationsToChats(list), [list]);
|
|
14
|
+
return { chats };
|
|
15
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TChatMessage } from '../../types';
|
|
2
2
|
import type { OpenAIStreamAdapterOptions, OpenAIStreamAdapterResult, OpenAIStreamSource } from './types';
|
|
3
3
|
import { OpenAIResponseLike } from './types/openAiTypes';
|
|
4
|
-
export type { OpenAIStreamAdapterOptions, OpenAIStreamAdapterResult, OpenAIStreamSource, } from './types';
|
|
4
|
+
export type { OpenAIStreamAdapterOptions, OpenAIStreamAdapterResult, OpenAIStreamAdapterStatus, OpenAIStreamSource, } from './types';
|
|
5
5
|
/** Single non-streaming response → TChatMessage[]. For streaming use useOpenAIStreamAdapter. */
|
|
6
6
|
export declare function useOpenAIResponsesAdapter(response: OpenAIResponseLike | null): TChatMessage[];
|
|
7
7
|
/**
|
|
@@ -19,12 +19,12 @@ export function useOpenAIStreamAdapter(stream, options = {}) {
|
|
|
19
19
|
const initialMessagesRef = useRef(initialMessages);
|
|
20
20
|
initialMessagesRef.current = initialMessages;
|
|
21
21
|
const [messages, setMessages] = useState(initialMessages);
|
|
22
|
-
const [status, setStatus] = useState('
|
|
22
|
+
const [status, setStatus] = useState('ready');
|
|
23
23
|
const [error, setError] = useState(null);
|
|
24
24
|
const assistantMessageId = useMemo(() => optionId !== null && optionId !== void 0 ? optionId : `assistant-${Date.now()}`, [optionId]);
|
|
25
25
|
useEffect(() => {
|
|
26
26
|
if (!stream) {
|
|
27
|
-
setStatus('
|
|
27
|
+
setStatus('ready');
|
|
28
28
|
setError(null);
|
|
29
29
|
return undefined;
|
|
30
30
|
}
|
|
@@ -68,7 +68,7 @@ export function useOpenAIStreamAdapter(stream, options = {}) {
|
|
|
68
68
|
},
|
|
69
69
|
onEnd: (finalMessages, s, err) => {
|
|
70
70
|
var _a;
|
|
71
|
-
setStatus(s);
|
|
71
|
+
setStatus(s === 'done' ? 'ready' : s);
|
|
72
72
|
setError(err !== null && err !== void 0 ? err : null);
|
|
73
73
|
(_a = onStreamEndRef.current) === null || _a === void 0 ? void 0 : _a.call(onStreamEndRef, finalMessages);
|
|
74
74
|
},
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.g-aikit-alert {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--g-spacing-2);
|
|
5
|
+
}
|
|
6
|
+
.g-aikit-alert__header {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: var(--g-spacing-2);
|
|
10
|
+
}
|
|
11
|
+
.g-aikit-alert__text {
|
|
12
|
+
flex: 1;
|
|
13
|
+
}
|
|
14
|
+
.g-aikit-alert__icon {
|
|
15
|
+
flex-shrink: 0;
|
|
16
|
+
}
|
|
17
|
+
.g-aikit-alert__icon_variant_error {
|
|
18
|
+
color: var(--g-color-text-danger);
|
|
19
|
+
}
|
|
20
|
+
.g-aikit-alert__icon_variant_warning {
|
|
21
|
+
color: var(--g-color-text-warning-heavy);
|
|
22
|
+
}
|
|
23
|
+
.g-aikit-alert__icon_variant_info {
|
|
24
|
+
color: var(--g-color-text-info);
|
|
25
|
+
}
|
|
26
|
+
.g-aikit-alert__action {
|
|
27
|
+
margin-left: auto;
|
|
28
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
.g-aikit-chat-date {
|
|
2
|
+
color: var(--g-color-text-secondary);
|
|
3
|
+
font-family: var(--g-text-body-font-family);
|
|
4
|
+
font-size: var(--g-text-body-1-font-size);
|
|
5
|
+
font-style: normal;
|
|
6
|
+
font-weight: var(--g-text-body-font-weight);
|
|
7
|
+
line-height: var(--g-text-body-1-line-height);
|
|
8
|
+
display: inline-block;
|
|
9
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
.g-aikit-context-indicator__container {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
}
|
|
7
|
+
.g-aikit-context-indicator__container_orientation_horizontal {
|
|
8
|
+
flex-direction: row;
|
|
9
|
+
}
|
|
10
|
+
.g-aikit-context-indicator__container_orientation_horizontal.g-aikit-context-indicator__container_reversed {
|
|
11
|
+
flex-direction: row-reverse;
|
|
12
|
+
}
|
|
13
|
+
.g-aikit-context-indicator__container_orientation_vertical {
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
}
|
|
16
|
+
.g-aikit-context-indicator__container_orientation_vertical.g-aikit-context-indicator__container_reversed {
|
|
17
|
+
flex-direction: column-reverse;
|
|
18
|
+
}
|
|
19
|
+
.g-aikit-context-indicator__progress {
|
|
20
|
+
--percentage: 0;
|
|
21
|
+
--progress-color: var(--g-aikit-ci-color-progress-1);
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
width: 16px;
|
|
26
|
+
height: 16px;
|
|
27
|
+
border-radius: 50%;
|
|
28
|
+
position: relative;
|
|
29
|
+
}
|
|
30
|
+
.g-aikit-context-indicator__progress::before {
|
|
31
|
+
content: "";
|
|
32
|
+
position: absolute;
|
|
33
|
+
inset: 0;
|
|
34
|
+
border-radius: 50%;
|
|
35
|
+
opacity: 0.3;
|
|
36
|
+
background: var(--progress-color);
|
|
37
|
+
opacity: 0.3;
|
|
38
|
+
}
|
|
39
|
+
.g-aikit-context-indicator__progress::after {
|
|
40
|
+
content: "";
|
|
41
|
+
position: absolute;
|
|
42
|
+
inset: 0;
|
|
43
|
+
border-radius: 50%;
|
|
44
|
+
opacity: 1;
|
|
45
|
+
background: conic-gradient(var(--progress-color) 0deg, var(--progress-color) calc(3.6deg * var(--percentage)), transparent calc(3.6deg * var(--percentage)), transparent 360deg);
|
|
46
|
+
}
|
|
47
|
+
.g-aikit-context-indicator__inner {
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
width: calc(100% - 4px);
|
|
50
|
+
height: calc(100% - 4px);
|
|
51
|
+
border-radius: 50%;
|
|
52
|
+
background: var(--g-aikit-color-bg-primary);
|
|
53
|
+
position: relative;
|
|
54
|
+
z-index: 1;
|
|
55
|
+
}
|
|
56
|
+
.g-aikit-context-indicator__value {
|
|
57
|
+
color: var(--g-color-text-primary);
|
|
58
|
+
font-family: var(--g-text-body-font-family);
|
|
59
|
+
font-size: var(--g-text-body-1-font-size);
|
|
60
|
+
font-style: normal;
|
|
61
|
+
font-weight: var(--g-text-body-font-weight);
|
|
62
|
+
line-height: var(--g-text-body-1-line-height);
|
|
63
|
+
}
|
|
64
|
+
.g-aikit-context-indicator__value::after {
|
|
65
|
+
content: "%";
|
|
66
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.g-aikit-diff-stat {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 4px;
|
|
5
|
+
color: var(--g-color-text-danger);
|
|
6
|
+
font-family: var(--g-text-code-font-family);
|
|
7
|
+
font-size: var(--g-text-code-inline-1);
|
|
8
|
+
font-style: normal;
|
|
9
|
+
font-weight: var(--g-text-code-font-weight);
|
|
10
|
+
line-height: var(--g-text-code-inline-1-line-height);
|
|
11
|
+
}
|
|
12
|
+
.g-aikit-diff-stat__added {
|
|
13
|
+
color: var(--g-color-text-positive-heavy);
|
|
14
|
+
}
|
|
15
|
+
.g-aikit-diff-stat__added_allow_sign::before {
|
|
16
|
+
content: "+";
|
|
17
|
+
}
|
|
18
|
+
.g-aikit-diff-stat__deleted {
|
|
19
|
+
color: var(--g-color-text-danger);
|
|
20
|
+
}
|
|
21
|
+
.g-aikit-diff-stat__deleted_allow_sign::before {
|
|
22
|
+
content: "-";
|
|
23
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
@keyframes pulse {
|
|
2
|
+
100% {
|
|
3
|
+
opacity: 0;
|
|
4
|
+
}
|
|
5
|
+
50% {
|
|
6
|
+
opacity: 70%;
|
|
7
|
+
}
|
|
8
|
+
0% {
|
|
9
|
+
opacity: 40%;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
.g-aikit-loader {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: var(--g-spacing-1);
|
|
16
|
+
}
|
|
17
|
+
.g-aikit-loader__left, .g-aikit-loader__center, .g-aikit-loader__right {
|
|
18
|
+
background: var(--g-color-text-secondary);
|
|
19
|
+
border-radius: 50%;
|
|
20
|
+
animation: pulse ease 800ms infinite;
|
|
21
|
+
}
|
|
22
|
+
.g-aikit-loader_size_xs .g-aikit-loader__left,
|
|
23
|
+
.g-aikit-loader_size_xs .g-aikit-loader__center,
|
|
24
|
+
.g-aikit-loader_size_xs .g-aikit-loader__right {
|
|
25
|
+
width: 3px;
|
|
26
|
+
height: 3px;
|
|
27
|
+
}
|
|
28
|
+
.g-aikit-loader_size_s .g-aikit-loader__left,
|
|
29
|
+
.g-aikit-loader_size_s .g-aikit-loader__center,
|
|
30
|
+
.g-aikit-loader_size_s .g-aikit-loader__right {
|
|
31
|
+
width: 5px;
|
|
32
|
+
height: 5px;
|
|
33
|
+
}
|
|
34
|
+
.g-aikit-loader_size_m .g-aikit-loader__left,
|
|
35
|
+
.g-aikit-loader_size_m .g-aikit-loader__center,
|
|
36
|
+
.g-aikit-loader_size_m .g-aikit-loader__right {
|
|
37
|
+
width: 8px;
|
|
38
|
+
height: 8px;
|
|
39
|
+
}
|
|
40
|
+
.g-aikit-loader__left {
|
|
41
|
+
animation-delay: 200ms;
|
|
42
|
+
}
|
|
43
|
+
.g-aikit-loader__center {
|
|
44
|
+
animation-delay: 400ms;
|
|
45
|
+
}
|
|
46
|
+
.g-aikit-loader__right {
|
|
47
|
+
animation-delay: 600ms;
|
|
48
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.g-aikit-shimmer__container {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
color: var(--g-aikit-text-primary, inherit);
|
|
5
|
+
mask-image: linear-gradient(90deg, var(--g-aikit-shimmer-color-from) 0%, var(--g-aikit-shimmer-color-from) 40%, var(--g-aikit-shimmer-color-to) 50%, var(--g-aikit-shimmer-color-from) 60%, var(--g-aikit-shimmer-color-from) 100%);
|
|
6
|
+
mask-size: var(--g-aikit-shimmer-gradient-size) 100%;
|
|
7
|
+
mask-clip: text;
|
|
8
|
+
animation: shimmer var(--g-aikit-shimmer-duration) infinite linear;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@keyframes shimmer {
|
|
12
|
+
0% {
|
|
13
|
+
mask-position: 200% 50%;
|
|
14
|
+
}
|
|
15
|
+
100% {
|
|
16
|
+
mask-position: 0% 50%;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.g-aikit-submit-button {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: center;
|
|
4
|
+
align-items: center;
|
|
5
|
+
}
|
|
6
|
+
.g-aikit-submit-button_size_s.g-aikit-submit-button_loading {
|
|
7
|
+
padding: 4px;
|
|
8
|
+
}
|
|
9
|
+
.g-aikit-submit-button_size_m.g-aikit-submit-button_loading {
|
|
10
|
+
padding: 6px;
|
|
11
|
+
}
|
|
12
|
+
.g-aikit-submit-button_size_l.g-aikit-submit-button_loading {
|
|
13
|
+
padding: 10px;
|
|
14
|
+
}
|
|
15
|
+
.g-aikit-submit-button__loader {
|
|
16
|
+
display: flex;
|
|
17
|
+
}
|
|
18
|
+
.g-aikit-submit-button__spinner {
|
|
19
|
+
--g-color-line-brand: var(--g-color-text-brand-contrast);
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.g-aikit-base-message {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--g-spacing-1);
|
|
5
|
+
}
|
|
6
|
+
.g-aikit-base-message_variant_user {
|
|
7
|
+
align-items: flex-end;
|
|
8
|
+
max-width: 90%;
|
|
9
|
+
}
|
|
10
|
+
.g-aikit-base-message_variant_system, .g-aikit-base-message_variant_assistant {
|
|
11
|
+
align-items: flex-start;
|
|
12
|
+
}
|
|
13
|
+
.g-aikit-base-message_btn-hover .g-aikit-base-message__actions {
|
|
14
|
+
visibility: hidden;
|
|
15
|
+
}
|
|
16
|
+
.g-aikit-base-message_btn-hover:hover .g-aikit-base-message__actions {
|
|
17
|
+
visibility: visible;
|
|
18
|
+
}
|
|
19
|
+
.g-aikit-base-message__actions {
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: var(--g-spacing-3);
|
|
23
|
+
}
|
|
24
|
+
.g-aikit-base-message__actions_reverse {
|
|
25
|
+
flex-direction: row-reverse;
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.g-aikit-button-group {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
gap: var(--g-spacing-1);
|
|
5
|
+
}
|
|
6
|
+
.g-aikit-button-group_or_vertical {
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
}
|
|
10
|
+
.g-aikit-button-group_or_horizontal {
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
align-items: center;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.g-aikit-prompt-input-body {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
flex: 1;
|
|
5
|
+
align-self: stretch;
|
|
6
|
+
}
|
|
7
|
+
.g-aikit-prompt-input-body__textarea {
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
.g-aikit-prompt-input-body__textarea-control {
|
|
11
|
+
resize: none;
|
|
12
|
+
}
|
|
13
|
+
.g-aikit-prompt-input-body .g-text-area_disabled {
|
|
14
|
+
--_--background-color: none;
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.g-aikit-prompt-input-footer {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: flex-end;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
align-self: stretch;
|
|
6
|
+
gap: var(--g-spacing-1);
|
|
7
|
+
}
|
|
8
|
+
.g-aikit-prompt-input-footer__action-button {
|
|
9
|
+
color: var(--g-color-text-secondary);
|
|
10
|
+
}
|
|
11
|
+
.g-aikit-prompt-input-footer__action-button:hover {
|
|
12
|
+
color: var(--g-color-text-primary);
|
|
13
|
+
}
|
|
14
|
+
.g-aikit-prompt-input-footer__content {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
flex: 1;
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.g-aikit-prompt-input-header {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
gap: var(--g-spacing-2);
|
|
6
|
+
align-self: stretch;
|
|
7
|
+
}
|
|
8
|
+
.g-aikit-prompt-input-header__context-items {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: var(--g-spacing-1);
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
flex: 1;
|
|
14
|
+
min-width: 0;
|
|
15
|
+
}
|
|
16
|
+
.g-aikit-prompt-input-header__context-indicator {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
flex-shrink: 0;
|
|
20
|
+
margin-left: auto;
|
|
21
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
.g-aikit-suggestions__container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--g-spacing-2);
|
|
5
|
+
}
|
|
6
|
+
.g-aikit-suggestions__title {
|
|
7
|
+
padding-bottom: 0;
|
|
8
|
+
}
|
|
9
|
+
.g-aikit-suggestions {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: flex-start;
|
|
12
|
+
align-content: flex-start;
|
|
13
|
+
gap: var(--g-spacing-2) var(--g-spacing-2);
|
|
14
|
+
align-self: stretch;
|
|
15
|
+
flex-wrap: wrap;
|
|
16
|
+
}
|
|
17
|
+
.g-aikit-suggestions_layout_grid {
|
|
18
|
+
flex-direction: row;
|
|
19
|
+
}
|
|
20
|
+
.g-aikit-suggestions_layout_list {
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
}
|
|
23
|
+
.g-aikit-suggestions_layout_list .g-aikit-suggestions__button {
|
|
24
|
+
width: 100%;
|
|
25
|
+
}
|
|
26
|
+
.g-aikit-suggestions__button {
|
|
27
|
+
padding: calc(var(--g-spacing-base) * 2) calc(var(--g-spacing-base) * 4);
|
|
28
|
+
height: 100%;
|
|
29
|
+
box-shadow: none;
|
|
30
|
+
}
|
|
31
|
+
.g-aikit-suggestions__button .g-button__text {
|
|
32
|
+
width: 100%;
|
|
33
|
+
}
|
|
34
|
+
.g-aikit-suggestions__button-content {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: row;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: space-between;
|
|
39
|
+
flex: 1;
|
|
40
|
+
gap: calc(var(--g-spacing-base) * 1);
|
|
41
|
+
min-width: 0;
|
|
42
|
+
}
|
|
43
|
+
.g-aikit-suggestions__button-content_text-align_left {
|
|
44
|
+
justify-content: flex-start;
|
|
45
|
+
}
|
|
46
|
+
.g-aikit-suggestions__button-content_text-align_center {
|
|
47
|
+
justify-content: center;
|
|
48
|
+
}
|
|
49
|
+
.g-aikit-suggestions__button-content_text-align_right {
|
|
50
|
+
justify-content: flex-end;
|
|
51
|
+
}
|
|
52
|
+
.g-aikit-suggestions__button-text {
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
text-overflow: ellipsis;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
min-width: 0;
|
|
57
|
+
}
|
|
58
|
+
.g-aikit-suggestions__button-text-wrap {
|
|
59
|
+
word-break: break-word;
|
|
60
|
+
white-space: normal;
|
|
61
|
+
min-width: 0;
|
|
62
|
+
text-align: left;
|
|
63
|
+
}
|
|
64
|
+
.g-aikit-suggestions__button-icon {
|
|
65
|
+
width: 16px;
|
|
66
|
+
height: 16px;
|
|
67
|
+
color: var(--g-color-text-hint);
|
|
68
|
+
flex-shrink: 0;
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.g-aikit-tabs {
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%;
|
|
4
|
+
flex-direction: row;
|
|
5
|
+
align-items: flex-start;
|
|
6
|
+
gap: var(--g-spacing-2);
|
|
7
|
+
overflow: scroll hidden;
|
|
8
|
+
white-space: nowrap;
|
|
9
|
+
padding: var(--g-spacing-1) 0;
|
|
10
|
+
scrollbar-width: thin;
|
|
11
|
+
transition: scrollbar-color 0.3s ease-in-out;
|
|
12
|
+
scrollbar-color: transparent transparent;
|
|
13
|
+
}
|
|
14
|
+
.g-aikit-tabs:hover {
|
|
15
|
+
scrollbar-color: var(--g-color-base-generic-medium) transparent;
|
|
16
|
+
}
|
|
17
|
+
.g-aikit-tabs::-webkit-scrollbar {
|
|
18
|
+
height: 6px;
|
|
19
|
+
}
|
|
20
|
+
.g-aikit-tabs::-webkit-scrollbar-track {
|
|
21
|
+
background: transparent;
|
|
22
|
+
}
|
|
23
|
+
.g-aikit-tabs::-webkit-scrollbar-thumb {
|
|
24
|
+
background-color: transparent;
|
|
25
|
+
border-radius: 3px;
|
|
26
|
+
transition: background-color 0.3s ease-in-out;
|
|
27
|
+
}
|
|
28
|
+
.g-aikit-tabs:hover::-webkit-scrollbar-thumb {
|
|
29
|
+
background-color: var(--g-color-base-generic-medium);
|
|
30
|
+
}
|
|
31
|
+
.g-aikit-tabs__tab {
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
cursor: default;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
}
|