/*! ratio-ui · design system for knowledge sharing · https://github.com/losol/ratio-ui · (c) 2026 Losol AS · MPL-2.0 */
//#region src/tokens/spacing.ts
/** Maps a Space token to the Tailwind suffix (matches --spacing-* keys) */
var spaceValue = {
	none: "0",
	xs: "xs",
	sm: "sm",
	md: "md",
	lg: "lg",
	xl: "xl"
};
var spacingKeys = [
	"padding",
	"paddingX",
	"paddingY",
	"paddingTop",
	"paddingBottom",
	"margin",
	"marginX",
	"marginY",
	"marginTop",
	"marginBottom",
	"gap"
];
/** Split SpacingProps from remaining props. Useful for forwarding HTML attrs without leaking spacing keys to the DOM. */
function extractSpacingProps(props) {
	const spacing = {};
	const rest = { ...props };
	for (const key of spacingKeys) if (key in rest) {
		spacing[key] = rest[key];
		delete rest[key];
	}
	return [spacing, rest];
}
function buildSpacingClasses(props) {
	const classes = [];
	if (props.padding) classes.push(`p-${spaceValue[props.padding]}`);
	if (props.paddingX) classes.push(`px-${spaceValue[props.paddingX]}`);
	if (props.paddingY) classes.push(`py-${spaceValue[props.paddingY]}`);
	if (props.paddingTop) classes.push(`pt-${spaceValue[props.paddingTop]}`);
	if (props.paddingBottom) classes.push(`pb-${spaceValue[props.paddingBottom]}`);
	if (props.margin) classes.push(`m-${spaceValue[props.margin]}`);
	if (props.marginX) classes.push(`mx-${spaceValue[props.marginX]}`);
	if (props.marginY) classes.push(`my-${spaceValue[props.marginY]}`);
	if (props.marginTop) classes.push(`mt-${spaceValue[props.marginTop]}`);
	if (props.marginBottom) classes.push(`mb-${spaceValue[props.marginBottom]}`);
	if (props.gap) classes.push(`gap-${spaceValue[props.gap]}`);
	return classes.join(" ");
}
//#endregion
export { buildSpacingClasses, extractSpacingProps };

//# sourceMappingURL=spacing.js.map