[FRONT COMPONENTS] Move to twenty-sdk (#17587)

Move front components from twenty-shared to twenty-sdk
This commit is contained in:
Raphaël Bosi
2026-02-02 13:21:53 +01:00
committed by GitHub
parent b2218cbbf2
commit f0bc9fcb43
63 changed files with 146 additions and 139 deletions
@@ -0,0 +1,30 @@
import { z } from 'zod';
export const PropertySchemaZ = z.object({
type: z.enum(['string', 'number', 'boolean']),
optional: z.boolean(),
});
export const HtmlElementConfigZ = z.object({
tag: z.string().regex(/^html-[a-z0-9]+$/, 'Tag must start with "html-"'),
name: z
.string()
.regex(/^Html[A-Z]/, 'Name must be PascalCase starting with Html'),
properties: z.record(z.string(), PropertySchemaZ),
});
export const HtmlElementConfigArrayZ = z.array(HtmlElementConfigZ);
export const ComponentSchemaZ = z.object({
name: z.string().min(1),
tagName: z.string().min(1),
customElementName: z.string().min(1),
properties: z.record(z.string(), PropertySchemaZ),
events: z.array(z.string()).readonly(),
isHtmlElement: z.boolean(),
htmlTag: z.string().min(1),
});
export type PropertySchema = z.infer<typeof PropertySchemaZ>;
export type HtmlElementConfig = z.infer<typeof HtmlElementConfigZ>;
export type ComponentSchema = z.infer<typeof ComponentSchemaZ>;