"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OtherCheckbox = void 0;
var tslib_1 = require("tslib");
var react_1 = tslib_1.__importDefault(require("react"));
var react_native_1 = require("react-native");
var button_1 = require("@fluentui-react-native/button");
var experimental_checkbox_1 = require("@fluentui-react-native/experimental-checkbox");
var text_1 = require("@fluentui-react-native/text");
var styles_1 = require("../Common/styles");
var pressableStyle = { borderWidth: 1, padding: 4, gap: 4, flexDirection: 'row', alignItems: 'center' };
var OtherCheckbox = function () {
    var _a = react_1.default.useState(false), isChecked = _a[0], setisChecked = _a[1];
    var setCheckedTrue = react_1.default.useCallback(function () {
        setisChecked(true);
    }, []);
    var setCheckedFalse = react_1.default.useCallback(function () {
        setisChecked(false);
    }, []);
    var onChange = react_1.default.useCallback(function (_e, checked) {
        setisChecked(checked);
    }, []);
    var onPress = react_1.default.useCallback(function () {
        setisChecked(!isChecked);
    }, [isChecked]);
    var memoizedStyles = react_1.default.useMemo(function () { return (react_native_1.Platform.OS === 'android' ? tslib_1.__assign(tslib_1.__assign({}, styles_1.mobileStyles.containerSpacedEvenly), { height: 150 }) : { gap: 8 }); }, []);
    return (react_1.default.createElement(react_native_1.View, { style: memoizedStyles },
        react_1.default.createElement(react_native_1.View, null,
            react_1.default.createElement(button_1.ButtonV1, { onClick: setCheckedTrue, size: "small" }, "Check controlled checkboxes below"),
            react_1.default.createElement(button_1.ButtonV1, { onClick: setCheckedFalse, size: "small" }, "Uncheck controlled checkboxes below")),
        react_1.default.createElement(react_native_1.View, null,
            react_1.default.createElement(experimental_checkbox_1.Checkbox, { label: "This is a controlled Checkbox", checked: isChecked, onChange: onChange }),
            react_1.default.createElement(react_native_1.Pressable, { style: pressableStyle, onPress: onPress },
                react_1.default.createElement(experimental_checkbox_1.Checkbox, { checked: isChecked, onChange: onChange }),
                react_1.default.createElement(text_1.TextV1, null, "A controlled checkbox in a Pressable. Pressing Pressable also toggles Checkbox")),
            react_native_1.Platform.OS !== 'android' && (react_1.default.createElement(react_1.default.Fragment, null,
                react_1.default.createElement(experimental_checkbox_1.Checkbox, { label: "Checkbox rendered with labelPosition 'before' (controlled)", labelPosition: "before", checked: isChecked }),
                react_1.default.createElement(experimental_checkbox_1.Checkbox, { label: "A required checkbox with other required text", required: "**" }))))));
};
exports.OtherCheckbox = OtherCheckbox;
//# sourceMappingURL=OtherCheckboxPropsTest.js.map