/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
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_VStack = require("../VStack.cjs");
const require_components_Divider_DividerLabel = require("./DividerLabel.cjs");
const require_components_Divider_DividerLine = require("./DividerLine.cjs");
const require_components_Divider_utils = require("./utils.cjs");
let react = require("react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/components/Divider/Divider.tsx
const ORIENTATION_WIDTH_MAP = {
	horizontal: "w-full",
	vertical: ""
};
/**
* **📦 A divider component that can be used to visually separate components**
*
* @description
* The Divider component is a visual element used to separate content and create clear groupings within a layout. It helps establish hierarchy, improve readability, and guide users through sections of an interface. Dividers can appear as horizontal or vertical lines and are commonly used between related content blocks, within menus, or in dense UI areas to reduce visual clutter.
*
* For custom composition, import `DividerLine` and `DividerLabel` from the same package entrypoint
* and compose them inside `Divider`, `HStack`, or `VStack`.
*
* @example
* ```tsx
* import { Divider, DividerLabel, DividerLine } from '@yahoo/uds';
*
* // Default primary horizontal divider. Similar to <hr />
* <Divider />
*
* // A vertical divider.
* <Divider vertical />
*
* // A horizontal divider with the secondary styling.
* <Divider variant="secondary" />
*
* // A vertical divider with the tertiary styling.
* <Divider vertical variant="tertiary" />
*
* // Manual composition.
* <Divider>
*   <DividerLine />
*   <DividerLabel>Section</DividerLabel>
*   <DividerLine />
* </Divider>
* ```
*
* @usage
* - Visually separating parts of a page. Usually used in conjuction with [HStack](./h-stack) or [VStack](./v-stack).
* - Use `DividerLine` and `DividerLabel` when a layout needs custom composition.
*
* @see The {@link https://uds.build/docs/components/divider Divider Docs} for more info
*
* @related [Box](https://uds.build/docs/components/box), [HStack](https://uds.build/docs/components/h-stack), [VStack](https://uds.build/docs/components/v-stack)
*/
const Divider = (0, react.forwardRef)(function Divider({ variant = "primary", vertical = false, contentPosition = "center", className, slotProps, children, gap, ...boxProps }, ref) {
	const direction = vertical ? "vertical" : "horizontal";
	const InternalComponent = vertical ? require_components_VStack.VStack : require_components_HStack.HStack;
	const { className: rootClassName, ...rootSlotProps } = slotProps?.root ?? {};
	const { className: labelClassName, variant: labelTextVariant, ...labelSlotProps } = slotProps?.label ?? {};
	const { className: lineClassName, ...lineSlotProps } = slotProps?.line ?? {};
	const classNames = (0, react.useMemo)(() => ({
		root: require_styles_styler.cx(ORIENTATION_WIDTH_MAP[direction], variant !== "inherit" && require_styles_styler.getStyles({ dividerVariantRoot: variant }), className, rootClassName),
		label: labelClassName,
		line: lineClassName
	}), [
		className,
		direction,
		labelClassName,
		lineClassName,
		rootClassName,
		variant
	]);
	if (children !== void 0 && children !== null && children !== false) {
		const content = require_components_Divider_utils.shouldWrapInLabel(children) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Divider_DividerLabel.DividerLabel, {
			className: classNames.label,
			textVariant: labelTextVariant,
			variant,
			...labelSlotProps,
			children
		}) : require_components_Divider_utils.renderManualChildren(children, variant, vertical);
		return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InternalComponent, {
			alignItems: "center",
			className: classNames.root,
			flex: "1",
			gap,
			ref,
			...boxProps,
			...rootSlotProps,
			children: require_components_Divider_utils.hasManualLine(children) ? content : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
				contentPosition !== "start" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Divider_DividerLine.DividerLine, {
					className: classNames.line,
					variant,
					vertical,
					...lineSlotProps
				}),
				content,
				contentPosition !== "end" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Divider_DividerLine.DividerLine, {
					className: classNames.line,
					variant,
					vertical,
					...lineSlotProps
				})
			] })
		});
	}
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
		className: classNames.root,
		display: "flex",
		flex: "none",
		ref,
		...boxProps,
		...rootSlotProps,
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Divider_DividerLine.DividerLine, {
			className: classNames.line,
			variant,
			vertical,
			...lineSlotProps
		})
	});
});
Divider.displayName = "Divider";
//#endregion
exports.Divider = Divider;
