@nexara/nativeflow
Version:
Beautiful, responsive, and customizable UI components for React Native – built for performance and seamless experiences.
59 lines (58 loc) • 1.5 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _reactNative = require("react-native");
var _ResponsiveCalculations = require("../../helpers/ResponsiveCalculations.js");
var _index = require("../../hooks/index.js");
var _jsxRuntime = require("react/jsx-runtime");
const StyledText = ({
variant = 'primary',
fScale = 'base',
children,
style,
ff,
fs,
tas,
fw,
color,
themeColor,
...rest
}) => {
const {
colors,
sizes: {
typography: typographyScales
}
} = (0, _index.useTheme)();
const getVariantColor = () => {
switch (variant) {
case 'secondary':
return colors.typography.secondary;
case 'tertiary':
return colors.typography.tertiary;
case 'disabled':
return colors.typography.disabled;
case 'inverse':
return colors.typography.inverse;
default:
return colors.typography.primary;
}
};
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
style: [{
fontSize: (0, _ResponsiveCalculations.responsiveFontSize)(fs ?? typographyScales[fScale]),
fontFamily: ff ?? '',
textAlign: tas ? 'center' : 'auto',
...(fw ? {
fontWeight: fw
} : {}),
color: color ?? (themeColor && colors.brand.primary || getVariantColor())
}, style],
...rest,
children: children
});
};
var _default = exports.default = StyledText;
//# sourceMappingURL=StyledText.js.map