From ee4024a3da3f8583433d7482bcba4d6da3f7e458 Mon Sep 17 00:00:00 2001 From: marurunn Date: Sun, 5 Jan 2025 02:54:27 +0900 Subject: [PATCH 1/3] add dark theme --- frontend/src/components/Alert.tsx | 6 +- frontend/src/components/ApiKeyItem.tsx | 6 +- frontend/src/components/AppContent.tsx | 16 +++-- frontend/src/components/AuthAmplify.tsx | 2 +- frontend/src/components/AuthCustom.tsx | 2 +- frontend/src/components/Button.tsx | 4 +- frontend/src/components/ButtonFileChoose.tsx | 4 +- frontend/src/components/ButtonSend.tsx | 2 +- frontend/src/components/ChatListDrawer.tsx | 4 +- .../src/components/ChatMessage.stories.tsx | 12 ++-- frontend/src/components/ChatMessage.tsx | 8 +-- .../src/components/ChatMessageMarkdown.tsx | 4 +- .../DialogConfirmClearConversations.tsx | 2 +- .../src/components/DialogConfirmDeleteApi.tsx | 2 +- .../components/DialogConfirmDeleteApiKey.tsx | 2 +- .../src/components/DialogConfirmDeleteBot.tsx | 2 +- .../components/DialogConfirmDeleteChat.tsx | 2 +- .../components/DialogInstructionsSamples.tsx | 4 +- frontend/src/components/DialogShareBot.tsx | 4 +- frontend/src/components/DrawerItem.tsx | 8 +-- frontend/src/components/GenerationConfig.tsx | 2 +- frontend/src/components/InputChatContent.tsx | 12 ++-- frontend/src/components/InputText.tsx | 8 +-- .../src/components/KnowledgeFileUploader.tsx | 6 +- .../src/components/ListItemBot.stories.tsx | 12 ++-- frontend/src/components/ListItemBot.tsx | 8 +-- frontend/src/components/Menu.tsx | 10 +-- frontend/src/components/ModalDialog.tsx | 6 +- frontend/src/components/PopoverItem.tsx | 2 +- .../src/components/PopoverMenu.stories.tsx | 2 +- frontend/src/components/PopoverMenu.tsx | 4 +- frontend/src/components/RadioButton.tsx | 8 +-- .../src/components/RelatedDocumentViewer.tsx | 4 +- frontend/src/components/Select.tsx | 10 +-- frontend/src/components/Skeleton.tsx | 2 +- frontend/src/components/Slider.tsx | 8 +-- frontend/src/components/StatusSyncBot.tsx | 6 +- .../src/components/SwitchBedrockModel.tsx | 10 +-- frontend/src/components/Textarea.tsx | 8 +-- frontend/src/components/Toggle.tsx | 4 +- .../src/components/UploadedAttachedFile.tsx | 8 +-- .../agent/components/AgentToolList.tsx | 2 +- .../agent/components/AvailableTools.tsx | 4 +- .../features/agent/components/ToolCard.tsx | 4 +- .../knowledgeBase/pages/BotKbEditPage.tsx | 40 +++++------ frontend/src/pages/AdminApiManagementPage.tsx | 4 +- frontend/src/pages/AdminBotManagementPage.tsx | 32 ++++----- .../src/pages/AdminSharedBotAnalyticsPage.tsx | 4 +- frontend/src/pages/BotApiSettingsPage.tsx | 12 ++-- frontend/src/pages/BotExplorePage.tsx | 8 +-- frontend/src/pages/ChatPage.tsx | 72 ++++++++++++++++--- frontend/src/pages/ErrorFallback.tsx | 8 +-- frontend/src/providers/SnackbarProvider.tsx | 2 +- frontend/tailwind.config.js | 36 ++++++++-- 54 files changed, 276 insertions(+), 188 deletions(-) diff --git a/frontend/src/components/Alert.tsx b/frontend/src/components/Alert.tsx index 6bf0e62a7..9e33f36c5 100644 --- a/frontend/src/components/Alert.tsx +++ b/frontend/src/components/Alert.tsx @@ -24,7 +24,7 @@ const Alert: React.FC = (props) => { return (
= (props) => { )}>
{icon}
{props.title}
-
+
{props.children}
diff --git a/frontend/src/components/ApiKeyItem.tsx b/frontend/src/components/ApiKeyItem.tsx index 58f3a164e..d0e39b06b 100644 --- a/frontend/src/components/ApiKeyItem.tsx +++ b/frontend/src/components/ApiKeyItem.tsx @@ -64,7 +64,7 @@ const ApiKeyItem: React.FC = (props) => { {isLoading ? ( ) : ( -
+
{botApiKey?.description}
@@ -80,7 +80,7 @@ const ApiKeyItem: React.FC = (props) => { {t('bot.apiSettings.label.apiKeyDetail.inactive')}
)} -
+
{t('bot.apiSettings.label.apiKeyDetail.creationDate')}:
@@ -98,7 +98,7 @@ const ApiKeyItem: React.FC = (props) => {
diff --git a/frontend/src/components/DialogConfirmDeleteApi.tsx b/frontend/src/components/DialogConfirmDeleteApi.tsx index 17b2351ca..798b9df40 100644 --- a/frontend/src/components/DialogConfirmDeleteApi.tsx +++ b/frontend/src/components/DialogConfirmDeleteApi.tsx @@ -28,7 +28,7 @@ const DialogConfirmDeleteApi: React.FC = (props) => {
diff --git a/frontend/src/components/DialogConfirmDeleteApiKey.tsx b/frontend/src/components/DialogConfirmDeleteApiKey.tsx index c55218ecb..3ab3af8e2 100644 --- a/frontend/src/components/DialogConfirmDeleteApiKey.tsx +++ b/frontend/src/components/DialogConfirmDeleteApiKey.tsx @@ -35,7 +35,7 @@ const DialogConfirmDeleteApiKey: React.FC = (props) => {
diff --git a/frontend/src/components/DialogConfirmDeleteBot.tsx b/frontend/src/components/DialogConfirmDeleteBot.tsx index 5c74a530a..83cec18eb 100644 --- a/frontend/src/components/DialogConfirmDeleteBot.tsx +++ b/frontend/src/components/DialogConfirmDeleteBot.tsx @@ -36,7 +36,7 @@ const DialogConfirmDeleteBot: React.FC = (props) => { onClick={() => { props.onDelete(props.target?.id ?? ''); }} - className="bg-red p-2 text-aws-font-color-white"> + className="bg-red p-2 text-aws-font-color-white-light dark:text-aws-font-color-white-dark"> {t('button.delete')}
diff --git a/frontend/src/components/DialogConfirmDeleteChat.tsx b/frontend/src/components/DialogConfirmDeleteChat.tsx index b3290f57f..489c532ab 100644 --- a/frontend/src/components/DialogConfirmDeleteChat.tsx +++ b/frontend/src/components/DialogConfirmDeleteChat.tsx @@ -36,7 +36,7 @@ const DialogConfirmDeleteChat: React.FC = (props) => { onClick={() => { props.onDelete(props.target?.id ?? ''); }} - className="bg-red p-2 text-aws-font-color-white"> + className="bg-red p-2 text-aws-font-color-white-light dark:text-aws-font-color-white-dark"> {t('button.delete')} diff --git a/frontend/src/components/DialogInstructionsSamples.tsx b/frontend/src/components/DialogInstructionsSamples.tsx index 54fb3e73d..24026da66 100644 --- a/frontend/src/components/DialogInstructionsSamples.tsx +++ b/frontend/src/components/DialogInstructionsSamples.tsx @@ -13,7 +13,7 @@ const PromptSample: React.FC = (props) => { return (
{props.title}
-
+
{props.prompt.split('\n').map((s, idx) => (
{s}
))} @@ -58,7 +58,7 @@ const DialogInstructionsSamples: React.FC = (props) => { href={t('bot.samples.anthropicLibrary.url')} target="_blank" rel="noopener noreferrer" - className="text-aws-sea-blue underline hover:text-aws-sea-blue-hover"> + className="text-aws-sea-blue-light dark:text-aws-font-color-blue underline hover:text-aws-sea-blue-hover-light dark:hover:text-aws-sea-blue-hover-dark"> {t('bot.samples.anthropicLibrary.title')}
diff --git a/frontend/src/components/DialogShareBot.tsx b/frontend/src/components/DialogShareBot.tsx index 3f56d445b..61b7f17ee 100644 --- a/frontend/src/components/DialogShareBot.tsx +++ b/frontend/src/components/DialogShareBot.tsx @@ -54,10 +54,10 @@ const DialogShareBot: React.FC = (props) => {
{isShared && ( -
+
diff --git a/frontend/src/components/DrawerItem.tsx b/frontend/src/components/DrawerItem.tsx index 93f4569a1..46612a0f3 100644 --- a/frontend/src/components/DrawerItem.tsx +++ b/frontend/src/components/DrawerItem.tsx @@ -19,8 +19,8 @@ const DrawerItem: React.FC = (props) => { className={twMerge( 'group mx-2 my-1 flex h-10 items-center rounded px-2', props.isActive ?? true - ? 'bg-aws-sea-blue' - : 'hover:bg-aws-sea-blue-hover', + ? 'bg-aws-sea-blue-light dark:bg-aws-sea-blue-dark' + : 'hover:bg-aws-sea-blue-hover-light dark:hover:bg-aws-paper-dark', props.className )} to={props.to} @@ -34,8 +34,8 @@ const DrawerItem: React.FC = (props) => { className={twMerge( 'absolute inset-y-0 right-0 w-8 bg-gradient-to-l', props.isActive - ? 'from-aws-sea-blue' - : 'from-aws-squid-ink group-hover:from-aws-sea-blue-hover' + ? 'from-aws-sea-blue-light dark:from-aws-sea-blue-dark' + : 'from-aws-squid-ink-light dark:from-aws-squid-ink-dark group-hover:from-aws-sea-blue-hover-light dark:group-hover:from-aws-paper-dark' )} /> )} diff --git a/frontend/src/components/GenerationConfig.tsx b/frontend/src/components/GenerationConfig.tsx index 1ad155ac1..1cc065542 100644 --- a/frontend/src/components/GenerationConfig.tsx +++ b/frontend/src/components/GenerationConfig.tsx @@ -36,7 +36,7 @@ const GenerationConfig: React.FC = ({ const { t } = useTranslation(); return (
-
+
{t('generationConfig.description')}
diff --git a/frontend/src/components/InputChatContent.tsx b/frontend/src/components/InputChatContent.tsx index 9c89459d5..96e8456bb 100644 --- a/frontend/src/components/InputChatContent.tsx +++ b/frontend/src/components/InputChatContent.tsx @@ -457,7 +457,7 @@ const InputChatContent = forwardRef((props, focusInputRef) = onDrop={onDrop} className={twMerge( props.className, - 'relative mb-7 flex w-11/12 flex-col rounded-xl border border-black/10 bg-white shadow-[0_0_30px_7px] shadow-light-gray md:w-10/12 lg:w-4/6 xl:w-3/6' + 'relative mb-7 flex w-11/12 flex-col rounded-xl border border-black/10 bg-white dark:bg-aws-ui-color-dark shadow-[0_0_30px_7px] shadow-light-gray dark:shadow-black/35 md:w-10/12 lg:w-4/6 xl:w-3/6' )}>