diff --git a/storybook/src/components/registry.tsx b/storybook/src/components/registry.tsx index 2e7fa5e5d..4ba0f6c62 100644 --- a/storybook/src/components/registry.tsx +++ b/storybook/src/components/registry.tsx @@ -556,6 +556,116 @@ export const Switch: React.FC = ({ ) } +// FormField - wrapper for form inputs with label and error +interface FormFieldProps extends LuaComponentProps { + label?: string + error?: string + required?: boolean + helperText?: string +} + +export const FormField: React.FC = ({ + label, + error, + required, + helperText, + children, + className = 'mb-4' +}) => ( +
+ {label && ( + + )} + {children} + {helperText && !error &&

{helperText}

} + {error &&

{error}

} +
+) + +// ConditionalRender - renders children based on condition (always renders in Storybook for preview) +interface ConditionalRenderProps extends LuaComponentProps { + condition?: boolean + when?: string + fallback?: React.ReactNode +} + +export const ConditionalRender: React.FC = ({ + children, + className = '' +}) => ( +
{children}
+) + +// Image - image component +interface ImageProps extends LuaComponentProps { + src?: string + alt?: string + width?: string | number + height?: string | number + objectFit?: 'contain' | 'cover' | 'fill' | 'none' +} + +export const Image: React.FC = ({ + src, + alt = 'Image', + width, + height, + objectFit = 'cover', + className = '' +}) => ( + src ? ( + {alt} + ) : ( +
+ [Image: {alt}] +
+ ) +) + +// Iframe - embedded frame +interface IframeProps extends LuaComponentProps { + src?: string + title?: string + width?: string | number + height?: string | number + allowFullScreen?: boolean +} + +export const Iframe: React.FC = ({ + src, + title = 'Embedded content', + width = '100%', + height = 400, + className = '' +}) => ( + src ? ( +