import * as React from 'react';
import { KeyboardAvoidingView } from 'react-native';
import { Input } from '@fluentui-react-native/input';
import DismissSvg from '../../../assets/dismissIcon.svg';
import FilledSvg from '../../../assets/filledIcon.svg';
import OutlineSvg from '../../../assets/outlineIcon.svg';
export var dismissIconProps = { svgSource: { src: DismissSvg, viewBox: '0 0 20 20' } };
export var outlineIconProps = { svgSource: { src: OutlineSvg, viewBox: '0 0 20 20' } };
export var filledIconProps = { svgSource: { src: FilledSvg, viewBox: '0 0 20 20' } };
export 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(KeyboardAvoidingView, { behavior: "padding", keyboardVerticalOffset: 200, style: { flex: 1 } },
        React.createElement(Input, { error: error, defaultIcon: outlineIconProps, focusedStateIcon: 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, { defaultIcon: outlineIconProps, placeholder: "No focused state icon!", label: "Label" }),
        React.createElement(Input, { placeholder: "Enter text here!", accessoryIcon: dismissIconProps, label: "Label", assistiveText: "Assistive Text", accessoryText: "Accessory" }),
        React.createElement(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, { placeholder: "Custom dismiss icon onPress - Blur", componentRef: textInputRef, accessoryIcon: outlineIconProps, accessoryButtonOnPress: function () {
                // Demonstrating blur on the text input
                textInputRef.current.blur();
            }, accessoryText: "Accessory", type: "email-address" }),
        React.createElement(Input, { onChange: function (text) { return setControlText(text); }, placeholder: 'Text entered here shows below too', defaultValue: controlText }),
        React.createElement(Input, { value: 'Controlled text - ' + controlText })));
};
//# sourceMappingURL=InputDefault.js.map