@s-ui/react-atom-input
Version:
> Inputs are the text fields that users fill in with different types of information. These include dates, passwords or even short answers. It’s a field where users can write alphanumeric texts.
33 lines • 1.33 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
var _excluded = ["type", "shape", "noBorder"];
import { forwardRef } from 'react';
import PropTypes from 'prop-types';
import InputContainer from './Container/InputContainer.js';
import getComponentAndProps from './helpers/getComponentAndProps.js';
import { inputSizes, inputStates } from './Input/index.js';
import { INPUT_SHAPES, TYPES } from './config.js';
import { jsx as _jsx } from "react/jsx-runtime";
var AtomInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
var type = _ref.type,
shape = _ref.shape,
noBorder = _ref.noBorder,
props = _objectWithoutPropertiesLoose(_ref, _excluded);
var _getComponentAndProps = getComponentAndProps(_extends({
type: type
}, props)),
Component = _getComponentAndProps[0],
newProps = _getComponentAndProps[1];
return /*#__PURE__*/_jsx(InputContainer, {
shape: shape,
noBorder: noBorder,
children: /*#__PURE__*/_jsx(Component, _extends({}, newProps, {
shape: shape,
noBorder: noBorder,
ref: ref
}))
});
});
AtomInput.displayName = 'AtomInput';
export default AtomInput;
export { inputSizes, inputStates, TYPES as inputTypes, INPUT_SHAPES as inputShapes };