import React, { useState } from "react";
import { isUndefined } from "@pisell/utils";
import classNames from "classnames";
import "./index.less";
//#region src/components/virtual-keyboard/VirtualInput/index.tsx
const VirtualInput = (props) => {
	const { value, autoFocus, placeholder = "" } = props;
	const [isFocus, setIsFocus] = useState(autoFocus);
	const onFocus = () => {
		setIsFocus(true);
	};
	const onBlur = () => {
		setIsFocus(false);
	};
	return /* @__PURE__ */ React.createElement("div", {
		onFocus,
		onBlur,
		tabIndex: 0,
		className: classNames("pisell-virtual-input-value", { "pisell-virtual-input-value-focus": isFocus })
	}, value, (isUndefined(value) || value === "") && /* @__PURE__ */ React.createElement("div", { className: "pisell-virtual-input-placeholder" }, placeholder), /* @__PURE__ */ React.createElement("div", { className: "pisell-virtual-input-caret-container" }, isFocus && /* @__PURE__ */ React.createElement("div", { className: "pisell-virtual-input-caret" })));
};
//#endregion
export { VirtualInput as default };
