UNPKG

@razorpay/blade

Version:

The Design System that powers Razorpay

61 lines (58 loc) 3.38 kB
import _defineProperty from '@babel/runtime/helpers/defineProperty'; import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties'; import React__default from 'react'; import { AnimatedBaseInputWrapper } from './AnimatedBaseInputWrapper.web.js'; import '../../Box/BaseBox/index.js'; import { jsx, jsxs } from 'react/jsx-runtime'; import { BaseBox } from '../../Box/BaseBox/BaseBox.web.js'; var _excluded = ["children", "validationState", "currentInteraction", "isLabelLeftPositioned", "isTextArea", "showAllTags", "setShowAllTagsWithAnimation", "maxTagRows", "numberOfLines", "isTableInputCell", "topContent", "bottomContent", "inputRowOverlay"]; 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; } var _BaseInputWrapper = function _BaseInputWrapper(_ref, ref) { var children = _ref.children, validationState = _ref.validationState, currentInteraction = _ref.currentInteraction, isLabelLeftPositioned = _ref.isLabelLeftPositioned, isTextArea = _ref.isTextArea, showAllTags = _ref.showAllTags, setShowAllTagsWithAnimation = _ref.setShowAllTagsWithAnimation, maxTagRows = _ref.maxTagRows, numberOfLines = _ref.numberOfLines, isTableInputCell = _ref.isTableInputCell, topContent = _ref.topContent, bottomContent = _ref.bottomContent, inputRowOverlay = _ref.inputRowOverlay, props = _objectWithoutProperties(_ref, _excluded); // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing var hasExtraContent = Boolean(topContent || bottomContent || inputRowOverlay); return /*#__PURE__*/jsx(AnimatedBaseInputWrapper // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unnecessary-type-assertion , _objectSpread(_objectSpread({ ref: ref, isTextArea: isTextArea, validationState: validationState, currentInteraction: currentInteraction, showAllTags: showAllTags, maxTagRows: maxTagRows, setShowAllTagsWithAnimation: setShowAllTagsWithAnimation, numberOfLines: numberOfLines, isTableInputCell: isTableInputCell }, props), {}, { children: hasExtraContent ? /*#__PURE__*/jsxs(BaseBox, { display: "flex", flexDirection: "column", width: "100%", children: [topContent, /*#__PURE__*/jsxs(BaseBox, { display: "flex", flexDirection: "row", width: "100%", alignItems: isTextArea ? 'flex-start' : 'center', position: inputRowOverlay ? 'relative' : undefined, children: [children, inputRowOverlay] }), bottomContent] }) : children })); }; var BaseInputWrapper = /*#__PURE__*/React__default.forwardRef(_BaseInputWrapper); export { BaseInputWrapper }; //# sourceMappingURL=BaseInputWrapper.js.map