@razorpay/blade 6.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @razorpay/blade
2
2
 
3
+ ## 6.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 62a98bb1: fix(blade): update BaseInput background color
8
+
3
9
  ## 6.0.0
4
10
 
5
11
  ### Major Changes
@@ -3937,7 +3937,7 @@ var getVisualContainerStyles=function getVisualContainerStyles(){return {display
3937
3937
 
3938
3938
  var getTextStyles=function getTextStyles(_ref){var variant=_ref.variant,type=_ref.type,weight=_ref.weight,size=_ref.size,contrast=_ref.contrast,theme=_ref.theme;return getBaseTextStyles(_extends({},getTextProps({variant:variant,type:type,weight:weight,size:size,contrast:contrast}),{theme:theme}));};
3939
3939
 
3940
- var getInputBackgroundAndBorderStyles=function getInputBackgroundAndBorderStyles(_ref){var theme=_ref.theme,isHovered=_ref.isHovered,isFocused=_ref.isFocused,isDisabled=_ref.isDisabled,validationState=_ref.validationState;var backgroundColor=theme.colors.brand.gray[200].lowContrast;var borderBottomColor=theme.colors.brand.gray[400].lowContrast;if(isHovered){backgroundColor=theme.colors.brand.gray[300].lowContrast;}if(isFocused){backgroundColor=theme.colors.brand.primary[300];}if(isDisabled){backgroundColor=theme.colors.brand.gray[200].lowContrast;borderBottomColor=theme.colors.brand.gray[300].lowContrast;}if(validationState==='error'){backgroundColor=theme.colors.feedback.background.negative.lowContrast;borderBottomColor=theme.colors.feedback.border.negative.highContrast;}else if(validationState==='success'){backgroundColor=theme.colors.feedback.background.positive.lowContrast;borderBottomColor=theme.colors.feedback.border.positive.highContrast;}return {backgroundColor:backgroundColor,borderBottomColor:borderBottomColor,borderTopLeftRadius:makeBorderSize(theme.border.radius.small),borderTopRightRadius:makeBorderSize(theme.border.radius.small),borderBottomWidth:makeBorderSize(theme.border.width.thin),borderBottomStyle:'solid'};};var getBaseInputStyles=function getBaseInputStyles(_ref2){var theme=_ref2.theme,isDisabled=_ref2.isDisabled,leadingIcon=_ref2.leadingIcon,prefix=_ref2.prefix,interactionElement=_ref2.interactionElement,suffix=_ref2.suffix,trailingIcon=_ref2.trailingIcon,textAlign=_ref2.textAlign;var _getInputVisualsToBeR=getInputVisualsToBeRendered({leadingIcon:leadingIcon,prefix:prefix,interactionElement:interactionElement,suffix:suffix,trailingIcon:trailingIcon}),hasLeadingIcon=_getInputVisualsToBeR.hasLeadingIcon,hasPrefix=_getInputVisualsToBeR.hasPrefix,hasInteractionElement=_getInputVisualsToBeR.hasInteractionElement,hasSuffix=_getInputVisualsToBeR.hasSuffix,hasTrailingIcon=_getInputVisualsToBeR.hasTrailingIcon;var isReactNative=getPlatformType()==='react-native';return _extends({},getTextStyles({size:'medium',variant:'body',type:isDisabled?'placeholder':'subtle',weight:'regular',contrast:'low',theme:theme}),{flex:1,backgroundColor:'transparent',paddingTop:makeSpace(theme.spacing[3]),paddingBottom:makeSpace(theme.spacing[3]),paddingLeft:hasLeadingIcon||hasPrefix?makeSpace(theme.spacing[3]):makeSpace(theme.spacing[4]),paddingRight:hasInteractionElement||hasSuffix||hasTrailingIcon?makeSpace(theme.spacing[3]):makeSpace(theme.spacing[4]),textAlign:textAlign,width:'100%'},isReactNative?{}:{resize:'none'});};
3940
+ var getInputBackgroundAndBorderStyles=function getInputBackgroundAndBorderStyles(_ref){var theme=_ref.theme,isHovered=_ref.isHovered,isFocused=_ref.isFocused,isDisabled=_ref.isDisabled,validationState=_ref.validationState;var backgroundColor=theme.colors.brand.gray.a50.lowContrast;var borderBottomColor=theme.colors.brand.gray.a100.lowContrast;if(isHovered){backgroundColor=theme.colors.brand.gray.a100.lowContrast;}if(isFocused){backgroundColor=theme.colors.brand.primary[300];}if(isDisabled){backgroundColor=theme.colors.brand.gray.a50.lowContrast;borderBottomColor=theme.colors.brand.gray[300].lowContrast;}if(validationState==='error'){backgroundColor=theme.colors.feedback.background.negative.lowContrast;borderBottomColor=theme.colors.feedback.border.negative.highContrast;}else if(validationState==='success'){backgroundColor=theme.colors.feedback.background.positive.lowContrast;borderBottomColor=theme.colors.feedback.border.positive.highContrast;}return {backgroundColor:backgroundColor,borderBottomColor:borderBottomColor,borderTopLeftRadius:makeBorderSize(theme.border.radius.small),borderTopRightRadius:makeBorderSize(theme.border.radius.small),borderBottomWidth:makeBorderSize(theme.border.width.thin),borderBottomStyle:'solid'};};var getBaseInputStyles=function getBaseInputStyles(_ref2){var theme=_ref2.theme,isDisabled=_ref2.isDisabled,leadingIcon=_ref2.leadingIcon,prefix=_ref2.prefix,interactionElement=_ref2.interactionElement,suffix=_ref2.suffix,trailingIcon=_ref2.trailingIcon,textAlign=_ref2.textAlign;var _getInputVisualsToBeR=getInputVisualsToBeRendered({leadingIcon:leadingIcon,prefix:prefix,interactionElement:interactionElement,suffix:suffix,trailingIcon:trailingIcon}),hasLeadingIcon=_getInputVisualsToBeR.hasLeadingIcon,hasPrefix=_getInputVisualsToBeR.hasPrefix,hasInteractionElement=_getInputVisualsToBeR.hasInteractionElement,hasSuffix=_getInputVisualsToBeR.hasSuffix,hasTrailingIcon=_getInputVisualsToBeR.hasTrailingIcon;var isReactNative=getPlatformType()==='react-native';return _extends({},getTextStyles({size:'medium',variant:'body',type:isDisabled?'placeholder':'subtle',weight:'regular',contrast:'low',theme:theme}),{flex:1,backgroundColor:'transparent',paddingTop:makeSpace(theme.spacing[3]),paddingBottom:makeSpace(theme.spacing[3]),paddingLeft:hasLeadingIcon||hasPrefix?makeSpace(theme.spacing[3]):makeSpace(theme.spacing[4]),paddingRight:hasInteractionElement||hasSuffix||hasTrailingIcon?makeSpace(theme.spacing[3]):makeSpace(theme.spacing[4]),textAlign:textAlign,width:'100%'},isReactNative?{}:{resize:'none'});};
3941
3941
 
3942
3942
  var _excluded$1=["name","isRequired","isDisabled","maxCharacters","handleOnFocus","handleOnChange","handleOnBlur","handleOnInput","handleOnKeyDown","keyboardType","keyboardReturnKeyType","autoCompleteSuggestionType","accessibilityProps","currentInteraction","setCurrentInteraction","type","numberOfLines","isTextArea"];var autoCompleteSuggestionTypeAndroid={none:'off',name:'name',email:'email',username:'username',password:'password',newPassword:'password-new',oneTimeCode:'sms-otp',telephone:'tel',postalCode:'postal-code',countryName:'postal-address-country',creditCardNumber:'cc-number',creditCardCSC:'cc-csc',creditCardExpiry:'cc-exp',creditCardExpiryMonth:'cc-exp-month',creditCardExpiryYear:'cc-exp-year'};var autoCompleteSuggestionTypeIOS={none:'none',name:'name',email:'emailAddress',username:'username',password:'password',newPassword:'newPassword',oneTimeCode:'oneTimeCode',telephone:'telephoneNumber',postalCode:'postalCode',countryName:'countryName',creditCardNumber:'creditCardNumber',creditCardCSC:'none',creditCardExpiry:'none',creditCardExpiryMonth:'none',creditCardExpiryYear:'none'};var KeyboardTypeToNativeValuesMap={text:'default',search:'default',telephone:'phone-pad',email:'email-address',url:'url',decimal:'decimal-pad'};var StyledNativeBaseInput=styled.TextInput(function(props){var _props$numberOfLines;return _extends({},getBaseInputStyles({theme:props.theme,isFocused:props.isFocused,isDisabled:!props.editable,validationState:props.validationState,leadingIcon:props.leadingIcon,prefix:props.prefix,interactionElement:props.interactionElement,suffix:props.suffix,trailingIcon:props.trailingIcon}),{lineHeight:undefined,textAlignVertical:'top',height:props.isTextArea?props.theme.typography.lineHeights.xl*((_props$numberOfLines=props.numberOfLines)!=null?_props$numberOfLines:0)+"px":'36px'});});var StyledBaseInput=React__default.forwardRef(function(_ref,ref){var name=_ref.name;_ref.isRequired;var isDisabled=_ref.isDisabled,maxCharacters=_ref.maxCharacters,handleOnFocus=_ref.handleOnFocus,handleOnChange=_ref.handleOnChange,handleOnBlur=_ref.handleOnBlur,handleOnInput=_ref.handleOnInput,handleOnKeyDown=_ref.handleOnKeyDown,_ref$keyboardType=_ref.keyboardType,keyboardType=_ref$keyboardType===void 0?'text':_ref$keyboardType,keyboardReturnKeyType=_ref.keyboardReturnKeyType,autoCompleteSuggestionType=_ref.autoCompleteSuggestionType,accessibilityProps=_ref.accessibilityProps,currentInteraction=_ref.currentInteraction,setCurrentInteraction=_ref.setCurrentInteraction,type=_ref.type,numberOfLines=_ref.numberOfLines,isTextArea=_ref.isTextArea,props=_objectWithoutProperties(_ref,_excluded$1);return jsx(StyledNativeBaseInput,_extends({ref:ref,multiline:isTextArea,numberOfLines:numberOfLines,isFocused:currentInteraction==='active',editable:!isDisabled,maxLength:maxCharacters,onFocus:function onFocus(event){handleOnFocus==null?void 0:handleOnFocus({name:name,value:event==null?void 0:event.nativeEvent.text});setCurrentInteraction('active');},onBlur:function onBlur(){setCurrentInteraction('default');},onChangeText:function onChangeText(text){handleOnChange==null?void 0:handleOnChange({name:name,value:text});handleOnInput==null?void 0:handleOnInput({name:name,value:text});},onEndEditing:function onEndEditing(event){return handleOnBlur==null?void 0:handleOnBlur({name:name,value:event==null?void 0:event.nativeEvent.text});},onKeyPress:function onKeyPress(event){handleOnKeyDown==null?void 0:handleOnKeyDown({name:name,key:event==null?void 0:event.nativeEvent.key,event:event});},keyboardType:KeyboardTypeToNativeValuesMap[keyboardType],returnKeyType:keyboardReturnKeyType,autoCompleteType:autoCompleteSuggestionType?autoCompleteSuggestionTypeAndroid[autoCompleteSuggestionType]:undefined,secureTextEntry:type==='password',isTextArea:isTextArea,textContentType:autoCompleteSuggestionType?autoCompleteSuggestionTypeIOS[autoCompleteSuggestionType]:undefined},props,accessibilityProps));});StyledBaseInput.displayName='StyledBaseInput';
3943
3943