import type { Sx } from "@lattice-ui/style"; type GuiPropRecord = Record; export type SurfaceToken = "surface" | "elevated" | "sunken" | "overlay"; function asSxProps(value: GuiPropRecord): Partial { return value as unknown as Partial; } /** * Props-only surface helper. * Use this when you only want host props (including host border props). * It does not create child instances like UICorner/UIStroke/shadow nodes. */ export function surface(token: SurfaceToken): Sx { return (theme) => { switch (token) { case "surface": return asSxProps({ BackgroundColor3: theme.colors.surface, BorderColor3: theme.colors.border, BorderSizePixel: 1, }); case "elevated": return asSxProps({ BackgroundColor3: theme.colors.surfaceElevated, BorderColor3: theme.colors.border, BorderSizePixel: 1, }); case "sunken": return asSxProps({ BackgroundColor3: theme.colors.background, BorderColor3: theme.colors.border, BorderSizePixel: 1, }); case "overlay": return asSxProps({ BackgroundColor3: theme.colors.overlay, BackgroundTransparency: 0.35, BorderSizePixel: 0, }); } }; }