UNPKG

@audira/carbon-react-native

Version:

Build React Native apps with component and shared patterns using Carbon

30 lines (29 loc) 918 B
"use strict"; import { forwardRef, useContext } from 'react'; import { CarbonStyleSheet } from "../../../carbon-style-sheet/index.js"; import { ThemeContext } from "../../../contexts/index.js"; import { Text } from "../../text/index.js"; import { VariantContext } from "../_variant-context.js"; import { jsx as _jsx } from "react/jsx-runtime"; export const Subtitle = /*#__PURE__*/forwardRef(function Subtitle({ style, ...props }, ref) { useContext(ThemeContext); const variantContext = useContext(VariantContext); return /*#__PURE__*/_jsx(Text, { ...props, ref: ref, type: "body_compact_01", style: [mapTextColorStyle[variantContext.color], style] }); }); const mapTextColorStyle = CarbonStyleSheet.create({ low_contrast: { color: CarbonStyleSheet.color.text_primary }, high_contrast: { color: CarbonStyleSheet.color.text_inverse } }); //# sourceMappingURL=Subtitle.js.map