// packages/components/src/item-group/item-group/component.tsx
import { contextConnect } from "../../context/index.js";
import { useItemGroup } from "./hook.js";
import { ItemGroupContext, useItemGroupContext } from "../context.js";
import { View } from "../../view/index.js";
import { jsx as _jsx } from "react/jsx-runtime";
function UnconnectedItemGroup(props, forwardedRef) {
  const {
    isBordered,
    isSeparated,
    size: sizeProp,
    ...otherProps
  } = useItemGroup(props);
  const {
    size: contextSize
  } = useItemGroupContext();
  const spacedAround = !isBordered && !isSeparated;
  const size = sizeProp || contextSize;
  const contextValue = {
    spacedAround,
    size
  };
  return /* @__PURE__ */ _jsx(ItemGroupContext.Provider, {
    value: contextValue,
    children: /* @__PURE__ */ _jsx(View, {
      ...otherProps,
      ref: forwardedRef
    })
  });
}
var ItemGroup = contextConnect(UnconnectedItemGroup, "ItemGroup");
var component_default = ItemGroup;
export {
  ItemGroup,
  component_default as default
};
//# sourceMappingURL=component.js.map
