Skip to content

Commit 9df3bfe

Browse files
Copilothotlong
andcommitted
Fix mobile responsiveness for basic components
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 7f50978 commit 9df3bfe

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

packages/components/src/renderers/basic/button-group.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ComponentRegistry.register('button-group',
2222

2323
return (
2424
<div
25-
className={cn('inline-flex rounded-md shadow-sm', schema.className)}
25+
className={cn('flex flex-wrap sm:inline-flex rounded-md shadow-sm', schema.className)}
2626
role="group"
2727
{...buttonGroupProps}
2828
{...{ 'data-obj-id': dataObjId, 'data-obj-type': dataObjType, style }}

packages/components/src/renderers/basic/div.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ ComponentRegistry.register('div',
4343
{ name: 'className', type: 'string', label: 'CSS Class' }
4444
],
4545
defaultProps: {
46-
className: 'p-4 border border-dashed border-gray-300 rounded min-h-[100px]'
46+
className: 'p-2 sm:p-4 border border-dashed border-gray-300 rounded min-h-[100px]'
4747
}
4848
}
4949
);

packages/components/src/renderers/basic/image.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ ComponentRegistry.register('image',
4040
{ name: 'src', type: 'string', label: 'Source URL' },
4141
{ name: 'alt', type: 'string', label: 'Alt Text' },
4242
{ name: 'className', type: 'string', label: 'Classes' }
43-
]
43+
],
44+
defaultProps: {
45+
className: 'max-w-full h-auto'
46+
}
4447
}
4548
);

packages/components/src/renderers/basic/navigation-menu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ComponentRegistry.register('navigation-menu',
3333
<>
3434
<NavigationMenuTrigger>{item.label}</NavigationMenuTrigger>
3535
<NavigationMenuContent>
36-
<ul className="grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px]">
36+
<ul className="grid w-full gap-3 p-4 sm:w-[400px] md:w-[500px] md:grid-cols-2 lg:w-[600px]">
3737
{item.children.map((child, childIdx) => (
3838
<li key={childIdx}>
3939
<NavigationMenuLink asChild>

packages/components/src/renderers/basic/separator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ComponentRegistry.register('separator',
5050
],
5151
defaultProps: {
5252
orientation: 'horizontal',
53-
className: 'my-4'
53+
className: 'my-2 sm:my-4'
5454
}
5555
}
5656
);

packages/components/src/renderers/basic/span.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ ComponentRegistry.register('span',
4343
{ name: 'className', type: 'string', label: 'CSS Class' }
4444
],
4545
defaultProps: {
46-
className: 'px-2 py-1'
46+
className: 'px-1.5 py-0.5 sm:px-2 sm:py-1'
4747
},
4848
defaultChildren: [
4949
{ type: 'text', content: 'Inline text' }

0 commit comments

Comments
 (0)