46376fc3dacc2f79b2dfc54f7e08d66e.json
4.35 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 React=_interopRequireWildcard(require(\"react\"));var _Text=_interopRequireDefault(require(\"react-native-web/dist/exports/Text\"));var _theming=require(\"../../core/theming\");var _jsxFileName=\"/Users/satya/Workspace/Callstack/react-native-paper/src/components/Typography/Text.tsx\";var Text=function(_React$Component){(0,_inherits2.default)(Text,_React$Component);function Text(){(0,_classCallCheck2.default)(this,Text);return(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(Text).apply(this,arguments));}(0,_createClass2.default)(Text,[{key:\"setNativeProps\",value:function setNativeProps(args){return this.root&&this.root.setNativeProps(args);}},{key:\"render\",value:function render(){var _this=this;var _this$props=this.props,style=_this$props.style,theme=_this$props.theme,rest=(0,_objectWithoutProperties2.default)(_this$props,[\"style\",\"theme\"]);return React.createElement(_Text.default,(0,_extends2.default)({},rest,{ref:function ref(c){_this.root=c;},style:[(0,_objectSpread2.default)({},theme.fonts.regular,{color:theme.colors.text,textAlign:'left'}),style],__source:{fileName:_jsxFileName,lineNumber:35}}));}}]);return Text;}(React.Component);var _default=(0,_theming.withTheme)(Text);exports.default=_default;","map":{"version":3,"sources":["Text.tsx"],"names":["Text","React","Component","args","style","theme","rest","color","textAlign","withTheme"],"mappings":"4+BAAA,oD,gFAEA,2C,0GAkBMA,GAAAA,CAAAA,I,oUAMWG,I,CAAc,CAC3B,MAAO,MAAA,IAAA,EAAa,KAAA,IAAA,CAAA,cAAA,CAApB,IAAoB,CAApB,C,wCAGO,CAAA,GAAA,CAAA,KAAA,CAAA,IAAA,CAAA,GAAA,CAAA,WAAA,CAC2B,KAD3B,KAAA,CACCC,KADD,CAAA,WAAA,CAAA,KAAA,CACQC,KADR,CAAA,WAAA,CAAA,KAAA,CACkBC,IADlB,CAAA,sCAAA,WAAA,CAAA,CAAA,OAAA,CAAA,OAAA,CAAA,CAAA,CAGP,MACE,CAAA,KAAA,CAAA,aAAA,CAAA,aAAA,CAAA,sBAAA,EAAA,CAAA,IAAA,CAAA,CAEE,GAAG,CAAE,QAAA,CAAA,GAAA,CAAA,CAAA,CAAK,CACR,KAAI,CAAJ,IAAA,CAAA,CAAA,CAHJ,CAAA,CAKE,KAAK,CAAE,CAAA,2BAAA,EAAA,CAEAD,KAAK,CAALA,KAAAA,CAFA,OAAA,CAAA,CAGHE,KAAK,CAAEF,KAAK,CAALA,MAAAA,CAHJ,IAAA,CAIHG,SAAS,CAJN,MAAA,CAAA,CAAA,CALT,KAKS,CALT,CAAA,QAAA,CAAA,CAAA,QAAA,CAAA,YAAA,CAAA,UAAA,CADF,EACE,CAAA,CAAA,CAAA,CADF,C,mBAbeP,KAAK,CAACC,S,CAAnBF,C,aAgCSS,uBAAf,IAAeA,C","sourcesContent":["import * as React from 'react';\nimport { Text as NativeText, TextStyle, StyleProp } from 'react-native';\nimport { withTheme } from '../../core/theming';\nimport { Theme } from '../../types';\n\ntype Props = React.ComponentProps<typeof NativeText> & {\n style?: StyleProp<TextStyle>;\n /**\n * @optional\n */\n theme: Theme;\n};\n\n// @component-group Typography\n\n/**\n * Text component which follows styles from the theme.\n *\n * @extends Text props https://facebook.github.io/react-native/docs/text.html#props\n */\nclass Text extends React.Component<Props> {\n private root: NativeText | undefined | null;\n\n /**\n * @internal\n */\n setNativeProps(args: Object) {\n return this.root && this.root.setNativeProps(args);\n }\n\n render() {\n const { style, theme, ...rest } = this.props;\n\n return (\n <NativeText\n {...rest}\n ref={c => {\n this.root = c;\n }}\n style={[\n {\n ...theme.fonts.regular,\n color: theme.colors.text,\n textAlign: 'left',\n },\n style,\n ]}\n />\n );\n }\n}\n\nexport default withTheme(Text);\n"]},"metadata":{},"sourceType":"script"}