diff --git a/dbal/ts/src/core/validation/validate-component-hierarchy-create.ts b/dbal/ts/src/core/validation/validate-component-hierarchy-create.ts new file mode 100644 index 000000000..d3e857f86 --- /dev/null +++ b/dbal/ts/src/core/validation/validate-component-hierarchy-create.ts @@ -0,0 +1,39 @@ +import type { ComponentHierarchy } from '../types' +import { isPlainObject } from './is-plain-object' +import { isValidUuid } from './is-valid-uuid' + +export function validateComponentHierarchyCreate(data: Partial): string[] { + const errors: string[] = [] + + if (!data.pageId) { + errors.push('pageId is required') + } else if (!isValidUuid(data.pageId)) { + errors.push('pageId must be a valid UUID') + } + + if (data.parentId !== undefined) { + if (typeof data.parentId !== 'string' || !isValidUuid(data.parentId)) { + errors.push('parentId must be a valid UUID') + } + } + + if (!data.componentType) { + errors.push('componentType is required') + } else if (data.componentType.length > 100) { + errors.push('componentType must be 1-100 characters') + } + + if (data.order === undefined) { + errors.push('order is required') + } else if (!Number.isInteger(data.order) || data.order < 0) { + errors.push('order must be a non-negative integer') + } + + if (data.props === undefined) { + errors.push('props is required') + } else if (!isPlainObject(data.props)) { + errors.push('props must be an object') + } + + return errors +} diff --git a/frontends/nextjs/src/components/ui/alert.ts b/frontends/nextjs/src/components/ui/alert.ts new file mode 100644 index 000000000..bc9b35ab7 --- /dev/null +++ b/frontends/nextjs/src/components/ui/alert.ts @@ -0,0 +1,3 @@ +// Re-export for backward compatibility +// TODO: Update imports to use @/components/ui directly +export { Alert, AlertTitle, AlertDescription, type AlertVariant, type AlertProps } from './molecules/Alert' diff --git a/frontends/nextjs/src/components/ui/badge.ts b/frontends/nextjs/src/components/ui/badge.ts new file mode 100644 index 000000000..1b5dc9ccf --- /dev/null +++ b/frontends/nextjs/src/components/ui/badge.ts @@ -0,0 +1,3 @@ +// Re-export for backward compatibility +// TODO: Update imports to use @/components/ui directly +export { Badge, type BadgeProps, type BadgeVariant } from './atoms/Badge' diff --git a/frontends/nextjs/src/components/ui/button.ts b/frontends/nextjs/src/components/ui/button.ts new file mode 100644 index 000000000..fe61d0f70 --- /dev/null +++ b/frontends/nextjs/src/components/ui/button.ts @@ -0,0 +1,3 @@ +// Re-export for backward compatibility +// TODO: Update imports to use @/components/ui directly +export { Button, type ButtonProps, type ButtonVariant, type ButtonSize } from './atoms/Button' diff --git a/frontends/nextjs/src/components/ui/card.ts b/frontends/nextjs/src/components/ui/card.ts new file mode 100644 index 000000000..9005bafc1 --- /dev/null +++ b/frontends/nextjs/src/components/ui/card.ts @@ -0,0 +1,3 @@ +// Re-export for backward compatibility +// TODO: Update imports to use @/components/ui directly +export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from './molecules/Card' diff --git a/frontends/nextjs/src/components/ui/dialog.ts b/frontends/nextjs/src/components/ui/dialog.ts new file mode 100644 index 000000000..a6e66eaf2 --- /dev/null +++ b/frontends/nextjs/src/components/ui/dialog.ts @@ -0,0 +1,14 @@ +// Re-export for backward compatibility +// TODO: Update imports to use @/components/ui directly +export { + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogOverlay, + DialogPortal, + DialogTitle, + DialogTrigger, +} from './molecules/Dialog' diff --git a/frontends/nextjs/src/components/ui/input.ts b/frontends/nextjs/src/components/ui/input.ts new file mode 100644 index 000000000..3a6ad63af --- /dev/null +++ b/frontends/nextjs/src/components/ui/input.ts @@ -0,0 +1,3 @@ +// Re-export for backward compatibility +// TODO: Update imports to use @/components/ui directly +export { Input, type InputProps } from './atoms/Input' diff --git a/frontends/nextjs/src/components/ui/label.ts b/frontends/nextjs/src/components/ui/label.ts new file mode 100644 index 000000000..6c5501e29 --- /dev/null +++ b/frontends/nextjs/src/components/ui/label.ts @@ -0,0 +1,3 @@ +// Re-export for backward compatibility +// TODO: Update imports to use @/components/ui directly +export { Label, type LabelProps } from './atoms/Label' diff --git a/frontends/nextjs/src/components/ui/select.ts b/frontends/nextjs/src/components/ui/select.ts new file mode 100644 index 000000000..775ac9cf0 --- /dev/null +++ b/frontends/nextjs/src/components/ui/select.ts @@ -0,0 +1,14 @@ +// Re-export for backward compatibility +// TODO: Update imports to use @/components/ui directly +export { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectLabel, + SelectScrollDownButton, + SelectScrollUpButton, + SelectSeparator, + SelectTrigger, + SelectValue, +} from './molecules/Select' diff --git a/frontends/nextjs/src/components/ui/separator.ts b/frontends/nextjs/src/components/ui/separator.ts new file mode 100644 index 000000000..cf886811d --- /dev/null +++ b/frontends/nextjs/src/components/ui/separator.ts @@ -0,0 +1,3 @@ +// Re-export for backward compatibility +// TODO: Update imports to use @/components/ui directly +export { Separator, type SeparatorProps } from './atoms/Separator' diff --git a/frontends/nextjs/src/components/ui/tabs.ts b/frontends/nextjs/src/components/ui/tabs.ts new file mode 100644 index 000000000..e0be87387 --- /dev/null +++ b/frontends/nextjs/src/components/ui/tabs.ts @@ -0,0 +1,3 @@ +// Re-export for backward compatibility +// TODO: Update imports to use @/components/ui directly +export { Tabs, TabsList, TabsTrigger, TabsContent } from './molecules/Tabs'