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 const dismissIconProps = { svgSource: { src: DismissSvg, viewBox: '0 0 20 20' } };
export const outlineIconProps = { svgSource: { src: OutlineSvg, viewBox: '0 0 20 20' } };
export const filledIconProps = { svgSource: { src: FilledSvg, viewBox: '0 0 20 20' } };
export const InputDefault = () => {
    const [error, setError] = React.useState('');
    const [controlText, setControlText] = React.useState('Controls other text input!');
    const 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: (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: () => console.log('focused'), onBlur: () => console.log('blurred') }),
        React.createElement(Input, { placeholder: "Custom dismiss icon onPress - Blur", componentRef: textInputRef, accessoryIcon: outlineIconProps, accessoryButtonOnPress: () => {
                // Demonstrating blur on the text input
                textInputRef.current.blur();
            }, accessoryText: "Accessory", type: "email-address" }),
        React.createElement(Input, { onChange: (text) => setControlText(text), placeholder: 'Text entered here shows below too', defaultValue: controlText }),
        React.createElement(Input, { value: 'Controlled text - ' + controlText })));
};
//# sourceMappingURL=InputDefault.js.map