var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ResizingClearButton=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _reactNativePaper=require("react-native-paper");var _reactNativeComponents=require("@brightlayer-ui/react-native-components");var _color=_interopRequireDefault(require("color"));var _jsxFileName="/home/circleci/login-workflow/login-workflow/src/components/ResizingClearButton.tsx";var makeStyles=function makeStyles(theme,fontSize){return _reactNative.StyleSheet.create({container:{paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderWidth:1,borderColor:'transparent'},textButton:{textAlign:'center',alignSelf:'center',fontSize:fontSize,color:theme.colors.primary,fontWeight:'500'}});};var ResizingClearButton=function ResizingClearButton(props){var title=props.title,_onPress=props.onPress,style=props.style,_props$fontSize=props.fontSize,fontSize=_props$fontSize===void 0?16:_props$fontSize,_props$numberOfLines=props.numberOfLines,numberOfLines=_props$numberOfLines===void 0?1:_props$numberOfLines;var theme=(0,_reactNativePaper.useTheme)(props.theme);var _React$useState=_react.default.useState(fontSize),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),currentFont=_React$useState2[0],setCurrentFont=_React$useState2[1];var styles=makeStyles(theme,fontSize);return _react.default.createElement(_reactNative.TouchableHighlight,{style:[styles.container],underlayColor:(0,_color.default)(theme.colors.primary).alpha(0.16).rgb().string(),onPress:function onPress(){_onPress();},accessibilityRole:'button',__source:{fileName:_jsxFileName,lineNumber:70,columnNumber:9}},_react.default.createElement(_reactNative.View,{style:style,__source:{fileName:_jsxFileName,lineNumber:78,columnNumber:13}},_react.default.createElement(_reactNativeComponents.Body1,{allowFontScaling:true,adjustsFontSizeToFit:true,numberOfLines:1,color:"primary",style:[styles.textButton,{fontSize:currentFont}],onTextLayout:function onTextLayout(event){var lines=event.nativeEvent.lines;if(lines.length>numberOfLines){setCurrentFont(currentFont-1);}},__source:{fileName:_jsxFileName,lineNumber:79,columnNumber:17}},title)));};exports.ResizingClearButton=ResizingClearButton;
//# sourceMappingURL=ResizingClearButton.js.map