"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.InputDefault = exports.filledIconProps = exports.outlineIconProps = exports.dismissIconProps = void 0;
const React = __importStar(require("react"));
const react_native_1 = require("react-native");
const input_1 = require("@fluentui-react-native/input");
const dismissIcon_svg_1 = __importDefault(require("../../../assets/dismissIcon.svg"));
const filledIcon_svg_1 = __importDefault(require("../../../assets/filledIcon.svg"));
const outlineIcon_svg_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' } };
const InputDefault = () => {
    const [error, setError] = React.useState('');
    const [controlText, setControlText] = React.useState('Controls other text input!');
    const 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: (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: () => console.log('focused'), onBlur: () => console.log('blurred') }),
        React.createElement(input_1.Input, { placeholder: "Custom dismiss icon onPress - Blur", componentRef: textInputRef, accessoryIcon: exports.outlineIconProps, accessoryButtonOnPress: () => {
                // Demonstrating blur on the text input
                textInputRef.current.blur();
            }, accessoryText: "Accessory", type: "email-address" }),
        React.createElement(input_1.Input, { onChange: (text) => 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