Skip to content

Commit 714b64a

Browse files
committed
Refine palette and property panel UI spacing
Adjusted padding, icon sizes, and container heights in ComponentPalette and PropertyPanel for a more compact and consistent appearance. Added overflow handling and bottom padding to improve scroll behavior and layout.
1 parent bb8929c commit 714b64a

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

packages/designer/src/components/ComponentPalette.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ export const ComponentPalette: React.FC<ComponentPaletteProps> = ({ className })
8989
onDragStart={(e) => handleDragStart(e, type)}
9090
onDragEnd={handleDragEnd}
9191
className={cn(
92-
"group flex flex-col items-center justify-center gap-2 p-3 rounded-lg border border-transparent hover:border-blue-200 hover:bg-blue-50 hover:shadow-sm cursor-grab active:cursor-grabbing transition-all bg-white relative",
93-
"h-24"
92+
"group flex flex-col items-center justify-center gap-1.5 p-2 rounded-lg border border-transparent hover:border-blue-200 hover:bg-blue-50 hover:shadow-sm cursor-grab active:cursor-grabbing transition-all bg-white relative",
93+
"h-20"
9494
)}
9595
>
96-
<div className="w-8 h-8 rounded-md bg-gray-50 group-hover:bg-white flex items-center justify-center text-gray-500 group-hover:text-blue-600 transition-colors border border-gray-100 group-hover:border-blue-100">
97-
<Icon size={18} strokeWidth={1.5} />
96+
<div className="w-7 h-7 rounded-md bg-gray-50 group-hover:bg-white flex items-center justify-center text-gray-500 group-hover:text-blue-600 transition-colors border border-gray-100 group-hover:border-blue-100">
97+
<Icon size={16} strokeWidth={1.5} />
9898
</div>
9999
<span className="text-xs font-medium text-gray-600 group-hover:text-blue-700 text-center w-full truncate px-1">
100100
{config.label || type}
@@ -109,14 +109,14 @@ export const ComponentPalette: React.FC<ComponentPaletteProps> = ({ className })
109109
};
110110

111111
return (
112-
<div className={cn("flex flex-col h-full bg-gray-50/50 border-r w-72", className)}>
112+
<div className={cn("flex flex-col h-full bg-gray-50/50 border-r w-72 overflow-hidden", className)}>
113113
<div className="px-4 py-3 border-b bg-white shrink-0">
114114
<h2 className="text-sm font-semibold text-gray-900">Components</h2>
115115
<p className="text-xs text-gray-500 mt-0.5">Drag to add to canvas</p>
116116
</div>
117117

118-
<ScrollArea className="flex-1">
119-
<div className="p-4 space-y-6">
118+
<ScrollArea className="flex-1 w-full">
119+
<div className="p-4 space-y-6 pb-20">
120120
{Object.entries(CATEGORIES).map(([category, types]) => {
121121
const availableTypes = getComponentscategory(types);
122122
if (availableTypes.length === 0) return null;

packages/designer/src/components/PropertyPanel.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export const PropertyPanel: React.FC<PropertyPanelProps> = ({ className }) => {
153153
};
154154

155155
return (
156-
<div className={cn("flex flex-col h-full bg-white border-l w-80 shadow-xl shadow-gray-200/50 z-10", className)}>
156+
<div className={cn("flex flex-col h-full bg-white border-l w-80 shadow-xl shadow-gray-200/50 z-10 overflow-hidden", className)}>
157157
<div className="px-5 py-4 border-b flex items-center justify-between bg-gray-50/50">
158158
<div>
159159
<div className="flex items-center gap-2">
@@ -173,8 +173,8 @@ export const PropertyPanel: React.FC<PropertyPanelProps> = ({ className }) => {
173173
</Button>
174174
</div>
175175

176-
<ScrollArea className="flex-1">
177-
<div className="p-5 space-y-6">
176+
<ScrollArea className="flex-1 w-full">
177+
<div className="p-5 space-y-6 pb-20">
178178
{/* Common Properties */}
179179
<div className="space-y-4">
180180
<div className="flex items-center gap-2 pb-2 border-b border-gray-100">

0 commit comments

Comments
 (0)