import "core-js/modules/es.symbol.js";
import "core-js/modules/es.array.filter.js";
import "core-js/modules/es.array.for-each.js";
import "core-js/modules/es.array.push.js";
import "core-js/modules/es.object.define-properties.js";
import "core-js/modules/es.object.define-property.js";
import "core-js/modules/es.object.get-own-property-descriptor.js";
import "core-js/modules/es.object.get-own-property-descriptors.js";
import "core-js/modules/es.object.keys.js";
import "core-js/modules/es.object.to-string.js";
import "core-js/modules/esnext.iterator.constructor.js";
import "core-js/modules/esnext.iterator.filter.js";
import "core-js/modules/esnext.iterator.for-each.js";
import "core-js/modules/web.dom-collections.for-each.js";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
import { useState } from 'react';
import { FcrInput } from '.';
import { FcrIconType } from '../icon/type';
import { FcrInputPassword } from './input-password';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
var meta = {
  title: 'Components/Input',
  tags: ['autodocs'],
  component: FcrInput,
  args: {
    placeholder: 'please input room name',
    shape: 'rounded',
    disabled: false
  },
  argTypes: {}
};
export var Doc = function Doc(props) {
  var _useState = useState(''),
    _useState2 = _slicedToArray(_useState, 2),
    value = _useState2[0],
    setValue = _useState2[1];
  var handleChange = function handleChange(val) {
    setValue(val);
  };
  return /*#__PURE__*/_jsxs("div", {
    children: [/*#__PURE__*/_jsx("div", {
      style: {
        width: 200,
        marginBottom: 50
      },
      children: /*#__PURE__*/_jsx(FcrInput, _objectSpread(_objectSpread({}, props), {}, {
        label: 'Basic',
        value: value,
        onChange: handleChange
      }))
    }), /*#__PURE__*/_jsx("div", {
      style: {
        width: 200,
        marginBottom: 50
      },
      children: /*#__PURE__*/_jsx(FcrInputPassword, _objectSpread(_objectSpread({}, props), {}, {
        label: "password",
        value: value,
        onChange: handleChange
      }))
    }), /*#__PURE__*/_jsx("div", {
      style: {
        width: 200,
        marginBottom: 50
      },
      children: /*#__PURE__*/_jsx(FcrInput, _objectSpread(_objectSpread({}, props), {}, {
        label: 'Allow Clear',
        size: "large",
        allowClear: true,
        value: value,
        onChange: handleChange
      }))
    }), /*#__PURE__*/_jsx("div", {
      style: {
        width: 200,
        marginBottom: 50
      },
      children: /*#__PURE__*/_jsx(FcrInput, _objectSpread(_objectSpread({}, props), {}, {
        label: 'show count',
        size: "large",
        showCount: true,
        maxLength: 30,
        allowClear: true,
        value: value,
        onChange: handleChange
      }))
    }), /*#__PURE__*/_jsx("div", {
      style: {
        width: 200,
        marginBottom: 50
      },
      children: /*#__PURE__*/_jsx(FcrInput, _objectSpread(_objectSpread({}, props), {}, {
        label: 'Search',
        size: "large",
        value: value,
        iconPrefix: {
          type: FcrIconType.FCR_V2_SEARCH,
          colors: {
            iconPrimary: 'var(--fcr_ui_scene_icontext1)'
          }
        },
        onChange: handleChange
      }))
    }), /*#__PURE__*/_jsx("div", {
      style: {
        width: 200,
        marginBottom: 50
      },
      children: /*#__PURE__*/_jsx(FcrInput, _objectSpread(_objectSpread({}, props), {}, {
        label: 'Disabled',
        size: "large",
        disabled: true
      }))
    })]
  });
};
export default meta;