feat: new icons (#5412)

This commit is contained in:
zxhlyh
2024-06-20 11:05:08 +08:00
committed by GitHub
parent 0105129fa8
commit 2328ed8ffa
338 changed files with 880 additions and 3669 deletions

View File

@@ -1,6 +1,9 @@
import { useState } from 'react'
import type { FC } from 'react'
import cn from 'classnames'
import {
RiQuestionLine,
} from '@remixicon/react'
import { ValidatingTip } from '../../key-validator/ValidateStatus'
import type {
CredentialFormSchema,
@@ -16,7 +19,6 @@ import { useLanguage } from '../hooks'
import Input from './Input'
import { SimpleSelect } from '@/app/components/base/select'
import Tooltip from '@/app/components/base/tooltip-plus'
import { HelpCircle } from '@/app/components/base/icons/src/vender/line/general'
import Radio from '@/app/components/base/radio'
type FormProps = {
className?: string
@@ -78,7 +80,7 @@ const Form: FC<FormProps> = ({
{tooltip[language] || tooltip.en_US}
</div>
} >
<HelpCircle className='w-3 h-3 text-gray-500' />
<RiQuestionLine className='w-3 h-3 text-gray-500' />
</Tooltip>
</span>))
if (formSchema.type === FormTypeEnum.textInput || formSchema.type === FormTypeEnum.secretInput || formSchema.type === FormTypeEnum.textNumber) {

View File

@@ -7,6 +7,9 @@ import {
useState,
} from 'react'
import { useTranslation } from 'react-i18next'
import {
RiErrorWarningFill,
} from '@remixicon/react'
import type {
CredentialFormSchema,
CredentialFormSchemaRadio,
@@ -40,7 +43,6 @@ import Form from './Form'
import Button from '@/app/components/base/button'
import { Lock01 } from '@/app/components/base/icons/src/vender/solid/security'
import { LinkExternal02 } from '@/app/components/base/icons/src/vender/line/general'
import { AlertCircle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback'
import {
PortalToFollowElem,
PortalToFollowElemContent,
@@ -358,7 +360,7 @@ const ModelModal: FC<ModelModalProps> = ({
(validatedStatusState.status === ValidatedStatus.Error && validatedStatusState.message)
? (
<div className='flex px-[10px] py-3 bg-[#FEF3F2] text-xs text-[#D92D20]'>
<AlertCircle className='mt-[1px] mr-2 w-[14px] h-[14px]' />
<RiErrorWarningFill className='mt-[1px] mr-2 w-[14px] h-[14px]' />
{validatedStatusState.message}
</div>
)

View File

@@ -7,6 +7,9 @@ import {
useState,
} from 'react'
import { useTranslation } from 'react-i18next'
import {
RiErrorWarningFill,
} from '@remixicon/react'
import type {
CredentialFormSchema,
CredentialFormSchemaRadio,
@@ -32,7 +35,6 @@ import Form from './Form'
import Button from '@/app/components/base/button'
import { Lock01 } from '@/app/components/base/icons/src/vender/solid/security'
import { LinkExternal02 } from '@/app/components/base/icons/src/vender/line/general'
import { AlertCircle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback'
import {
PortalToFollowElem,
PortalToFollowElemContent,
@@ -303,7 +305,7 @@ const ModelLoadBalancingEntryModal: FC<ModelModalProps> = ({
(validatedStatusState.status === ValidatedStatus.Error && validatedStatusState.message)
? (
<div className='flex px-[10px] py-3 bg-[#FEF3F2] text-xs text-[#D92D20]'>
<AlertCircle className='mt-[1px] mr-2 w-[14px] h-[14px]' />
<RiErrorWarningFill className='mt-[1px] mr-2 w-[14px] h-[14px]' />
{validatedStatusState.message}
</div>
)

View File

@@ -1,10 +1,12 @@
import type { FC } from 'react'
import { useEffect, useRef, useState } from 'react'
import cn from 'classnames'
import {
RiQuestionLine,
} from '@remixicon/react'
import type { ModelParameterRule } from '../declarations'
import { useLanguage } from '../hooks'
import { isNullOrUndefined } from '../utils'
import { HelpCircle } from '@/app/components/base/icons/src/vender/line/general'
import Switch from '@/app/components/base/switch'
import Tooltip from '@/app/components/base/tooltip'
import Slider from '@/app/components/base/slider'
@@ -234,7 +236,7 @@ const ParameterItem: FC<ParameterItemProps> = ({
<div className='w-[200px] whitespace-pre-wrap'>{parameterRule.help[language] || parameterRule.help.en_US}</div>
)}
>
<HelpCircle className='mr-1.5 w-3.5 h-3.5 text-gray-400' />
<RiQuestionLine className='mr-1.5 w-3.5 h-3.5 text-gray-400' />
</Tooltip>
)
}

View File

@@ -1,9 +1,9 @@
import type { FC } from 'react'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import { RiArrowDownSLine } from '@remixicon/react'
import Dropdown from '@/app/components/base/dropdown'
import { SlidersH } from '@/app/components/base/icons/src/vender/line/mediaAndDevices'
import { ChevronDown } from '@/app/components/base/icons/src/vender/line/arrows'
import { Brush01 } from '@/app/components/base/icons/src/vender/solid/editor'
import { Scales02 } from '@/app/components/base/icons/src/vender/solid/FinanceAndECommerce'
import { Target04 } from '@/app/components/base/icons/src/vender/solid/general'
@@ -27,7 +27,7 @@ const PresetsParameter: FC<PresetsParameterProps> = ({
>
<SlidersH className='mr-[5px] w-3.5 h-3.5 text-gray-500' />
{t('common.modelProvider.loadPresets')}
<ChevronDown className='ml-0.5 w-3.5 h-3.5 text-gray-500' />
<RiArrowDownSLine className='ml-0.5 w-3.5 h-3.5 text-gray-500' />
</div>
)
}, [])

View File

@@ -1,6 +1,7 @@
import type { FC } from 'react'
import { useTranslation } from 'react-i18next'
import cn from 'classnames'
import { RiArrowDownSLine } from '@remixicon/react'
import type {
Model,
ModelItem,
@@ -14,7 +15,6 @@ import { useProviderContext } from '@/context/provider-context'
import { SlidersH } from '@/app/components/base/icons/src/vender/line/mediaAndDevices'
import { AlertTriangle } from '@/app/components/base/icons/src/vender/line/alertsAndFeedback'
import TooltipPlus from '@/app/components/base/tooltip-plus'
import { ChevronDown } from '@/app/components/base/icons/src/vender/line/arrows'
export type TriggerProps = {
open?: boolean
@@ -106,7 +106,7 @@ const Trigger: FC<TriggerProps> = ({
<SlidersH className={cn(!isInWorkflow ? 'text-indigo-600' : 'text-gray-500', 'shrink-0 w-4 h-4')} />
)
}
{isInWorkflow && (<ChevronDown className='absolute top-[9px] right-2 w-3.5 h-3.5 text-gray-500' />)}
{isInWorkflow && (<RiArrowDownSLine className='absolute top-[9px] right-2 w-3.5 h-3.5 text-gray-500' />)}
</div>
)
}

View File

@@ -1,5 +1,5 @@
import type { FC } from 'react'
import { ChevronDown } from '@/app/components/base/icons/src/vender/line/arrows'
import { RiArrowDownSLine } from '@remixicon/react'
import { CubeOutline } from '@/app/components/base/icons/src/vender/line/shapes'
type ModelTriggerProps = {
@@ -30,7 +30,7 @@ const ModelTrigger: FC<ModelTriggerProps> = ({
</div>
</div>
<div className='shrink-0 flex items-center justify-center w-4 h-4'>
<ChevronDown className='w-3.5 h-3.5 text-gray-500' />
<RiArrowDownSLine className='w-3.5 h-3.5 text-gray-500' />
</div>
</div>
)

View File

@@ -1,4 +1,5 @@
import type { FC } from 'react'
import { RiArrowDownSLine } from '@remixicon/react'
import type {
Model,
ModelItem,
@@ -11,7 +12,6 @@ import { useLanguage } from '../hooks'
import ModelIcon from '../model-icon'
import ModelName from '../model-name'
import { AlertTriangle } from '@/app/components/base/icons/src/vender/line/alertsAndFeedback'
import { ChevronDown } from '@/app/components/base/icons/src/vender/line/arrows'
import TooltipPlus from '@/app/components/base/tooltip-plus'
type ModelTriggerProps = {
@@ -61,7 +61,7 @@ const ModelTrigger: FC<ModelTriggerProps> = ({
</TooltipPlus>
)
: (
<ChevronDown
<RiArrowDownSLine
className='w-3.5 h-3.5 text-gray-500'
/>
)

View File

@@ -1,5 +1,8 @@
import type { FC } from 'react'
import { useState } from 'react'
import {
RiSearchLine,
} from '@remixicon/react'
import type {
DefaultModel,
Model,
@@ -7,7 +10,6 @@ import type {
} from '../declarations'
import { useLanguage } from '../hooks'
import PopupItem from './popup-item'
import { SearchLg } from '@/app/components/base/icons/src/vender/line/general'
import { XCircle } from '@/app/components/base/icons/src/vender/solid/general'
type PopupProps = {
@@ -47,7 +49,7 @@ const Popup: FC<PopupProps> = ({
flex items-center pl-[9px] pr-[10px] h-8 rounded-lg border
${searchText ? 'bg-white border-gray-300 shadow-xs' : 'bg-gray-100 border-transparent'}
`}>
<SearchLg
<RiSearchLine
className={`
shrink-0 mr-[7px] w-[14px] h-[14px]
${searchText ? 'text-gray-500' : 'text-gray-400'}

View File

@@ -1,5 +1,7 @@
import {
RiExternalLinkLine,
} from '@remixicon/react'
import { CubeOutline } from '@/app/components/base/icons/src/vender/line/shapes'
import { LinkExternal01 } from '@/app/components/base/icons/src/vender/line/general'
const ModelTrigger = () => {
return (
@@ -16,7 +18,7 @@ const ModelTrigger = () => {
</div>
</div>
<div className='shrink-0 flex items-center justify-center w-4 h-4'>
<LinkExternal01 className='w-3.5 h-3.5 text-gray-500' />
<RiExternalLinkLine className='w-3.5 h-3.5 text-gray-500' />
</div>
</div>
)

View File

@@ -1,6 +1,9 @@
import type { FC } from 'react'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import {
RiLoader2Line,
} from '@remixicon/react'
import type {
CustomConfigurationModelFixedFields,
ModelItem,
@@ -19,7 +22,6 @@ import QuotaPanel from './quota-panel'
import ModelList from './model-list'
import AddModelButton from './add-model-button'
import { ChevronDownDouble } from '@/app/components/base/icons/src/vender/line/arrows'
import { Loading02 } from '@/app/components/base/icons/src/vender/line/general'
import { fetchModelProviderModelList } from '@/service/common'
import { useEventEmitterContextContext } from '@/context/event-emitter'
import { IS_CE_EDITION } from '@/config'
@@ -131,7 +133,7 @@ const ProviderAddedCard: FC<ProviderAddedCardProps> = ({
}
{
loading && (
<Loading02 className='ml-0.5 animate-spin w-3 h-3' />
<RiLoader2Line className='ml-0.5 animate-spin w-3 h-3' />
)
}
</div>

View File

@@ -2,13 +2,17 @@ import classNames from 'classnames'
import type { Dispatch, SetStateAction } from 'react'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import {
RiDeleteBinLine,
RiQuestionLine,
} from '@remixicon/react'
import type { ConfigurationMethodEnum, CustomConfigurationModelFixedFields, ModelLoadBalancingConfig, ModelLoadBalancingConfigEntry, ModelProvider } from '../declarations'
import Indicator from '../../../indicator'
import CooldownTimer from './cooldown-timer'
import TooltipPlus from '@/app/components/base/tooltip-plus'
import Switch from '@/app/components/base/switch'
import { Balance } from '@/app/components/base/icons/src/vender/line/financeAndECommerce'
import { Edit02, HelpCircle, Plus02, Trash03 } from '@/app/components/base/icons/src/vender/line/general'
import { Edit02, Plus02 } from '@/app/components/base/icons/src/vender/line/general'
import { AlertTriangle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback'
import { useModalContextSelector } from '@/context/modal-context'
import UpgradeBtn from '@/app/components/billing/upgrade-btn'
@@ -157,7 +161,7 @@ const ModelLoadBalancingConfigs = ({
<div className='flex items-center gap-1 text-sm'>
{t('common.modelProvider.loadBalancing')}
<TooltipPlus popupContent={t('common.modelProvider.loadBalancingInfo')} popupClassName='max-w-[300px]'>
<HelpCircle className='w-3 h-3 text-gray-400' />
<RiQuestionLine className='w-3 h-3 text-gray-400' />
</TooltipPlus>
</div>
<div className='text-xs text-gray-500'>{t('common.modelProvider.loadBalancingDescription')}</div>
@@ -213,7 +217,7 @@ const ModelLoadBalancingConfigs = ({
className='flex items-center justify-center w-8 h-8 text-gray-500 bg-white rounded-lg transition-colors cursor-pointer hover:bg-black/5'
onClick={() => updateConfigEntry(index, () => undefined)}
>
<Trash03 className='w-4 h-4' />
<RiDeleteBinLine className='w-4 h-4' />
</span>
<span className='mr-2 h-3 border-r border-r-gray-100' />
</div>

View File

@@ -2,8 +2,11 @@ import { Fragment } from 'react'
import type { FC } from 'react'
import { Popover, Transition } from '@headlessui/react'
import { useTranslation } from 'react-i18next'
import {
RiCheckLine,
RiMoreFill,
} from '@remixicon/react'
import { PreferredProviderTypeEnum } from '../declarations'
import { Check, DotsHorizontal } from '@/app/components/base/icons/src/vender/line/general'
import Button from '@/app/components/base/button'
type SelectorProps = {
@@ -35,7 +38,7 @@ const Selector: FC<SelectorProps> = ({
px-0 w-6 h-6 bg-white rounded-md
${open && '!bg-gray-100'}
`}>
<DotsHorizontal className='w-3 h-3 text-gray-700' />
<RiMoreFill className='w-3 h-3 text-gray-700' />
</Button>
)
}
@@ -57,7 +60,7 @@ const Selector: FC<SelectorProps> = ({
onClick={() => onSelect(option.key)}
>
<div className='grow'>{option.text}</div>
{value === option.key && <Check className='w-4 h-4 text-primary-600' />}
{value === option.key && <RiCheckLine className='w-4 h-4 text-primary-600' />}
</div>
</Popover.Button>
))

View File

@@ -1,5 +1,8 @@
import type { FC } from 'react'
import { useTranslation } from 'react-i18next'
import {
RiAddLine,
} from '@remixicon/react'
import type {
ModelProvider,
} from '../declarations'
@@ -14,7 +17,7 @@ import {
import ModelBadge from '../model-badge'
import ProviderIcon from '../provider-icon'
import s from './index.module.css'
import { Plus, Settings01 } from '@/app/components/base/icons/src/vender/line/general'
import { Settings01 } from '@/app/components/base/icons/src/vender/line/general'
import Button from '@/app/components/base/button'
type ProviderCardProps = {
@@ -76,7 +79,7 @@ const ProviderCard: FC<ProviderCardProps> = ({
className='px-0 h-7 bg-white text-xs text-gray-700'
onClick={() => onOpenModal(method)}
>
<Plus className='mr-[5px] w-3.5 h-3.5' />
<RiAddLine className='mr-[5px] w-3.5 h-3.5' />
{t('common.modelProvider.addModel')}
</Button>
)

View File

@@ -1,6 +1,9 @@
import type { FC } from 'react'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import {
RiQuestionLine,
} from '@remixicon/react'
import ModelSelector from '../model-selector'
import {
useModelList,
@@ -13,7 +16,7 @@ import type {
} from '../declarations'
import { ModelTypeEnum } from '../declarations'
import Tooltip from '@/app/components/base/tooltip'
import { HelpCircle, Settings01 } from '@/app/components/base/icons/src/vender/line/general'
import { Settings01 } from '@/app/components/base/icons/src/vender/line/general'
import {
PortalToFollowElem,
PortalToFollowElemContent,
@@ -148,7 +151,7 @@ const SystemModel: FC<SystemModelSelectorProps> = ({
<div className='w-[261px] text-gray-500'>{t('common.modelProvider.systemReasoningModel.tip')}</div>
}
>
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400' />
<RiQuestionLine className='ml-0.5 w-[14px] h-[14px] text-gray-400' />
</Tooltip>
</div>
<div>
@@ -168,7 +171,7 @@ const SystemModel: FC<SystemModelSelectorProps> = ({
<div className='w-[261px] text-gray-500'>{t('common.modelProvider.embeddingModel.tip')}</div>
}
>
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400' />
<RiQuestionLine className='ml-0.5 w-[14px] h-[14px] text-gray-400' />
</Tooltip>
</div>
<div>
@@ -188,7 +191,7 @@ const SystemModel: FC<SystemModelSelectorProps> = ({
<div className='w-[261px] text-gray-500'>{t('common.modelProvider.rerankModel.tip')}</div>
}
>
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400' />
<RiQuestionLine className='ml-0.5 w-[14px] h-[14px] text-gray-400' />
</Tooltip>
</div>
<div>
@@ -208,7 +211,7 @@ const SystemModel: FC<SystemModelSelectorProps> = ({
<div className='w-[261px] text-gray-500'>{t('common.modelProvider.speechToTextModel.tip')}</div>
}
>
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400' />
<RiQuestionLine className='ml-0.5 w-[14px] h-[14px] text-gray-400' />
</Tooltip>
</div>
<div>
@@ -228,7 +231,7 @@ const SystemModel: FC<SystemModelSelectorProps> = ({
<div className='w-[261px] text-gray-500'>{t('common.modelProvider.ttsModel.tip')}</div>
}
>
<HelpCircle className='ml-0.5 w-[14px] h-[14px] text-gray-400' />
<RiQuestionLine className='ml-0.5 w-[14px] h-[14px] text-gray-400' />
</Tooltip>
</div>
<div>