feat(base): add drop-edge indicator component for pragmatic-dnd

This commit is contained in:
Philipinho
2026-05-24 02:18:31 +01:00
parent 911bf53924
commit 218b5755a9
2 changed files with 48 additions and 0 deletions
@@ -0,0 +1,10 @@
import type { Edge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
import classes from "@/features/base/styles/grid.module.css";
type Props = {
edge: Edge;
};
export function BaseDropEdgeIndicator({ edge }: Props) {
return <div className={classes.dropEdgeLine} data-edge={edge} aria-hidden />;
}
@@ -614,3 +614,41 @@
background: rgba(255, 255, 255, 0.08);
color: var(--mantine-color-white);
}
.dropEdgeLine {
position: absolute;
background: light-dark(
var(--mantine-color-blue-5),
var(--mantine-color-blue-4)
);
pointer-events: none;
z-index: 2;
}
.dropEdgeLine[data-edge="left"] {
top: 0;
bottom: 0;
left: 0;
width: 2px;
}
.dropEdgeLine[data-edge="right"] {
top: 0;
bottom: 0;
right: 0;
width: 2px;
}
.dropEdgeLine[data-edge="top"] {
left: 0;
right: 0;
top: 0;
height: 2px;
}
.dropEdgeLine[data-edge="bottom"] {
left: 0;
right: 0;
bottom: 0;
height: 2px;
}