import { SizableText, XStack, YStack } from "tamagui"; import { Surface } from "./Surface"; import { useResolvedKnobs } from "./useResolvedKnobs"; export default { title: "Theme/Surface", component: Surface, parameters: { status: { type: "beta" }, docs: { description: { component: "Surface paints nothing. It declares size/density intent for a subtree and nested Surfaces clamp step-down only (LC-68). The probe below is a Tamagui stack that spreads what useResolvedKnobs resolved inside the wrapper, so the measured part is the stack, never the wrapper.", }, }, }, }; /** Spreads the resolved recipe on a stack so the wrapper's effect is measurable. */ function Probe({ label }: { label: string }) { const { knobProps } = useResolvedKnobs(); const attrs = { "data-size": String(knobProps.size), "data-space": String(knobProps.space), "data-size-token": String(knobProps.sizeToken), "data-gap": String(knobProps.gap.gap), } as Record; return ( {label}: token {String(knobProps.sizeToken)}, gap {String(knobProps.gap.gap)} ); } export const main = { name: "Main", render: () => ( ), }; /** LC-68: a large request inside a small Surface resolves small; small inside large stays small. */ export const nestedClamp = { name: "Nested clamp", render: () => ( ), }; /** Density steps the gap, not the control height. */ export const density = { name: "Density", render: () => ( ), };