import { __assign } from "tslib";
import * as React from 'react';
import { Input } from '@fluentui-react-native/input';
import { Stack } from '@fluentui-react-native/stack';
import { Text } from '@fluentui-react-native/text';
import { INPUT_TEST_COMPONENT, INPUT_TEXT, INPUT_TEST_COMPONENT_DISMISS_BUTTON, INPUT_ERROR_STRING, INPUT_ONCLICK_STRING, INPUT_START_STRING, } from '../../../../E2E/src/Input/consts';
import FilledSvg from '../../../assets/filledIcon.svg';
import OutlineSvg from '../../../assets/outlineIcon.svg';
import { stackStyle } from '../Common/styles';
import { testProps } from '../Common/TestProps';
export var outlineIconProps = { svgSource: { src: OutlineSvg, viewBox: '0 0 20 20' } };
export var filledIconProps = { svgSource: { src: FilledSvg, viewBox: '0 0 20 20' } };
export var E2EInputTest = function () {
    var _a = React.useState(''), error = _a[0], setError = _a[1];
    var _b = React.useState(INPUT_START_STRING), text = _b[0], setText = _b[1];
    return (React.createElement(Stack, { style: stackStyle },
        React.createElement(Text
        /* For Android E2E testing purposes, testProps must be passed in after accessibilityLabel. */
        , __assign({}, testProps(INPUT_TEXT)), text),
        React.createElement(Input, __assign({ error: error, defaultIcon: outlineIconProps, value: text, focusedStateIcon: filledIconProps, textInputProps: { autoFocus: true }, placeholder: "Only text upto 5 characters!", assistiveText: "Assistive Text", label: "Label", onChange: function (text) {
                setText(text);
                if (text.length > 5) {
                    setError('Text must be less than 5 characters!');
                    setText(INPUT_ERROR_STRING);
                }
                else {
                    setError('');
                }
            } }, testProps(INPUT_TEST_COMPONENT), { accessoryIconAccessibilityLabel: INPUT_TEST_COMPONENT_DISMISS_BUTTON, accessoryButtonOnPress: function () {
                setText(INPUT_ONCLICK_STRING);
            } }))));
};
//# sourceMappingURL=E2EInputTest.js.map