"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InputDefault = exports.filledIconProps = exports.outlineIconProps = exports.dismissIconProps = void 0;
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var react_native_1 = require("react-native");
var input_1 = require("@fluentui-react-native/input");
var dismissIcon_svg_1 = tslib_1.__importDefault(require("../../../assets/dismissIcon.svg"));
var filledIcon_svg_1 = tslib_1.__importDefault(require("../../../assets/filledIcon.svg"));
var outlineIcon_svg_1 = tslib_1.__importDefault(require("../../../assets/outlineIcon.svg"));
exports.dismissIconProps = { svgSource: { src: dismissIcon_svg_1.default, viewBox: '0 0 20 20' } };
exports.outlineIconProps = { svgSource: { src: outlineIcon_svg_1.default, viewBox: '0 0 20 20' } };
exports.filledIconProps = { svgSource: { src: filledIcon_svg_1.default, viewBox: '0 0 20 20' } };
var InputDefault = function () {
    var _a = React.useState(''), error = _a[0], setError = _a[1];
    var _b = React.useState('Controls other text input!'), controlText = _b[0], setControlText = _b[1];
    var textInputRef = React.useRef(null);
    return (React.createElement(react_native_1.KeyboardAvoidingView, { behavior: "padding", keyboardVerticalOffset: 200, style: { flex: 1 } },
        React.createElement(input_1.Input, { error: error, defaultIcon: exports.outlineIconProps, focusedStateIcon: exports.filledIconProps, textInputProps: { autoFocus: true }, placeholder: "Only text upto 5 characters!", assistiveText: "Assistive Text", label: "Label", onChange: function (text) {
                if (text.length > 5)
                    setError('Text must be less than 5 characters!');
                else
                    setError('');
            } }),
        React.createElement(input_1.Input, { defaultIcon: exports.outlineIconProps, placeholder: "No focused state icon!", label: "Label" }),
        React.createElement(input_1.Input, { placeholder: "Enter text here!", accessoryIcon: exports.dismissIconProps, label: "Label", assistiveText: "Assistive Text", accessoryText: "Accessory" }),
        React.createElement(input_1.Input, { placeholder: "Enter text here!", type: "decimal-pad", accessoryIcon: null, onFocus: function () { return console.log('focused'); }, onBlur: function () { return console.log('blurred'); } }),
        React.createElement(input_1.Input, { placeholder: "Custom dismiss icon onPress - Blur", componentRef: textInputRef, accessoryIcon: exports.outlineIconProps, accessoryButtonOnPress: function () {
                // Demonstrating blur on the text input
                textInputRef.current.blur();
            }, accessoryText: "Accessory", type: "email-address" }),
        React.createElement(input_1.Input, { onChange: function (text) { return setControlText(text); }, placeholder: 'Text entered here shows below too', defaultValue: controlText }),
        React.createElement(input_1.Input, { value: 'Controlled text - ' + controlText })));
};
exports.InputDefault = InputDefault;
//# sourceMappingURL=InputDefault.js.map