react-native-input-code-otp
Version:
react-native-input-code-otp is a high-performance and fully customizable OTP input component for React Native, inspired by @shadcn/ui.
29 lines (28 loc) • 912 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TextInputOTPGroup = TextInputOTPGroup;
var _react = require("react");
var _reactNative = require("react-native");
var _jsxRuntime = require("react/jsx-runtime");
function TextInputOTPGroup({
groupStyles,
children
}) {
const slots = _react.Children.toArray(children).filter(child => /*#__PURE__*/(0, _react.isValidElement)(child));
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
style: _reactNative.StyleSheet.flatten([styles.inputGroup, groupStyles]),
children: slots.map((child, index) => /*#__PURE__*/(0, _react.cloneElement)(child, {
isFirst: index === 0,
isLast: index === slots.length - 1
}))
});
}
const styles = _reactNative.StyleSheet.create({
inputGroup: {
flexDirection: 'row',
alignItems: 'center'
}
});
//# sourceMappingURL=text-input-otp-group.js.map