"use strict";
/**
 * Theme atoms - Enhanced exports with pairify function for array-style syntax
 * These provide direct access to static design tokens and support composition
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.px = exports.pl = exports.pb = exports.pr = exports.pt = exports.p = exports.my = exports.mx = exports.ml = exports.mb = exports.mr = exports.mt = exports.m = exports.text = exports.bg = exports.a = exports.atoms = exports.layouts = exports.gap = exports.aspectRatio = exports.position = exports.transforms = exports.textAlignVertical = exports.textDecoration = exports.textTransform = exports.letterSpacing = exports.lineHeight = exports.fontSize = exports.fontWeight = exports.textAlign = exports.overflow = exports.zIndex = exports.opacity = exports.flex = exports.sizes = exports.textColors = exports.backgrounds = exports.radiusAtoms = exports.spacingAtoms = exports.borders = exports.layout = exports.iconSizes = exports.typographyAtoms = exports.getPlatformTypography = exports.colors = exports.touchTargets = exports.spacing = exports.shadows = exports.borderRadius = exports.animations = void 0;
exports.translateY = exports.translateX = exports.scale = exports.rotate = exports.left = exports.bottom = exports.right = exports.top = exports.r = exports.h = exports.w = exports.py = void 0;
const react_native_1 = require("react-native");
const tokens_1 = require("./tokens");
Object.defineProperty(exports, "animations", { enumerable: true, get: function () { return tokens_1.animations; } });
Object.defineProperty(exports, "borderRadius", { enumerable: true, get: function () { return tokens_1.borderRadius; } });
Object.defineProperty(exports, "shadows", { enumerable: true, get: function () { return tokens_1.shadows; } });
Object.defineProperty(exports, "spacing", { enumerable: true, get: function () { return tokens_1.spacing; } });
Object.defineProperty(exports, "touchTargets", { enumerable: true, get: function () { return tokens_1.touchTargets; } });
/**
 * Pairify function - converts nested objects into key-value pairs that return style objects
 * This allows for array-style syntax like style={[a.borders.green[300], a.shadows.xl]}
 */
function pairify(obj, styleKeyPrefix) {
    const result = {};
    for (const [key, value] of Object.entries(obj)) {
        if (typeof value === "object" && value !== null && !Array.isArray(value)) {
            // For nested objects (like color scales), create another level
            result[key] = {};
            for (const [nestedKey, nestedValue] of Object.entries(value)) {
                result[key][nestedKey] = { [styleKeyPrefix]: nestedValue };
            }
        }
        else {
            // For simple values, create the style object directly
            result[key] = { [styleKeyPrefix]: value };
        }
    }
    return result;
}
// Export raw color tokens for advanced use cases
exports.colors = tokens_1.colors;
// Platform-aware typography helper
const getPlatformTypography = () => {
    if (react_native_1.Platform.OS === "ios") {
        return tokens_1.typography.ios;
    }
    else if (react_native_1.Platform.OS === "android") {
        return tokens_1.typography.android;
    }
    return tokens_1.typography.universal;
};
exports.getPlatformTypography = getPlatformTypography;
// Export all typography scales
exports.typographyAtoms = {
    platform: (0, exports.getPlatformTypography)(),
    universal: tokens_1.typography.universal,
    ios: tokens_1.typography.ios,
    android: tokens_1.typography.android,
};
// Static icon sizes (colors are handled by theme)
exports.iconSizes = {
    sm: 16,
    md: 20,
    lg: 24,
    xl: 32,
};
// Common layout utilities
exports.layout = {
    flex: {
        center: {
            justifyContent: "center",
            alignItems: "center",
        },
        alignCenter: {
            alignItems: "center",
        },
        justifyCenter: {
            justifyContent: "center",
        },
        row: {
            flexDirection: "row",
        },
        column: {
            flexDirection: "column",
        },
        spaceBetween: {
            justifyContent: "space-between",
        },
        spaceAround: {
            justifyContent: "space-around",
        },
        spaceEvenly: {
            justifyContent: "space-evenly",
        },
        direction: pairify({
            row: "row",
            column: "column",
            "row-reverse": "row-reverse",
            "column-reverse": "column-reverse",
        }, "flexDirection"),
        justify: pairify({
            start: "flex-start",
            end: "flex-end",
            center: "center",
            between: "space-between",
            around: "space-around",
            evenly: "space-evenly",
        }, "justifyContent"),
        align: pairify({
            start: "flex-start",
            end: "flex-end",
            center: "center",
            stretch: "stretch",
            baseline: "baseline",
        }, "alignItems"),
        wrap: pairify({
            wrap: "wrap",
            nowrap: "nowrap",
            reverse: "wrap-reverse",
        }, "flexWrap"),
    },
    position: pairify({
        absolute: "absolute",
        relative: "relative",
        static: "static",
    }, "position"),
};
// Enhanced border utilities with pairified colors and widths
exports.borders = {
    width: pairify({
        thin: 1,
        medium: 2,
        thick: 4,
    }, "borderWidth"),
    style: pairify({
        solid: "solid",
        dashed: "dashed",
        dotted: "dotted",
    }, "borderStyle"),
    // Pairified color borders
    color: pairify(tokens_1.colors, "borderColor"),
    // Top border utilities
    top: {
        width: pairify({
            thin: 1,
            medium: 2,
            thick: 4,
        }, "borderTopWidth"),
        color: pairify(tokens_1.colors, "borderTopColor"),
    },
    // Bottom border utilities
    bottom: {
        width: pairify({
            thin: 1,
            medium: 2,
            thick: 4,
        }, "borderBottomWidth"),
        color: pairify(tokens_1.colors, "borderBottomColor"),
    },
    // Left border utilities
    left: {
        width: pairify({
            thin: 1,
            medium: 2,
            thick: 4,
        }, "borderLeftWidth"),
        color: pairify(tokens_1.colors, "borderLeftColor"),
    },
    // Right border utilities
    right: {
        width: pairify({
            thin: 1,
            medium: 2,
            thick: 4,
        }, "borderRightWidth"),
        color: pairify(tokens_1.colors, "borderRightColor"),
    },
};
// Pairified spacing utilities
exports.spacingAtoms = {
    margin: pairify(tokens_1.spacing, "margin"),
    marginTop: pairify(tokens_1.spacing, "marginTop"),
    marginRight: pairify(tokens_1.spacing, "marginRight"),
    marginBottom: pairify(tokens_1.spacing, "marginBottom"),
    marginLeft: pairify(tokens_1.spacing, "marginLeft"),
    marginHorizontal: pairify(tokens_1.spacing, "marginHorizontal"),
    marginVertical: pairify(tokens_1.spacing, "marginVertical"),
    padding: pairify(tokens_1.spacing, "padding"),
    paddingTop: pairify(tokens_1.spacing, "paddingTop"),
    paddingRight: pairify(tokens_1.spacing, "paddingRight"),
    paddingBottom: pairify(tokens_1.spacing, "paddingBottom"),
    paddingLeft: pairify(tokens_1.spacing, "paddingLeft"),
    paddingHorizontal: pairify(tokens_1.spacing, "paddingHorizontal"),
    paddingVertical: pairify(tokens_1.spacing, "paddingVertical"),
};
// Pairified border radius utilities
exports.radiusAtoms = {
    all: pairify(tokens_1.borderRadius, "borderRadius"),
    top: pairify(tokens_1.borderRadius, "borderTopLeftRadius"),
    topRight: pairify(tokens_1.borderRadius, "borderTopRightRadius"),
    bottom: pairify(tokens_1.borderRadius, "borderBottomLeftRadius"),
    bottomRight: pairify(tokens_1.borderRadius, "borderBottomRightRadius"),
    left: pairify(tokens_1.borderRadius, "borderTopLeftRadius"),
    right: pairify(tokens_1.borderRadius, "borderTopRightRadius"),
};
// Background color utilities
exports.backgrounds = pairify(tokens_1.colors, "backgroundColor");
// Text color utilities
exports.textColors = pairify(tokens_1.colors, "color");
// Percentage-based sizes
const percentageSizes = {
    "10": "10%",
    "20": "20%",
    "25": "25%",
    "30": "30%",
    "33": "33.333333%",
    "40": "40%",
    "50": "50%",
    "60": "60%",
    "66": "66.666667%",
    "70": "70%",
    "75": "75%",
    "80": "80%",
    "90": "90%",
    "100": "100%",
};
// Size utilities (width and height)
exports.sizes = {
    width: {
        ...pairify(tokens_1.spacing, "width"),
        percent: pairify(percentageSizes, "width"),
    },
    height: {
        ...pairify(tokens_1.spacing, "height"),
        percent: pairify(percentageSizes, "height"),
    },
    minWidth: {
        ...pairify(tokens_1.spacing, "minWidth"),
        percent: pairify(percentageSizes, "minWidth"),
    },
    minHeight: {
        ...pairify(tokens_1.spacing, "minHeight"),
        percent: pairify(percentageSizes, "minHeight"),
    },
    maxWidth: {
        ...pairify(tokens_1.spacing, "maxWidth"),
        percent: pairify(percentageSizes, "maxWidth"),
    },
    maxHeight: {
        ...pairify(tokens_1.spacing, "maxHeight"),
        percent: pairify(percentageSizes, "maxHeight"),
    },
};
// Flex utilities
exports.flex = {
    values: pairify({
        0: 0,
        1: 1,
        2: 2,
        3: 3,
        4: 4,
        5: 5,
    }, "flex"),
    grow: pairify({
        0: 0,
        1: 1,
    }, "flexGrow"),
    shrink: pairify({
        0: 0,
        1: 1,
    }, "flexShrink"),
    basis: {
        ...pairify(tokens_1.spacing, "flexBasis"),
        ...pairify(percentageSizes, "flexBasis"),
        auto: { flexBasis: "auto" },
    },
};
// Opacity utilities
exports.opacity = pairify({
    0: 0,
    5: 0.05,
    10: 0.1,
    20: 0.2,
    25: 0.25,
    30: 0.3,
    40: 0.4,
    50: 0.5,
    60: 0.6,
    70: 0.7,
    75: 0.75,
    80: 0.8,
    90: 0.9,
    95: 0.95,
    100: 1,
}, "opacity");
// Z-index utilities
exports.zIndex = pairify({
    0: 0,
    10: 10,
    20: 20,
    30: 30,
    40: 40,
    50: 50,
    auto: "auto",
}, "zIndex");
// Overflow utilities
exports.overflow = pairify({
    visible: "visible",
    hidden: "hidden",
    scroll: "scroll",
}, "overflow");
// Text alignment utilities
exports.textAlign = pairify({
    left: "left",
    center: "center",
    right: "right",
    justify: "justify",
    auto: "auto",
}, "textAlign");
// Font weight utilities
exports.fontWeight = pairify({
    thin: "100",
    extralight: "200",
    light: "300",
    normal: "400",
    medium: "500",
    semibold: "600",
    bold: "700",
    extrabold: "800",
    black: "900",
}, "fontWeight");
// Font size utilities (separate from typography for quick access)
exports.fontSize = pairify({
    xs: 12,
    sm: 14,
    base: 16,
    lg: 18,
    xl: 20,
    "2xl": 24,
    "3xl": 30,
    "4xl": 36,
    "5xl": 48,
    "6xl": 60,
    "7xl": 72,
    "8xl": 96,
    "9xl": 128,
}, "fontSize");
// Line height utilities
exports.lineHeight = pairify({
    none: 1,
    tight: 1.25,
    snug: 1.375,
    normal: 1.5,
    relaxed: 1.625,
    loose: 2,
    3: 12,
    4: 16,
    5: 20,
    6: 24,
    7: 28,
    8: 32,
    9: 36,
    10: 40,
}, "lineHeight");
// Letter spacing utilities
exports.letterSpacing = pairify({
    tighter: -0.5,
    tight: -0.25,
    normal: 0,
    wide: 0.25,
    wider: 0.5,
    widest: 1,
}, "letterSpacing");
// Text transform utilities
exports.textTransform = pairify({
    uppercase: "uppercase",
    lowercase: "lowercase",
    capitalize: "capitalize",
    none: "none",
}, "textTransform");
// Text decoration utilities
exports.textDecoration = pairify({
    none: "none",
    underline: "underline",
    lineThrough: "line-through",
    underlineLineThrough: "underline line-through",
}, "textDecorationLine");
// Text align vertical utilities (React Native specific)
exports.textAlignVertical = pairify({
    auto: "auto",
    top: "top",
    bottom: "bottom",
    center: "center",
}, "textAlignVertical");
// Transform utilities
exports.transforms = {
    rotate: pairify({
        0: 0,
        1: 1,
        2: 2,
        3: 3,
        6: 6,
        12: 12,
        45: 45,
        90: 90,
        180: 180,
        270: 270,
    }, "rotate"),
    scale: pairify({
        0: 0,
        50: 0.5,
        75: 0.75,
        90: 0.9,
        95: 0.95,
        100: 1,
        105: 1.05,
        110: 1.1,
        125: 1.25,
        150: 1.5,
        200: 2,
    }, "scale"),
    scaleX: pairify({
        0: 0,
        50: 0.5,
        75: 0.75,
        90: 0.9,
        95: 0.95,
        100: 1,
        105: 1.05,
        110: 1.1,
        125: 1.25,
        150: 1.5,
        200: 2,
    }, "scaleX"),
    scaleY: pairify({
        0: 0,
        50: 0.5,
        75: 0.75,
        90: 0.9,
        95: 0.95,
        100: 1,
        105: 1.05,
        110: 1.1,
        125: 1.25,
        150: 1.5,
        200: 2,
    }, "scaleY"),
    translateX: pairify(tokens_1.spacing, "translateX"),
    translateY: pairify(tokens_1.spacing, "translateY"),
};
// Absolute positioning utilities
exports.position = {
    top: pairify(tokens_1.spacing, "top"),
    right: pairify(tokens_1.spacing, "right"),
    bottom: pairify(tokens_1.spacing, "bottom"),
    left: pairify(tokens_1.spacing, "left"),
    // Common position combinations
    topLeft: (top, left) => ({
        position: "absolute",
        top,
        left,
    }),
    topRight: (top, right) => ({
        position: "absolute",
        top,
        right,
    }),
    bottomLeft: (bottom, left) => ({
        position: "absolute",
        bottom,
        left,
    }),
    bottomRight: (bottom, right) => ({
        position: "absolute",
        bottom,
        right,
    }),
    // Percentage-based positioning
    percent: {
        top: pairify({
            0: "0%",
            25: "25%",
            50: "50%",
            75: "75%",
            100: "100%",
        }, "top"),
        right: pairify({
            0: "0%",
            25: "25%",
            50: "50%",
            75: "75%",
            100: "100%",
        }, "right"),
        bottom: pairify({
            0: "0%",
            25: "25%",
            50: "50%",
            75: "75%",
            100: "100%",
        }, "bottom"),
        left: pairify({
            0: "0%",
            25: "25%",
            50: "50%",
            75: "75%",
            100: "100%",
        }, "left"),
    },
};
// Aspect ratio utilities (React Native 0.71+)
exports.aspectRatio = pairify({
    square: 1,
    video: 16 / 9,
    photo: 4 / 3,
    portrait: 3 / 4,
    wide: 21 / 9,
    ultrawide: 32 / 9,
    "1/1": 1,
    "3/2": 3 / 2,
    "4/3": 4 / 3,
    "16/9": 16 / 9,
    "21/9": 21 / 9,
}, "aspectRatio");
// Gap utilities (React Native 0.71+)
exports.gap = {
    row: pairify(tokens_1.spacing, "rowGap"),
    column: pairify(tokens_1.spacing, "columnGap"),
    all: pairify(tokens_1.spacing, "gap"),
};
// Common layout patterns
exports.layouts = {
    // Full screen
    fullScreen: {
        position: "absolute",
        top: 0,
        left: 0,
        right: 0,
        bottom: 0,
    },
    // Centered content
    centered: {
        flex: 1,
        justifyContent: "center",
        alignItems: "center",
    },
    // Centered modal/overlay
    overlay: {
        position: "absolute",
        top: 0,
        left: 0,
        right: 0,
        bottom: 0,
        justifyContent: "center",
        alignItems: "center",
        backgroundColor: "rgba(0, 0, 0, 0.5)",
    },
    // Safe area friendly
    safeContainer: {
        flex: 1,
        paddingTop: react_native_1.Platform.OS === "ios" ? 44 : 0, // Status bar height
    },
    // Row with space between
    spaceBetweenRow: {
        flexDirection: "row",
        justifyContent: "space-between",
        alignItems: "center",
    },
    // Sticky header
    stickyHeader: {
        position: "absolute",
        top: 0,
        left: 0,
        right: 0,
        zIndex: 10,
    },
    // Bottom sheet style
    bottomSheet: {
        position: "absolute",
        bottom: 0,
        left: 0,
        right: 0,
        borderTopLeftRadius: 16,
        borderTopRightRadius: 16,
    },
};
// Export everything as a combined atoms object for convenience
exports.atoms = {
    colors: tokens_1.colors,
    spacing: tokens_1.spacing,
    borderRadius: tokens_1.borderRadius,
    radius: exports.radiusAtoms,
    typography: exports.typographyAtoms,
    shadows: tokens_1.shadows,
    touchTargets: tokens_1.touchTargets,
    animations: tokens_1.animations,
    iconSizes: exports.iconSizes,
    layout: exports.layout,
    borders: exports.borders,
    backgrounds: exports.backgrounds,
    textColors: exports.textColors,
    spacingAtoms: exports.spacingAtoms,
    sizes: exports.sizes,
    flex: exports.flex,
    opacity: exports.opacity,
    zIndex: exports.zIndex,
    overflow: exports.overflow,
    textAlign: exports.textAlign,
    fontWeight: exports.fontWeight,
    fontSize: exports.fontSize,
    lineHeight: exports.lineHeight,
    letterSpacing: exports.letterSpacing,
    textTransform: exports.textTransform,
    textDecoration: exports.textDecoration,
    textAlignVertical: exports.textAlignVertical,
    transforms: exports.transforms,
    position: exports.position,
    aspectRatio: exports.aspectRatio,
    gap: exports.gap,
    layouts: exports.layouts,
};
// Convenient shorthand aliases
exports.a = exports.atoms;
exports.bg = exports.backgrounds;
exports.text = exports.textColors;
exports.m = exports.spacingAtoms.margin;
exports.mt = exports.spacingAtoms.marginTop;
exports.mr = exports.spacingAtoms.marginRight;
exports.mb = exports.spacingAtoms.marginBottom;
exports.ml = exports.spacingAtoms.marginLeft;
exports.mx = exports.spacingAtoms.marginHorizontal;
exports.my = exports.spacingAtoms.marginVertical;
exports.p = exports.spacingAtoms.padding;
exports.pt = exports.spacingAtoms.paddingTop;
exports.pr = exports.spacingAtoms.paddingRight;
exports.pb = exports.spacingAtoms.paddingBottom;
exports.pl = exports.spacingAtoms.paddingLeft;
exports.px = exports.spacingAtoms.paddingHorizontal;
exports.py = exports.spacingAtoms.paddingVertical;
exports.w = exports.sizes.width;
exports.h = exports.sizes.height;
exports.r = exports.radiusAtoms.all;
exports.top = exports.position.top;
exports.right = exports.position.right;
exports.bottom = exports.position.bottom;
exports.left = exports.position.left;
exports.rotate = exports.transforms.rotate;
exports.scale = exports.transforms.scale;
exports.translateX = exports.transforms.translateX;
exports.translateY = exports.transforms.translateY;
//# sourceMappingURL=atoms.js.map