/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
const require_styles_styler = require('../../styles/styler.cjs');
const require_components_Box = require('../Box.cjs');
const require_components_HStack = require('../HStack.cjs');
const require_components_Text = require('../Text.cjs');
const require_components_VStack = require('../VStack.cjs');
let react = require("react");
let react_jsx_runtime = require("react/jsx-runtime");

//#region src/components/Divider/DividerCore.tsx
const ORIENTATION_WIDTH_MAP = {
	horizontal: "w-full",
	vertical: ""
};
const DividerCore = (0, react.forwardRef)(function Divider({ vertical = false, contentPosition = "center", className, layerClassNames, children, ...boxProps }, ref) {
	const direction = vertical ? "vertical" : "horizontal";
	const InternalComponent = vertical ? require_components_VStack.VStack : require_components_HStack.HStack;
	const classNames = (0, react.useMemo)(() => ({
		root: require_styles_styler.cx(ORIENTATION_WIDTH_MAP[direction], className, layerClassNames?.root),
		label: require_styles_styler.cx(layerClassNames?.text),
		line: layerClassNames?.line
	}), [
		className,
		direction,
		layerClassNames?.root,
		layerClassNames?.text,
		layerClassNames?.line
	]);
	const lineStyle = (0, react.useMemo)(() => direction === "vertical" ? {
		borderTopWidth: 0,
		borderRightWidth: 0,
		borderBottomWidth: 0
	} : {
		borderLeftWidth: 0,
		borderRightWidth: 0,
		borderBottomWidth: 0
	}, [direction]);
	const Line = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
		flex: "1",
		className: classNames.line,
		style: lineStyle
	});
	if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(InternalComponent, {
		flex: "1",
		alignItems: "center",
		className: classNames.root,
		ref,
		...boxProps,
		children: [
			contentPosition !== "start" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Line, {}),
			/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
				flex: "none",
				children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
					as: "span",
					color: "inherit",
					variant: "inherit",
					className: classNames.label,
					children
				})
			}),
			contentPosition !== "end" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Line, {})
		]
	});
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
		display: "flex",
		flex: "none",
		className: classNames.root,
		ref,
		...boxProps,
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Line, {})
	});
});
DividerCore.displayName = "DividerCore";

//#endregion
exports.DividerCore = DividerCore;