{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nvar _jsxFileName = \"/Users/rohitsingh/Documents/projects/new-nativebase-setup/NativeBase/example/node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/lib/icon-button.js\";\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nimport isString from 'lodash.isstring';\nimport omit from 'lodash.omit';\nimport pick from 'lodash.pick';\nimport React, { PureComponent } from 'react';\nimport { StyleSheet, Text, TouchableHighlight, View } from \"./react-native\";\nvar styles = StyleSheet.create({\n  container: {\n    flexDirection: 'row',\n    justifyContent: 'flex-start',\n    alignItems: 'center',\n    padding: 8\n  },\n  touchable: {\n    overflow: 'hidden'\n  },\n  icon: {\n    marginRight: 10\n  },\n  text: {\n    fontWeight: '600',\n    backgroundColor: 'transparent'\n  }\n});\nvar IOS7_BLUE = '#007AFF';\nvar TEXT_PROP_NAMES = ['ellipsizeMode', 'numberOfLines', 'textBreakStrategy', 'selectable', 'suppressHighlighting', 'allowFontScaling', 'adjustsFontSizeToFit', 'minimumFontScale'];\nvar TOUCHABLE_PROP_NAMES = ['accessible', 'accessibilityLabel', 'accessibilityHint', 'accessibilityComponentType', 'accessibilityRole', 'accessibilityStates', 'accessibilityTraits', 'onFocus', 'onBlur', 'disabled', 'onPress', 'onPressIn', 'onPressOut', 'onLayout', 'onLongPress', 'nativeID', 'testID', 'delayPressIn', 'delayPressOut', 'delayLongPress', 'activeOpacity', 'underlayColor', 'selectionColor', 'onShowUnderlay', 'onHideUnderlay', 'hasTVPreferredFocus', 'tvParallaxProperties'];\nexport default function createIconButtonComponent(Icon) {\n  var _class, _temp;\n\n  return _temp = _class = function (_PureComponent) {\n    _inherits(IconButton, _PureComponent);\n\n    var _super = _createSuper(IconButton);\n\n    function IconButton() {\n      _classCallCheck(this, IconButton);\n\n      return _super.apply(this, arguments);\n    }\n\n    _createClass(IconButton, [{\n      key: \"render\",\n      value: function render() {\n        var _this$props = this.props,\n            style = _this$props.style,\n            iconStyle = _this$props.iconStyle,\n            children = _this$props.children,\n            restProps = _objectWithoutProperties(_this$props, [\"style\", \"iconStyle\", \"children\"]);\n\n        var iconProps = pick(restProps, TEXT_PROP_NAMES, 'style', 'name', 'size', 'color');\n        var touchableProps = pick(restProps, TOUCHABLE_PROP_NAMES);\n        var props = omit(restProps, Object.keys(iconProps), Object.keys(touchableProps), 'iconStyle', 'borderRadius', 'backgroundColor');\n        iconProps.style = iconStyle ? [styles.icon, iconStyle] : styles.icon;\n        var colorStyle = pick(this.props, 'color');\n        var blockStyle = pick(this.props, 'backgroundColor', 'borderRadius');\n        return React.createElement(TouchableHighlight, _extends({\n          style: [styles.touchable, blockStyle]\n        }, touchableProps), React.createElement(View, _extends({\n          style: [styles.container, blockStyle, style]\n        }, props), React.createElement(Icon, iconProps), isString(children) ? React.createElement(Text, {\n          style: [styles.text, colorStyle]\n        }, children) : children));\n      }\n    }]);\n\n    return IconButton;\n  }(PureComponent), _class.defaultProps = {\n    backgroundColor: IOS7_BLUE,\n    borderRadius: 5,\n    color: 'white',\n    size: 20\n  }, _temp;\n}","map":{"version":3,"sources":["/Users/rohitsingh/Documents/projects/new-nativebase-setup/NativeBase/example/node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/lib/icon-button.js"],"names":["isString","omit","pick","React","PureComponent","StyleSheet","Text","TouchableHighlight","View","styles","create","container","flexDirection","justifyContent","alignItems","padding","touchable","overflow","icon","marginRight","text","fontWeight","backgroundColor","IOS7_BLUE","TEXT_PROP_NAMES","TOUCHABLE_PROP_NAMES","createIconButtonComponent","Icon","props","style","iconStyle","children","restProps","iconProps","touchableProps","Object","keys","colorStyle","blockStyle","defaultProps","borderRadius","color","size"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,QAAP,MAAqB,iBAArB;AACA,OAAOC,IAAP,MAAiB,aAAjB;AACA,OAAOC,IAAP,MAAiB,aAAjB;AACA,OAAOC,KAAP,IAAgBC,aAAhB,QAAqC,OAArC;AACA,SAASC,UAAT,EAAqBC,IAArB,EAA2BC,kBAA3B,EAA+CC,IAA/C;AAEA,IAAMC,MAAM,GAAGJ,UAAU,CAACK,MAAX,CAAkB;AAC/BC,EAAAA,SAAS,EAAE;AACTC,IAAAA,aAAa,EAAE,KADN;AAETC,IAAAA,cAAc,EAAE,YAFP;AAGTC,IAAAA,UAAU,EAAE,QAHH;AAITC,IAAAA,OAAO,EAAE;AAJA,GADoB;AAO/BC,EAAAA,SAAS,EAAE;AACTC,IAAAA,QAAQ,EAAE;AADD,GAPoB;AAU/BC,EAAAA,IAAI,EAAE;AACJC,IAAAA,WAAW,EAAE;AADT,GAVyB;AAa/BC,EAAAA,IAAI,EAAE;AACJC,IAAAA,UAAU,EAAE,KADR;AAEJC,IAAAA,eAAe,EAAE;AAFb;AAbyB,CAAlB,CAAf;AAmBA,IAAMC,SAAS,GAAG,SAAlB;AAEA,IAAMC,eAAe,GAAG,CACtB,eADsB,EAEtB,eAFsB,EAGtB,mBAHsB,EAItB,YAJsB,EAKtB,sBALsB,EAMtB,kBANsB,EAOt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AR,EAAcY,SAAd,CAAH,GAA8BrB,MAAM,CAACS,IAAhE;AAEA,YAAMmB,UAAU,GAAGnC,IAAI,CAAC,KAAK0B,KAAN,EAAa,OAAb,CAAvB;AACA,YAAMU,UAAU,GAAGpC,IAAI,CAAC,KAAK0B,KAAN,EAAa,iBAAb,EAAgC,cAAhC,CAAvB;AAEA,eACE,oBAAC,kBAAD;AACE,UAAA,KAAK,EAAE,CAACnB,MAAM,CAACO,SAAR,EAAmBsB,UAAnB;AADT,WAEMJ,cAFN,GAIE,oBAAC,IAAD;AAAM,UAAA,KAAK,EAAE,CAACzB,MAAM,CAACE,SAAR,EAAmB2B,UAAnB,EAA+BT,KAA/B;AAAb,WAAwDD,KAAxD,GACE,oBAAC,IAAD,EAAUK,SAAV,CADF,EAEGjC,QAAQ,CAAC+B,QAAD,CAAR,GACC,oBAAC,IAAD;AAAM,UAAA,KAAK,EAAE,CAACtB,MAAM,CAACW,IAAR,EAAciB,UAAd;AAAb,WAAyCN,QAAzC,CADD,GAGCA,QALJ,CAJF,CADF;AAeD;AAhDH;;AAAA;AAAA,IAAgC3B,aAAhC,UACSmC,YADT,GACwB;AACpBjB,IAAAA,eAAe,EAAEC,SADG;AAEpBiB,IAAAA,YAAY,EAAE,CAFM;AAGpBC,IAAAA,KAAK,EAAE,OAHa;AAIpBC,IAAAA,IAAI,EAAE;AAJc,GADxB;AAkDD","sourcesContent":["import isString from 'lodash.isstring';\nimport omit from 'lodash.omit';\nimport pick from 'lodash.pick';\nimport React, { PureComponent } from 'react';\nimport { StyleSheet, Text, TouchableHighlight, View } from './react-native';\n\nconst styles = StyleSheet.create({\n  container: {\n    flexDirection: 'row',\n    justifyContent: 'flex-start',\n    alignItems: 'center',\n    padding: 8,\n  },\n  touchable: {\n    overflow: 'hidden',\n  },\n  icon: {\n    marginRight: 10,\n  },\n  text: {\n    fontWeight: '600',\n    backgroundColor: 'transparent',\n  },\n});\n\nconst IOS7_BLUE = '#007AFF';\n\nconst TEXT_PROP_NAMES = [\n  'ellipsizeMode',\n  'numberOfLines',\n  'textBreakStrategy',\n  'selectable',\n  'suppressHighlighting',\n  'allowFontScaling',\n  'adjustsFontSizeToFit',\n  'minimumFontScale',\n];\n\nconst TOUCHABLE_PROP_NAMES = [\n  'accessible',\n  'accessibilityLabel',\n  'accessibilityHint',\n  'accessibilityComponentType',\n  'accessibilityRole',\n  'accessibilityStates',\n  'accessibilityTraits',\n  'onFocus',\n  'onBlur',\n  'disabled',\n  'onPress',\n  'onPressIn',\n  'onPressOut',\n  'onLayout',\n  'onLongPress',\n  'nativeID',\n  'testID',\n  'delayPressIn',\n  'delayPressOut',\n  'delayLongPress',\n  'activeOpacity',\n  'underlayColor',\n  'selectionColor',\n  'onShowUnderlay',\n  'onHideUnderlay',\n  'hasTVPreferredFocus',\n  'tvParallaxProperties',\n];\n\nexport default function createIconButtonComponent(Icon) {\n  return class IconButton extends PureComponent {\n    static defaultProps = {\n      backgroundColor: IOS7_BLUE,\n      borderRadius: 5,\n      color: 'white',\n      size: 20,\n    };\n\n    render() {\n      const { style, iconStyle, children, ...restProps } = this.props;\n\n      const iconProps = pick(\n        restProps,\n        TEXT_PROP_NAMES,\n        'style',\n        'name',\n        'size',\n        'color'\n      );\n      const touchableProps = pick(restProps, TOUCHABLE_PROP_NAMES);\n      const props = omit(\n        restProps,\n        Object.keys(iconProps),\n        Object.keys(touchableProps),\n        'iconStyle',\n        'borderRadius',\n        'backgroundColor'\n      );\n      iconProps.style = iconStyle ? [styles.icon, iconStyle] : styles.icon;\n\n      const colorStyle = pick(this.props, 'color');\n      const blockStyle = pick(this.props, 'backgroundColor', 'borderRadius');\n\n      return (\n        <TouchableHighlight\n          style={[styles.touchable, blockStyle]}\n          {...touchableProps}\n        >\n          <View style={[styles.container, blockStyle, style]} {...props}>\n            <Icon {...iconProps} />\n            {isString(children) ? (\n              <Text style={[styles.text, colorStyle]}>{children}</Text>\n            ) : (\n              children\n            )}\n          </View>\n        </TouchableHighlight>\n      );\n    }\n  };\n}\n"]},"metadata":{},"sourceType":"module"}