/*! ratio-ui · design system for knowledge sharing · https://github.com/losol/ratio-ui · (c) 2026 Losol AS · MPL-2.0 */
import "react";
import { jsx } from "react/jsx-runtime";
//#region src/layout/Stack/Stack.tsx
var gapClasses = {
	none: "gap-0",
	xs: "gap-xs",
	sm: "gap-sm",
	md: "gap-md",
	lg: "gap-lg",
	xl: "gap-xl"
};
var alignClasses = {
	start: "items-start",
	center: "items-center",
	end: "items-end",
	stretch: "items-stretch"
};
var justifyClasses = {
	start: "justify-start",
	center: "justify-center",
	end: "justify-end",
	between: "justify-between",
	around: "justify-around",
	evenly: "justify-evenly"
};
/**
* Stack - A flexible container for arranging items in a row or column with consistent spacing
*
* @example
* ```tsx
* // Vertical stack with medium gap
* <Stack gap="md">
*   <div>Item 1</div>
*   <div>Item 2</div>
*   <div>Item 3</div>
* </Stack>
*
* // Horizontal stack with dividers
* <Stack direction="horizontal" gap="lg" dividers>
*   <span>Section 1</span>
*   <span>Section 2</span>
*   <span>Section 3</span>
* </Stack>
*
* // Centered items
* <Stack align="center" justify="center">
*   <button>Action 1</button>
*   <button>Action 2</button>
* </Stack>
* ```
*/
var Stack = ({ direction = "vertical", gap = "md", align, justify, wrap = false, dividers = false, className = "", as: Component = "div", children }) => {
	const flexDirection = direction === "vertical" ? "flex-col" : "flex-row";
	const gapClass = gapClasses[gap];
	const alignClass = align ? alignClasses[align] : "";
	const justifyClass = justify ? justifyClasses[justify] : "";
	const wrapClass = wrap ? "flex-wrap" : "";
	let dividerClass = "";
	if (dividers) dividerClass = direction === "vertical" ? "divide-y divide-border-1" : "divide-x divide-border-1";
	return /* @__PURE__ */ jsx(Component, {
		className: [
			"flex",
			flexDirection,
			gapClass,
			alignClass,
			justifyClass,
			wrapClass,
			dividerClass,
			className
		].filter(Boolean).join(" "),
		children
	});
};
//#endregion
export { Stack };

//# sourceMappingURL=Stack.js.map