chore: update quick search style (#1565)

This commit is contained in:
JimmFly 2023-03-15 15:15:13 +08:00 committed by GitHub
parent 45ab08b459
commit 5ac6632276
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 24 deletions

View File

@ -100,7 +100,7 @@ export const QuickSearchModal: React.FC<QuickSearchModalProps> = ({
data-testid="quickSearch" data-testid="quickSearch"
> >
<ModalWrapper <ModalWrapper
width={620} width={608}
style={{ style={{
maxHeight: '80vh', maxHeight: '80vh',
minHeight: isPublicAndNoQuery() ? '72px' : '412px', minHeight: isPublicAndNoQuery() ? '72px' : '412px',

View File

@ -2,7 +2,7 @@ import { displayFlex, styled, textEllipsis } from '@affine/component';
export const StyledContent = styled('div')(({ theme }) => { export const StyledContent = styled('div')(({ theme }) => {
return { return {
minHeight: '280px', minHeight: '290px',
maxHeight: '70vh', maxHeight: '70vh',
width: '100%', width: '100%',
overflow: 'auto', overflow: 'auto',
@ -12,6 +12,9 @@ export const StyledContent = styled('div')(({ theme }) => {
color: theme.colors.textColor, color: theme.colors.textColor,
transition: 'all 0.15s', transition: 'all 0.15s',
letterSpacing: '0.06em', letterSpacing: '0.06em',
'[cmdk-group]': {
width: '100%',
},
'[cmdk-group-heading]': { '[cmdk-group-heading]': {
...displayFlex('start', 'center'), ...displayFlex('start', 'center'),
margin: '0 16px', margin: '0 16px',
@ -20,10 +23,15 @@ export const StyledContent = styled('div')(({ theme }) => {
fontSize: theme.font.sm, fontSize: theme.font.sm,
color: theme.colors.secondaryTextColor, color: theme.colors.secondaryTextColor,
}, },
'[cmdk-item]': {
margin: '0 4px',
},
'[aria-selected="true"]': { '[aria-selected="true"]': {
borderRadius: '5px', transition: 'all 0.15s',
borderRadius: '4px',
color: theme.colors.primaryColor, color: theme.colors.primaryColor,
backgroundColor: theme.colors.hoverBackground, backgroundColor: theme.colors.hoverBackground,
padding: '0 2px',
}, },
}; };
}); });
@ -44,11 +52,15 @@ export const StyledNotFound = styled('div')(({ theme }) => {
width: '612px', width: '612px',
...displayFlex('center', 'center'), ...displayFlex('center', 'center'),
flexDirection: 'column', flexDirection: 'column',
padding: '5px 16px', padding: '0 16px',
fontSize: theme.font.base, fontSize: theme.font.sm,
lineHeight: '22px',
color: theme.colors.secondaryTextColor,
span: { span: {
...displayFlex('flex-start', 'center'),
width: '100%', width: '100%',
fontWeight: '500', fontWeight: '400',
height: '36px',
}, },
'>svg': { '>svg': {
@ -59,7 +71,6 @@ export const StyledNotFound = styled('div')(({ theme }) => {
}); });
export const StyledInputContent = styled('div')(({ theme }) => { export const StyledInputContent = styled('div')(({ theme }) => {
return { return {
margin: '13px 0',
...displayFlex('space-between', 'center'), ...displayFlex('space-between', 'center'),
input: { input: {
width: '492px', width: '492px',
@ -78,23 +89,24 @@ export const StyledInputContent = styled('div')(({ theme }) => {
export const StyledShortcut = styled('div')(({ theme }) => { export const StyledShortcut = styled('div')(({ theme }) => {
return { return {
color: theme.colors.placeHolderColor, color: theme.colors.placeHolderColor,
fontSize: theme.font.base, fontSize: theme.font.sm,
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
}; };
}); });
export const StyledLabel = styled('label')(({ theme }) => { export const StyledLabel = styled('label')(({ theme }) => {
return { return {
width: '24px', width: '20px',
height: '24px', height: '20px',
color: theme.colors.iconColor, color: theme.colors.iconColor,
fontSize: '20px',
}; };
}); });
export const StyledModalHeader = styled('div')(() => { export const StyledModalHeader = styled('div')(() => {
return { return {
height: '48px', height: '36px',
margin: '12px 24px 0px 24px', margin: '12px 16px 0px 16px',
...displayFlex('space-between', 'center'), ...displayFlex('space-between', 'center'),
}; };
}); });
@ -102,7 +114,7 @@ export const StyledModalDivider = styled('div')(({ theme }) => {
return { return {
width: 'auto', width: 'auto',
height: '0', height: '0',
margin: '6px 16px 6.5px 16px', margin: '6px 16px',
position: 'relative', position: 'relative',
borderTop: `0.5px solid ${theme.colors.borderColor}`, borderTop: `0.5px solid ${theme.colors.borderColor}`,
transition: 'all 0.15s', transition: 'all 0.15s',
@ -111,30 +123,38 @@ export const StyledModalDivider = styled('div')(({ theme }) => {
export const StyledModalFooter = styled('div')(({ theme }) => { export const StyledModalFooter = styled('div')(({ theme }) => {
return { return {
fontSize: theme.font.base, fontSize: 'inherit',
lineHeight: '22px', lineHeight: '22px',
marginBottom: '8px', marginBottom: '8px',
textAlign: 'center', textAlign: 'center',
color: theme.colors.textColor, color: theme.colors.textColor,
...displayFlex('center', 'center'), ...displayFlex('center', 'center'),
transition: 'all .15s',
'[cmdk-item]': {
margin: '0 4px',
},
'[aria-selected="true"]': { '[aria-selected="true"]': {
transition: 'background .15s, color .15s', transition: 'all 0.15s',
borderRadius: '5px', borderRadius: '4px',
color: theme.colors.primaryColor, color: theme.colors.primaryColor,
backgroundColor: theme.colors.hoverBackground, backgroundColor: theme.colors.hoverBackground,
'span,svg': {
transition: 'all 0.15s',
transform: 'scale(1.02)',
},
}, },
}; };
}); });
export const StyledModalFooterContent = styled('button')(({ theme }) => { export const StyledModalFooterContent = styled('button')(({ theme }) => {
return { return {
width: '612px', width: '600px',
height: '32px', height: '32px',
fontSize: theme.font.base, fontSize: theme.font.base,
lineHeight: '22px', lineHeight: '22px',
textAlign: 'center', textAlign: 'center',
...displayFlex('center', 'center'), ...displayFlex('center', 'center'),
color: 'inherit', color: 'inherit',
borderRadius: '5px', borderRadius: '4px',
transition: 'background .15s, color .15s', transition: 'background .15s, color .15s',
'>svg': { '>svg': {
fontSize: '20px', fontSize: '20px',
@ -144,13 +164,13 @@ export const StyledModalFooterContent = styled('button')(({ theme }) => {
}); });
export const StyledListItem = styled('button')(({ theme }) => { export const StyledListItem = styled('button')(({ theme }) => {
return { return {
width: '612px', // width: '612px',
height: '32px', height: '32px',
fontSize: theme.font.base, fontSize: 'inherit',
color: 'inherit', color: 'inherit',
paddingLeft: '12px', padding: '0 12px',
borderRadius: '5px', borderRadius: '4px',
transition: 'background .15s, color .15s', transition: 'all .15s',
...displayFlex('flex-start', 'center'), ...displayFlex('flex-start', 'center'),
span: { span: {
...textEllipsis(1), ...textEllipsis(1),

View File

@ -12,7 +12,7 @@ export const ModalWrapper = styled('div')<{
height, height,
minHeight, minHeight,
backgroundColor: theme.colors.popoverBackground, backgroundColor: theme.colors.popoverBackground,
borderRadius: '24px', borderRadius: '16px',
position: 'relative', position: 'relative',
maxHeight: 'calc(100vh - 32px)', maxHeight: 'calc(100vh - 32px)',
}; };