// ─── Numeric / Unit helpers ──────────────────────────────────────────────────
/** "12px", "-4px" */
export const isPx = (v) => /^-?[\d.]+px$/.test(v);
/** "1.5rem" */
export const isRem = (v) => /^-?[\d.]+rem$/.test(v);
/** "1em" */
export const isEm = (v) => /^-?[\d.]+em$/.test(v);
/** Plain number string with no unit: "12", "1.5", NOT "-3" for unsigned contexts */
export const isUnitlessNumber = (v) => /^-?[\d.]+$/.test(v) && !isNaN(Number(v));
/** Non-negative unitless number only */
export const isNonNegativeUnitlessNumber = (v) => isUnitlessNumber(v) && Number(v) >= 0;
/** "50%" */
export const isPercent = (v) => /^[\d.]+%$/.test(v);
// ─── Color helpers ───────────────────────────────────────────────────────────
/** #RGB, #RGBA, #RRGGBB, #RRGGBBAA */
export const isHex = (v) => /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(v);
/** rgb(...) */
export const isRgb = (v) => /^rgb\(\s*[\d.]+%?\s*,\s*[\d.]+%?\s*,\s*[\d.]+%?\s*\)$/.test(v);
/** rgba(...) */
export const isRgba = (v) => /^rgba\(\s*[\d.]+%?\s*,\s*[\d.]+%?\s*,\s*[\d.]+%?\s*,\s*[\d.]+%?\s*\)$/.test(v);
/** hsl(...) */
export const isHsl = (v) => /^hsl\(\s*[\d.]+\s*,\s*[\d.]+%\s*,\s*[\d.]+%\s*\)$/.test(v);
/** hsla(...) */
export const isHsla = (v) => /^hsla\(\s*[\d.]+\s*,\s*[\d.]+%\s*,\s*[\d.]+%\s*,\s*[\d.]+\s*\)$/.test(v);
/**
 * Named color regex: 3-20 alphabetic characters only
 * Matches: "red", "blue", "transparent" (but not "foobar123" or "red-blue")
 */
const NAMED_COLOR = /^[a-zA-Z]{3,20}$/;
export const isNamedColor = (v) => NAMED_COLOR.test(v);
/** Any color valid for css-to-react-native: #hex, rgb(), rgba(), named */
export const isMobileColor = (v) => isHex(v) || isRgb(v) || isRgba(v) || isNamedColor(v);
/** Any color valid in CSS (superset of mobile) */
export const isWebColor = (v) => isHex(v) || isRgb(v) || isRgba(v) || isHsl(v) || isHsla(v) || isNamedColor(v);
//# sourceMappingURL=primitives.js.map