"use client";
import {
  GroupLabelContext
} from "./7HVFURXT.js";
import {
  createElement,
  createHook,
  forwardRef
} from "./GWSL6KNJ.js";
import {
  useWrapElement
} from "./KPHZR4MB.js";

// src/group/group.tsx
import { removeUndefinedValues } from "@ariakit/core/utils/misc";
import { useState } from "react";
import { jsx } from "react/jsx-runtime";
var TagName = "div";
var useGroup = createHook(
  function useGroup2(props) {
    const [labelId, setLabelId] = useState();
    props = useWrapElement(
      props,
      (element) => /* @__PURE__ */ jsx(GroupLabelContext.Provider, { value: setLabelId, children: element }),
      []
    );
    props = {
      role: "group",
      "aria-labelledby": labelId,
      ...props
    };
    return removeUndefinedValues(props);
  }
);
var Group = forwardRef(function Group2(props) {
  const htmlProps = useGroup(props);
  return createElement(TagName, htmlProps);
});

export {
  useGroup,
  Group
};
