mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-24 18:02:47 +08:00
feat: add tooltip & popover
This commit is contained in:
36
packages/app/src/components/tooltip/Container.tsx
Normal file
36
packages/app/src/components/tooltip/Container.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import { styled } from '@/styles';
|
||||
import type { ReactNode, CSSProperties } from 'react';
|
||||
import type { PopoverDirection } from './interface';
|
||||
export interface PopoverContainerProps {
|
||||
children?: ReactNode;
|
||||
/**
|
||||
* The pop-up window points to. The pop-up window has three rounded corners, one is a right angle, and the right angle is the direction of the pop-up window.
|
||||
*/
|
||||
direction: PopoverDirection;
|
||||
style?: CSSProperties;
|
||||
}
|
||||
const border_radius_map: Record<PopoverContainerProps['direction'], string> = {
|
||||
none: '10px',
|
||||
'left-top': '0 10px 10px 10px',
|
||||
'left-bottom': '10px 10px 10px 0',
|
||||
'right-top': '10px 0 10px 10px',
|
||||
'right-bottom': '10px 10px 0 10px',
|
||||
};
|
||||
|
||||
export const PopoverContainer = styled('div')<
|
||||
Pick<PopoverContainerProps, 'direction'>
|
||||
>(({ theme, direction, style }) => {
|
||||
return '';
|
||||
// const shadow = theme.affine.shadows.shadow1;
|
||||
// const white = theme.affine.palette.white;
|
||||
//
|
||||
// const borderRadius =
|
||||
// border_radius_map[direction] || border_radius_map['left-top'];
|
||||
// return {
|
||||
// boxShadow: shadow,
|
||||
// borderRadius: borderRadius,
|
||||
// padding: '8px 4px',
|
||||
// backgroundColor: white,
|
||||
// ...style,
|
||||
// };
|
||||
});
|
||||
Reference in New Issue
Block a user