import _extends from '../../../@babel/runtime/helpers/esm/extends.js';
import { forwardRef, createElement } from 'react';
import { composeEventHandlers as $e42e1063c40fb3ef$export$b9ecd428b558ff10 } from '../external/@radix-ui/primitive/dist/index.js';
import { useControllableState as $71cd76cc60e0454e$export$6f32135080cb4c3 } from '../../react-use-controllable-state/dist/index.js';
import { Primitive as $8927f6f2acc4f386$export$250ffa63cdc0d034 } from '../external/@radix-ui/react-primitive/dist/index.js';

const $b3bbe2732c13b576$export$bea8ebba691c5813 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
    const { pressed: pressedProp , defaultPressed: defaultPressed = false , onPressedChange: onPressedChange , ...buttonProps } = props;
    const [pressed = false, setPressed] = $71cd76cc60e0454e$export$6f32135080cb4c3({
        prop: pressedProp,
        onChange: onPressedChange,
        defaultProp: defaultPressed
    });
    return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
        type: "button",
        "aria-pressed": pressed,
        "data-state": pressed ? 'on' : 'off',
        "data-disabled": props.disabled ? '' : undefined
    }, buttonProps, {
        ref: forwardedRef,
        onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, ()=>{
            if (!props.disabled) setPressed(!pressed);
        })
    }));
});

export { $b3bbe2732c13b576$export$bea8ebba691c5813 as Toggle };
//# sourceMappingURL=index.js.map
