-- Compiled with roblox-ts v3.0.0 local TS = _G[script] local React = TS.import(script, TS.getModule(script, "@lattice-ui", "core").out).React local _style = TS.import(script, TS.getModule(script, "@lattice-ui", "style").out) local mergeGuiProps = _style.mergeGuiProps local resolveSx = _style.resolveSx local useTheme = _style.useTheme local surface = TS.import(script, script.Parent, "surface").surface --[[ * * Decorated surface host primitive. * Unlike `surface()`, this renders instance-graph decoration via UICorner/UIStroke. * Host border props are not the canonical border representation here. * `asChild` is intentionally not supported in this milestone. ]] local function Surface(props) local tone = props.tone or "surface" local sx = props.sx local children = props.children local asChild = props.asChild if asChild ~= nil then error("[Surface] `asChild` is not supported in M2.") end local restProps = {} for rawKey, value in pairs(props) do if not (type(rawKey) == "string") then continue end if rawKey == "tone" or rawKey == "sx" or rawKey == "children" or rawKey == "asChild" then continue end restProps[rawKey] = value end local _binding = useTheme() local theme = _binding.theme local toneProps = resolveSx(surface(tone), theme) local sxProps = resolveSx(sx, theme) local baseProps = if tone == "overlay" then toneProps else mergeGuiProps(toneProps, { BorderSizePixel = 0, }) local mergedProps = mergeGuiProps(baseProps, sxProps, restProps) local decorated = tone ~= "overlay" local _attributes = table.clone(mergedProps) setmetatable(_attributes, nil) return React.createElement("frame", _attributes, if decorated then React.createElement("uicorner", { CornerRadius = UDim.new(0, theme.radius.lg), }) else nil, if decorated then React.createElement("uistroke", { Color = theme.colors.border, Thickness = 1, }) else nil, children) end return { Surface = Surface, }