@antscorp/antsomi-ui 2.0.103 → 2.0.104
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/es/__mocks__/sql-query.json +56 -0
- package/es/assets/css/main.scss +2 -2
- package/es/components/atoms/App/App.d.ts +7 -0
- package/es/components/atoms/App/App.js +5 -0
- package/es/components/atoms/App/index.d.ts +1 -0
- package/es/components/atoms/App/index.js +1 -0
- package/es/components/atoms/Input/Input.d.ts +11 -17
- package/es/components/atoms/Input/Input.js +11 -12
- package/es/components/atoms/List/List.d.ts +1 -0
- package/es/components/atoms/List/List.js +1 -0
- package/es/components/atoms/List/index.d.ts +1 -0
- package/es/components/atoms/List/index.js +1 -0
- package/es/components/atoms/Scrollbars/Scrollbars.d.ts +3 -4
- package/es/components/atoms/Scrollbars/Scrollbars.js +2 -1
- package/es/components/atoms/SlideBar/SlideBar.js +1 -1
- package/es/components/atoms/Tag/Tag.js +1 -1
- package/es/components/atoms/index.d.ts +3 -0
- package/es/components/atoms/index.js +2 -0
- package/es/components/icons/FeedbackOutlinedIcon.d.ts +3 -0
- package/es/components/icons/FeedbackOutlinedIcon.js +7 -0
- package/es/components/icons/LazyIcon/LazyIcon.d.ts +5 -0
- package/es/components/icons/LazyIcon/LazyIcon.js +5 -0
- package/es/components/icons/NavigateBeforeIcon.d.ts +3 -0
- package/es/components/icons/NavigateBeforeIcon.js +7 -0
- package/es/components/icons/NavigateNextIcon.d.ts +3 -0
- package/es/components/icons/NavigateNextIcon.js +7 -0
- package/es/components/icons/PenSparkIcon.d.ts +3 -0
- package/es/components/icons/PenSparkIcon.js +7 -0
- package/es/components/icons/StatusSuccessIcon.d.ts +3 -0
- package/es/components/icons/StatusSuccessIcon.js +7 -0
- package/es/components/icons/SummarizeIconIcon.d.ts +3 -0
- package/es/components/icons/SummarizeIconIcon.js +7 -0
- package/es/components/icons/index.d.ts +5 -0
- package/es/components/icons/index.js +5 -0
- package/es/components/index.scss +1 -0
- package/es/components/molecules/AddDynamicContent/AddDynamicContent.d.ts +1 -2
- package/es/components/molecules/CalendarSelection/constants.d.ts +1 -1
- package/es/components/molecules/CalendarSelection/constants.js +1 -1
- package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +8 -2
- package/es/components/molecules/CaptureScreen/CaptureScreen.js +2 -2
- package/es/components/molecules/DrawerDetail/DrawerDetail.js +19 -7
- package/es/components/molecules/DrawerDetail/types.d.ts +5 -0
- package/es/components/molecules/EditingListV2/components/Loadable.d.ts +1 -1
- package/es/components/molecules/EditorScript/EditorScript.d.ts +1 -2
- package/es/components/molecules/EditorScript/EditorScript.js +5 -1
- package/es/components/molecules/FontSizeInput/index.scss +15 -0
- package/es/components/molecules/Select/styled.js +1 -1
- package/es/components/molecules/SelectAccount/type.d.ts +1 -1
- package/es/components/molecules/TagifyInput/utils.style.js +1 -0
- package/es/components/molecules/TemplateSaveAs/hooks/useTemplateSave.d.ts +1 -1
- package/es/components/organism/AccountProfile/components/AccountSetting/AccountSetting.js +2 -1
- package/es/components/organism/AccountProfile/components/AccountSetting/components/LanguageSelector/styles.d.ts +1 -1
- package/es/components/organism/AccountProfile/components/AccountSetting/components/LanguageSelector/styles.js +1 -1
- package/es/components/organism/ActivityTimeline/__mocks__/event_tracking.json +1290 -0
- package/es/components/organism/ActivityTimeline/__mocks__/timeline.json +3059 -0
- package/es/components/organism/DataTable/hooks/useDataTableListing/useDataTableListing.js +5 -4
- package/es/components/organism/Login/components/LoginWithEmail/styled.js +1 -1
- package/es/components/organism/Login/components/SetupGGAuthenticator/styled.js +1 -1
- package/es/components/organism/Login/components/SignIn/styled.js +1 -1
- package/es/components/organism/Login/components/WidgetLayout/styled.js +1 -1
- package/es/components/organism/Login/styled.d.ts +3 -3
- package/es/components/organism/Login/styled.js +11 -11
- package/es/components/organism/ModifyColumnModal/styled.d.ts +2 -2
- package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.d.ts +1 -2
- package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.js +3 -1
- package/es/components/organism/SQLGeneration/SQLGeneration.d.ts +3 -0
- package/es/components/organism/SQLGeneration/SQLGeneration.js +26 -0
- package/es/components/organism/SQLGeneration/components/CheckboxShowDiff.d.ts +2 -0
- package/es/components/organism/SQLGeneration/components/CheckboxShowDiff.js +16 -0
- package/es/components/organism/SQLGeneration/components/EditTableSourcesDrawer.d.ts +2 -0
- package/es/components/organism/SQLGeneration/components/EditTableSourcesDrawer.js +56 -0
- package/es/components/organism/SQLGeneration/components/ErrorDisplay.d.ts +21 -0
- package/es/components/organism/SQLGeneration/components/ErrorDisplay.js +69 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationActions.d.ts +4 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationActions.js +23 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationCodeBlock.d.ts +2 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationCodeBlock.js +22 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationEditPrompt.d.ts +2 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationEditPrompt.js +66 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationHeader.d.ts +2 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationHeader.js +10 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationModal.d.ts +2 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationModal.js +35 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationPagination.d.ts +4 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationPagination.js +13 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationPrompt.d.ts +2 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationPrompt.js +31 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationPromptDisplay.d.ts +2 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationPromptDisplay.js +15 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationQuerySummary.d.ts +2 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationQuerySummary.js +17 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationRefine.d.ts +1 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationRefine.js +55 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationResult.d.ts +5 -0
- package/es/components/organism/SQLGeneration/components/SQLGenerationResult.js +29 -0
- package/es/components/organism/SQLGeneration/components/index.d.ts +9 -0
- package/es/components/organism/SQLGeneration/components/index.js +9 -0
- package/es/components/organism/SQLGeneration/components/styled.d.ts +52 -0
- package/es/components/organism/SQLGeneration/components/styled.js +382 -0
- package/es/components/organism/SQLGeneration/constants.d.ts +48 -0
- package/es/components/organism/SQLGeneration/constants.js +48 -0
- package/es/components/organism/SQLGeneration/hooks/index.d.ts +1 -0
- package/es/components/organism/SQLGeneration/hooks/index.js +1 -0
- package/es/components/organism/SQLGeneration/hooks/useKeyboardNavigation.d.ts +14 -0
- package/es/components/organism/SQLGeneration/hooks/useKeyboardNavigation.js +123 -0
- package/es/components/organism/SQLGeneration/index.d.ts +10 -0
- package/es/components/organism/SQLGeneration/index.js +6 -0
- package/es/components/organism/SQLGeneration/index.scss +1 -0
- package/es/components/organism/SQLGeneration/integrations/AceEditor/index.d.ts +1 -0
- package/es/components/organism/SQLGeneration/integrations/AceEditor/index.js +1 -0
- package/es/components/organism/SQLGeneration/integrations/AceEditor/index.scss +4 -0
- package/es/components/organism/SQLGeneration/integrations/AceEditor/useAceEditor.d.ts +9 -0
- package/es/components/organism/SQLGeneration/integrations/AceEditor/useAceEditor.js +24 -0
- package/es/components/organism/SQLGeneration/integrations/AceEditor/useEnhancePlaceholder.d.ts +10 -0
- package/es/components/organism/SQLGeneration/integrations/AceEditor/useEnhancePlaceholder.js +172 -0
- package/es/components/organism/SQLGeneration/integrations/AceEditor/useInsertQuery.d.ts +8 -0
- package/es/components/organism/SQLGeneration/integrations/AceEditor/useInsertQuery.js +21 -0
- package/es/components/organism/SQLGeneration/integrations/AntsomiAI/index.d.ts +1 -0
- package/es/components/organism/SQLGeneration/integrations/AntsomiAI/index.js +1 -0
- package/es/components/organism/SQLGeneration/integrations/AntsomiAI/useAntsomiAI.d.ts +1 -0
- package/es/components/organism/SQLGeneration/integrations/AntsomiAI/useAntsomiAI.js +35 -0
- package/es/components/organism/SQLGeneration/integrations/AntsomiSqlWS/index.d.ts +1 -0
- package/es/components/organism/SQLGeneration/integrations/AntsomiSqlWS/index.js +1 -0
- package/es/components/organism/SQLGeneration/integrations/AntsomiSqlWS/useAntsomiSqlWS.d.ts +7 -0
- package/es/components/organism/SQLGeneration/integrations/AntsomiSqlWS/useAntsomiSqlWS.js +10 -0
- package/es/components/organism/SQLGeneration/selectors.d.ts +857 -0
- package/es/components/organism/SQLGeneration/selectors.js +61 -0
- package/es/components/organism/SQLGeneration/store/index.d.ts +2 -0
- package/es/components/organism/SQLGeneration/store/index.js +1 -0
- package/es/components/organism/SQLGeneration/store/provider.d.ts +7 -0
- package/es/components/organism/SQLGeneration/store/provider.js +40 -0
- package/es/components/organism/SQLGeneration/store/store.d.ts +383 -0
- package/es/components/organism/SQLGeneration/store/store.js +309 -0
- package/es/components/organism/SQLGeneration/store/types.d.ts +97 -0
- package/es/components/organism/SQLGeneration/store/types.js +1 -0
- package/es/components/organism/SQLGeneration/types.d.ts +29 -0
- package/es/components/organism/SQLGeneration/types.js +1 -0
- package/es/components/organism/index.d.ts +1 -0
- package/es/components/organism/index.js +1 -0
- package/es/components/organism/index.scss +1 -0
- package/es/components/template/TemplateListing/hooks/useTemplateListing.d.ts +3 -4
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.js +1 -0
- package/es/hooks/useFocusManagement.d.ts +14 -0
- package/es/hooks/useFocusManagement.js +124 -0
- package/es/locales/ja/google-sheet.json +2 -2
- package/es/providers/ConfigProvider/ConfigProvider.js +4 -1
- package/es/providers/ConfigProvider/GlobalStyle.js +153 -46
- package/es/queries/AI/index.d.ts +23 -0
- package/es/queries/AI/index.js +4 -0
- package/es/queries/AI/useSqlGeneration.d.ts +25 -0
- package/es/queries/AI/useSqlGeneration.js +13 -0
- package/es/queries/TemplateListing/index.d.ts +2 -2
- package/es/queries/index.d.ts +1 -0
- package/es/queries/index.js +1 -0
- package/es/services/AI/index.d.ts +15 -0
- package/es/services/AI/index.js +15 -0
- package/es/types/auth.d.ts +25 -0
- package/es/types/auth.js +1 -0
- package/es/types/index.d.ts +1 -0
- package/es/types/index.js +1 -0
- package/es/utils/common.d.ts +1 -0
- package/es/utils/common.js +16 -1
- package/es/utils/web.d.ts +16 -3
- package/es/utils/web.js +36 -3
- package/es/utils/zustand.d.ts +10 -0
- package/es/utils/zustand.js +8 -0
- package/package.json +15 -10
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SQL_GENERATION_CONSTANTS } from '../constants';
|
|
3
|
+
import { PromptSection, PromptTextArea, GenerateButtonContainer, GenerateButton } from './styled';
|
|
4
|
+
import { useSQLGenerationStore } from '../store/provider';
|
|
5
|
+
import { selectIsLoading, selectPrompt, selectGenerateSQLError } from '../selectors';
|
|
6
|
+
import { GenerateSQLError } from './ErrorDisplay';
|
|
7
|
+
export const SQLGenerationPrompt = () => {
|
|
8
|
+
const prompt = useSQLGenerationStore(selectPrompt);
|
|
9
|
+
const isLoading = useSQLGenerationStore(selectIsLoading);
|
|
10
|
+
const generateError = useSQLGenerationStore(selectGenerateSQLError);
|
|
11
|
+
const setPrompt = useSQLGenerationStore(s => s.setPrompt);
|
|
12
|
+
const generateSQL = useSQLGenerationStore(s => s.generateSQL);
|
|
13
|
+
const onGenerateSQL = useSQLGenerationStore(s => s.onGenerateSQL);
|
|
14
|
+
const disabled = !onGenerateSQL;
|
|
15
|
+
// Handle textarea change
|
|
16
|
+
const handleChange = (e) => {
|
|
17
|
+
setPrompt(e.target.value);
|
|
18
|
+
};
|
|
19
|
+
// Handle Enter key press (Ctrl/Cmd + Enter to generate)
|
|
20
|
+
const handleKeyDown = (e) => {
|
|
21
|
+
if ((e.ctrlKey || e.metaKey) && e.key === 'Enter') {
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
if (!disabled && !isLoading && prompt.trim()) {
|
|
24
|
+
generateSQL();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
// Check if generate button should be disabled
|
|
29
|
+
const isGenerateDisabled = disabled || isLoading || !prompt.trim();
|
|
30
|
+
return (_jsxs(PromptSection, { direction: "vertical", size: 12, style: { width: '100%' }, children: [_jsx(PromptTextArea, { id: "sql-prompt-input", value: prompt, onChange: handleChange, onKeyDown: handleKeyDown, placeholder: SQL_GENERATION_CONSTANTS.PLACEHOLDER_TEXTS.PROMPT, disabled: disabled, "aria-label": "SQL generation prompt", "aria-describedby": "sql-generation-description prompt-help-text", "aria-required": "true", autoFocus: true }), _jsx(GenerateButtonContainer, { children: _jsx(GenerateButton, { type: "primary", onClick: generateSQL, loading: isLoading, disabled: isGenerateDisabled, children: SQL_GENERATION_CONSTANTS.BUTTON_TEXTS.GENERATE }) }), generateError && _jsx(GenerateSQLError, { style: { marginTop: '12px' } })] }));
|
|
31
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Typography, Button } from '../../../atoms';
|
|
3
|
+
import { PromptDisplaySection, PromptDisplayText, PromptDisplayActions } from './styled';
|
|
4
|
+
import { useSQLGenerationStore } from '../store/provider';
|
|
5
|
+
import { selectCurrentResult, selectIsLoading } from '../selectors';
|
|
6
|
+
const { Text } = Typography;
|
|
7
|
+
export const SQLGenerationPromptDisplay = () => {
|
|
8
|
+
const currentResult = useSQLGenerationStore(selectCurrentResult);
|
|
9
|
+
const isLoading = useSQLGenerationStore(selectIsLoading);
|
|
10
|
+
const setIsEditingPrompt = useSQLGenerationStore(s => s.setIsEditingPrompt);
|
|
11
|
+
if (!currentResult)
|
|
12
|
+
return null;
|
|
13
|
+
const { prompt } = currentResult;
|
|
14
|
+
return (_jsxs(PromptDisplaySection, { children: [_jsx(PromptDisplayText, { children: _jsx(Text, { style: { color: '#1a73e8', fontSize: '14px' }, children: prompt }) }), _jsx(PromptDisplayActions, { children: _jsx(Button, { onClick: () => setIsEditingPrompt(true), disabled: isLoading, children: "Edit" }) })] }));
|
|
15
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useSQLGenerationStore } from '../store/provider';
|
|
3
|
+
import { selectCurrentResultSummary, selectIsSummaryLoading } from '../selectors';
|
|
4
|
+
import { SummarySection } from './styled';
|
|
5
|
+
import { Spin, Typography } from '../../../atoms';
|
|
6
|
+
const { Text } = Typography;
|
|
7
|
+
export const SQLGenerationQuerySummary = () => {
|
|
8
|
+
const isSummaryLoading = useSQLGenerationStore(selectIsSummaryLoading);
|
|
9
|
+
const summary = useSQLGenerationStore(selectCurrentResultSummary);
|
|
10
|
+
if (isSummaryLoading) {
|
|
11
|
+
return (_jsx(SummarySection, { className: "loading", role: "status", "aria-live": "polite", children: _jsx(Spin, { size: "small", indicatorSize: 20, "aria-hidden": "true" }) }));
|
|
12
|
+
}
|
|
13
|
+
if (!summary) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return (_jsx(SummarySection, { role: "region", "aria-label": "Query summary", children: _jsx(Text, { children: summary }) }));
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SQLGenerationRefine: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Input } from 'antd';
|
|
3
|
+
import { useSQLGenerationStore } from '../store/provider';
|
|
4
|
+
import { selectCurrentResult, selectIsRefining, selectRefineSQLError } from '../selectors';
|
|
5
|
+
import { RefineSection } from './styled';
|
|
6
|
+
import { useEffect, useRef, useState } from 'react';
|
|
7
|
+
import { PlaneIcon } from '../../../icons';
|
|
8
|
+
import { RefineSQLError } from './ErrorDisplay';
|
|
9
|
+
export const SQLGenerationRefine = () => {
|
|
10
|
+
const currentResult = useSQLGenerationStore(selectCurrentResult);
|
|
11
|
+
const isRefining = useSQLGenerationStore(selectIsRefining);
|
|
12
|
+
const refineError = useSQLGenerationStore(selectRefineSQLError);
|
|
13
|
+
const setRefinePrompt = useSQLGenerationStore(s => s.setRefinePrompt);
|
|
14
|
+
const refineSQL = useSQLGenerationStore(s => s.refineSQL);
|
|
15
|
+
const { refinePrompt: originalRefinePrompt = '' } = currentResult || {};
|
|
16
|
+
const sectionRef = useRef(null);
|
|
17
|
+
const [hasChanges, setHasChanges] = useState(false);
|
|
18
|
+
const [currentRefinePrompt, setCurrentRefinePrompt] = useState(originalRefinePrompt);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
setCurrentRefinePrompt(originalRefinePrompt);
|
|
21
|
+
setHasChanges(false);
|
|
22
|
+
}, [originalRefinePrompt]);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
setHasChanges(currentRefinePrompt.trim() !== originalRefinePrompt.trim());
|
|
25
|
+
}, [currentRefinePrompt, originalRefinePrompt]);
|
|
26
|
+
const handleCancel = () => {
|
|
27
|
+
setCurrentRefinePrompt(originalRefinePrompt);
|
|
28
|
+
setHasChanges(false);
|
|
29
|
+
};
|
|
30
|
+
const handleBlur = (e) => {
|
|
31
|
+
if (!sectionRef.current?.contains(e.relatedTarget)) {
|
|
32
|
+
handleCancel();
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const handleRefine = () => {
|
|
36
|
+
if (hasChanges && currentRefinePrompt.trim()) {
|
|
37
|
+
setRefinePrompt(currentRefinePrompt.trim());
|
|
38
|
+
refineSQL().finally(() => {
|
|
39
|
+
setHasChanges(false);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const handleKeyPress = (e) => {
|
|
44
|
+
if (e.key === 'Enter' && hasChanges && !isRefining) {
|
|
45
|
+
handleRefine();
|
|
46
|
+
}
|
|
47
|
+
if (e.key === 'Escape') {
|
|
48
|
+
handleCancel();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const handleRefinePromptChange = (e) => {
|
|
52
|
+
setCurrentRefinePrompt(e.target.value);
|
|
53
|
+
};
|
|
54
|
+
return (_jsxs(RefineSection, { ref: sectionRef, role: "region", "aria-label": "Refine SQL query", children: [_jsx(Input, { id: "refine-input", value: currentRefinePrompt, onChange: handleRefinePromptChange, onKeyDown: handleKeyPress, placeholder: "Enter refine prompt", disabled: isRefining, onBlur: handleBlur, "aria-label": "SQL refinement prompt" }), _jsxs(Button, { type: "primary", disabled: !hasChanges, onClick: handleRefine, loading: isRefining, "aria-describedby": isRefining ? 'refine-loading' : undefined, children: ["Refine", _jsx(PlaneIcon, { size: 16 })] }), refineError && _jsx(RefineSQLError, { style: { marginTop: '12px' } })] }));
|
|
55
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Spin, Typography, Flex } from '../../../atoms';
|
|
3
|
+
import { SQL_GENERATION_CONSTANTS } from '../constants';
|
|
4
|
+
import { ResultSection, LoadingContainer, ResultInfo } from './styled';
|
|
5
|
+
import { useSQLGenerationStore } from '../store/provider';
|
|
6
|
+
import { selectCurrentResult, selectIsLoading, selectResultsAllKeys } from '../selectors';
|
|
7
|
+
import { StatusSuccessIcon } from '../../../icons';
|
|
8
|
+
import 'ace-builds/src-noconflict/mode-mysql';
|
|
9
|
+
import 'ace-builds/src-noconflict/theme-textmate';
|
|
10
|
+
import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
11
|
+
import { SQLGenerationCodeBlock } from './SQLGenerationCodeBlock';
|
|
12
|
+
import { SQLGenerationPagination } from './SQLGenerationPagination';
|
|
13
|
+
import { CheckboxShowDiff } from './CheckboxShowDiff';
|
|
14
|
+
const { Text } = Typography;
|
|
15
|
+
export const SQLGenerationResult = () => {
|
|
16
|
+
const isLoading = useSQLGenerationStore(selectIsLoading);
|
|
17
|
+
const resultAllKeys = useSQLGenerationStore(selectResultsAllKeys);
|
|
18
|
+
const currentResult = useSQLGenerationStore(selectCurrentResult);
|
|
19
|
+
// Loading state
|
|
20
|
+
if (isLoading) {
|
|
21
|
+
return (_jsx(ResultSection, { role: "region", "aria-labelledby": "result-heading", children: _jsxs(LoadingContainer, { role: "status", "aria-live": "polite", children: [_jsx(Spin, { size: "small", indicatorSize: 20, "aria-hidden": "true" }), _jsx(Text, { style: { fontSize: '14px', color: '#666' }, children: SQL_GENERATION_CONSTANTS.LOADING_TEXTS.GENERATING })] }) }));
|
|
22
|
+
}
|
|
23
|
+
if (resultAllKeys.length === 0) {
|
|
24
|
+
return (_jsx(ResultSection, { role: "region", "aria-labelledby": "result-heading", children: _jsx(LoadingContainer, { role: "status", children: _jsx(Text, { style: { fontSize: '14px', color: '#999' }, children: SQL_GENERATION_CONSTANTS.PLACEHOLDER_TEXTS.NO_RESULT }) }) }));
|
|
25
|
+
}
|
|
26
|
+
if (!currentResult)
|
|
27
|
+
return null;
|
|
28
|
+
return (_jsxs(ResultSection, { role: "region", "aria-labelledby": "result-heading", children: [_jsx("div", { role: "region", "aria-label": "Generated SQL code", children: _jsx(SQLGenerationCodeBlock, {}) }), currentResult.processedDataSize && (_jsxs(ResultInfo, { role: "status", "aria-label": "Query processing information", children: [_jsx(StatusSuccessIcon, { size: 16, color: globalToken?.colorSuccess, "aria-hidden": "true" }), _jsx(Text, { style: { fontSize: '13px', color: '#5f6368' }, children: SQL_GENERATION_CONSTANTS.RESULT_TEXTS.PROCESSED_DATA.replace('{size}', currentResult.processedDataSize) })] })), _jsxs(Flex, { style: { marginTop: '16px', marginBottom: '16px' }, justify: "space-between", align: "center", children: [_jsx(CheckboxShowDiff, {}), _jsx(SQLGenerationPagination, { style: { marginLeft: 'auto' } })] })] }));
|
|
29
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { SQLGenerationModal } from './SQLGenerationModal';
|
|
2
|
+
export { SQLGenerationHeader } from './SQLGenerationHeader';
|
|
3
|
+
export { SQLGenerationPrompt } from './SQLGenerationPrompt';
|
|
4
|
+
export { SQLGenerationEditPrompt } from './SQLGenerationEditPrompt';
|
|
5
|
+
export { SQLGenerationPromptDisplay } from './SQLGenerationPromptDisplay';
|
|
6
|
+
export { SQLGenerationResult } from './SQLGenerationResult';
|
|
7
|
+
export { SQLGenerationActions } from './SQLGenerationActions';
|
|
8
|
+
export { EditTableSourcesDrawer } from './EditTableSourcesDrawer';
|
|
9
|
+
export { ErrorDisplay, CurrentOperationError, GenerateSQLError, RefineSQLError, QuerySummaryError, } from './ErrorDisplay';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { SQLGenerationModal } from './SQLGenerationModal';
|
|
2
|
+
export { SQLGenerationHeader } from './SQLGenerationHeader';
|
|
3
|
+
export { SQLGenerationPrompt } from './SQLGenerationPrompt';
|
|
4
|
+
export { SQLGenerationEditPrompt } from './SQLGenerationEditPrompt';
|
|
5
|
+
export { SQLGenerationPromptDisplay } from './SQLGenerationPromptDisplay';
|
|
6
|
+
export { SQLGenerationResult } from './SQLGenerationResult';
|
|
7
|
+
export { SQLGenerationActions } from './SQLGenerationActions';
|
|
8
|
+
export { EditTableSourcesDrawer } from './EditTableSourcesDrawer';
|
|
9
|
+
export { ErrorDisplay, CurrentOperationError, GenerateSQLError, RefineSQLError, QuerySummaryError, } from './ErrorDisplay';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const PopoverContent: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
maxWidth?: number | undefined;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const PopoverBody: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export declare const HeaderContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
+
export declare const HeaderContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
+
export declare const HeaderTitle: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/typography/Text").TextProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
|
|
9
|
+
export declare const CloseButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").ButtonProps & import("react").RefAttributes<import("react").LegacyRef<HTMLElement>>>, any, {}, never>;
|
|
10
|
+
export declare const PromptSection: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").SpaceProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
11
|
+
Compact: import("react").FC<import("antd/es/space/Compact").SpaceCompactProps>;
|
|
12
|
+
}, any, {}, never>;
|
|
13
|
+
export declare const PromptTextArea: import("styled-components").StyledComponent<"textarea", any, {}, never>;
|
|
14
|
+
export declare const GenerateButtonContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
|
+
export declare const GenerateButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").ButtonProps & import("react").RefAttributes<import("react").LegacyRef<HTMLElement>>>, any, {}, never>;
|
|
16
|
+
export declare const ResultSection: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
17
|
+
export declare const LoadingContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
|
+
export declare const SQLCodeBlock: import("styled-components").StyledComponent<import("react").FC<import("../../../molecules/EditorScript").EditorScriptProps>, any, {}, never>;
|
|
19
|
+
export declare const ResultInfo: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
20
|
+
export declare const PaginationIndicator: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
21
|
+
export declare const ActionsSection: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
22
|
+
export declare const ActionButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").ButtonProps & import("react").RefAttributes<import("react").LegacyRef<HTMLElement>>>, any, {}, never>;
|
|
23
|
+
export declare const CautionLink: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").ButtonProps & import("react").RefAttributes<import("react").LegacyRef<HTMLElement>>>, any, {}, never>;
|
|
24
|
+
export declare const RatingSection: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
25
|
+
export declare const RatingText: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
26
|
+
export declare const RatingButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").ButtonProps & import("react").RefAttributes<import("react").LegacyRef<HTMLElement>>>, any, {}, never>;
|
|
27
|
+
export declare const StyledModal: import("styled-components").StyledComponent<import("react").ComponentType<any> | keyof import("react").JSX.IntrinsicElements, any, any, any>;
|
|
28
|
+
export declare const ModalDescription: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/typography/Text").TextProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
|
|
29
|
+
export declare const SearchSection: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
30
|
+
export declare const LanguageSelector: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
31
|
+
export declare const SearchInput: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
32
|
+
export declare const SearchActions: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
33
|
+
export declare const GeneratedSearchInfo: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
34
|
+
export declare const TableListHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
35
|
+
export declare const TableListHeaderLeft: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
36
|
+
export declare const TableListHeaderRight: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
37
|
+
export declare const TableListContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
38
|
+
export declare const TableItem: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
39
|
+
export declare const TableItemContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
40
|
+
export declare const TableName: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/typography/Text").TextProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
|
|
41
|
+
export declare const EmptyState: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
42
|
+
export declare const PaginationControls: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
43
|
+
export declare const PaginationText: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/typography/Text").TextProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
|
|
44
|
+
export declare const EditPromptSection: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
45
|
+
export declare const EditPromptInput: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
46
|
+
export declare const EditPromptActions: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
47
|
+
export declare const PromptDisplaySection: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
48
|
+
export declare const PromptDisplayText: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
49
|
+
export declare const PromptDisplayActions: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
50
|
+
export declare const SummarySection: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
51
|
+
export declare const RefineSection: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
52
|
+
export declare const AccessibilityStyles: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
// Components
|
|
4
|
+
import { Button, Typography } from '../../../atoms';
|
|
5
|
+
import { EditorScript } from '../../../molecules/EditorScript';
|
|
6
|
+
import { Modal } from '../../../molecules/Modal';
|
|
7
|
+
// Constants
|
|
8
|
+
import { THEME } from '../../../../constants';
|
|
9
|
+
import { Space } from 'antd';
|
|
10
|
+
const { Text } = Typography;
|
|
11
|
+
// SQLGenerationPopover styles
|
|
12
|
+
export const PopoverContent = styled.div `
|
|
13
|
+
max-width: ${props => props.maxWidth || 800}px;
|
|
14
|
+
padding: 0;
|
|
15
|
+
border-radius: 8px;
|
|
16
|
+
box-shadow:
|
|
17
|
+
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
18
|
+
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
19
|
+
0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
20
|
+
`;
|
|
21
|
+
export const PopoverBody = styled.div `
|
|
22
|
+
padding: 0 16px 16px;
|
|
23
|
+
`;
|
|
24
|
+
// SQLGenerationHeader styles
|
|
25
|
+
export const HeaderContainer = styled.div `
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
padding: 16px 16px 12px;
|
|
30
|
+
border-bottom: 1px solid #f0f0f0;
|
|
31
|
+
margin-bottom: 16px;
|
|
32
|
+
`;
|
|
33
|
+
export const HeaderContent = styled.div `
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: 8px;
|
|
37
|
+
`;
|
|
38
|
+
export const HeaderTitle = styled(Text) `
|
|
39
|
+
&.antsomi-typography {
|
|
40
|
+
font-size: 16px;
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
color: #202124;
|
|
43
|
+
margin: 0;
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
export const CloseButton = styled(Button) `
|
|
47
|
+
border: none;
|
|
48
|
+
box-shadow: none;
|
|
49
|
+
padding: 4px;
|
|
50
|
+
min-width: auto;
|
|
51
|
+
height: auto;
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
|
|
56
|
+
&:hover {
|
|
57
|
+
background-color: #f5f5f5;
|
|
58
|
+
}
|
|
59
|
+
`;
|
|
60
|
+
// SQLGenerationPrompt styles
|
|
61
|
+
export const PromptSection = styled(Space) `
|
|
62
|
+
margin-bottom: 0px;
|
|
63
|
+
`;
|
|
64
|
+
export const PromptTextArea = styled.textarea `
|
|
65
|
+
width: 100%;
|
|
66
|
+
min-height: 72px;
|
|
67
|
+
max-height: 144px;
|
|
68
|
+
resize: none;
|
|
69
|
+
font-size: 14px;
|
|
70
|
+
line-height: 1.5;
|
|
71
|
+
border: 1px solid #d9d9d9;
|
|
72
|
+
border-radius: 4px;
|
|
73
|
+
padding: 8px 12px;
|
|
74
|
+
font-family: inherit;
|
|
75
|
+
outline: none;
|
|
76
|
+
transition: border-color 0.2s;
|
|
77
|
+
|
|
78
|
+
&:focus {
|
|
79
|
+
border-color: ${THEME.token?.colorPrimary};
|
|
80
|
+
box-shadow: 0 0 0 2px rgba(0, 94, 184, 0.1);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&::placeholder {
|
|
84
|
+
color: ${THEME.token?.colorTextPlaceholder};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&:disabled {
|
|
88
|
+
background-color: #f5f5f5;
|
|
89
|
+
cursor: not-allowed;
|
|
90
|
+
}
|
|
91
|
+
`;
|
|
92
|
+
export const GenerateButtonContainer = styled.div `
|
|
93
|
+
display: flex;
|
|
94
|
+
justify-content: flex-end;
|
|
95
|
+
margin-top: 12px;
|
|
96
|
+
`;
|
|
97
|
+
export const GenerateButton = styled(Button) `
|
|
98
|
+
border-radius: 6px;
|
|
99
|
+
font-weight: 500;
|
|
100
|
+
`;
|
|
101
|
+
// SQLGenerationResult styles
|
|
102
|
+
export const ResultSection = styled.div `
|
|
103
|
+
margin-bottom: 16px;
|
|
104
|
+
min-height: 200px;
|
|
105
|
+
`;
|
|
106
|
+
export const LoadingContainer = styled.div `
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
min-height: 100px;
|
|
111
|
+
color: #666;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
gap: 12px;
|
|
114
|
+
`;
|
|
115
|
+
export const SQLCodeBlock = styled(EditorScript) `
|
|
116
|
+
padding: 0 12px;
|
|
117
|
+
background: #f1f3f4;
|
|
118
|
+
border-top-left-radius: 8px;
|
|
119
|
+
border-top-right-radius: 8px;
|
|
120
|
+
`;
|
|
121
|
+
export const ResultInfo = styled.div `
|
|
122
|
+
display: flex;
|
|
123
|
+
align-items: center;
|
|
124
|
+
gap: 8px;
|
|
125
|
+
background: #dbddde;
|
|
126
|
+
border-bottom-left-radius: 8px;
|
|
127
|
+
border-bottom-right-radius: 8px;
|
|
128
|
+
padding: 4px 12px;
|
|
129
|
+
`;
|
|
130
|
+
export const PaginationIndicator = styled.div `
|
|
131
|
+
display: flex;
|
|
132
|
+
justify-content: center;
|
|
133
|
+
align-items: center;
|
|
134
|
+
gap: 8px;
|
|
135
|
+
`;
|
|
136
|
+
// SQLGenerationActions styles
|
|
137
|
+
export const ActionsSection = styled.div `
|
|
138
|
+
border-top: 1px solid #f0f0f0;
|
|
139
|
+
padding-top: 12px;
|
|
140
|
+
`;
|
|
141
|
+
export const ActionButton = styled(Button) `
|
|
142
|
+
border-radius: 6px;
|
|
143
|
+
font-size: 13px;
|
|
144
|
+
height: 32px;
|
|
145
|
+
padding: 0 12px;
|
|
146
|
+
|
|
147
|
+
&.primary {
|
|
148
|
+
font-weight: 500;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&.with-icon {
|
|
152
|
+
display: flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
gap: 4px;
|
|
155
|
+
}
|
|
156
|
+
`;
|
|
157
|
+
export const CautionLink = styled(Button) `
|
|
158
|
+
font-size: 13px;
|
|
159
|
+
height: 32px;
|
|
160
|
+
padding: 0 4px;
|
|
161
|
+
color: #1a73e8;
|
|
162
|
+
text-decoration: underline;
|
|
163
|
+
margin-left: auto;
|
|
164
|
+
|
|
165
|
+
&:hover {
|
|
166
|
+
color: #1557b0;
|
|
167
|
+
}
|
|
168
|
+
`;
|
|
169
|
+
export const RatingSection = styled.div `
|
|
170
|
+
margin-top: 12px;
|
|
171
|
+
display: flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
gap: 8px;
|
|
174
|
+
`;
|
|
175
|
+
export const RatingText = styled.span `
|
|
176
|
+
font-size: 13px;
|
|
177
|
+
color: #5f6368;
|
|
178
|
+
`;
|
|
179
|
+
export const RatingButton = styled(Button) `
|
|
180
|
+
min-width: auto;
|
|
181
|
+
height: 24px;
|
|
182
|
+
padding: 0 4px;
|
|
183
|
+
border: none;
|
|
184
|
+
box-shadow: none;
|
|
185
|
+
|
|
186
|
+
&:hover {
|
|
187
|
+
background-color: #f5f5f5;
|
|
188
|
+
}
|
|
189
|
+
`;
|
|
190
|
+
// EditTableSourcesModal styles
|
|
191
|
+
export const StyledModal = styled(Modal) `
|
|
192
|
+
.antsomi-modal-header {
|
|
193
|
+
border-bottom: 1px solid #f0f0f0;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.antsomi-modal-body {
|
|
197
|
+
padding: 16px 24px;
|
|
198
|
+
}
|
|
199
|
+
`;
|
|
200
|
+
export const ModalDescription = styled(Text) `
|
|
201
|
+
font-size: 14px;
|
|
202
|
+
color: ${THEME.token?.colorTextSecondary};
|
|
203
|
+
margin-bottom: 16px;
|
|
204
|
+
display: block;
|
|
205
|
+
`;
|
|
206
|
+
export const SearchSection = styled.div `
|
|
207
|
+
display: flex;
|
|
208
|
+
gap: 12px;
|
|
209
|
+
padding: 12px;
|
|
210
|
+
background-color: #f8f9fa;
|
|
211
|
+
border-radius: 6px;
|
|
212
|
+
border: 1px solid #e9ecef;
|
|
213
|
+
margin-bottom: 16px;
|
|
214
|
+
`;
|
|
215
|
+
export const LanguageSelector = styled.div `
|
|
216
|
+
display: flex;
|
|
217
|
+
align-items: center;
|
|
218
|
+
gap: 8px;
|
|
219
|
+
font-size: 14px;
|
|
220
|
+
font-weight: 500;
|
|
221
|
+
cursor: pointer;
|
|
222
|
+
`;
|
|
223
|
+
export const SearchInput = styled.div `
|
|
224
|
+
flex: 1;
|
|
225
|
+
`;
|
|
226
|
+
export const SearchActions = styled.div `
|
|
227
|
+
display: flex;
|
|
228
|
+
align-items: center;
|
|
229
|
+
gap: 8px;
|
|
230
|
+
`;
|
|
231
|
+
export const GeneratedSearchInfo = styled.div `
|
|
232
|
+
font-size: 13px;
|
|
233
|
+
color: #5f6368;
|
|
234
|
+
margin-bottom: 16px;
|
|
235
|
+
`;
|
|
236
|
+
export const TableListHeader = styled.div `
|
|
237
|
+
display: flex;
|
|
238
|
+
align-items: center;
|
|
239
|
+
justify-content: space-between;
|
|
240
|
+
margin-bottom: 12px;
|
|
241
|
+
padding-bottom: 8px;
|
|
242
|
+
border-bottom: 1px solid #f0f0f0;
|
|
243
|
+
`;
|
|
244
|
+
export const TableListHeaderLeft = styled.div `
|
|
245
|
+
display: flex;
|
|
246
|
+
align-items: center;
|
|
247
|
+
gap: 8px;
|
|
248
|
+
`;
|
|
249
|
+
export const TableListHeaderRight = styled.div `
|
|
250
|
+
display: flex;
|
|
251
|
+
align-items: center;
|
|
252
|
+
gap: 16px;
|
|
253
|
+
`;
|
|
254
|
+
export const TableListContainer = styled.div `
|
|
255
|
+
max-height: 300px;
|
|
256
|
+
overflow-y: auto;
|
|
257
|
+
`;
|
|
258
|
+
export const TableItem = styled.div `
|
|
259
|
+
display: flex;
|
|
260
|
+
align-items: center;
|
|
261
|
+
gap: 12px;
|
|
262
|
+
padding: 8px 0;
|
|
263
|
+
border-bottom: 1px solid #f5f5f5;
|
|
264
|
+
`;
|
|
265
|
+
export const TableItemContent = styled.div `
|
|
266
|
+
display: flex;
|
|
267
|
+
align-items: center;
|
|
268
|
+
gap: 8px;
|
|
269
|
+
flex: 1;
|
|
270
|
+
`;
|
|
271
|
+
export const TableName = styled(Text) `
|
|
272
|
+
font-size: 14px;
|
|
273
|
+
color: #1a73e8;
|
|
274
|
+
`;
|
|
275
|
+
export const EmptyState = styled.div `
|
|
276
|
+
text-align: center;
|
|
277
|
+
padding: 40px 20px;
|
|
278
|
+
color: #999;
|
|
279
|
+
`;
|
|
280
|
+
export const PaginationControls = styled.div `
|
|
281
|
+
display: flex;
|
|
282
|
+
align-items: center;
|
|
283
|
+
gap: 4px;
|
|
284
|
+
`;
|
|
285
|
+
export const PaginationText = styled(Text) `
|
|
286
|
+
font-size: 13px;
|
|
287
|
+
color: ${THEME.token?.colorTextSecondary};
|
|
288
|
+
`;
|
|
289
|
+
// Edit Prompt Styles
|
|
290
|
+
export const EditPromptSection = styled.div `
|
|
291
|
+
display: flex;
|
|
292
|
+
gap: 12px;
|
|
293
|
+
margin-bottom: 16px;
|
|
294
|
+
`;
|
|
295
|
+
export const EditPromptInput = styled.div `
|
|
296
|
+
display: flex;
|
|
297
|
+
align-items: center;
|
|
298
|
+
flex: 1;
|
|
299
|
+
|
|
300
|
+
.input__wrapper {
|
|
301
|
+
width: 100%;
|
|
302
|
+
}
|
|
303
|
+
`;
|
|
304
|
+
export const EditPromptActions = styled.div `
|
|
305
|
+
display: flex;
|
|
306
|
+
justify-content: flex-end;
|
|
307
|
+
align-items: center;
|
|
308
|
+
`;
|
|
309
|
+
// Prompt Display Styles
|
|
310
|
+
export const PromptDisplaySection = styled.div `
|
|
311
|
+
display: flex;
|
|
312
|
+
justify-content: space-between;
|
|
313
|
+
align-items: center;
|
|
314
|
+
margin-bottom: 16px;
|
|
315
|
+
gap: 12px;
|
|
316
|
+
`;
|
|
317
|
+
export const PromptDisplayText = styled.div `
|
|
318
|
+
flex: 1;
|
|
319
|
+
line-height: 1.4;
|
|
320
|
+
`;
|
|
321
|
+
export const PromptDisplayActions = styled.div `
|
|
322
|
+
flex-shrink: 0;
|
|
323
|
+
`;
|
|
324
|
+
export const SummarySection = styled.div `
|
|
325
|
+
margin-top: 16px;
|
|
326
|
+
max-height: 60px;
|
|
327
|
+
overflow-y: auto;
|
|
328
|
+
display: flex;
|
|
329
|
+
gap: 10px;
|
|
330
|
+
|
|
331
|
+
&.loading {
|
|
332
|
+
display: flex;
|
|
333
|
+
align-items: center;
|
|
334
|
+
justify-content: center;
|
|
335
|
+
height: 60px;
|
|
336
|
+
}
|
|
337
|
+
`;
|
|
338
|
+
export const RefineSection = styled.div `
|
|
339
|
+
display: flex;
|
|
340
|
+
gap: 12px;
|
|
341
|
+
margin-top: 16px;
|
|
342
|
+
margin-bottom: 16px;
|
|
343
|
+
`;
|
|
344
|
+
// Global styles for accessibility
|
|
345
|
+
export const AccessibilityStyles = styled.div `
|
|
346
|
+
/* Focus indicators */
|
|
347
|
+
.antsomi-btn:focus-visible,
|
|
348
|
+
.antsomi-input:focus-visible,
|
|
349
|
+
.antsomi-checkbox:focus-visible {
|
|
350
|
+
outline: 2px solid #1890ff !important;
|
|
351
|
+
outline-offset: 2px !important;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/* High contrast mode support */
|
|
355
|
+
@media (prefers-contrast: high) {
|
|
356
|
+
.sql-generation-modal {
|
|
357
|
+
border: 2px solid !important;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/* Reduced motion support */
|
|
362
|
+
@media (prefers-reduced-motion: reduce) {
|
|
363
|
+
.antsomi-spin {
|
|
364
|
+
animation: none !important;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/* Error display styles */
|
|
369
|
+
.sql-generation-error {
|
|
370
|
+
margin: 12px 0;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/* Keyboard shortcuts help */
|
|
374
|
+
kbd {
|
|
375
|
+
background-color: #f5f5f5;
|
|
376
|
+
border: 1px solid #d9d9d9;
|
|
377
|
+
border-radius: 3px;
|
|
378
|
+
padding: 2px 4px;
|
|
379
|
+
font-family: monospace;
|
|
380
|
+
font-size: 0.85em;
|
|
381
|
+
}
|
|
382
|
+
`;
|