"use strict";
const jsxRuntime = require("react/jsx-runtime");
const React = require("react");
const styles_lib_components_Accordion_AccordionItem_cjs = require("../Accordion/AccordionItem.cjs");
const styles_lib_components_Box_Box_cjs = require("../Box/Box.cjs");
const styles_lib_components_Divider_Divider_cjs = require("../Divider/Divider.cjs");
const styles_lib_css_negativeMargin_negativeMargin_cjs = require("../../css/negativeMargin/negativeMargin.cjs");
const styles_lib_utils_resolveResponsiveProp_cjs = require("../../utils/resolveResponsiveProp.cjs");
const styles_lib_components_Tiles_Tiles_css_cjs = require("./Tiles.css.cjs");
const styles_lib_css_atoms_sprinkles_css_cjs = require("../../css/atoms/sprinkles.css.cjs");
const styles_lib_components_Accordion_Accordion_cjs = require("../Accordion/Accordion.cjs");
const Tiles = ({
  children,
  space = "none",
  columns = 1,
  dividers = false,
  data,
  ...restProps
}) => /* @__PURE__ */ jsxRuntime.jsx(
  styles_lib_components_Box_Box_cjs.Box,
  {
    className: styles_lib_css_negativeMargin_negativeMargin_cjs.negativeMargin("top", space),
    ...styles_lib_components_Accordion_Accordion_cjs.buildDataAttributes({ data, validateRestProps: restProps }),
    children: /* @__PURE__ */ jsxRuntime.jsx(
      styles_lib_components_Box_Box_cjs.Box,
      {
        display: "flex",
        flexWrap: "wrap",
        className: styles_lib_css_negativeMargin_negativeMargin_cjs.negativeMargin("left", space),
        children: React.Children.map(styles_lib_components_Accordion_AccordionItem_cjs.flattenChildren(children), (child, i) => /* @__PURE__ */ jsxRuntime.jsx(
          styles_lib_components_Box_Box_cjs.Box,
          {
            minWidth: 0,
            className: styles_lib_utils_resolveResponsiveProp_cjs.resolveResponsiveProp(
              columns,
              styles_lib_components_Tiles_Tiles_css_cjs.columnsMobile,
              styles_lib_components_Tiles_Tiles_css_cjs.columnsTablet,
              styles_lib_components_Tiles_Tiles_css_cjs.columnsDesktop,
              styles_lib_components_Tiles_Tiles_css_cjs.columnsWide
            ),
            children: /* @__PURE__ */ jsxRuntime.jsxs(
              styles_lib_components_Box_Box_cjs.Box,
              {
                height: "full",
                paddingTop: space,
                paddingLeft: space,
                children: [
                  dividers && i > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
                    styles_lib_components_Box_Box_cjs.Box,
                    {
                      paddingBottom: space,
                      display: styles_lib_css_atoms_sprinkles_css_cjs.mapResponsiveValue(
                        columns,
                        (column) => column === 1 ? "block" : "none"
                      ),
                      children: typeof dividers === "string" ? /* @__PURE__ */ jsxRuntime.jsx(styles_lib_components_Divider_Divider_cjs.Divider, { weight: dividers }) : /* @__PURE__ */ jsxRuntime.jsx(styles_lib_components_Divider_Divider_cjs.Divider, {})
                    }
                  ) : null,
                  child
                ]
              }
            )
          }
        ))
      }
    )
  }
);
exports.Tiles = Tiles;
