'use strict';

var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var utils = require('./utils-CTr7wn5d.js');
var primitives_Accordion = require('./primitives/Accordion.js');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefault(React);

const AccordionItemComponent = React.forwardRef(({ title, children, className, value, ...otherProps }, ref) => (jsxRuntime.jsxs(primitives_Accordion.AccordionItem, { ref: ref, value: value, className: utils.cn(className), ...otherProps, children: [jsxRuntime.jsx(primitives_Accordion.AccordionTrigger, { children: title }), jsxRuntime.jsx(primitives_Accordion.AccordionContent, { children: children })] })));
AccordionItemComponent.displayName = "Accordion.Item";
const Accordion = React.forwardRef(({ className, children, type = "single", ...otherProps }, ref) => {
    // Auto-generate value props for items that don't have one
    const enhancedChildren = React.Children.map(children, (child, index) => {
        if (!React__default.default.isValidElement(child))
            return child;
        const childValue = child.props.value ?? `item-${index}`;
        return React__default.default.cloneElement(child, { value: childValue });
    });
    return (jsxRuntime.jsx(primitives_Accordion.Accordion, { ref: ref, type: type, className: utils.cn(className), ...otherProps, children: enhancedChildren }));
});
Accordion.displayName = "Accordion";
Accordion.Item = AccordionItemComponent;

exports.Accordion = Accordion;
//# sourceMappingURL=Accordion-BoTckTBI.js.map
