9b210bded3364c8ac7bdf0430ad56640.json
4.71 KB
{"ast":null,"code":"var _interopRequireWildcard=require(\"@babel/runtime/helpers/interopRequireWildcard\");var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _extends2=_interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));var _objectSpread2=_interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread\"));var _objectWithoutProperties2=_interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutProperties\"));var _classCallCheck2=_interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));var _createClass2=_interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));var _possibleConstructorReturn2=_interopRequireDefault(require(\"@babel/runtime/helpers/possibleConstructorReturn\"));var _getPrototypeOf2=_interopRequireDefault(require(\"@babel/runtime/helpers/getPrototypeOf\"));var _inherits2=_interopRequireDefault(require(\"@babel/runtime/helpers/inherits\"));var _color=_interopRequireDefault(require(\"color\"));var React=_interopRequireWildcard(require(\"react\"));var _I18nManager=_interopRequireDefault(require(\"react-native-web/dist/exports/I18nManager\"));var _Text=_interopRequireDefault(require(\"./Text\"));var _theming=require(\"../../core/theming\");var _jsxFileName=\"/Users/satya/Workspace/Callstack/react-native-paper/src/components/Typography/StyledText.tsx\";var StyledText=function(_React$Component){(0,_inherits2.default)(StyledText,_React$Component);function StyledText(){(0,_classCallCheck2.default)(this,StyledText);return(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(StyledText).apply(this,arguments));}(0,_createClass2.default)(StyledText,[{key:\"render\",value:function render(){var _this$props=this.props,theme=_this$props.theme,alpha=_this$props.alpha,family=_this$props.family,style=_this$props.style,rest=(0,_objectWithoutProperties2.default)(_this$props,[\"theme\",\"alpha\",\"family\",\"style\"]);var textColor=(0,_color.default)(theme.colors.text).alpha(alpha).rgb().string();var font=theme.fonts[family];var writingDirection=_I18nManager.default.isRTL?'rtl':'ltr';return React.createElement(_Text.default,(0,_extends2.default)({},rest,{style:[(0,_objectSpread2.default)({color:textColor},font,{textAlign:'left',writingDirection:writingDirection}),style,this.props.style],__source:{fileName:_jsxFileName,lineNumber:27}}));}}]);return StyledText;}(React.Component);var _default=(0,_theming.withTheme)(StyledText);exports.default=_default;","map":{"version":3,"sources":["StyledText.tsx"],"names":["StyledText","React","Component","theme","alpha","family","style","rest","textColor","color","font","writingDirection","I18nManager","textAlign","withTheme"],"mappings":"4+BAAA,oDACA,oD,8FAGA,oDACA,2C,gHAUMA,GAAAA,CAAAA,U,mVACK,CAAA,GAAA,CAAA,WAAA,CAC0C,KAD1C,KAAA,CACCG,KADD,CAAA,WAAA,CAAA,KAAA,CACQC,KADR,CAAA,WAAA,CAAA,KAAA,CACeC,MADf,CAAA,WAAA,CAAA,MAAA,CACuBC,KADvB,CAAA,WAAA,CAAA,KAAA,CACiCC,IADjC,CAAA,sCAAA,WAAA,CAAA,CAAA,OAAA,CAAA,OAAA,CAAA,QAAA,CAAA,OAAA,CAAA,CAAA,CAEP,GAAMC,CAAAA,SAAS,CAAGC,mBAAMN,KAAK,CAALA,MAAAA,CAANM,IAAAA,EAAAA,KAAAA,CAAAA,KAAAA,EAAAA,GAAAA,GAAlB,MAAkBA,EAAlB,CAIA,GAAMC,CAAAA,IAAI,CAAGP,KAAK,CAALA,KAAAA,CAAb,MAAaA,CAAb,CACA,GAAMQ,CAAAA,gBAAgB,CAAGC,qBAAAA,KAAAA,CAAAA,KAAAA,CAAzB,KAAA,CAEA,MACE,CAAA,KAAA,CAAA,aAAA,CAAA,aAAA,CAAA,sBAAA,EAAA,CAAA,IAAA,CAAA,CAEE,KAAK,CAAE,CAAA,2BAAA,CACHH,KAAK,CADF,SAAA,CAAA,CAAA,IAAA,CAAA,CACwBI,SAAS,CADjC,MAAA,CAC2CF,gBAAgB,CAD3D,gBAAA,CAAA,CAAA,CAAA,KAAA,CAGL,KAAA,KAAA,CALJ,KAES,CAFT,CAAA,QAAA,CAAA,CAAA,QAAA,CAAA,YAAA,CAAA,UAAA,CADF,EACE,CAAA,CAAA,CAAA,CADF,C,yBAVqBV,KAAK,CAACC,S,CAAzBF,C,aAuBSc,uBAAf,UAAeA,C","sourcesContent":["import color from 'color';\nimport * as React from 'react';\nimport { I18nManager, StyleProp, TextStyle } from 'react-native';\n\nimport Text from './Text';\nimport { withTheme } from '../../core/theming';\nimport { Theme } from '../../types';\n\ntype Props = React.ComponentProps<typeof Text> & {\n alpha: number;\n family: 'regular' | 'medium' | 'light' | 'thin';\n style?: StyleProp<TextStyle>;\n theme: Theme;\n};\n\nclass StyledText extends React.Component<Props> {\n render() {\n const { theme, alpha, family, style, ...rest } = this.props;\n const textColor = color(theme.colors.text)\n .alpha(alpha)\n .rgb()\n .string();\n const font = theme.fonts[family];\n const writingDirection = I18nManager.isRTL ? 'rtl' : 'ltr';\n\n return (\n <Text\n {...rest}\n style={[\n { color: textColor, ...font, textAlign: 'left', writingDirection },\n style,\n this.props.style,\n ]}\n />\n );\n }\n}\n\nexport default withTheme(StyledText);\n"]},"metadata":{},"sourceType":"script"}