UNPKG

@eslam-elmeniawy/react-native-common-components

Version:

Common `ReactNative` components packed in library for usage in projects.

72 lines (69 loc) 1.63 kB
"use strict"; // External imports. import * as React from 'react'; import { StyleSheet } from 'react-native'; // Types imports. // Internal imports. import styles from "./TextInput.styles.js"; import { Text } from "../Text/index.js"; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const TopLabel = /*#__PURE__*/React.memo(props => { const { topLabelProps, theme, isRequired, style: inputStyle } = props; const { label, textProps } = topLabelProps ?? {}; if (label) { const { type, size, style, ...other } = textProps ?? {}; const { marginVertical, marginTop, width, marginHorizontal, marginStart, marginEnd, marginLeft, marginRight, alignSelf } = inputStyle ?? {}; const _widthHorizontalMarginStyle = { width, marginHorizontal, marginStart, marginEnd, marginLeft, marginRight, alignSelf }; return /*#__PURE__*/_jsxs(Text, { type: type ?? 'bold', size: size ?? 13, style: StyleSheet.flatten([styles.noVerticalMargin, { color: theme.isV3 ? theme.colors.onBackground : theme.colors.text, marginTop: marginVertical ?? marginTop }, _widthHorizontalMarginStyle, style]), ...other, children: [label, isRequired && /*#__PURE__*/_jsx(Text, { type: type ?? 'bold', size: size ?? 13, style: { color: theme.colors.error }, children: ' *' })] }); } return null; }); export default TopLabel; //# sourceMappingURL=TopLabel.js.map