@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
21 lines • 1.41 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CheckboxWithLabel = exports.CheckboxWithLabelUncontrolled = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = __importDefault(require("react"));
const useCheckbox_1 = require("../../hooks/useCheckbox/useCheckbox");
const checkboxWithLabelControlled_1 = require("./checkboxWithLabelControlled");
const CheckboxWithLabelUncontrolledComponent = ({ initialChecked = false, disabled = false, ...props }, ref) => {
const { isChecked, handleToggleIsChecked } = (0, useCheckbox_1.useCheckbox)({ initialChecked, disabled });
return ((0, jsx_runtime_1.jsx)(checkboxWithLabelControlled_1.CheckboxWithLabelControlled, { ref: ref, checked: isChecked, disabled: disabled, onChange: handleToggleIsChecked, ...props }));
};
/**
* @deprecated This component has been deprecated and will be removed in the next MAJOR release. Will include all this on the CheckBox component
*/
const CheckboxWithLabelUncontrolled = react_1.default.forwardRef(CheckboxWithLabelUncontrolledComponent);
exports.CheckboxWithLabelUncontrolled = CheckboxWithLabelUncontrolled;
exports.CheckboxWithLabel = CheckboxWithLabelUncontrolled;
//# sourceMappingURL=checkboxWithLabelUncontrolled.js.map