import { jsxs, jsx } from "react/jsx-runtime";
import { createContext, useMemo, useContext } 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.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/components/Card/Card.mjs";
import { Stack } from "../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/components/Stack/Stack.mjs";
import { Group } from "../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/components/Group/Group.mjs";
import { Divider as Divider$1 } from "../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/components/Divider/Divider.mjs";
const PropertyCardContext = createContext(void 0);
const PropertyCard = ({ title, children, labelProps, valueProps, ...rest }) => {
  const contextValue = useMemo(
    () => ({
      labelProps,
      valueProps
    }),
    [labelProps, valueProps]
  );
  return /* @__PURE__ */ jsxs(Card, { p: "xl", ...rest, children: [
    title && /* @__PURE__ */ jsx(Typography, { variant: "headline-sm", mb: 16, children: title }),
    /* @__PURE__ */ jsx(PropertyCardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(Stack, { gap: 16, children }) })
  ] });
};
const Item = ({ label, children, labelProps, valueProps, ...rest }) => {
  const context = useContext(PropertyCardContext);
  const mergedLabelProps = {
    ...context == null ? void 0 : context.labelProps,
    ...labelProps
  };
  const mergedValueProps = {
    ...context == null ? void 0 : context.valueProps,
    ...valueProps
  };
  return /* @__PURE__ */ jsxs(Group, { gap: "md", wrap: "nowrap", ...rest, children: [
    /* @__PURE__ */ jsx(Typography, { variant: "label-lg", miw: 128, ...mergedLabelProps, children: label }),
    /* @__PURE__ */ jsx(Typography, { variant: "body-lg", sx: { wordBreak: "break-all" }, ...mergedValueProps, children })
  ] });
};
const Divider = (props) => {
  return /* @__PURE__ */ jsx(Divider$1, { color: "carbon.4", my: "xs", ...props });
};
PropertyCard.Item = Item;
PropertyCard.Divider = Divider;
export {
  PropertyCard
};
