import { jsx } from 'react/jsx-runtime';
import React__default from 'react';
import Input from '../components/Input.js';
import InputLabel from '../components/InputLabel.js';
import InputAdornment from '../components/InputAdornment.js';
import FormHelperText from '../components/FormHelperText.js';
import TextField from '../components/TextField.js';
import { textFieldArgTypes } from './utils/formControlStories.js';
import { getAdornmentIconProps } from './utils/adornmentStories.js';
import '../tslib.es6-20a2a300.js';
import '../makeStyles-c9a99c7a.js';
import '../defaultTheme-49a26576.js';
import '../Input-d5c36a50.js';
import '../clsx.m-6243b874.js';
import '../withStyles-99aeb25b.js';
import '../hoist-non-react-statics.cjs-b718ab87.js';
import '../formControlState-da4d15f8.js';
import '../FormControlContext-64eed5c2.js';
import '../capitalize-5d3e9aac.js';
import '../useForkRef-4ff8cc89.js';
import '../deprecatedPropType-0232df1e.js';
import '../refType-5cc24a92.js';
import '../components/Typography.js';
import '../_commonjsHelpers-57e89916.js';
import '../theme/colors.js';
import '../theme/fontSize.js';
import '../theme/fontWeight.js';
import '../theme/fontFamily.js';
import '../theme/lineHeight.js';
import '../Typography-649a8eff.js';
import '../createStyles-16423e9e.js';
import '../useFormControl-dc7cf5d6.js';
import '../components/Icon.js';
import '../icons/ArrowRight.js';
import '../icons/ArrowRightCircle.js';
import '../icons/Check.js';
import '../icons/CheckCircle.js';
import '../icons/ChevronRight.js';
import '../icons/CrossCircle.js';
import '../icons/DollarSign.js';
import '../icons/InfoCircle.js';
import '../icons/Link.js';
import '../icons/TriangleUp.js';
import '../icons/TriangleDown.js';
import '../icons/TriangleLeft.js';
import '../icons/Copy.js';
import '../icons/SortUp.js';
import '../icons/Cross.js';
import '../icons/Search.js';
import '../icons/Range.js';
import '../components/IconButton.js';
import '../IconButton-7563dc0d.js';
import '../ButtonBase-11d3cdb5.js';
import 'react-dom';
import '../useEventCallback-8817ed1c.js';
import '../useIsFocusVisible-c048447c.js';
import '../TransitionGroupContext-2ba64e99.js';
import '../elementTypeAcceptingRef-7677eeee.js';
import '../Box-581dc061.js';
import '../styled-339d0187.js';
import '../FormControl-1f6cf8f3.js';
import './utils/iconStories.js';

var Template = function (args) {
    var startAdornmentIconProps = getAdornmentIconProps(args, "start");
    var endAdornmentIconProps = getAdornmentIconProps(args, "end");
    return (jsx(TextField, { id: args.id, inputProps: {
            placeholder: args.placeholder,
            startAdornment: startAdornmentIconProps ? (jsx(InputAdornment, { position: "start", iconButtonProps: startAdornmentIconProps }, void 0)) : undefined,
            endAdornment: endAdornmentIconProps ? (jsx(InputAdornment, { position: "end", iconButtonProps: endAdornmentIconProps }, void 0)) : undefined
        } }, void 0));
};
/**
 * Stories
 */
var Default = Template.bind({});
var ClearText = function () {
    var _a = React__default.useState(""), value = _a[0], setValue = _a[1];
    var handleChange = function (event) {
        setValue(event.target.value);
    };
    return (jsx(TextField, { id: "clear-text", label: "Find validator", helperText: "Address is not longer than 5 characters", onChange: handleChange, error: value.length > 5, inputProps: {
            value: value,
            placeholder: "Please enter validator address",
            startAdornment: (jsx(InputAdornment, { position: "start", iconButtonProps: { iconProps: { iconKey: "search", size: "xs" } } }, void 0)),
            endAdornment: (jsx(InputAdornment, { position: "end", iconButtonProps: {
                    iconProps: { iconKey: "cross", color: "secondary", size: "xs" },
                    disabled: !value.length,
                    onClick: function () { return setValue(""); }
                } }, void 0))
        } }, void 0));
};
var TextField_stories = {
    title: "Form Controls/TextField",
    component: TextField,
    argTypes: textFieldArgTypes,
    subcomponents: {
        InputLabel: InputLabel,
        Input: Input,
        FormHelperText: FormHelperText
    }
};

export { ClearText, Default, TextField_stories as default };
