fix(studio): refine preset surfaces and repair gallery interactions
This commit is contained in:
1 parent
f642a84c58
commit
bb40dffee8
20 files changed
+345
-72
No files matched your search
@@ -23,18 +23,35 @@ export function catalogRecipes(): Record<string, ComponentRecipe> {
|
||||
const circle = ["circle", "round"].includes(axes.shape?.default ?? "");
|
||||
const semanticGeometry =
|
||||
/thumb|track|spinner|progress|marker|port$|status|dot|star|srOnly/i.test(part);
|
||||
// Joined surfaces share the outer component's corners. Rounding each
|
||||
// child creates seams, scalloped panels and rounded splitter rails.
|
||||
const joined = (
|
||||
{
|
||||
StatsBar: ["item", "content"],
|
||||
AuthSplitLayout: ["content"],
|
||||
Collapse: ["trigger", "panel", "content"],
|
||||
InputNumber: ["button", "content", "input"],
|
||||
LayoutSplitter: ["handle"],
|
||||
} as Record<string, string[]>
|
||||
)[name]?.includes(part);
|
||||
if (
|
||||
descriptor.properties.includes("borderRadius") &&
|
||||
!roundedFalse &&
|
||||
!circle &&
|
||||
!semanticGeometry
|
||||
!semanticGeometry &&
|
||||
!joined
|
||||
) {
|
||||
styles.borderRadius = ref(
|
||||
descriptor.profile === "control" ? "shape.control" : "shape.panel",
|
||||
);
|
||||
}
|
||||
// Only existing surfaces receive elevation. Layout wrappers and provider hosts are untouched.
|
||||
if (descriptor.profile === "surface" && descriptor.properties.includes("boxShadow"))
|
||||
if (
|
||||
descriptor.profile === "surface" &&
|
||||
descriptor.properties.includes("boxShadow") &&
|
||||
!joined &&
|
||||
!(name === "PreferenceSwitcher" && part === "menu")
|
||||
)
|
||||
styles.boxShadow = ref("elevation.panel");
|
||||
if (Object.keys(styles).length) base[part] = styles;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user