mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-18 11:31:12 -05:00
feat: styling zod schema and data migration
This commit is contained in:
@@ -2,6 +2,7 @@ import { z } from "zod";
|
||||
|
||||
import { ZColor, ZPlacement } from "./common";
|
||||
import { ZEnvironment } from "./environment";
|
||||
import { ZStyling } from "./styling";
|
||||
|
||||
export const ZProduct = z.object({
|
||||
id: z.string().cuid2(),
|
||||
@@ -11,6 +12,7 @@ export const ZProduct = z.object({
|
||||
teamId: z.string(),
|
||||
brandColor: ZColor,
|
||||
highlightBorderColor: ZColor.nullable(),
|
||||
styling: ZStyling.optional(),
|
||||
recontactDays: z.number().int(),
|
||||
inAppSurveyBranding: z.boolean(),
|
||||
linkSurveyBranding: z.boolean(),
|
||||
|
||||
29
packages/types/styling.ts
Normal file
29
packages/types/styling.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import { ZColor } from "./common";
|
||||
|
||||
export const ZStylingColor = z.object({
|
||||
light: ZColor,
|
||||
dark: ZColor.optional(),
|
||||
});
|
||||
|
||||
export const ZCardArrangementOptions = z.enum(["casual", "straight", "simple"]);
|
||||
|
||||
export const ZCardArrangement = z.object({
|
||||
linkSurveys: ZCardArrangementOptions,
|
||||
inAppSurveys: ZCardArrangementOptions,
|
||||
});
|
||||
|
||||
export const ZStyling = z.object({
|
||||
brandColor: ZStylingColor,
|
||||
questionColor: ZStylingColor,
|
||||
inputColor: ZStylingColor,
|
||||
inputBorderColor: ZStylingColor,
|
||||
cardBackgroundColor: ZStylingColor,
|
||||
highlightBorderColor: ZStylingColor.optional(),
|
||||
enableDarkMode: z.boolean(),
|
||||
roundness: z.number(),
|
||||
cardArrangement: ZCardArrangement,
|
||||
});
|
||||
|
||||
export type TStyling = z.infer<typeof ZStyling>;
|
||||
Reference in New Issue
Block a user