Skip to content

Commit

Permalink
DuoTonal for AI functions
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Apr 3, 2024
1 parent d8b1f99 commit 21ed38a
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 42 deletions.
4 changes: 2 additions & 2 deletions src/apps/call/CallWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ChatIcon from '@mui/icons-material/Chat';
import CheckRoundedIcon from '@mui/icons-material/CheckRounded';
import CloseRoundedIcon from '@mui/icons-material/CloseRounded';
import MicIcon from '@mui/icons-material/Mic';
import RecordVoiceOverIcon from '@mui/icons-material/RecordVoiceOver';
import RecordVoiceOverTwoToneIcon from '@mui/icons-material/RecordVoiceOverTwoTone';
import WarningRoundedIcon from '@mui/icons-material/WarningRounded';

import { PreferencesTab, useOptimaLayout } from '~/common/layout/optima/useOptimaLayout';
Expand Down Expand Up @@ -129,7 +129,7 @@ export function CallWizard(props: { strict?: boolean, conversationId: string | n

{/* Text to Speech status */}
<StatusCard
icon={<RecordVoiceOverIcon />}
icon={<RecordVoiceOverTwoToneIcon />}
text={
(synthesis.mayWork ? 'Voice synthesis should be ready.' : 'There might be an issue with ElevenLabs voice synthesis.')
+ (synthesis.isConfiguredServerSide ? '' : (synthesis.isConfiguredClientSide ? '' : ' Please add your API key in the settings.'))
Expand Down
4 changes: 2 additions & 2 deletions src/apps/call/Telephone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import CallEndIcon from '@mui/icons-material/CallEnd';
import CallIcon from '@mui/icons-material/Call';
import MicIcon from '@mui/icons-material/Mic';
import MicNoneIcon from '@mui/icons-material/MicNone';
import RecordVoiceOverIcon from '@mui/icons-material/RecordVoiceOver';
import RecordVoiceOverTwoToneIcon from '@mui/icons-material/RecordVoiceOverTwoTone';

import { ScrollToBottom } from '~/common/scroll-to-bottom/ScrollToBottom';
import { ScrollToBottomButton } from '~/common/scroll-to-bottom/ScrollToBottomButton';
Expand Down Expand Up @@ -57,7 +57,7 @@ function CallMenuItems(props: {
</MenuItem>

<MenuItem onClick={handleChangeVoiceToggle}>
<ListItemDecorator><RecordVoiceOverIcon /></ListItemDecorator>
<ListItemDecorator><RecordVoiceOverTwoToneIcon /></ListItemDecorator>
Change Voice
<Switch checked={props.override} onChange={handleChangeVoiceToggle} sx={{ ml: 'auto' }} />
</MenuItem>
Expand Down
4 changes: 2 additions & 2 deletions src/apps/chat/commands/CommandsDraw.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import FormatPaintIcon from '@mui/icons-material/FormatPaint';
import FormatPaintTwoToneIcon from '@mui/icons-material/FormatPaintTwoTone';

import type { ICommandsProvider } from './ICommandsProvider';

Expand All @@ -11,7 +11,7 @@ export const CommandsDraw: ICommandsProvider = {
alternatives: ['/imagine', '/img'],
arguments: ['prompt'],
description: 'Assistant will draw the text',
Icon: FormatPaintIcon,
Icon: FormatPaintTwoToneIcon,
}],

};
4 changes: 2 additions & 2 deletions src/apps/chat/components/composer/Composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import AttachFileIcon from '@mui/icons-material/AttachFile';
import AutoAwesomeIcon from '@mui/icons-material/AutoAwesome';
import AutoModeIcon from '@mui/icons-material/AutoMode';
import ExpandLessIcon from '@mui/icons-material/ExpandLess';
import FormatPaintIcon from '@mui/icons-material/FormatPaint';
import FormatPaintTwoToneIcon from '@mui/icons-material/FormatPaintTwoTone';
import PsychologyIcon from '@mui/icons-material/Psychology';
import SendIcon from '@mui/icons-material/Send';
import StopOutlinedIcon from '@mui/icons-material/StopOutlined';
Expand Down Expand Up @@ -518,7 +518,7 @@ export function Composer(props: {
: isAppend ? <SendIcon sx={{ fontSize: 18 }} />
: isReAct ? <PsychologyIcon />
: isTextBeam ? <ChatBeamIcon /> /* <GavelIcon /> */
: isDraw ? <FormatPaintIcon />
: isDraw ? <FormatPaintTwoToneIcon />
: <TelegramIcon />;

let textPlaceholder: string =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import * as React from 'react';

import { Button, IconButton } from '@mui/joy';
import { SxProps } from '@mui/joy/styles/types';
import FormatPaintIcon from '@mui/icons-material/FormatPaint';
import FormatPaintTwoToneIcon from '@mui/icons-material/FormatPaintTwoTone';


export function ButtonOptionsDraw(props: { isMobile?: boolean, onClick: () => void, sx?: SxProps }) {
return props.isMobile ? (
<IconButton variant='soft' color='warning' onClick={props.onClick} sx={props.sx}>
<FormatPaintIcon />
<FormatPaintTwoToneIcon />
</IconButton>
) : (
<Button variant='soft' color='warning' onClick={props.onClick} sx={props.sx}>
Expand Down
30 changes: 15 additions & 15 deletions src/apps/chat/components/message/ChatMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import { shallow } from 'zustand/shallow';

import type { SxProps } from '@mui/joy/styles/types';
import { Avatar, Box, CircularProgress, IconButton, ListDivider, ListItem, ListItemDecorator, MenuItem, Switch, Tooltip, Typography } from '@mui/joy';
import AccountTreeIcon from '@mui/icons-material/AccountTree';
import AccountTreeTwoToneIcon from '@mui/icons-material/AccountTreeTwoTone';
import ClearIcon from '@mui/icons-material/Clear';
import ContentCopyIcon from '@mui/icons-material/ContentCopy';
import DifferenceIcon from '@mui/icons-material/Difference';
import EditRoundedIcon from '@mui/icons-material/EditRounded';
import Face6Icon from '@mui/icons-material/Face6';
import ForkRightIcon from '@mui/icons-material/ForkRight';
import FormatPaintIcon from '@mui/icons-material/FormatPaint';
import FormatPaintTwoToneIcon from '@mui/icons-material/FormatPaintTwoTone';
import MoreVertIcon from '@mui/icons-material/MoreVert';
import RecordVoiceOverIcon from '@mui/icons-material/RecordVoiceOver';
import RecordVoiceOverTwoToneIcon from '@mui/icons-material/RecordVoiceOverTwoTone';
import ReplayIcon from '@mui/icons-material/Replay';
import SettingsSuggestIcon from '@mui/icons-material/SettingsSuggest';
import SmartToyOutlinedIcon from '@mui/icons-material/SmartToyOutlined';
Expand Down Expand Up @@ -114,7 +114,7 @@ export function makeAvatar(messageAvatar: string | null, messageRole: DMessage['

// icon: text-to-image
if (isTextToImage)
return <FormatPaintIcon sx={{
return <FormatPaintTwoToneIcon sx={{
...avatarIconSx,
animation: `${animationColorRainbow} 1s linear 2.66`,
}} />;
Expand Down Expand Up @@ -650,19 +650,19 @@ export function ChatMessage(props: {
{!!props.onTextDiagram && <ListDivider />}
{!!props.onTextDiagram && (
<MenuItem onClick={handleOpsDiagram} disabled={!couldDiagram}>
<ListItemDecorator><AccountTreeIcon color='success' /></ListItemDecorator>
Diagram ...
<ListItemDecorator><AccountTreeTwoToneIcon /></ListItemDecorator>
Auto-Diagram ...
</MenuItem>
)}
{!!props.onTextImagine && (
<MenuItem onClick={handleOpsImagine} disabled={!couldImagine || props.isImagining}>
<ListItemDecorator>{props.isImagining ? <CircularProgress size='sm' /> : <FormatPaintIcon color='success' />}</ListItemDecorator>
Draw ...
<ListItemDecorator>{props.isImagining ? <CircularProgress size='sm' /> : <FormatPaintTwoToneIcon />}</ListItemDecorator>
Auto-Draw
</MenuItem>
)}
{!!props.onTextSpeak && (
<MenuItem onClick={handleOpsSpeak} disabled={!couldSpeak || props.isSpeaking}>
<ListItemDecorator>{props.isSpeaking ? <CircularProgress size='sm' /> : <RecordVoiceOverIcon color='success' />}</ListItemDecorator>
<ListItemDecorator>{props.isSpeaking ? <CircularProgress size='sm' /> : <RecordVoiceOverTwoToneIcon />}</ListItemDecorator>
Speak
</MenuItem>
)}
Expand Down Expand Up @@ -702,19 +702,19 @@ export function ChatMessage(props: {
>
<MenuItem onClick={handleOpsCopy} sx={{ flex: 1, alignItems: 'center' }}>
<ListItemDecorator><ContentCopyIcon /></ListItemDecorator>
Copy <span style={{ opacity: 0.5 }}>selection</span>
Copy
</MenuItem>
{!!props.onTextDiagram && <ListDivider />}
{!!props.onTextDiagram && <MenuItem onClick={handleOpsDiagram} disabled={!couldDiagram || props.isImagining}>
<ListItemDecorator><AccountTreeIcon color='success' /></ListItemDecorator>
Diagram ...
<ListItemDecorator><AccountTreeTwoToneIcon /></ListItemDecorator>
Auto-Diagram ...
</MenuItem>}
{!!props.onTextImagine && <MenuItem onClick={handleOpsImagine} disabled={!couldImagine || props.isImagining}>
<ListItemDecorator>{props.isImagining ? <CircularProgress size='sm' /> : <FormatPaintIcon color='success' />}</ListItemDecorator>
Imagine
<ListItemDecorator>{props.isImagining ? <CircularProgress size='sm' /> : <FormatPaintTwoToneIcon />}</ListItemDecorator>
Auto-Draw
</MenuItem>}
{!!props.onTextSpeak && <MenuItem onClick={handleOpsSpeak} disabled={!couldSpeak || props.isSpeaking}>
<ListItemDecorator>{props.isSpeaking ? <CircularProgress size='sm' /> : <RecordVoiceOverIcon color='success' />}</ListItemDecorator>
<ListItemDecorator>{props.isSpeaking ? <CircularProgress size='sm' /> : <RecordVoiceOverTwoToneIcon />}</ListItemDecorator>
Speak
</MenuItem>}
</CloseableMenu>
Expand Down
4 changes: 2 additions & 2 deletions src/apps/draw/components/DrawHeading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';

import type { SxProps } from '@mui/joy/styles/types';
import { Box, Button, ButtonGroup, Chip, Divider, IconButton, Typography } from '@mui/joy';
import FormatPaintIcon from '@mui/icons-material/FormatPaint';
import FormatPaintTwoToneIcon from '@mui/icons-material/FormatPaintTwoTone';

import { animationShadowRingLimey } from '~/common/util/animUtils';

Expand Down Expand Up @@ -32,7 +32,7 @@ export function DrawHeading(props: {
backgroundColor: 'background.popup',
animation: `${animationShadowRingLimey} 5s infinite`,
}}>
<FormatPaintIcon />
<FormatPaintTwoToneIcon />
</IconButton>

{/* Messaging */}
Expand Down
4 changes: 2 additions & 2 deletions src/apps/draw/components/PromptDesigner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Box, Button, ButtonGroup, Dropdown, Grid, IconButton, Menu, MenuButton,
import AddIcon from '@mui/icons-material/Add';
import ArrowForwardRoundedIcon from '@mui/icons-material/ArrowForwardRounded';
import AutoFixHighIcon from '@mui/icons-material/AutoFixHigh';
import FormatPaintIcon from '@mui/icons-material/FormatPaint';
import FormatPaintTwoToneIcon from '@mui/icons-material/FormatPaintTwoTone';
import KeyboardArrowLeftIcon from '@mui/icons-material/KeyboardArrowLeft';
import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
import MoreTimeIcon from '@mui/icons-material/MoreTime';
Expand Down Expand Up @@ -287,7 +287,7 @@ export function PromptDesigner(props: {
<Button
key='draw-queue'
variant='solid' color='primary'
endDecorator={<FormatPaintIcon />}
endDecorator={<FormatPaintTwoToneIcon />}
onClick={handlePromptEnqueue}
sx={{
animation: `${animationEnterBelow} 0.1s ease-out`,
Expand Down
6 changes: 3 additions & 3 deletions src/apps/draw/components/ProviderSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';

import { FormControl, FormLabel, ListItemDecorator, Option, Select } from '@mui/joy';
import FormatPaintIcon from '@mui/icons-material/FormatPaint';
import FormatPaintTwoToneIcon from '@mui/icons-material/FormatPaintTwoTone';

import type { TextToImageProvider } from '~/common/components/useCapabilities';
import { OpenAIIcon } from '~/common/components/icons/vendors/OpenAIIcon';
Expand All @@ -22,7 +22,7 @@ export function ProviderSelect(props: {
label: provider.label + (provider.painter !== provider.label ? ` ${provider.painter}` : ''),
value: provider.id,
configured: provider.configured,
Icon: provider.vendor === 'openai' ? OpenAIIcon : FormatPaintIcon,
Icon: provider.vendor === 'openai' ? OpenAIIcon : FormatPaintTwoToneIcon,
});
});
return options;
Expand All @@ -41,7 +41,7 @@ export function ProviderSelect(props: {
value={props.activeProviderId}
placeholder='Select a service'
onChange={(_event, value) => value && props.setActiveProviderId(value)}
// startDecorator={<FormatPaintIcon sx={{ display: { xs: 'none', sm: 'inherit' } }} />}
// startDecorator={<FormatPaintTwoToneIcon sx={{ display: { xs: 'none', sm: 'inherit' } }} />}
sx={{
minWidth: '12rem',
}}
Expand Down
8 changes: 4 additions & 4 deletions src/common/app.nav.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import type { FunctionComponent } from 'react';

// App icons
import AccountTreeIcon from '@mui/icons-material/AccountTree';
import AccountTreeOutlinedIcon from '@mui/icons-material/AccountTreeOutlined';
import AccountTreeTwoToneIcon from '@mui/icons-material/AccountTreeTwoTone';
import AutoAwesomeIcon from '@mui/icons-material/AutoAwesome';
import AutoAwesomeOutlinedIcon from '@mui/icons-material/AutoAwesomeOutlined';
import CallIcon from '@mui/icons-material/Call';
import CallOutlinedIcon from '@mui/icons-material/CallOutlined';
import Diversity2Icon from '@mui/icons-material/Diversity2';
import EventNoteIcon from '@mui/icons-material/EventNote';
import EventNoteOutlinedIcon from '@mui/icons-material/EventNoteOutlined';
import FormatPaintIcon from '@mui/icons-material/FormatPaint';
import FormatPaintOutlinedIcon from '@mui/icons-material/FormatPaintOutlined';
import FormatPaintTwoToneIcon from '@mui/icons-material/FormatPaintTwoTone';
import ImageIcon from '@mui/icons-material/Image';
import ImageOutlinedIcon from '@mui/icons-material/ImageOutlined';
import IosShareIcon from '@mui/icons-material/IosShare';
Expand Down Expand Up @@ -110,7 +110,7 @@ export const navItems: {
name: 'Draw',
barTitle: 'Generate Images',
icon: FormatPaintOutlinedIcon,
iconActive: FormatPaintIcon,
iconActive: FormatPaintTwoToneIcon,
type: 'app',
route: '/draw',
// hideOnMobile: true,
Expand All @@ -130,7 +130,7 @@ export const navItems: {
{
name: 'Patterns',
icon: AccountTreeOutlinedIcon,
iconActive: AccountTreeIcon,
iconActive: AccountTreeTwoToneIcon,
type: 'app',
route: '/patterns',
isDev: true,
Expand Down
8 changes: 8 additions & 0 deletions src/common/app.theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ export const appTheme = extendTheme({
},
},

// JoyMenuItem: {
// styleOverrides: {
// root: {
// '--Icon-fontSize': '1rem', // smaller menu(s) icon - default is 1.25rem ('xl', 20px)
// },
// },
// },

// JoyModal: {
// styleOverrides: {
// backdrop: {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/aifn/digrams/DiagramsModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';

import { Box, Button, ButtonGroup, CircularProgress, Divider, FormControl, FormLabel, Grid, IconButton, Input } from '@mui/joy';
import AccountTreeIcon from '@mui/icons-material/AccountTree';
import AccountTreeTwoToneIcon from '@mui/icons-material/AccountTreeTwoTone';
import ExpandLessIcon from '@mui/icons-material/ExpandLess';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import ReplayIcon from '@mui/icons-material/Replay';
Expand Down Expand Up @@ -165,7 +165,7 @@ export function DiagramsModal(props: { config: DiagramConfig, onClose: () => voi
variant={abortController ? 'soft' : 'solid'} color='primary'
disabled={!diagramLlm}
onClick={abortController ? () => abortController.abort() : handleGenerateNew}
endDecorator={abortController ? <StopOutlinedIcon /> : diagramCode ? <ReplayIcon /> : <AccountTreeIcon />}
endDecorator={abortController ? <StopOutlinedIcon /> : diagramCode ? <ReplayIcon /> : <AccountTreeTwoToneIcon />}
sx={{ minWidth: 200 }}
>
{abortController ? 'Stop' : diagramCode ? 'Regenerate' : 'Generate'}
Expand Down
4 changes: 2 additions & 2 deletions src/modules/elevenlabs/useElevenLabsVoiceDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';

import { CircularProgress, Option, Select } from '@mui/joy';
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
import RecordVoiceOverIcon from '@mui/icons-material/RecordVoiceOver';
import RecordVoiceOverTwoToneIcon from '@mui/icons-material/RecordVoiceOverTwoTone';

import { apiQuery } from '~/common/util/trpc.client';

Expand Down Expand Up @@ -31,7 +31,7 @@ function VoicesDropdown(props: {
variant='outlined' disabled={props.disabled || !props.voices.length}
// color={props.isErrorVoices ? 'danger' : undefined}
placeholder={props.isErrorVoices ? 'Issue loading voices' : props.isValidKey ? 'Select a voice' : 'Missing API Key'}
startDecorator={<RecordVoiceOverIcon />}
startDecorator={<RecordVoiceOverTwoToneIcon />}
endDecorator={props.isValidKey && props.isLoadingVoices && <CircularProgress size='sm' />}
indicator={<KeyboardArrowDownIcon />}
slotProps={{
Expand Down
4 changes: 2 additions & 2 deletions src/modules/t2i/prodia/ProdiaSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { shallow } from 'zustand/shallow';

import { Chip, CircularProgress, FormControl, Input, Option, Select, Slider, Switch } from '@mui/joy';
import CropSquareIcon from '@mui/icons-material/CropSquare';
import FormatPaintIcon from '@mui/icons-material/FormatPaint';
import FormatPaintTwoToneIcon from '@mui/icons-material/FormatPaintTwoTone';
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
import StayPrimaryLandscapeIcon from '@mui/icons-material/StayPrimaryLandscape';
import StayPrimaryPortraitIcon from '@mui/icons-material/StayPrimaryPortrait';
Expand Down Expand Up @@ -92,7 +92,7 @@ export function ProdiaSettings(props: { noSkipKey?: boolean }) {
<Select
variant='outlined' placeholder={isValidKey ? 'Select a model' : 'Enter API Key'}
value={modelId} onChange={handleModelChange}
startDecorator={<FormatPaintIcon sx={{ display: { xs: 'none', sm: 'inherit' } }} />}
startDecorator={<FormatPaintTwoToneIcon sx={{ display: { xs: 'none', sm: 'inherit' } }} />}
endDecorator={isValidKey && loadingModels && <CircularProgress size='sm' />}
indicator={<KeyboardArrowDownIcon />}
slotProps={{
Expand Down

0 comments on commit 21ed38a

Please sign in to comment.