--- interface Props { /** Layout mode: number of columns or 'auto' for responsive */ layout?: "2-column" | "3-column" | "4-column" | "auto"; /** Gap between items - can be a predefined size or custom value (e.g., "2rem", "20px", "1.5em") */ gap?: "small" | "medium" | "large" | string; /** Optional class to apply on the wrapper */ class?: string; /** Optional ID for the stack */ id?: string; } const { layout = "2-column", gap = "medium", class: className, id, } = Astro.props as Props; // Generate flex properties based on layout const getFlexProperties = () => { switch (layout) { case "2-column": return { flexBasis: "50%", maxWidth: "50%" }; case "3-column": return { flexBasis: "33.333%", maxWidth: "33.333%" }; case "4-column": return { flexBasis: "25%", maxWidth: "25%" }; case "auto": return { flexBasis: "auto", maxWidth: "none" }; default: // By default, all children on one line with equal width return { flexBasis: "auto", maxWidth: "none" }; } }; const getGapSize = () => { // If it's a predefined size, return the corresponding value switch (gap) { case "small": return "0.5rem"; case "medium": return "1rem"; case "large": return "1.5rem"; default: // If it's a custom value, return it as-is (e.g., "2rem", "20px", "1.5em") return gap; } }; const flexProps = getFlexProperties(); const gapSize = getGapSize(); ---