@audira/carbon-react-native
Version:
Build React Native apps with component and shared patterns using Carbon
34 lines (33 loc) • 1.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Subtitle = void 0;
var _react = require("react");
var _index = require("../../../carbon-style-sheet/index.js");
var _index2 = require("../../../contexts/index.js");
var _index3 = require("../../text/index.js");
var _variantContext = require("../_variant-context.js");
var _jsxRuntime = require("react/jsx-runtime");
const Subtitle = exports.Subtitle = /*#__PURE__*/(0, _react.forwardRef)(function Subtitle({
style,
...props
}, ref) {
(0, _react.useContext)(_index2.ThemeContext);
const variantContext = (0, _react.useContext)(_variantContext.VariantContext);
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.Text, {
...props,
ref: ref,
type: "body_compact_01",
style: [mapTextColorStyle[variantContext.color], style]
});
});
const mapTextColorStyle = _index.CarbonStyleSheet.create({
low_contrast: {
color: _index.CarbonStyleSheet.color.text_primary
},
high_contrast: {
color: _index.CarbonStyleSheet.color.text_inverse
}
});
//# sourceMappingURL=Subtitle.js.map