import { jsxs, jsx } from 'react/jsx-runtime';
import { FormItem, FormControl, FormMessage } from '../../form.mjs';
import { Input } from '../../input.mjs';
import AutoFormLabel from '../common/label.mjs';
import AutoFormTooltip from '../common/tooltip.mjs';

function AutoFormNumber({
  label,
  isRequired,
  fieldConfigItem,
  fieldProps
}) {
  const { showLabel: _showLabel, ...fieldPropsWithoutShowLabel } = fieldProps;
  const showLabel = _showLabel === void 0 ? true : _showLabel;
  return /* @__PURE__ */ jsxs(FormItem, { children: [
    showLabel && /* @__PURE__ */ jsx(
      AutoFormLabel,
      {
        label: fieldConfigItem?.label || label,
        isRequired
      }
    ),
    /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, { type: "number", ...fieldPropsWithoutShowLabel }) }),
    /* @__PURE__ */ jsx(AutoFormTooltip, { fieldConfigItem }),
    /* @__PURE__ */ jsx(FormMessage, {})
  ] });
}

export { AutoFormNumber as default };
