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.
26 lines (25 loc) • 811 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useSlotBorderStyles = useSlotBorderStyles;
var _constants = require("../constants.js");
function useSlotBorderStyles({
isFocused,
isFirst,
isLast
}) {
return {
height: isFocused ? _constants.FOCUSED_SLOT_HEIGHT : _constants.SLOT_HEIGHT,
borderColor: isFocused ? _constants.DEFAULT_DARK_COLOR : _constants.DEFAULT_LIGHT_COLOR,
borderTopWidth: 2,
borderBottomWidth: 2,
borderLeftWidth: isFocused || isFirst ? 2 : 1,
borderRightWidth: isFocused || isLast ? 2 : 1,
borderTopLeftRadius: isFirst ? 8 : 0,
borderTopRightRadius: isLast ? 8 : 0,
borderBottomLeftRadius: isFirst ? 8 : 0,
borderBottomRightRadius: isLast ? 8 : 0
};
}
//# sourceMappingURL=use-slot-border-styles.js.map