@blockstack/ui
Version:
Blockstack UI components built using React and styled-components with styled-system.
54 lines (49 loc) • 2.07 kB
JavaScript
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../_virtual/_rollupPluginBabelHelpers.js';
import React__default, { forwardRef } from 'react';
import { Box } from '../box/index.esm.js';
import { inputSizes } from '../input/styles.esm.js';
var InputElement = /*#__PURE__*/forwardRef(function (_ref, ref) {
var _placementProp;
var _ref$size = _ref.size,
size = _ref$size === void 0 ? 'default' : _ref$size,
children = _ref.children,
_ref$placement = _ref.placement,
placement = _ref$placement === void 0 ? 'left' : _ref$placement,
_ref$disablePointerEv = _ref.disablePointerEvents,
disablePointerEvents = _ref$disablePointerEv === void 0 ? false : _ref$disablePointerEv,
props = _objectWithoutPropertiesLoose(_ref, ["size", "children", "placement", "disablePointerEvents"]);
var height = inputSizes[size] && inputSizes[size].height;
var fontSize = inputSizes[size] && inputSizes[size].fontSize;
var placementProp = (_placementProp = {}, _placementProp[placement] = '0', _placementProp);
return React__default.createElement(Box, Object.assign({
display: "flex",
alignItems: "center",
justifyContent: "center",
position: "absolute",
height: height,
width: height,
fontSize: fontSize,
top: "0",
zIndex: 1,
ref: ref
}, disablePointerEvents && {
pointerEvents: 'none'
}, placementProp, props), children);
});
var InputLeftElement = /*#__PURE__*/forwardRef(function (props, ref) {
return React__default.createElement(InputElement, Object.assign({
ref: ref,
placement: "left"
}, props));
});
var InputRightElement = /*#__PURE__*/forwardRef(function (props, ref) {
return React__default.createElement(InputElement, Object.assign({
ref: ref,
placement: "right"
}, props));
});
InputElement.displayName = 'InputElement';
InputLeftElement.displayName = 'InputLeftElement';
InputRightElement.displayName = 'InputRightElement';
export { InputElement, InputLeftElement, InputRightElement };
//# sourceMappingURL=index.esm.js.map