Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/components/form/slider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ComponentDemo, DemoGrid } from '@/app/components/ComponentDemo';
schema={{
type: "slider",
label: "Volume",
defaultValue: 50
defaultValue: [50]
}}
title="Basic Slider"
/>
Expand Down
11 changes: 9 additions & 2 deletions packages/components/src/renderers/basic/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ function toPascalCase(str: string): string {
.join('');
}

// Map of renamed icons in lucide-react (from old name to new name)
const iconNameMap: Record<string, string> = {
'Home': 'House', // "Home" was renamed to "House" in lucide-react's icons object
};

const IconRenderer = forwardRef<SVGSVGElement, { schema: IconSchema; className?: string; [key: string]: any }>(
({ schema, className, ...props }, ref) => {
// Extract designer-related props
Expand All @@ -33,10 +38,12 @@ const IconRenderer = forwardRef<SVGSVGElement, { schema: IconSchema; className?:

// Convert icon name to PascalCase for Lucide lookup
const iconName = toPascalCase(schema.name);
const Icon = (icons as any)[iconName];
// Apply icon name mapping for renamed icons
const mappedIconName = iconNameMap[iconName] || iconName;
const Icon = (icons as any)[mappedIconName];

if (!Icon) {
console.warn(`Icon "${schema.name}" (lookup: "${iconName}") not found in lucide-react`);
console.warn(`Icon "${schema.name}" (lookup: "${iconName}"${mappedIconName !== iconName ? ` -> "${mappedIconName}"` : ''}) not found in lucide-react`);
return null;
}

Expand Down
9 changes: 8 additions & 1 deletion packages/components/src/renderers/form/slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@ ComponentRegistry.register('slider',
...sliderProps
} = props;

// Ensure defaultValue is an array for backward compatibility
const defaultValue = Array.isArray(schema.defaultValue)
? schema.defaultValue
: schema.defaultValue !== undefined
? [schema.defaultValue]
: undefined;

return (
<Slider
defaultValue={schema.defaultValue}
defaultValue={defaultValue}
max={schema.max}
min={schema.min}
step={schema.step}
Expand Down
Loading