-
Notifications
You must be signed in to change notification settings - Fork 2
Add mobile responsiveness to all components #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,3 +48,6 @@ docs/.vitepress/cache | |
| apps/site/.next | ||
| apps/site/.map.ts | ||
| apps/site/.source | ||
|
|
||
| # Test artifacts | ||
| test-screenshots | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,16 +39,16 @@ ComponentRegistry.register('flex', | |
| align === 'center' && 'items-center', | ||
| align === 'baseline' && 'items-baseline', | ||
| align === 'stretch' && 'items-stretch', | ||
| // Gap | ||
| // Gap - Mobile-first responsive | ||
| gap === 0 && 'gap-0', | ||
| gap === 1 && 'gap-1', | ||
| gap === 2 && 'gap-2', | ||
| gap === 3 && 'gap-3', | ||
| gap === 4 && 'gap-4', | ||
| gap === 5 && 'gap-5', | ||
| gap === 6 && 'gap-6', | ||
| gap === 7 && 'gap-7', | ||
| gap === 8 && 'gap-8', | ||
| gap === 2 && 'gap-1.5 sm:gap-2', | ||
| gap === 3 && 'gap-2 sm:gap-3', | ||
| gap === 4 && 'gap-2 sm:gap-3 md:gap-4', | ||
| gap === 5 && 'gap-3 sm:gap-4 md:gap-5', | ||
| gap === 6 && 'gap-3 sm:gap-4 md:gap-6', | ||
| gap === 7 && 'gap-4 sm:gap-5 md:gap-7', | ||
| gap === 8 && 'gap-4 sm:gap-6 md:gap-8', | ||
|
Comment on lines
+42
to
+51
|
||
| // Wrap | ||
| wrap && 'flex-wrap', | ||
| className | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,16 +42,16 @@ const StackRenderer = forwardRef<HTMLDivElement, { schema: StackSchema; classNam | |
| align === 'center' && 'items-center', | ||
| align === 'baseline' && 'items-baseline', | ||
| align === 'stretch' && 'items-stretch', | ||
| // Gap | ||
| // Gap - Mobile-first responsive | ||
| gap === 0 && 'gap-0', | ||
| gap === 1 && 'gap-1', | ||
| gap === 2 && 'gap-2', | ||
| gap === 3 && 'gap-3', | ||
| gap === 4 && 'gap-4', | ||
| gap === 5 && 'gap-5', | ||
| gap === 6 && 'gap-6', | ||
| gap === 8 && 'gap-8', | ||
| gap === 10 && 'gap-10', | ||
| gap === 2 && 'gap-1.5 sm:gap-2', | ||
| gap === 3 && 'gap-2 sm:gap-3', | ||
| gap === 4 && 'gap-2 sm:gap-3 md:gap-4', | ||
| gap === 5 && 'gap-3 sm:gap-4 md:gap-5', | ||
| gap === 6 && 'gap-3 sm:gap-4 md:gap-6', | ||
| gap === 8 && 'gap-4 sm:gap-6 md:gap-8', | ||
| gap === 10 && 'gap-5 sm:gap-7 md:gap-10', | ||
|
Comment on lines
+45
to
+54
|
||
| // Wrap | ||
| wrap && 'flex-wrap', | ||
| className | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,7 +53,7 @@ const renderContextMenuItems = (items: any[]) => { | |
| ComponentRegistry.register('context-menu', | ||
| ({ schema, className, ...props }: { schema: ContextMenuSchema; className?: string; [key: string]: any }) => { | ||
| // Determine classes | ||
| const triggerClass = schema.triggerClassName || className || (schema.className as string) || "h-[150px] w-[300px] border border-dashed text-sm flex items-center justify-center"; | ||
| const triggerClass = schema.triggerClassName || className || (schema.className as string) || "h-[120px] w-full sm:h-[150px] sm:w-[300px] border border-dashed text-sm flex items-center justify-center"; | ||
| const contentClass = schema.contentClassName; | ||
|
|
||
| return ( | ||
|
Comment on lines
55
to
59
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The added
defaultProps.classNameimproves the designer “dropped” defaults, butSchemaRendererdoes not applydefaultPropsat runtime (packages/react/src/SchemaRenderer.tsx:30-37). As a result, schemas that omitclassNamewill still render<img>withoutmax-w-full h-auto, so this change may not fully deliver the stated responsive default behavior outside the designer. If the goal is a true runtime default, set a fallback class in the renderer whenclassNameis empty and merge it with the providedclassName.