-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
81 changed files
with
4,731 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import styled from 'styled-components' | ||
import ScrollArea from 'react-scrollbar' | ||
|
||
export const ThemedScrollArea = styled(ScrollArea)` | ||
&.scrollarea { | ||
height: 100%; | ||
.scrollbar { | ||
background-color: white !important; | ||
} | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import styled from 'styled-components'; | ||
import ColorId from '../../../styles/ColorId'; | ||
|
||
/** | ||
* without antd dep | ||
*/ | ||
const ThemedTextArea2 = styled.textarea` | ||
color: ${props => props.theme[ColorId.input_foreground]}; | ||
background-color: ${props => props.theme[ColorId.input_background]}; | ||
border: 0; | ||
border-radius: 0; | ||
padding: 4px 11px; | ||
&:focus, &:focus-visible { | ||
border: 0; | ||
box-shadow: none; | ||
outline: none; | ||
} | ||
&::-webkit-scrollbar { | ||
position: absolute; | ||
width: 6px; | ||
} | ||
&::-webkit-scrollbar-track { | ||
} | ||
&::-webkit-scrollbar-thumb { | ||
background-color: darkgrey; | ||
outline: none; | ||
transition: all .4s; | ||
&:hover{ | ||
background: grey; | ||
opacity: .6 !important; | ||
} | ||
&.active{ | ||
background: gray; | ||
opacity: .6 !important; | ||
} | ||
} | ||
&::-webkit-scrollbar-corner { | ||
} | ||
&::-webkit-resizer { | ||
//display: none; | ||
} | ||
`; | ||
|
||
export { | ||
ThemedTextArea2, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import { Menu } from 'antd'; | ||
import styled from 'styled-components'; | ||
import ColorId from '../../../styles/ColorId'; | ||
|
||
|
||
const SideMenu = styled(Menu)` | ||
background-color: ${props => props.theme[ColorId.tab_inactiveBackground]}; | ||
color: ${props => props.theme[ColorId.tab_inactiveForeground]}; | ||
&.ant-menu-vertical, &.ant-menu-inline { | ||
border: none; | ||
} | ||
` | ||
|
||
const SideMenuItem = styled(SideMenu.Item)` | ||
background-color: ${props => props.theme[ColorId.tab_inactiveBackground]}; | ||
&:active { | ||
background-color: ${props => props.theme[ColorId.tab_inactiveBackground]}; | ||
} | ||
> a { | ||
color: ${props => props.theme[ColorId.tab_inactiveForeground]}; | ||
&:hover { | ||
color: ${props => props.theme[ColorId.tab_activeForeground]} | ||
} | ||
} | ||
&.ant-menu-item-selected { | ||
> a, > a:hover { | ||
color: ${props => props.theme[ColorId.tab_activeForeground]}; | ||
} | ||
&:after { | ||
border-right: 3px solid ${props => props.theme[ColorId.tab_activeForeground]}; | ||
//border-right: none; | ||
} | ||
} | ||
.ant-menu:not(.ant-menu-horizontal) &.ant-menu-item-selected { | ||
background-color: ${props => props.theme[ColorId.tab_inactiveBackground]}; | ||
} | ||
` | ||
|
||
const SideSubMenu = styled(SideMenu.SubMenu)` | ||
> .ant-menu { | ||
background-color: ${props => props.theme[ColorId.tab_inactiveBackground]}; | ||
} | ||
.ant-menu-submenu-title { | ||
color: ${props => props.theme[ColorId.tab_inactiveForeground]}; | ||
&:active { | ||
background-color: ${props => props.theme[ColorId.tab_inactiveBackground]}; | ||
} | ||
} | ||
.ant-menu-submenu-title:hover { | ||
color: ${props => props.theme[ColorId.tab_activeForeground]}; | ||
} | ||
&.ant-menu-submenu-inline > .ant-menu-submenu-title:hover .ant-menu-submenu-arrow { | ||
&::before { | ||
background: ${props => props.theme[ColorId.tab_activeForeground]}; | ||
} | ||
&::after { | ||
background: ${props => props.theme[ColorId.tab_activeForeground]}; | ||
} | ||
} | ||
&.ant-menu-submenu-selected { | ||
color: ${props => props.theme[ColorId.tab_activeForeground]}; | ||
} | ||
` | ||
|
||
export { | ||
SideMenu, | ||
SideSubMenu, | ||
SideMenuItem, | ||
} |
38 changes: 38 additions & 0 deletions
38
src/browser/components/themed-ui/selector/llm-provider-selector.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react' | ||
import { LLMProvider } from '../../../../common/services/llm/provider' | ||
import { ThemedSelect } from './select' | ||
|
||
export interface LLMProviderSelectorProps { | ||
value: LLMProvider.Constant | null | ||
availableProviders: LLMProvider.Constant[] | ||
onSelect?: (provider: LLMProvider.Constant) => void | ||
className?: string | ||
} | ||
|
||
export const LLMProviderSelector: React.FC<LLMProviderSelectorProps> = ( | ||
props: LLMProviderSelectorProps, | ||
) => { | ||
const { onSelect, value, availableProviders } = props | ||
const providers = availableProviders.map((e) => LLMProvider.of(e)) | ||
|
||
return ( | ||
<ThemedSelect | ||
className={props.className} | ||
size={'small'} | ||
placeholder="Service Provider" | ||
value={value} | ||
optionLabelProp="label" | ||
onChange={(value) => { | ||
onSelect?.(value as LLMProvider.Constant) | ||
}} | ||
> | ||
{providers.map((e) => { | ||
return ( | ||
<ThemedSelect.Option key={e.name} label={e.label}> | ||
{e.label} | ||
</ThemedSelect.Option> | ||
) | ||
})} | ||
</ThemedSelect> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { Select } from 'antd' | ||
import styled, { createGlobalStyle } from 'styled-components'; | ||
import ColorId from '../../../styles/ColorId'; | ||
|
||
export const GlobalSelectStyles = createGlobalStyle` | ||
.ant-select-dropdown { | ||
border-radius: 0; | ||
color: ${props => props.theme[ColorId.input_foreground]}; | ||
background-color: ${props => props.theme[ColorId.input_background]}; | ||
} | ||
.ant-select-dropdown-menu-item { | ||
border-radius: 0; | ||
background-color: #3C3C3C; | ||
color: #F0F0F0; | ||
&:hover:not(&-disabled) { | ||
background-color: rebeccapurple; | ||
} | ||
&-selected { | ||
background-color: rebeccapurple; | ||
} | ||
&-active { | ||
background-color: rebeccapurple; | ||
&:not(&-disabled) { | ||
background-color: rebeccapurple; | ||
} | ||
} | ||
} | ||
`; | ||
|
||
export const ThemedSelect = styled(Select)` | ||
// &.ant-select-focused { | ||
// .ant-select-selection { | ||
// border-color: ${props => props.theme[ColorId.input_border]}; | ||
// &:hover { | ||
// border-color: ${props => props.theme[ColorId.input_border]}; | ||
// } | ||
// &:focus { | ||
// border-color: ${props => props.theme[ColorId.input_border]}; | ||
// } | ||
// } | ||
// } | ||
.ant-select-selection { | ||
color: ${props => props.theme[ColorId.input_foreground]}; | ||
background-color: ${props => props.theme[ColorId.input_background]}; | ||
border-radius: 0; | ||
//border-color: unset; | ||
border-color: ${props => props.theme[ColorId.input_border]}; | ||
&:focus { | ||
//border-color: unset; | ||
border-color: ${props => props.theme[ColorId.input_border]}; | ||
box-shadow: none; | ||
} | ||
&:hover { | ||
//border-color: unset; | ||
border-color: ${props => props.theme[ColorId.input_border]}; | ||
} | ||
.ant-select-arrow { | ||
color: ${props => props.theme[ColorId.input_foreground]}; | ||
} | ||
} | ||
` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import styled from 'styled-components' | ||
import ColorId from '../../../styles/ColorId' | ||
import React from 'react' | ||
import { Link } from 'react-router-dom' | ||
|
||
export const RouterMenu = styled.ul` | ||
background-color: ${(props) => props.theme[ColorId.tab_inactiveBackground]}; | ||
color: ${(props) => props.theme[ColorId.tab_inactiveForeground]}; | ||
margin: 0; | ||
padding: 0; | ||
` | ||
|
||
const MenuItemContainer = styled.li` | ||
display: inline-block; | ||
//border-bottom: none; | ||
//position: relative; | ||
//list-style: none; | ||
//cursor: pointer; | ||
color:${props => props.theme[ColorId.tab_inactiveForeground]}; | ||
background-color: ${props => props.theme[ColorId.tab_inactiveBackground]}; | ||
&.active { | ||
color:${props => props.theme[ColorId.tab_activeForeground]}; | ||
background-color: ${props => props.theme[ColorId.tab_activeBackground]}; | ||
} | ||
a { | ||
display: inline-block; | ||
text-align: center; | ||
padding: 6px 12px; | ||
width: 8em; | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
vertical-align: middle; | ||
color: unset; | ||
transition: none; | ||
} | ||
a:hover { | ||
color: unset; | ||
} | ||
` | ||
|
||
export const RouterMenuItem: React.FC<any> = (props) => { | ||
let { active, onClick, to, className, children } = props | ||
className += active ? ' active' : '' | ||
return ( | ||
<MenuItemContainer className={className} onClick={onClick}> | ||
<Link tabIndex={-1} to={to}> | ||
{children} | ||
</Link> | ||
</MenuItemContainer> | ||
) | ||
} |
Oops, something went wrong.