/*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
import { shadowOffsetMap, shadowSpreadRadiusMap, spacingMap } from "../../fixtures/dist/index.js";
import { newAlwaysPalette } from "../../palette/dist/index.js";

//#region ../css-tokens/dist/index.js
/*! © 2026 Yahoo, Inc. UDS Motion Tokens v0.0.0-development */
const UDS_PREFIX = "uds";
const AVATAR_SIZE_PREFIX = `${UDS_PREFIX}-avatar-size`;
const BACKGROUND_COLOR_PREFIX = `${UDS_PREFIX}-background-color`;
const BORDER_RADIUS_PREFIX = `${UDS_PREFIX}-border-radius`;
const BORDER_WIDTH_PREFIX = `${UDS_PREFIX}-border-width`;
const DROP_SHADOW_PREFIX = `${UDS_PREFIX}-drop-shadow`;
const BACKGROUND_BLUR_RADIUS_PREFIX = `${UDS_PREFIX}-background-blur-radius`;
const BACKGROUND_BLUR_COLOR_PREFIX = `${UDS_PREFIX}-background-blur-color`;
const BACKGROUND_BLUR_FALLBACK_COLOR_PREFIX = `${UDS_PREFIX}-background-blur-fallback-color`;
const FONT_FAMILY_PREFIX = `${UDS_PREFIX}-font`;
const FONT_SIZE_PREFIX = `${UDS_PREFIX}-font-size`;
const FONT_WEIGHT_PREFIX = `${UDS_PREFIX}-font-weight`;
const FONT_SLANT_PREFIX = `${UDS_PREFIX}-font-slant`;
const FONT_WIDTH_PREFIX = `${UDS_PREFIX}-font-width`;
const ICON_SIZE_PREFIX = `${UDS_PREFIX}-icon-size`;
const LINE_COLOR_PREFIX = `${UDS_PREFIX}-line-color`;
const LINE_HEIGHT_PREFIX = `${UDS_PREFIX}-line-height`;
const LETTER_SPACING_PREFIX = `${UDS_PREFIX}-letter-spacing`;
const MOTION_PREFIX = `${UDS_PREFIX}-motion`;
const OUTLINE_PREFIX = `${UDS_PREFIX}-outline`;
const SPECTRUM_COLOR_PREFIX = `${UDS_PREFIX}-spectrum-color`;
const TEXT_TRANSFORM_PREFIX = `${UDS_PREFIX}-text-transform`;
const DARK_COLOR_MODE_CLASSNAME = `${UDS_PREFIX}-color-mode-dark`;
const LIGHT_COLOR_MODE_CLASSNAME = `${UDS_PREFIX}-color-mode-light`;
const SYSTEM_COLOR_MODE_CLASSNAME = `${UDS_PREFIX}-color-mode-system`;
const INVERT_COLOR_MODE_CLASSNAME = `${UDS_PREFIX}-color-mode-invert`;
const XSMALL_SCALE_MODE_CLASSNAME = `${UDS_PREFIX}-scale-mode-xsmall`;
const SMALL_SCALE_MODE_CLASSNAME = `${UDS_PREFIX}-scale-mode-small`;
const MEDIUM_SCALE_MODE_CLASSNAME = `${UDS_PREFIX}-scale-mode-medium`;
const LARGE_SCALE_MODE_CLASSNAME = `${UDS_PREFIX}-scale-mode-large`;
const XLARGE_SCALE_MODE_CLASSNAME = `${UDS_PREFIX}-scale-mode-xlarge`;
const XXLARGE_SCALE_MODE_CLASSNAME = `${UDS_PREFIX}-scale-mode-xxlarge`;
const XXXLARGE_SCALE_MODE_CLASSNAME = `${UDS_PREFIX}-scale-mode-xxxlarge`;
const TEXT_RESPONSIVE_CLASSNAME = "uds-text-responsive";
const TEXT_RESPONSIVE_BREAKPOINT_CLASSNAMES = {
	defaultBreakpoint: "uds-text-default",
	base: "uds-text-base",
	sm: "uds-text-sm",
	md: "uds-text-md",
	lg: "uds-text-lg",
	xl: "uds-text-xl",
	"2xl": "uds-text-2xl"
};
const BUTTON_GAP_VAR = `--${UDS_PREFIX}-button-gap`;
const BUTTON_SCALE_EFFECT = `--${UDS_PREFIX}-button-scale-effect`;
const BUTTON_SCALE_EFFECT_REST = `${BUTTON_SCALE_EFFECT}-rest`;
const BUTTON_SCALE_EFFECT_HOVER = `${BUTTON_SCALE_EFFECT}-hover`;
const BUTTON_SCALE_EFFECT_PRESSED = `${BUTTON_SCALE_EFFECT}-pressed`;
const PSEUDO_STYLE_SELECTOR_MAP = {
	hover: ":hover:not([disabled])",
	pressed: ":active:not([disabled])",
	disabled: ":disabled",
	focused: ":focus-visible",
	focusedWithin: ":has(:focus-visible)",
	notDisabled: ":not(:has(:disabled))"
};
/**
* These CSS utilities are temporarily housed here because they are shared
* dependencies between:
* - @yahoo/uds-automated-config (component automation/styling generation)
* - @yahoo/uds (tailwind plugin for shadow generation)
*
* Placing them in css-tokens avoids circular dependencies between these packages.
* TODO: Consider creating a dedicated shared utilities package if this grows.
*/
const textVariantsSafe = (variant) => variant.replace("/", "-");
function hexToRgb(hex) {
	hex = hex.replace("#", "");
	if (hex.length === 3) hex = hex.split("").map((char) => char + char).join("");
	return `${parseInt(hex.substring(0, 2), 16)} ${parseInt(hex.substring(2, 4), 16)} ${parseInt(hex.substring(4, 6), 16)}`;
}
const RGB = {
	white: hexToRgb(newAlwaysPalette["always/white"]),
	black: hexToRgb(newAlwaysPalette["always/black"]),
	brand: hexToRgb(newAlwaysPalette["always/brand"]),
	accent: hexToRgb(newAlwaysPalette["always/accent"])
};
const ALWAYS_AS_RGB = {
	black: RGB.black,
	white: RGB.white,
	"always/black": RGB.black,
	"always/white": RGB.white,
	"always/brand": RGB.brand,
	"always/accent": RGB.accent
};
/**
* Generate a single shadow value from a shadow preset configuration
*
* @param preset - The shadow preset configuration
* @param index - Optional index for numbered shadows (2-5)
* @param shadowType - The type of shadow (drop or inset)
* @returns A CSS box-shadow value string
*/
function getShadowLayerValue({ preset, prefix, shadowType }) {
	const varPrefix = `--uds-${shadowType}-shadow-`;
	const isPaletteColor = preset.color?.type === "palette";
	const isAlwaysColor = preset.color?.type === "always";
	let shadowColor = `var(--uds-${isPaletteColor ? "shadow" : "spectrum"}-color-${preset?.color?.value})`;
	if (isAlwaysColor) shadowColor = ALWAYS_AS_RGB[preset.color.value];
	const defaultColor = `var(${varPrefix}${prefix ? `${prefix}-` : ""}color, ${shadowColor})`;
	const cssValues = [
		`${shadowOffsetMap[preset.offsetX]}px`,
		`${shadowOffsetMap[preset.offsetY]}px`,
		`${spacingMap[preset.blur]}px`,
		`${shadowSpreadRadiusMap[preset.spread]}px`
	].map((value) => value).join(" ");
	const colorValue = `rgb(${defaultColor} / var(${varPrefix}${prefix ? `${prefix}-` : ""}opacity, ${Number(preset.opacity) / 100}))`;
	return `${shadowType === "inset" ? "inset " : ""}${cssValues} ${colorValue}`;
}
function getMotionVar({ variant, speed, control }) {
	return `${[
		`--${MOTION_PREFIX}`,
		variant,
		speed,
		control
	].join("-")}`;
}

//#endregion
export { AVATAR_SIZE_PREFIX, BACKGROUND_BLUR_COLOR_PREFIX, BACKGROUND_BLUR_FALLBACK_COLOR_PREFIX, BACKGROUND_BLUR_RADIUS_PREFIX, BACKGROUND_COLOR_PREFIX, BORDER_RADIUS_PREFIX, BORDER_WIDTH_PREFIX, BUTTON_GAP_VAR, BUTTON_SCALE_EFFECT, BUTTON_SCALE_EFFECT_HOVER, BUTTON_SCALE_EFFECT_PRESSED, BUTTON_SCALE_EFFECT_REST, DARK_COLOR_MODE_CLASSNAME, DROP_SHADOW_PREFIX, FONT_FAMILY_PREFIX, FONT_SIZE_PREFIX, FONT_SLANT_PREFIX, FONT_WEIGHT_PREFIX, FONT_WIDTH_PREFIX, ICON_SIZE_PREFIX, INVERT_COLOR_MODE_CLASSNAME, LARGE_SCALE_MODE_CLASSNAME, LETTER_SPACING_PREFIX, LIGHT_COLOR_MODE_CLASSNAME, LINE_COLOR_PREFIX, LINE_HEIGHT_PREFIX, MEDIUM_SCALE_MODE_CLASSNAME, OUTLINE_PREFIX, PSEUDO_STYLE_SELECTOR_MAP, SMALL_SCALE_MODE_CLASSNAME, SPECTRUM_COLOR_PREFIX, SYSTEM_COLOR_MODE_CLASSNAME, TEXT_RESPONSIVE_BREAKPOINT_CLASSNAMES, TEXT_RESPONSIVE_CLASSNAME, TEXT_TRANSFORM_PREFIX, UDS_PREFIX, XLARGE_SCALE_MODE_CLASSNAME, XSMALL_SCALE_MODE_CLASSNAME, XXLARGE_SCALE_MODE_CLASSNAME, XXXLARGE_SCALE_MODE_CLASSNAME, getMotionVar, getShadowLayerValue, textVariantsSafe };
//# sourceMappingURL=index.js.map