/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
import { __toESM } from "../_virtual/_rolldown/runtime.js";
import { require_plugin } from "../node_modules/.bun/tailwindcss@3.4.19_7500dce058369e0a/node_modules/tailwindcss/plugin.js";
import { entries } from "../packages/utils/dist/entries.js";
import { shouldNotMergeTokensIntoTailwindTheme } from "../utils/composeTailwindPlugins.js";
import { BORDER_WIDTH_PREFIX, LINE_COLOR_PREFIX } from "../packages/css-tokens/dist/index.js";
import { fromEntries } from "../packages/utils/dist/fromEntries.js";
import { getElevationStyles } from "../utils/getElevationStyles.js";
import { UDS_BORDER_WIDTH_THEME_KEY } from "./borderWidth.js";
//#region ../tailwind-internal/dist/plugins/elevation.js
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
var import_plugin = /* @__PURE__ */ __toESM(require_plugin(), 1);
const getBorderWidthTheme = (config, mergeTokensIntoTailwindTheme) => {
	const elevationBorderWidths = fromEntries(entries(config || {}).map(([level]) => [`elevation-${level}`, `var(--${BORDER_WIDTH_PREFIX}-elevation-${level})`]));
	if (!mergeTokensIntoTailwindTheme) return { [UDS_BORDER_WIDTH_THEME_KEY]: elevationBorderWidths };
	const namespacedBorderWidths = fromEntries(entries(elevationBorderWidths).map(([key, cssVar]) => [`width-${key}`, cssVar]));
	return {
		[UDS_BORDER_WIDTH_THEME_KEY]: elevationBorderWidths,
		borderWidth: namespacedBorderWidths,
		outlineWidth: namespacedBorderWidths,
		outlineOffset: namespacedBorderWidths
	};
};
const elevationPlugin = import_plugin.default.withOptions(({ config }) => ({ addUtilities }) => {
	addUtilities(getElevationStyles({ config }));
}, ({ config, disableOverrideTailwindTheme }) => {
	const shouldNotMergeBorderWidthTokensIntoTailwindTheme = shouldNotMergeTokensIntoTailwindTheme(disableOverrideTailwindTheme, "borderWidth");
	const borderColor = fromEntries(entries(config.elevation || {}).map(([level]) => [`elevation-${level}`, `var(--${LINE_COLOR_PREFIX}-elevation-${level})`]));
	return { theme: { extend: {
		borderColor,
		outlineColor: borderColor,
		...getBorderWidthTheme(config.elevation, !shouldNotMergeBorderWidthTokensIntoTailwindTheme)
	} } };
});
//#endregion
export { elevationPlugin };
