UNPKG

@crossed/ui

Version:

A universal & performant styling library for React Native, Next.js & React

48 lines (47 loc) 1.06 kB
import { jsx } from "react/jsx-runtime"; import { forwardRef } from "react"; import { TextInput } from "react-native"; import { inlineStyle, useTheme } from "@crossed/styled"; const styles = inlineStyle(({ colors }) => ({ base: { borderWidth: 0, backgroundColor: "transparent", maxWidth: 64, textAlign: "center", color: colors.text.primary }, web: { ":focus": { outlineWidth: 0 }, ":focus-visible": { outlineWidth: 0 } } })); const InputPart = forwardRef( ({ value, onChangeText, placeholder, onBlur, onFocus, id }, ref) => { const { colors } = useTheme(); return /* @__PURE__ */ jsx( TextInput, { selectTextOnFocus: true, ...styles.rnw(), value, placeholder, id, ref, showSoftInputOnFocus: false, onChangeText, placeholderTextColor: colors.text.secondary, onBlur, onFocus, keyboardType: "numeric" } ); } ); export { InputPart }; //# sourceMappingURL=InputPart.js.map