This commit is contained in:
archer
2023-07-17 10:20:30 +08:00
parent 98a5796592
commit 246283ee1c
46 changed files with 1747 additions and 780 deletions

View File

@@ -0,0 +1,22 @@
import React from 'react';
import { Flex, type FlexProps } from '@chakra-ui/react';
import MyIcon from '@/components/Icon';
const CloseIcon = (props: FlexProps) => {
return (
<Flex
cursor={'pointer'}
w={'22px'}
h={'22px'}
alignItems={'center'}
justifyContent={'center'}
borderRadius={'50%'}
_hover={{ bg: 'myGray.200' }}
{...props}
>
<MyIcon name={'closeLight'} w={'12px'} color={'myGray.500'} />
</Flex>
);
};
export default CloseIcon;

View File

@@ -0,0 +1,25 @@
import React from 'react';
import MyIcon from '@/components/Icon';
import { IconProps } from '@chakra-ui/react';
const DeleteIcon = (props: IconProps) => {
return (
<MyIcon
className="delete"
name={'delete' as any}
w={'14px'}
_hover={{ color: 'red.600' }}
display={['block', 'none']}
cursor={'pointer'}
{...props}
/>
);
};
export default DeleteIcon;
export const hoverDeleteStyles = {
'& .delete': {
display: 'block'
}
};

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1689489239258" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="23019" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M145.6 0C100.8 0 64 36.8 64 81.6v860.8C64 987.2 100.8 1024 145.6 1024h732.8c44.8 0 81.6-36.8 81.6-81.6V324.8L656 0H145.6z" fill="#45B058" p-id="23020"></path><path d="M388.8 691.2c1.6 1.6 3.2 4.8 3.2 8 0 6.4-4.8 11.2-11.2 11.2-3.2 0-6.4 0-8-3.2-11.2-12.8-30.4-22.4-48-22.4-41.6 0-73.6 32-73.6 78.4 0 44.8 32 78.4 73.6 78.4 17.6 0 35.2-8 48-22.4 1.6-1.6 4.8-3.2 8-3.2 6.4 0 11.2 4.8 11.2 11.2 0 3.2-1.6 6.4-3.2 8-14.4 16-35.2 27.2-64 27.2-56 0-99.2-40-99.2-99.2s43.2-99.2 99.2-99.2c28.8 0 49.6 11.2 64 27.2z m108.8 171.2c-28.8 0-51.2-9.6-67.2-24-3.2-1.6-3.2-4.8-3.2-8 0-6.4 3.2-12.8 11.2-12.8 1.6 0 4.8 1.6 6.4 3.2 12.8 11.2 32 20.8 54.4 20.8 33.6 0 44.8-19.2 44.8-33.6 0-49.6-113.6-22.4-113.6-91.2 0-30.4 27.2-52.8 65.6-52.8 24 0 46.4 8 62.4 20.8 1.6 1.6 3.2 4.8 3.2 8 0 6.4-4.8 11.2-11.2 11.2-1.6 0-4.8 0-6.4-1.6-14.4-11.2-32-17.6-49.6-17.6-24 0-40 12.8-40 30.4 0 43.2 113.6 19.2 113.6 91.2 0 27.2-19.2 56-70.4 56z m272-179.2L702.4 848c-3.2 8-9.6 12.8-17.6 12.8h-1.6c-8 0-16-4.8-19.2-12.8l-65.6-164.8c-1.6-1.6-1.6-3.2-1.6-4.8 0-6.4 4.8-12.8 12.8-12.8 4.8 0 9.6 3.2 11.2 8l62.4 160 62.4-160c1.6-4.8 6.4-8 11.2-8 8 0 14.4 6.4 14.4 12.8 0 1.6-1.6 3.2-1.6 4.8z" fill="#FFFFFF" p-id="23021"></path><path d="M960 326.4v16H755.2s-100.8-20.8-97.6-108.8c0 0 3.2 92.8 96 92.8H960z" fill="#349C42" p-id="23022"></path><path d="M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z" fill="#FFFFFF" p-id="23023"></path></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1689488775813" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6900" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M448 768h448V256H448v512z" fill="#7839ee" opacity=".1" p-id="6901"></path><path d="M960 928H384v-64h576v64z m0-768H384v-64h576v64zM128 736H64v-64h64v64z m0-128H64v-64h64v64z m0-128H64v-64h64v64z m0-128H64v-64h64v64z m0-128H64v-64h64v64zM320 800H256v-64h64v64z m0-128H256v-64h64v64z m0-128H256v-64h64v64z m0-128H256v-64h64v64z m0-128H256v-64h64v64zM640 256h64v512h-64z" fill="#7839ee" p-id="6902"></path><path d="M672 160l96 128H576l96-128zM672 864l96-128H576l96 128z" fill="#7839ee" p-id="6903"></path></svg>

After

Width:  |  Height:  |  Size: 839 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1689489413405" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2128" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M753 521.1c-23.2-60.8-116.5-56.6-143.1-4.8-15.9-52.8-121.7-70.4-146.8-6.4 0-51.1-0.8-271.7-0.8-271.7-0.1-32.3-26.3-58.3-58.5-58.3s-58.4 26-58.5 58.3l-1.9 433.7s-23.1-53.6-81.8-83.9c-94.5-48.6-137.3 17.9-92.8 62.6C266.4 748.7 322.2 830.3 356 922c28.6 77.5 87.4 94.2 87.4 94.2h366c48.2-31 62.3-134.1 62.3-134.1V582.2c-0.3-111.6-120.1-93.8-118.7-61.1z" p-id="2129" fill="#4e83fd"></path><path d="M286.3 442.9v-72.4c-36.3-32.1-59.6-78.5-59.6-130.8 0-96.7 78.5-175.2 175.2-175.2 96.7 0 175.2 78.5 175.2 175.2 0 51.2-22.4 96.9-57.4 128.9v74.1c69.9-40.6 117.6-115.4 117.6-202.1 0-129.4-105-234.4-234.4-234.4s-234.4 105-234.4 234.4c-0.1 86.9 47.7 161.8 117.8 202.3z" p-id="2130" fill="#4e83fd"></path></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1689489324421" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="28738" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M166.32 808.98l-99.28 99.28c-15.31 15.32-39.71 15.32-55.03 0-15.32-15.31-15.32-39.71 0-55.03l98.71-99.28c15.32-15.31 39.71-15.31 55.03 0 15.32 15.32 15.32 39.72 0.57 55.03z m48.22 48.79l-99.28 99.27c-15.31 15.32-15.31 39.71 0 55.03 15.32 15.32 39.71 15.32 55.03 0l99.28-99.28c15.32-15.32 15.32-39.71 0-55.03-15.32-15.31-39.72-15.31-55.03 0.01z m625.14-545.16c0 71.47-57.86 129.34-129.34 129.34S581 384.08 581 312.61c0-71.48 57.86-129.34 129.34-129.34 72.05 0 129.91 57.86 129.34 129.34z m-77.71 0.57c0-28.36-23.26-51.63-51.62-51.63-28.36 0-51.62 23.26-51.62 51.63 0 28.36 23.26 51.62 51.62 51.62 28.93 0 52.19-23.26 51.62-51.62z m236.56 68.07c-27.8 104.39-83.39 203.65-164.51 285.35h-3.97l-5.11 5.67c10.21 38.57 11.35 78.28 2.84 116.86-9.07 46.52-32.33 90.2-66.94 124.8l-2.27 2.27c-38.57 36.87-85.09 59.57-134.45 67.51-51.62 7.94-105.51 0-152.6-23.26-17.58-10.21-25.53-32.9-16.45-51.63 1.7-2.84 3.41-5.67 5.67-8.5 14.18-15.32 24.96-32.9 32.9-51.63l3.4-7.94c-10.21 1.7-20.42 4.53-30.63 5.1-29.5 4.54-60.14 6.24-90.2 5.67-10.21 0-19.86-3.97-26.1-11.35L181.63 671.14c-8.51-7.95-11.35-18.72-10.78-29.5 0-28.37 2.27-58.43 5.67-86.79 1.7-10.78 2.84-20.99 5.1-31.2l-8.51 3.4c-17.58 7.95-35.17 18.72-51.06 33.47-14.75 14.18-39.14 12.48-53.32-2.27-2.27-2.84-3.97-7.37-6.24-10.21-23.26-47.09-30.63-99.28-22.69-150.9 8.22-51.8 32.65-99.66 69.78-136.71 34.61-34.61 78.85-57.86 123.67-66.94 39.14-8.51 79.42-7.94 116.86 2.27l7.95-7.95C439.75 106.69 538.45 51.66 642.83 23.3c108.35-28.36 222.38-28.36 329.59 0 13.62 4.54 23.82 15.32 27.23 27.23l0.57 0.57v0.56c28.37 107.78 28.37 221.81-1.69 329.59zM936.12 92.51c-89.06-19.86-182.67-18.16-270.03 5.1-91.34 24.96-178.7 73.18-250.74 145.22l-10.78 10.78-10.21 11.35c-10.21 11.35-26.66 16.45-42.55 10.78-31.2-12.48-65.81-14.75-98.71-7.38-31.2 6.81-61.27 22.13-86.23 46.52-26.66 27.8-43.12 60.7-48.79 95.3-3.4 20.99-3.4 42.55 0.57 62.97 9.64-5.67 18.72-10.78 28.93-14.18 26.66-11.34 55.6-18.15 84.53-18.72 3.97-0.57 7.94 0 11.91 0.56 19.86 5.67 31.77 26.66 26.1 46.52-7.95 26.1-13.05 52.2-16.45 78.29-1.7 22.12-3.4 43.12-3.97 64.67l146.36 146.93c22.12-1.14 43.11-2.27 64.67-5.11 27.23-3.97 52.76-8.51 78.29-15.89 3.97-0.56 7.94-1.13 11.91-1.13 20.42 0.57 36.31 18.72 36.31 39.14-1.7 29.5-7.38 58.43-19.29 85.66-3.97 9.08-9.07 19.29-14.18 28.36 20.42 3.97 41.98 3.97 62.4 1.13 33.47-5.1 66.94-20.99 93.03-47.09l1.13-1.13c24.39-24.96 39.71-55.6 47.09-86.79 6.81-32.34 3.97-66.94-7.94-99.28-4.54-14.18-1.7-30.64 10.21-41.41l11.91-11.35 8.51-8.51 2.27-1.13c72.04-72.61 119.7-159.41 145.79-250.17 23.27-89.05 25.54-180.95 7.95-270.01z" p-id="28739" fill="#FB7C3C"></path></svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1689491332665" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5892" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M393.2 701.7c-8.2 0-16.4-3.1-22.6-9.4-12.5-12.5-12.5-32.8 0-45.3l115.3-115.3c14-14 36.9-14 50.9 0L652.1 647c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-95.5-95.5-95.5 95.5c-6.2 6.2-14.4 9.4-22.6 9.4z" fill="" p-id="5893"></path><path d="M511.3 921.1c-17.7 0-32-14.3-32-32v-276c0-17.7 14.3-32 32-32s32 14.3 32 32v276c0 17.6-14.3 32-32 32z" fill="" p-id="5894"></path><path d="M732.7 784.9c-17.7 0-32-14.3-32-32s14.3-32 32-32c90.6 0 164.3-73.7 164.3-164.3 0-82.9-61.9-153-144-163.1l-22.7-2.8-4.7-22.4c-20.8-99.9-110.1-172.4-212.4-172.4-102.2 0-191.5 72.5-212.4 172.4l-4.7 22.4-22.7 2.8c-82.1 10.1-144 80.2-144 163.1 0 90.6 73.7 164.3 164.3 164.3 17.7 0 32 14.3 32 32s-14.3 32-32 32c-61 0-118.3-23.8-161.5-66.9-43.1-43.1-66.9-100.5-66.9-161.5 0-107.6 75.2-199.7 178.2-222.8 15.8-53.8 47.7-102.2 91.3-138.1 50.1-41.2 113.4-63.9 178.3-63.9s128.3 22.7 178.3 63.9c43.6 35.9 75.5 84.3 91.3 138.1C885.9 356.8 961 448.9 961 556.5c0 61-23.8 118.3-66.9 161.5-43.1 43.1-100.4 66.9-161.4 66.9z" fill="" p-id="5895"></path></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1689496771994" class="icon" viewBox="0 0 1028 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12388" xmlns:xlink="http://www.w3.org/1999/xlink" ><path d="M646.4 512l345.6-345.6c38.4-38.4 38.4-96 0-134.4-38.4-38.4-96-38.4-134.4 0L512 377.6 166.4 32C128-6.4 70.4-6.4 32 32c-38.4 38.4-38.4 96 0 134.4L377.6 512l-345.6 345.6c-38.4 38.4-38.4 96 0 134.4 19.2 19.2 44.8 25.6 70.4 25.6s51.2-6.4 70.4-25.6L512 646.4l345.6 345.6c19.2 19.2 44.8 25.6 70.4 25.6s51.2-6.4 70.4-25.6c38.4-38.4 38.4-96 0-134.4L646.4 512z" p-id="12389"></path></svg>

After

Width:  |  Height:  |  Size: 689 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1689485689790" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3190" xmlns:xlink="http://www.w3.org/1999/xlink" ><path d="M953.86906337 704.50762194c-19.00036972 0.29457937-34.31849726 15.90728628-34.02391788 34.90765601v87.63736424c0 38.29531883-30.34167568 69.52073264-67.75325638 69.52073264H175.00119435c-37.4115807 0-67.75325639-31.22541381-67.7532564-69.52073264V201.80791751c0-38.29531883 30.34167568-69.52073264 67.7532564-69.52073264h235.66350044l87.49007456 155.6852c7.06990501 12.37233377 20.32597692 18.70579035 33.43475913 17.23289348h320.35507094c37.4115807 0 67.75325639 31.22541381 67.75325639 69.52073264v86.90091578c0 19.2949491 15.31812754 34.907656 34.17120756 34.90765601 18.85308003 0 34.02391789-15.61270692 34.02391788-34.90765601 0-0.88373813 0-1.76747625-0.14728968-2.65121438v-84.2497014c0-76.73792734-60.68335138-139.04146527-135.50651276-139.04146528H547.20223538l-87.34278486-155.09604125c-7.80635344-13.99252034-19.00036972-17.67476253-28.86877881-17.38018316l-0.14728967-0.14728968h-256.28405678c-74.82316139 0-135.50651276 62.30353794-135.50651277 139.04146527v623.47724842c0 76.73792734 60.68335138 139.04146527 135.50651277 139.04146527H852.23917881c74.82316139 0 135.50651276-62.30353794 135.50651276-139.04146527v-83.51325297c0.1472897-0.88373813 0.1472897-1.76747625 0.14728968-2.65121439 0.1472897-9.13196064-3.38766283-17.96934191-9.86840907-24.45008817-6.33345658-6.62803595-15.02354815-10.31027814-24.15550881-10.45756784z" p-id="3191"></path><path d="M473.55739149 451.90580738c-5.44971845-5.89158752-12.96149253-9.27925033-21.06242536-9.27925032-7.95364315 0-15.61270692 3.38766283-21.06242536 9.27925032l-125.49081399 133.59174683-0.73644843 0.73644844h-0.14728971l-0.73644843 0.73644844c-11.34130596 12.51962347-11.34130596 31.66728287 0 44.18690633l125.93268305 134.32819525c5.30242877 5.89158752 12.81420285 9.13196064 20.76784599 9.27925035 7.95364315 0 15.46541722-3.24037312 20.76784598-9.13196064l0.58915876-0.73644844c11.34130596-12.51962347 11.34130596-31.66728287 0-44.18690633l-75.85418922-81.00932829h344.51057975c16.05457598 0 29.16335819-13.99252034 29.16335819-31.07812414 0-17.08560379-13.10878221-31.07812413-29.16335819-31.07812411h-343.18497256l75.70689953-80.86203861c11.63588534-12.51962347 11.63588534-32.10915193 0-44.77606508z" p-id="3192"></path></svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -54,7 +54,14 @@ const map = {
voice: require('./icons/voice.svg').default,
html: require('./icons/file/html.svg').default,
pdf: require('./icons/file/pdf.svg').default,
markdown: require('./icons/file/markdown.svg').default
markdown: require('./icons/file/markdown.svg').default,
importLight: require('./icons/light/import.svg').default,
manualImport: require('./icons/file/manualImport.svg').default,
indexImport: require('./icons/file/indexImport.svg').default,
csvImport: require('./icons/file/csv.svg').default,
qaImport: require('./icons/file/qaImport.svg').default,
uploadFile: require('./icons/file/uploadFile.svg').default,
closeLight: require('./icons/light/close.svg').default
};
export type IconName = keyof typeof map;

View File

@@ -1,25 +1,47 @@
import React from 'react';
import { Stack, Box, Flex, useTheme } from '@chakra-ui/react';
import { Box, Flex, useTheme, Grid, type GridProps, theme } from '@chakra-ui/react';
import type { StackProps } from '@chakra-ui/react';
import MyIcon from '@/components/Icon';
// @ts-ignore
interface Props extends StackProps {
list: { label: string; value: string | number }[];
interface Props extends GridProps {
list: { icon?: string; title: string; desc?: string; value: string | number }[];
align?: 'top' | 'center';
value: string | number;
onChange: (e: string | number) => void;
}
const Radio = ({ list, value, onChange, ...props }: Props) => {
const MyRadio = ({ list, value, align = 'center', onChange, ...props }: Props) => {
const theme = useTheme();
return (
<Stack {...props} spacing={5} direction={'row'}>
<Grid gridGap={[3, 5]} fontSize={['sm', 'md']} {...props}>
{list.map((item) => (
<Flex
key={item.value}
alignItems={'center'}
alignItems={align}
cursor={'pointer'}
userSelect={'none'}
_before={{
py={3}
pl={'14px'}
pr={'36px'}
border={theme.borders.sm}
borderWidth={'1.5px'}
borderRadius={'md'}
bg={'myWhite.300'}
position={'relative'}
{...(value === item.value
? {
borderColor: 'myBlue.700'
}
: {
_hover: {
bg: 'white'
}
})}
_after={{
content: '""',
position: 'absolute',
right: '14px',
w: '16px',
h: '16px',
mr: 1,
@@ -36,18 +58,21 @@ const Radio = ({ list, value, onChange, ...props }: Props) => {
borderColor: 'myGray.200'
})
}}
_hover={{
_before: {
borderColor: 'myBlue.600'
}
}}
onClick={() => onChange(item.value)}
>
{item.label}
{!!item.icon && <MyIcon mr={'14px'} name={item.icon as any} w={'18px'} />}
<Box>
<Box>{item.title}</Box>
{!!item.desc && (
<Box fontSize={'sm'} color={'myGray.500'}>
{item.desc}
</Box>
)}
</Box>
</Flex>
))}
</Stack>
</Grid>
);
};
export default Radio;
export default MyRadio;