feat: new setting modal (#2834)

Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
Qi
2023-06-21 19:57:59 +08:00
committed by GitHub
parent 9a90ce694c
commit aa86d3a2ee
64 changed files with 1911 additions and 159 deletions

View File

@@ -1,4 +1,5 @@
export * from './menu';
// export { StyledMenuItem as MenuItem } from './styles';
export * from './menu-item';
export * from './menu-trigger';
export * from './pure-menu';

View File

@@ -0,0 +1,22 @@
import { ArrowDownSmallIcon } from '@blocksuite/icons';
import { forwardRef } from 'react';
import type { ButtonProps } from '../button';
import { StyledButton } from './styles';
export const MenuTrigger = forwardRef<HTMLButtonElement, ButtonProps>(
({ children, ...props }, ref) => {
return (
<StyledButton
ref={ref}
icon={<ArrowDownSmallIcon />}
iconPosition="end"
noBorder={true}
{...props}
>
{children}
</StyledButton>
);
}
);
MenuTrigger.displayName = 'MenuTrigger';

View File

@@ -1,6 +1,7 @@
import type { CSSProperties } from 'react';
import { displayFlex, styled, textEllipsis } from '../../styles';
import { Button } from '../button';
import StyledPopperContainer from '../shared/container';
export const StyledMenuWrapper = styled(StyledPopperContainer, {
@@ -100,3 +101,16 @@ export const StyledMenuItem = styled('button')<{
};
}
);
export const StyledButton = styled(Button)(() => {
return {
width: '100%',
height: '32px',
borderRadius: '8px',
backgroundColor: 'transparent',
...displayFlex('space-between', 'center'),
border: `1px solid var(--affine-border-color)`,
padding: '0 10px',
fontSize: 'var(--affine-font-base)',
};
});