import { jsxs, jsx } from "react/jsx-runtime";
import { Children, cloneElement } from "react";
/* empty css                                                                                                                                                                                       */
/* empty css                                                                                                                                                                                        */
/* empty css                                                                                                                                                                                                */
/* empty css                                                                                                                                                                                           */
/* empty css                                                                                                                                                                                           */
import { Typography } from "../../primitive/Typography/index.mjs";
import { Card } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Card/Card.mjs";
import { Stack } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Stack/Stack.mjs";
import { Group } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Group/Group.mjs";
import { Divider as Divider$1 } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Divider/Divider.mjs";
const PropertyCard = ({ title, children, labelProps, valueProps, ...rest }) => {
  const renderChildren = () => {
    return Children.map(children, (child) => {
      if (!child || typeof child !== "object" || !("props" in child)) {
        return child;
      }
      return cloneElement(child, {
        ...child.props,
        labelProps: {
          ...labelProps,
          ...child.props.labelProps
        },
        valueProps: {
          ...valueProps,
          ...child.props.valueProps
        }
      });
    });
  };
  return /* @__PURE__ */ jsxs(Card, { p: "xl", ...rest, children: [
    /* @__PURE__ */ jsx(Typography, { variant: "headline-sm", mb: 16, children: title }),
    /* @__PURE__ */ jsx(Stack, { gap: 16, children: renderChildren() })
  ] });
};
const Item = ({ label, children, labelProps, valueProps, ...rest }) => {
  return /* @__PURE__ */ jsxs(Group, { gap: "md", wrap: "nowrap", ...rest, children: [
    /* @__PURE__ */ jsx(Typography, { variant: "label-lg", miw: 128, ...labelProps, children: label }),
    /* @__PURE__ */ jsx(Typography, { variant: "body-lg", sx: { wordBreak: "break-all" }, ...valueProps, children })
  ] });
};
const Divider = (props) => {
  return /* @__PURE__ */ jsx(Divider$1, { color: "carbon.4", my: "xs", ...props });
};
PropertyCard.Item = Item;
PropertyCard.Divider = Divider;
export {
  PropertyCard
};
