@razorpay/blade 11.36.0 → 11.36.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/build/lib/native/components/Input/BaseInput/BaseInput.js +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js +2 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +1 -1
- package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +3 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js +77 -66
- package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +10 -10
- package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +3 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js +77 -66
- package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +10 -10
- package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/types/components/index.d.ts +4 -0
- package/build/types/components/index.native.d.ts +4 -0
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@ import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffect
|
|
|
38
38
|
import { getFocusRingStyles } from '../../../utils/getFocusRingStyles/getFocusRingStyles.native.js';
|
|
39
39
|
import { useMergeRefs } from '../../../utils/useMergeRefs.js';
|
|
40
40
|
|
|
41
|
-
var _excluded=["as","label","labelPosition","placeholder","type","defaultValue","tags","showAllTags","activeTagIndex","setActiveTagIndex","name","value","onFocus","onChange","onInput","onBlur","onSubmit","onClick","onKeyDown","isDisabled","necessityIndicator","validationState","errorText","helpText","successText","isRequired","leadingIcon","prefix","trailingInteractionElement","leadingInteractionElement","suffix","trailingIcon","maxCharacters","textAlign","autoFocus","keyboardReturnKeyType","keyboardType","autoCompleteSuggestionType","trailingHeaderSlot","trailingFooterSlot","numberOfLines","id","componentName","accessibilityLabel","labelId","activeDescendant","hideLabelText","hideFormHint","hasPopup","popupId","isPopupExpanded","maxTagRows","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","autoCapitalize","setInputWrapperRef","testID","isDropdownTrigger","isLabelInsideInput","size","trailingButton","valueComponentType","isTableInputCell","showHintsAsTooltip"];var autoCompleteSuggestionTypeValues=['none','on','name','email','username','password','newPassword','oneTimeCode','telephone','postalCode','countryName','creditCardNumber','creditCardCSC','creditCardExpiry','creditCardExpiryMonth','creditCardExpiryYear'];var useTags=function useTags(tags,activeTagIndex,setActiveTagIndex){var visibleTagsCountRef=React__default.useRef(0);React__default.useEffect(function(){if(tags&&activeTagIndex>=0&&activeTagIndex<tags.length){var _tags$activeTagIndex,_tags$activeTagIndex$;var tagTitle=(_tags$activeTagIndex=tags[activeTagIndex])==null?void 0:(_tags$activeTagIndex$=_tags$activeTagIndex.props)==null?void 0:_tags$activeTagIndex$.children;if(tagTitle){announce(`Close ${tagTitle} Tag`);}}},[activeTagIndex,tags==null?void 0:tags.length]);var onTagLeft=function onTagLeft(){if(activeTagIndex<0){setActiveTagIndex==null?void 0:setActiveTagIndex(visibleTagsCountRef.current-1);}if(activeTagIndex>0){setActiveTagIndex==null?void 0:setActiveTagIndex(activeTagIndex-1);}};var onTagRight=function onTagRight(){if(activeTagIndex<visibleTagsCountRef.current-1){setActiveTagIndex==null?void 0:setActiveTagIndex(activeTagIndex+1);}};var onTagRemove=function onTagRemove(){if(activeTagIndex>=0&&activeTagIndex<visibleTagsCountRef.current&&tags){tags[activeTagIndex].props.onDismiss({tagIndex:activeTagIndex});}};var onInputKeydownTagHandler=function onInputKeydownTagHandler(key){if(tags&&tags.length>0){if(key==='ArrowRight'){onTagRight();}if(key==='ArrowLeft'){onTagLeft();}if(key==='Backspace'){onTagRemove();}}};return {onInputKeydownTagHandler:onInputKeydownTagHandler,visibleTagsCountRef:visibleTagsCountRef};};var useInput=function useInput(_ref){var value=_ref.value,defaultValue=_ref.defaultValue,onClick=_ref.onClick,onFocus=_ref.onFocus,onChange=_ref.onChange,onBlur=_ref.onBlur,onSubmit=_ref.onSubmit,onInput=_ref.onInput,onKeyDown=_ref.onKeyDown,onInputKeydownTagHandler=_ref.onInputKeydownTagHandler;if(__DEV__){if(value&&defaultValue){throwBladeError({message:`Either 'value' or 'defaultValue' shall be passed. This decides if the input field is controlled or uncontrolled`,moduleName:'Input'});}}var _React$useState=React__default.useState(defaultValue!=null?defaultValue:value),_React$useState2=_slicedToArray(_React$useState,2),inputValue=_React$useState2[0],setInputValue=_React$useState2[1];var handleOnFocus=React__default.useCallback(function(_ref2){var name=_ref2.name,value=_ref2.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value;_value=(_value$target$value=value==null?void 0:value.target.value)!=null?_value$target$value:'';}onFocus==null?void 0:onFocus({name:name,value:_value});},[onFocus]);var handleOnClick=React__default.useCallback(function(_ref3){var name=_ref3.name,value=_ref3.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$currentTarget$;_value=(_value$currentTarget$=value==null?void 0:value.currentTarget.value)!=null?_value$currentTarget$:'';}onClick==null?void 0:onClick({name:name,value:_value});},[onClick]);var handleOnSubmit=React__default.useCallback(function(_ref4){var name=_ref4.name,value=_ref4.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value2;_value=(_value$target$value2=value==null?void 0:value.target.value)!=null?_value$target$value2:'';}if(isReactNative()){onSubmit==null?void 0:onSubmit({name:name,value:_value});}},[onSubmit]);var handleOnBlur=React__default.useCallback(function(_ref5){var name=_ref5.name,value=_ref5.value;var _value='';if(getPlatformType()==='react-native'&&typeof value=='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value3;_value=(_value$target$value3=value==null?void 0:value.target.value)!=null?_value$target$value3:'';}onBlur==null?void 0:onBlur({name:name,value:_value});},[onBlur]);var handleOnChange=React__default.useCallback(function(_ref6){var name=_ref6.name,value=_ref6.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value4;_value=(_value$target$value4=value==null?void 0:value.target.value)!=null?_value$target$value4:'';}onChange==null?void 0:onChange({name:name,value:_value});setInputValue(_value);},[onChange]);var handleOnInput=React__default.useCallback(function(_ref7){var name=_ref7.name,value=_ref7.value;var _value='';if(getPlatformType()==='react-native'&&typeof value=='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value5;_value=(_value$target$value5=value==null?void 0:value.target.value)!=null?_value$target$value5:'';}onInput==null?void 0:onInput({name:name,value:_value});},[onInput]);var handleOnKeyDown=React__default.useCallback(function(_ref8){var name=_ref8.name,key=_ref8.key,code=_ref8.code,event=_ref8.event;onInputKeydownTagHandler(key);onKeyDown==null?void 0:onKeyDown({name:name,key:key,code:code,event:event});},[onKeyDown]);return {handleOnFocus:handleOnFocus,handleOnClick:handleOnClick,handleOnChange:handleOnChange,handleOnBlur:handleOnBlur,handleOnSubmit:handleOnSubmit,handleOnInput:handleOnInput,handleOnKeyDown:handleOnKeyDown,inputValue:inputValue};};var getHintType=function getHintType(_ref9){var validationState=_ref9.validationState,hasHelpText=_ref9.hasHelpText;if(validationState==='error'){return 'error';}if(validationState==='success'){return 'success';}if(hasHelpText){return 'help';}return 'help';};var getDescribedByElementId=function getDescribedByElementId(_ref10){var validationState=_ref10.validationState,hasErrorText=_ref10.hasErrorText,hasSuccessText=_ref10.hasSuccessText,hasHelpText=_ref10.hasHelpText,errorTextId=_ref10.errorTextId,successTextId=_ref10.successTextId,helpTextId=_ref10.helpTextId;if(validationState==='error'&&hasErrorText){return errorTextId;}if(validationState==='success'&&hasSuccessText){return successTextId;}if(hasHelpText){return helpTextId;}return '';};var FocusRingWrapper=styled(BaseBox)(function(_ref11){var theme=_ref11.theme,currentInteraction=_ref11.currentInteraction,isTableInputCell=_ref11.isTableInputCell;return {borderRadius:makeBorderSize(isTableInputCell?theme.border.radius.none:theme.border.radius.medium),width:'100%','&:focus-within':!isTableInputCell?Object.assign({},getFocusRingStyles(),{transitionDuration:castWebType(makeMotionTime(getIn(theme.motion.duration,baseInputBorderBackgroundMotion[currentInteraction==='focus'?'enter':'exit'].duration))),transitionTimingFunction:castWebType(getIn(theme.motion.easing,baseInputBorderBackgroundMotion[currentInteraction==='focus'?'enter':'exit'].easing))}):{}};});var _BaseInput=function _BaseInput(_ref12,ref){var _ref12$as=_ref12.as,as=_ref12$as===void 0?'input':_ref12$as,label=_ref12.label,_ref12$labelPosition=_ref12.labelPosition,labelPosition=_ref12$labelPosition===void 0?'top':_ref12$labelPosition,placeholder=_ref12.placeholder,_ref12$type=_ref12.type,type=_ref12$type===void 0?'text':_ref12$type,defaultValue=_ref12.defaultValue,tags=_ref12.tags,_ref12$showAllTags=_ref12.showAllTags,showAllTags=_ref12$showAllTags===void 0?false:_ref12$showAllTags,_ref12$activeTagIndex=_ref12.activeTagIndex,activeTagIndex=_ref12$activeTagIndex===void 0?-1:_ref12$activeTagIndex,setActiveTagIndex=_ref12.setActiveTagIndex,name=_ref12.name,value=_ref12.value,onFocus=_ref12.onFocus,onChange=_ref12.onChange,onInput=_ref12.onInput,onBlur=_ref12.onBlur,onSubmit=_ref12.onSubmit,onClick=_ref12.onClick,onKeyDown=_ref12.onKeyDown,isDisabled=_ref12.isDisabled,necessityIndicator=_ref12.necessityIndicator,validationState=_ref12.validationState,errorText=_ref12.errorText,helpText=_ref12.helpText,successText=_ref12.successText,isRequired=_ref12.isRequired,leadingIcon=_ref12.leadingIcon,prefix=_ref12.prefix,trailingInteractionElement=_ref12.trailingInteractionElement,leadingInteractionElement=_ref12.leadingInteractionElement,suffix=_ref12.suffix,trailingIcon=_ref12.trailingIcon,maxCharacters=_ref12.maxCharacters,textAlign=_ref12.textAlign,autoFocus=_ref12.autoFocus,keyboardReturnKeyType=_ref12.keyboardReturnKeyType,keyboardType=_ref12.keyboardType,autoCompleteSuggestionType=_ref12.autoCompleteSuggestionType,trailingHeaderSlot=_ref12.trailingHeaderSlot,trailingFooterSlot=_ref12.trailingFooterSlot,numberOfLines=_ref12.numberOfLines,id=_ref12.id,componentName=_ref12.componentName,accessibilityLabel=_ref12.accessibilityLabel,labelId=_ref12.labelId,activeDescendant=_ref12.activeDescendant,hideLabelText=_ref12.hideLabelText,hideFormHint=_ref12.hideFormHint,hasPopup=_ref12.hasPopup,popupId=_ref12.popupId,isPopupExpanded=_ref12.isPopupExpanded,maxTagRows=_ref12.maxTagRows,shouldIgnoreBlurAnimation=_ref12.shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation=_ref12.setShouldIgnoreBlurAnimation,autoCapitalize=_ref12.autoCapitalize,setInputWrapperRef=_ref12.setInputWrapperRef,testID=_ref12.testID,isDropdownTrigger=_ref12.isDropdownTrigger,isLabelInsideInput=_ref12.isLabelInsideInput,_ref12$size=_ref12.size,size=_ref12$size===void 0?'medium':_ref12$size,trailingButton=_ref12.trailingButton,_ref12$valueComponent=_ref12.valueComponentType,valueComponentType=_ref12$valueComponent===void 0?'text':_ref12$valueComponent,_ref12$isTableInputCe=_ref12.isTableInputCell,isTableInputCell=_ref12$isTableInputCe===void 0?false:_ref12$isTableInputCe,_ref12$showHintsAsToo=_ref12.showHintsAsTooltip,showHintsAsTooltip=_ref12$showHintsAsToo===void 0?false:_ref12$showHintsAsToo,styledProps=_objectWithoutProperties(_ref12,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var inputRef=React__default.useRef(null);var mergedInputRef=useMergeRefs(ref,inputRef);var inputWrapperRef=React__default.useRef(null);var _useTags=useTags(tags,activeTagIndex,setActiveTagIndex),onInputKeydownTagHandler=_useTags.onInputKeydownTagHandler,visibleTagsCountRef=_useTags.visibleTagsCountRef;var _React$useState3=React__default.useState(false),_React$useState4=_slicedToArray(_React$useState3,2),showAllTagsWithAnimation=_React$useState4[0],setShowAllTagsWithAnimation=_React$useState4[1];var isReactNative=getPlatformType()==='react-native';React__default.useEffect(function(){if(showAllTags){setShowAllTagsWithAnimation(true);}else if(maxTagRows!=='expandable'){setShowAllTagsWithAnimation(false);}},[showAllTags,maxTagRows]);var _useInput=useInput({defaultValue:defaultValue,value:value,onFocus:onFocus,onClick:onClick,onChange:onChange,onBlur:onBlur,onSubmit:onSubmit,onInput:onInput,onKeyDown:onKeyDown,onInputKeydownTagHandler:onInputKeydownTagHandler}),handleOnFocus=_useInput.handleOnFocus,handleOnChange=_useInput.handleOnChange,handleOnClick=_useInput.handleOnClick,handleOnBlur=_useInput.handleOnBlur,handleOnSubmit=_useInput.handleOnSubmit,handleOnInput=_useInput.handleOnInput,handleOnKeyDown=_useInput.handleOnKeyDown,inputValue=_useInput.inputValue;var _useFormId=useFormId(id),inputId=_useFormId.inputId,helpTextId=_useFormId.helpTextId,errorTextId=_useFormId.errorTextId,successTextId=_useFormId.successTextId;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var isLabelLeftPositioned=labelPosition==='left'&&matchedDeviceType==='desktop';var _useInteraction=useInteraction(),currentInteraction=_useInteraction.currentInteraction,setCurrentInteraction=_useInteraction.setCurrentInteraction;var _isRequired=isRequired||necessityIndicator==='required';var accessibilityProps=makeAccessible({required:Boolean(_isRequired),disabled:Boolean(isDisabled),invalid:Boolean(validationState==='error'),describedBy:getDescribedByElementId({validationState:validationState,hasErrorText:Boolean(errorText),hasSuccessText:Boolean(successText),hasHelpText:Boolean(helpText),errorTextId:errorTextId,successTextId:successTextId,helpTextId:helpTextId}),label:accessibilityLabel,hasPopup:hasPopup,expanded:hasPopup?isPopupExpanded:undefined,controls:hasPopup?popupId:undefined,role:hasPopup?'combobox':undefined,activeDescendant:activeDescendant});var willRenderHintText=Boolean(helpText)||Boolean(successText)||Boolean(errorText);if(__DEV__){if(autoCompleteSuggestionType&&!autoCompleteSuggestionTypeValues.includes(autoCompleteSuggestionType)){throwBladeError({message:`Expected autoCompleteSuggestionType to be one of ${autoCompleteSuggestionTypeValues.join(', ')} but received ${autoCompleteSuggestionType}`,moduleName:'Input'});}}var isTextArea=as==='textarea';return jsxs(BaseBox,Object.assign({},metaAttribute({name:componentName,testID:testID}),getStyledProps(styledProps),{children:[jsxs(BaseBox,{display:"flex",flexDirection:isLabelLeftPositioned?'row':'column',justifyContent:isLabelLeftPositioned?'center':undefined,alignItems:isLabelLeftPositioned?'center':undefined,position:"relative",width:"100%",children:[!hideLabelText&&!isLabelInsideInput&&label&&jsxs(BaseBox,{display:"flex",flexDirection:isLabelLeftPositioned?'column':'row',justifyContent:"space-between",alignSelf:isTextArea?'flex-start':undefined,marginY:isTextArea&&isLabelLeftPositioned?'spacing.3':'spacing.0',children:[jsx(FormLabel,{as:"label",necessityIndicator:necessityIndicator,position:labelPosition,id:labelId,htmlFor:inputId,size:size,children:label}),trailingHeaderSlot==null?void 0:trailingHeaderSlot(value!=null?value:inputValue)]}),jsx(FocusRingWrapper,{currentInteraction:currentInteraction,isTableInputCell:isTableInputCell,children:jsxs(BaseInputWrapper,{isDropdownTrigger:isDropdownTrigger,isTextArea:isTextArea,isDisabled:isDisabled,validationState:validationState,currentInteraction:currentInteraction,isLabelLeftPositioned:isLabelLeftPositioned,showAllTags:showAllTags,setShowAllTagsWithAnimation:setShowAllTagsWithAnimation,ref:function ref(refNode){if(refNode){setInputWrapperRef==null?void 0:setInputWrapperRef(refNode);inputWrapperRef.current=refNode;}},maxTagRows:maxTagRows,size:size,numberOfLines:numberOfLines,onClick:function onClick(){if(!isReactNative){var _inputRef$current;(_inputRef$current=inputRef.current)==null?void 0:_inputRef$current.focus();}},isTableInputCell:isTableInputCell,children:[jsx(BaseInputVisuals,{size:size,leadingIcon:leadingIcon,prefix:prefix,isDisabled:isDisabled,leadingInteractionElement:leadingInteractionElement}),jsx(BaseInputTagSlot,{renderAs:as,tags:tags,isDisabled:isDisabled,showAllTags:showAllTagsWithAnimation,setFocusOnInput:function setFocusOnInput(){if(ref&&!isReactNative&&'current'in ref){var _ref$current;(_ref$current=ref.current)==null?void 0:_ref$current.focus();}},labelPrefix:isLabelInsideInput?label:undefined,isDropdownTrigger:isDropdownTrigger,visibleTagsCountRef:visibleTagsCountRef,handleOnInputClick:function handleOnInputClick(e){handleOnClick({name:name,value:isReactNative?value:e});},setShouldIgnoreBlurAnimation:setShouldIgnoreBlurAnimation,maxTagRows:maxTagRows,inputWrapperRef:inputWrapperRef,size:size,numberOfLines:numberOfLines,isTextArea:isTextArea,children:jsx(StyledBaseInput,Object.assign({as:as,id:inputId,ref:mergedInputRef,name:name,type:type,defaultValue:defaultValue,value:value,placeholder:placeholder,isDisabled:isDisabled,validationState:validationState,isRequired:_isRequired,handleOnFocus:handleOnFocus,handleOnChange:handleOnChange,handleOnBlur:handleOnBlur,handleOnSubmit:handleOnSubmit,handleOnInput:handleOnInput,handleOnKeyDown:handleOnKeyDown,handleOnClick:handleOnClick,leadingIcon:leadingIcon,prefix:prefix,trailingInteractionElement:trailingInteractionElement,leadingInteractionElement:leadingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,maxCharacters:maxCharacters,textAlign:textAlign,autoFocus:autoFocus,keyboardReturnKeyType:keyboardReturnKeyType,keyboardType:keyboardType,autoCompleteSuggestionType:autoCompleteSuggestionType,accessibilityProps:accessibilityProps,currentInteraction:currentInteraction,setCurrentInteraction:setCurrentInteraction,numberOfLines:numberOfLines,isTextArea:isTextArea||maxTagRows==='multiple'||maxTagRows==='expandable',hasPopup:hasPopup,hasTags:!!(tags&&tags.length>0),shouldIgnoreBlurAnimation:shouldIgnoreBlurAnimation,autoCapitalize:autoCapitalize,isDropdownTrigger:isDropdownTrigger,$size:size,valueComponentType:valueComponentType,isTableInputCell:isTableInputCell},metaAttribute({name:MetaConstants.StyledBaseInput})))}),jsx(BaseInputVisuals,{trailingInteractionElement:trailingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,isDisabled:isDisabled,validationState:validationState,trailingButton:trailingButton,size:size,errorText:errorText,successText:successText,showHintsAsTooltip:showHintsAsTooltip})]})})]}),hideFormHint||showHintsAsTooltip?null:jsx(BaseBox,{marginLeft:makeSize(isLabelLeftPositioned&&!hideLabelText?formHintLeftLabelMarginLeft[size]:0),children:jsxs(BaseBox,{display:"flex",flexDirection:"row",justifyContent:willRenderHintText?'space-between':'flex-end',children:[jsx(FormHint,{type:getHintType({validationState:validationState,hasHelpText:Boolean(helpText)}),helpText:helpText,errorText:errorText,successText:successText,helpTextId:helpTextId,errorTextId:errorTextId,successTextId:successTextId,size:size}),trailingFooterSlot==null?void 0:trailingFooterSlot(value!=null?value:inputValue)]})})]}));};var BaseInputWithRef=React__default.forwardRef(_BaseInput);var BaseInput=assignWithoutSideEffects(BaseInputWithRef,{displayName:'BaseInput'});
|
|
41
|
+
var _excluded=["as","label","labelPosition","placeholder","type","defaultValue","tags","showAllTags","activeTagIndex","setActiveTagIndex","name","value","onFocus","onChange","onInput","onBlur","onSubmit","onClick","onKeyDown","isDisabled","necessityIndicator","validationState","errorText","helpText","successText","isRequired","leadingIcon","prefix","trailingInteractionElement","onTrailingInteractionElementClick","leadingInteractionElement","suffix","trailingIcon","maxCharacters","textAlign","autoFocus","keyboardReturnKeyType","keyboardType","autoCompleteSuggestionType","trailingHeaderSlot","trailingFooterSlot","numberOfLines","id","componentName","accessibilityLabel","labelId","activeDescendant","hideLabelText","hideFormHint","hasPopup","popupId","isPopupExpanded","maxTagRows","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","autoCapitalize","setInputWrapperRef","testID","isDropdownTrigger","isLabelInsideInput","size","trailingButton","valueComponentType","isTableInputCell","showHintsAsTooltip"];var autoCompleteSuggestionTypeValues=['none','on','name','email','username','password','newPassword','oneTimeCode','telephone','postalCode','countryName','creditCardNumber','creditCardCSC','creditCardExpiry','creditCardExpiryMonth','creditCardExpiryYear'];var useTags=function useTags(tags,activeTagIndex,setActiveTagIndex){var visibleTagsCountRef=React__default.useRef(0);React__default.useEffect(function(){if(tags&&activeTagIndex>=0&&activeTagIndex<tags.length){var _tags$activeTagIndex,_tags$activeTagIndex$;var tagTitle=(_tags$activeTagIndex=tags[activeTagIndex])==null?void 0:(_tags$activeTagIndex$=_tags$activeTagIndex.props)==null?void 0:_tags$activeTagIndex$.children;if(tagTitle){announce(`Close ${tagTitle} Tag`);}}},[activeTagIndex,tags==null?void 0:tags.length]);var onTagLeft=function onTagLeft(){if(activeTagIndex<0){setActiveTagIndex==null?void 0:setActiveTagIndex(visibleTagsCountRef.current-1);}if(activeTagIndex>0){setActiveTagIndex==null?void 0:setActiveTagIndex(activeTagIndex-1);}};var onTagRight=function onTagRight(){if(activeTagIndex<visibleTagsCountRef.current-1){setActiveTagIndex==null?void 0:setActiveTagIndex(activeTagIndex+1);}};var onTagRemove=function onTagRemove(){if(activeTagIndex>=0&&activeTagIndex<visibleTagsCountRef.current&&tags){tags[activeTagIndex].props.onDismiss({tagIndex:activeTagIndex});}};var onInputKeydownTagHandler=function onInputKeydownTagHandler(key){if(tags&&tags.length>0){if(key==='ArrowRight'){onTagRight();}if(key==='ArrowLeft'){onTagLeft();}if(key==='Backspace'){onTagRemove();}}};return {onInputKeydownTagHandler:onInputKeydownTagHandler,visibleTagsCountRef:visibleTagsCountRef};};var useInput=function useInput(_ref){var value=_ref.value,defaultValue=_ref.defaultValue,onClick=_ref.onClick,onFocus=_ref.onFocus,onChange=_ref.onChange,onBlur=_ref.onBlur,onSubmit=_ref.onSubmit,onInput=_ref.onInput,onKeyDown=_ref.onKeyDown,onInputKeydownTagHandler=_ref.onInputKeydownTagHandler;if(__DEV__){if(value&&defaultValue){throwBladeError({message:`Either 'value' or 'defaultValue' shall be passed. This decides if the input field is controlled or uncontrolled`,moduleName:'Input'});}}var _React$useState=React__default.useState(defaultValue!=null?defaultValue:value),_React$useState2=_slicedToArray(_React$useState,2),inputValue=_React$useState2[0],setInputValue=_React$useState2[1];var handleOnFocus=React__default.useCallback(function(_ref2){var name=_ref2.name,value=_ref2.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value;_value=(_value$target$value=value==null?void 0:value.target.value)!=null?_value$target$value:'';}onFocus==null?void 0:onFocus({name:name,value:_value});},[onFocus]);var handleOnClick=React__default.useCallback(function(_ref3){var name=_ref3.name,value=_ref3.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$currentTarget$;_value=(_value$currentTarget$=value==null?void 0:value.currentTarget.value)!=null?_value$currentTarget$:'';}onClick==null?void 0:onClick({name:name,value:_value});},[onClick]);var handleOnSubmit=React__default.useCallback(function(_ref4){var name=_ref4.name,value=_ref4.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value2;_value=(_value$target$value2=value==null?void 0:value.target.value)!=null?_value$target$value2:'';}if(isReactNative()){onSubmit==null?void 0:onSubmit({name:name,value:_value});}},[onSubmit]);var handleOnBlur=React__default.useCallback(function(_ref5){var name=_ref5.name,value=_ref5.value;var _value='';if(getPlatformType()==='react-native'&&typeof value=='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value3;_value=(_value$target$value3=value==null?void 0:value.target.value)!=null?_value$target$value3:'';}onBlur==null?void 0:onBlur({name:name,value:_value});},[onBlur]);var handleOnChange=React__default.useCallback(function(_ref6){var name=_ref6.name,value=_ref6.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value4;_value=(_value$target$value4=value==null?void 0:value.target.value)!=null?_value$target$value4:'';}onChange==null?void 0:onChange({name:name,value:_value});setInputValue(_value);},[onChange]);var handleOnInput=React__default.useCallback(function(_ref7){var name=_ref7.name,value=_ref7.value;var _value='';if(getPlatformType()==='react-native'&&typeof value=='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value5;_value=(_value$target$value5=value==null?void 0:value.target.value)!=null?_value$target$value5:'';}onInput==null?void 0:onInput({name:name,value:_value});},[onInput]);var handleOnKeyDown=React__default.useCallback(function(_ref8){var name=_ref8.name,key=_ref8.key,code=_ref8.code,event=_ref8.event;onInputKeydownTagHandler(key);onKeyDown==null?void 0:onKeyDown({name:name,key:key,code:code,event:event});},[onKeyDown]);return {handleOnFocus:handleOnFocus,handleOnClick:handleOnClick,handleOnChange:handleOnChange,handleOnBlur:handleOnBlur,handleOnSubmit:handleOnSubmit,handleOnInput:handleOnInput,handleOnKeyDown:handleOnKeyDown,inputValue:inputValue};};var getHintType=function getHintType(_ref9){var validationState=_ref9.validationState,hasHelpText=_ref9.hasHelpText;if(validationState==='error'){return 'error';}if(validationState==='success'){return 'success';}if(hasHelpText){return 'help';}return 'help';};var getDescribedByElementId=function getDescribedByElementId(_ref10){var validationState=_ref10.validationState,hasErrorText=_ref10.hasErrorText,hasSuccessText=_ref10.hasSuccessText,hasHelpText=_ref10.hasHelpText,errorTextId=_ref10.errorTextId,successTextId=_ref10.successTextId,helpTextId=_ref10.helpTextId;if(validationState==='error'&&hasErrorText){return errorTextId;}if(validationState==='success'&&hasSuccessText){return successTextId;}if(hasHelpText){return helpTextId;}return '';};var FocusRingWrapper=styled(BaseBox)(function(_ref11){var theme=_ref11.theme,currentInteraction=_ref11.currentInteraction,isTableInputCell=_ref11.isTableInputCell;return {borderRadius:makeBorderSize(isTableInputCell?theme.border.radius.none:theme.border.radius.medium),width:'100%','&:focus-within':!isTableInputCell?Object.assign({},getFocusRingStyles(),{transitionDuration:castWebType(makeMotionTime(getIn(theme.motion.duration,baseInputBorderBackgroundMotion[currentInteraction==='focus'?'enter':'exit'].duration))),transitionTimingFunction:castWebType(getIn(theme.motion.easing,baseInputBorderBackgroundMotion[currentInteraction==='focus'?'enter':'exit'].easing))}):{}};});var _BaseInput=function _BaseInput(_ref12,ref){var _ref12$as=_ref12.as,as=_ref12$as===void 0?'input':_ref12$as,label=_ref12.label,_ref12$labelPosition=_ref12.labelPosition,labelPosition=_ref12$labelPosition===void 0?'top':_ref12$labelPosition,placeholder=_ref12.placeholder,_ref12$type=_ref12.type,type=_ref12$type===void 0?'text':_ref12$type,defaultValue=_ref12.defaultValue,tags=_ref12.tags,_ref12$showAllTags=_ref12.showAllTags,showAllTags=_ref12$showAllTags===void 0?false:_ref12$showAllTags,_ref12$activeTagIndex=_ref12.activeTagIndex,activeTagIndex=_ref12$activeTagIndex===void 0?-1:_ref12$activeTagIndex,setActiveTagIndex=_ref12.setActiveTagIndex,name=_ref12.name,value=_ref12.value,onFocus=_ref12.onFocus,onChange=_ref12.onChange,onInput=_ref12.onInput,onBlur=_ref12.onBlur,onSubmit=_ref12.onSubmit,onClick=_ref12.onClick,onKeyDown=_ref12.onKeyDown,isDisabled=_ref12.isDisabled,necessityIndicator=_ref12.necessityIndicator,validationState=_ref12.validationState,errorText=_ref12.errorText,helpText=_ref12.helpText,successText=_ref12.successText,isRequired=_ref12.isRequired,leadingIcon=_ref12.leadingIcon,prefix=_ref12.prefix,trailingInteractionElement=_ref12.trailingInteractionElement,onTrailingInteractionElementClick=_ref12.onTrailingInteractionElementClick,leadingInteractionElement=_ref12.leadingInteractionElement,suffix=_ref12.suffix,trailingIcon=_ref12.trailingIcon,maxCharacters=_ref12.maxCharacters,textAlign=_ref12.textAlign,autoFocus=_ref12.autoFocus,keyboardReturnKeyType=_ref12.keyboardReturnKeyType,keyboardType=_ref12.keyboardType,autoCompleteSuggestionType=_ref12.autoCompleteSuggestionType,trailingHeaderSlot=_ref12.trailingHeaderSlot,trailingFooterSlot=_ref12.trailingFooterSlot,numberOfLines=_ref12.numberOfLines,id=_ref12.id,componentName=_ref12.componentName,accessibilityLabel=_ref12.accessibilityLabel,labelId=_ref12.labelId,activeDescendant=_ref12.activeDescendant,hideLabelText=_ref12.hideLabelText,hideFormHint=_ref12.hideFormHint,hasPopup=_ref12.hasPopup,popupId=_ref12.popupId,isPopupExpanded=_ref12.isPopupExpanded,maxTagRows=_ref12.maxTagRows,shouldIgnoreBlurAnimation=_ref12.shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation=_ref12.setShouldIgnoreBlurAnimation,autoCapitalize=_ref12.autoCapitalize,setInputWrapperRef=_ref12.setInputWrapperRef,testID=_ref12.testID,isDropdownTrigger=_ref12.isDropdownTrigger,isLabelInsideInput=_ref12.isLabelInsideInput,_ref12$size=_ref12.size,size=_ref12$size===void 0?'medium':_ref12$size,trailingButton=_ref12.trailingButton,_ref12$valueComponent=_ref12.valueComponentType,valueComponentType=_ref12$valueComponent===void 0?'text':_ref12$valueComponent,_ref12$isTableInputCe=_ref12.isTableInputCell,isTableInputCell=_ref12$isTableInputCe===void 0?false:_ref12$isTableInputCe,_ref12$showHintsAsToo=_ref12.showHintsAsTooltip,showHintsAsTooltip=_ref12$showHintsAsToo===void 0?false:_ref12$showHintsAsToo,styledProps=_objectWithoutProperties(_ref12,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var inputRef=React__default.useRef(null);var mergedInputRef=useMergeRefs(ref,inputRef);var inputWrapperRef=React__default.useRef(null);var _useTags=useTags(tags,activeTagIndex,setActiveTagIndex),onInputKeydownTagHandler=_useTags.onInputKeydownTagHandler,visibleTagsCountRef=_useTags.visibleTagsCountRef;var _React$useState3=React__default.useState(false),_React$useState4=_slicedToArray(_React$useState3,2),showAllTagsWithAnimation=_React$useState4[0],setShowAllTagsWithAnimation=_React$useState4[1];var isReactNative=getPlatformType()==='react-native';React__default.useEffect(function(){if(showAllTags){setShowAllTagsWithAnimation(true);}else if(maxTagRows!=='expandable'){setShowAllTagsWithAnimation(false);}},[showAllTags,maxTagRows]);var _useInput=useInput({defaultValue:defaultValue,value:value,onFocus:onFocus,onClick:onClick,onChange:onChange,onBlur:onBlur,onSubmit:onSubmit,onInput:onInput,onKeyDown:onKeyDown,onInputKeydownTagHandler:onInputKeydownTagHandler}),handleOnFocus=_useInput.handleOnFocus,handleOnChange=_useInput.handleOnChange,handleOnClick=_useInput.handleOnClick,handleOnBlur=_useInput.handleOnBlur,handleOnSubmit=_useInput.handleOnSubmit,handleOnInput=_useInput.handleOnInput,handleOnKeyDown=_useInput.handleOnKeyDown,inputValue=_useInput.inputValue;var _useFormId=useFormId(id),inputId=_useFormId.inputId,helpTextId=_useFormId.helpTextId,errorTextId=_useFormId.errorTextId,successTextId=_useFormId.successTextId;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var isLabelLeftPositioned=labelPosition==='left'&&matchedDeviceType==='desktop';var _useInteraction=useInteraction(),currentInteraction=_useInteraction.currentInteraction,setCurrentInteraction=_useInteraction.setCurrentInteraction;var _isRequired=isRequired||necessityIndicator==='required';var accessibilityProps=makeAccessible({required:Boolean(_isRequired),disabled:Boolean(isDisabled),invalid:Boolean(validationState==='error'),describedBy:getDescribedByElementId({validationState:validationState,hasErrorText:Boolean(errorText),hasSuccessText:Boolean(successText),hasHelpText:Boolean(helpText),errorTextId:errorTextId,successTextId:successTextId,helpTextId:helpTextId}),label:accessibilityLabel,hasPopup:hasPopup,expanded:hasPopup?isPopupExpanded:undefined,controls:hasPopup?popupId:undefined,role:hasPopup?'combobox':undefined,activeDescendant:activeDescendant});var willRenderHintText=Boolean(helpText)||Boolean(successText)||Boolean(errorText);if(__DEV__){if(autoCompleteSuggestionType&&!autoCompleteSuggestionTypeValues.includes(autoCompleteSuggestionType)){throwBladeError({message:`Expected autoCompleteSuggestionType to be one of ${autoCompleteSuggestionTypeValues.join(', ')} but received ${autoCompleteSuggestionType}`,moduleName:'Input'});}}var isTextArea=as==='textarea';return jsxs(BaseBox,Object.assign({},metaAttribute({name:componentName,testID:testID}),getStyledProps(styledProps),{children:[jsxs(BaseBox,{display:"flex",flexDirection:isLabelLeftPositioned?'row':'column',justifyContent:isLabelLeftPositioned?'center':undefined,alignItems:isLabelLeftPositioned?'center':undefined,position:"relative",width:"100%",children:[!hideLabelText&&!isLabelInsideInput&&label&&jsxs(BaseBox,{display:"flex",flexDirection:isLabelLeftPositioned?'column':'row',justifyContent:"space-between",alignSelf:isTextArea?'flex-start':undefined,marginY:isTextArea&&isLabelLeftPositioned?'spacing.3':'spacing.0',children:[jsx(FormLabel,{as:"label",necessityIndicator:necessityIndicator,position:labelPosition,id:labelId,htmlFor:inputId,size:size,children:label}),trailingHeaderSlot==null?void 0:trailingHeaderSlot(value!=null?value:inputValue)]}),jsx(FocusRingWrapper,{currentInteraction:currentInteraction,isTableInputCell:isTableInputCell,children:jsxs(BaseInputWrapper,{isDropdownTrigger:isDropdownTrigger,isTextArea:isTextArea,isDisabled:isDisabled,validationState:validationState,currentInteraction:currentInteraction,isLabelLeftPositioned:isLabelLeftPositioned,showAllTags:showAllTags,setShowAllTagsWithAnimation:setShowAllTagsWithAnimation,ref:function ref(refNode){if(refNode){setInputWrapperRef==null?void 0:setInputWrapperRef(refNode);inputWrapperRef.current=refNode;}},maxTagRows:maxTagRows,size:size,numberOfLines:numberOfLines,onClick:function onClick(){if(!isReactNative){var _inputRef$current;(_inputRef$current=inputRef.current)==null?void 0:_inputRef$current.focus();}},isTableInputCell:isTableInputCell,children:[jsx(BaseInputVisuals,{size:size,leadingIcon:leadingIcon,prefix:prefix,isDisabled:isDisabled,leadingInteractionElement:leadingInteractionElement}),jsx(BaseInputTagSlot,{renderAs:as,tags:tags,isDisabled:isDisabled,showAllTags:showAllTagsWithAnimation,setFocusOnInput:function setFocusOnInput(){if(ref&&!isReactNative&&'current'in ref){var _ref$current;(_ref$current=ref.current)==null?void 0:_ref$current.focus();}},labelPrefix:isLabelInsideInput?label:undefined,isDropdownTrigger:isDropdownTrigger,visibleTagsCountRef:visibleTagsCountRef,handleOnInputClick:function handleOnInputClick(e){handleOnClick({name:name,value:isReactNative?value:e});},setShouldIgnoreBlurAnimation:setShouldIgnoreBlurAnimation,maxTagRows:maxTagRows,inputWrapperRef:inputWrapperRef,size:size,numberOfLines:numberOfLines,isTextArea:isTextArea,children:jsx(StyledBaseInput,Object.assign({as:as,id:inputId,ref:mergedInputRef,name:name,type:type,defaultValue:defaultValue,value:value,placeholder:placeholder,isDisabled:isDisabled,validationState:validationState,isRequired:_isRequired,handleOnFocus:handleOnFocus,handleOnChange:handleOnChange,handleOnBlur:handleOnBlur,handleOnSubmit:handleOnSubmit,handleOnInput:handleOnInput,handleOnKeyDown:handleOnKeyDown,handleOnClick:handleOnClick,leadingIcon:leadingIcon,prefix:prefix,trailingInteractionElement:trailingInteractionElement,leadingInteractionElement:leadingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,maxCharacters:maxCharacters,textAlign:textAlign,autoFocus:autoFocus,keyboardReturnKeyType:keyboardReturnKeyType,keyboardType:keyboardType,autoCompleteSuggestionType:autoCompleteSuggestionType,accessibilityProps:accessibilityProps,currentInteraction:currentInteraction,setCurrentInteraction:setCurrentInteraction,numberOfLines:numberOfLines,isTextArea:isTextArea||maxTagRows==='multiple'||maxTagRows==='expandable',hasPopup:hasPopup,hasTags:!!(tags&&tags.length>0),shouldIgnoreBlurAnimation:shouldIgnoreBlurAnimation,autoCapitalize:autoCapitalize,isDropdownTrigger:isDropdownTrigger,$size:size,valueComponentType:valueComponentType,isTableInputCell:isTableInputCell},metaAttribute({name:MetaConstants.StyledBaseInput})))}),jsx(BaseInputVisuals,{trailingInteractionElement:trailingInteractionElement,onTrailingInteractionElementClick:onTrailingInteractionElementClick,suffix:suffix,trailingIcon:trailingIcon,isDisabled:isDisabled,validationState:validationState,trailingButton:trailingButton,size:size,errorText:errorText,successText:successText,showHintsAsTooltip:showHintsAsTooltip})]})})]}),hideFormHint||showHintsAsTooltip?null:jsx(BaseBox,{marginLeft:makeSize(isLabelLeftPositioned&&!hideLabelText?formHintLeftLabelMarginLeft[size]:0),children:jsxs(BaseBox,{display:"flex",flexDirection:"row",justifyContent:willRenderHintText?'space-between':'flex-end',children:[jsx(FormHint,{type:getHintType({validationState:validationState,hasHelpText:Boolean(helpText)}),helpText:helpText,errorText:errorText,successText:successText,helpTextId:helpTextId,errorTextId:errorTextId,successTextId:successTextId,size:size}),trailingFooterSlot==null?void 0:trailingFooterSlot(value!=null?value:inputValue)]})})]}));};var BaseInputWithRef=React__default.forwardRef(_BaseInput);var BaseInput=assignWithoutSideEffects(BaseInputWithRef,{displayName:'BaseInput'});
|
|
42
42
|
|
|
43
43
|
export { BaseInput, getHintType };
|
|
44
44
|
//# sourceMappingURL=BaseInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInput.js","sources":["../../../../../../src/components/Input/BaseInput/BaseInput.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport type { ReactNode } from 'react';\nimport styled from 'styled-components';\nimport { StyledBaseInput } from './StyledBaseInput';\nimport { BaseInputVisuals } from './BaseInputVisuals';\nimport { BaseInputWrapper } from './BaseInputWrapper';\nimport { BaseInputTagSlot } from './BaseInputTagSlot';\nimport type { InputWrapperRef } from './types';\nimport { baseInputBorderBackgroundMotion, formHintLeftLabelMarginLeft } from './baseInputTokens';\nimport type {\n FormInputLabelProps,\n FormInputValidationProps,\n FormInputHandleOnEvent,\n FormInputOnEvent,\n FormHintProps,\n} from '~components/Form';\nimport { FormHint, FormLabel } from '~components/Form';\nimport type { IconComponent } from '~components/Icons';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport {\n castWebType,\n getPlatformType,\n isReactNative,\n makeBorderSize,\n makeMotionTime,\n useBreakpoint,\n} from '~utils';\nimport type { Platform } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useFormId } from '~components/Form/useFormId';\nimport { useTheme } from '~components/BladeProvider';\nimport useInteraction from '~utils/useInteraction';\nimport type { ActionStates } from '~utils/useInteraction';\nimport type {\n FormInputHandleOnClickEvent,\n FormInputHandleOnKeyDownEvent,\n} from '~components/Form/FormTypes';\nimport type { BladeElementRef, ContainerElementType, TestID } from '~utils/types';\nimport { makeSize } from '~utils/makeSize';\nimport type { AriaAttributes } from '~utils/makeAccessible';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\nimport { announce } from '~components/LiveAnnouncer/LiveAnnouncer';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { LinkProps } from '~components/Link';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\nimport getIn from '~utils/lodashButBetter/get';\nimport { useMergeRefs } from '~utils/useMergeRefs';\n\ntype CommonAutoCompleteSuggestionTypes =\n | 'none'\n | 'name'\n | 'email'\n | 'username'\n | 'password'\n | 'newPassword'\n | 'oneTimeCode'\n | 'telephone'\n | 'postalCode'\n | 'countryName'\n | 'creditCardNumber'\n | 'creditCardCSC'\n | 'creditCardExpiry'\n | 'creditCardExpiryMonth'\n | 'creditCardExpiryYear';\n\ntype WebAutoCompleteSuggestionType = CommonAutoCompleteSuggestionTypes | 'on';\n\ntype BaseInputCommonProps = FormInputLabelProps &\n FormInputValidationProps & {\n /**\n * Determines if it needs to be rendered as input, textarea or button\n */\n as?: 'input' | 'textarea' | 'button';\n /**\n * ID that will be used for accessibility\n */\n id: string;\n /**\n * Placeholder text to be displayed inside the input field\n */\n placeholder?: string;\n /**\n * Type of Input Field to be rendered.\n *\n * @default text\n */\n type?: 'text' | 'telephone' | 'email' | 'url' | 'number' | 'search' | 'password';\n /**\n * Used to set the default value of input field when it's uncontrolled\n */\n defaultValue?: string;\n /**\n * The name of the input field.\n *\n * Useful in form submissions\n */\n name?: string;\n /**\n * The callback function to be invoked when the input field gets focus\n */\n onFocus?: FormInputOnEvent;\n /**\n * The callback function to be invoked when the value of the input field changes\n */\n onChange?: FormInputOnEvent;\n /**\n * The callback function to be invoked when input is clicked\n */\n onClick?: FormInputOnEvent;\n /**\n * The callback function to be invoked when the value of the input field has any input\n */\n onInput?: FormInputOnEvent;\n /**\n * The callback function to be invoked whenever there is a keyDown event\n */\n onKeyDown?: FormInputHandleOnKeyDownEvent;\n /**\n * The callback function to be invoked when the the input field loses focus\n *\n * For React Native this will call `onEndEditing` event since we want to get the last value of the input field\n */\n onBlur?: FormInputOnEvent;\n /**\n * Ignores the blur event animation (Used in Select to ignore blur animation when item in option is clicked)\n */\n shouldIgnoreBlurAnimation?: boolean;\n /**\n * sets boolean that ignores the blur animations on baseinput\n */\n setShouldIgnoreBlurAnimation?: (shouldIgnoreBlurAnimation: boolean) => void;\n /**\n * Used to turn the input field to controlled so user can control the value\n */\n value?: string;\n /**\n * Used to disable the input field\n */\n isDisabled?: boolean;\n /**\n * If true, the input is marked as required, and `required` attribute will be added\n */\n isRequired?: boolean;\n /**\n * Icon to be shown at the start of the input field\n */\n leadingIcon?: IconComponent;\n /**\n * Prefix symbol to be displayed at the beginning of the input field. If leadingIcon is provided it'll be placed after it\n */\n prefix?: string;\n /**\n * Element to be rendered before suffix. This is decided by the component which is extending BaseInput\n *\n * eg: consumers can render a loader or they could render a clear button\n */\n trailingInteractionElement?: ReactNode;\n /**\n * Element to be rendered before prefix. This is decided by the component which is extending BaseInput\n *\n * eg: consumers can render a country selector or button\n */\n leadingInteractionElement?: ReactNode;\n /**\n * Suffix symbol to be displayed at the end of the input field. If trailingIcon is provided it'll be placed before it\n */\n suffix?: string;\n /**\n * Icon to be displayed at the end of the input field\n */\n trailingIcon?: IconComponent;\n /**\n * Displays the character counter under the input field\n */\n maxCharacters?: number;\n /**\n * alignment of the text inside input field\n */\n textAlign?: 'left' | 'center' | 'right';\n /**\n * If true, focuses the input field on load\n *\n * **Note:**\n * Automatically focusing a form control can confuse visually-impaired people using screen-reading technology and people with cognitive impairments.\n * When autofocus is assigned, screen-readers \"teleport\" their user to the form control without warning them beforehand.\n */\n autoFocus?: boolean;\n /**\n * Hints the platform to display an appropriate virtual keyboard\n *\n * **Native:** Passes as is the `keyboardType` attribute\n *\n * **Web:** Passes the value to the `inputMode` attribute\n */\n keyboardType?: 'text' | 'search' | 'telephone' | 'email' | 'url' | 'decimal';\n /**\n * determines what return key to show on the keyboard of mobile devices/virtual keyboard\n * **Note**: Few values are platform dependent and might not render on all the platforms\n *\n * `default` is only available on native. it'll be mapped to `enter` for web\n * `previous` is only available on native android\n */\n keyboardReturnKeyType?: 'default' | 'go' | 'done' | 'next' | 'previous' | 'search' | 'send';\n /**\n * Element to be rendered on the trailing slot of input field label\n */\n trailingHeaderSlot?: (value?: string) => ReactNode;\n /**\n * Element to be rendered on the trailing slot of input field footer\n */\n trailingFooterSlot?: (value?: string) => ReactNode;\n /**\n * Sets the textarea's number of lines\n */\n numberOfLines?: 2 | 3 | 4 | 5;\n /**\n * Sets the accessibility label for the input\n */\n accessibilityLabel?: string;\n /**\n * Sets the id of the label\n *\n * (Useful when assigning one label to multiple elements using aria-labelledby)\n */\n labelId?: string;\n /**\n * Can be used in select to set the id of the active descendant from the listbox\n */\n activeDescendant?: string;\n /**\n * Hides the label text\n */\n hideLabelText?: boolean;\n /**\n * Hides the form hint text\n */\n hideFormHint?: boolean;\n /**\n * componentName prop sets the data-blade-component attribute name\n * for internal metric collection purposes\n */\n componentName?: string;\n /**\n * whether the input has a popup\n */\n hasPopup?: AriaAttributes['hasPopup'];\n /**\n * id of the popup\n */\n popupId?: string;\n /**\n * true if popup is in expanded state\n */\n isPopupExpanded?: boolean;\n setInputWrapperRef?: (node: ContainerElementType) => void;\n /**\n * sets the autocapitalize behavior for the input\n */\n autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters';\n\n /**\n * constraints the height of input to given number rows\n *\n * When set to expandable, input takes 1 row in the begining and expands to take 3 when active\n *\n * @default 'single'\n */\n maxTagRows?: 'single' | 'multiple' | 'expandable';\n\n /**\n * A slot for adding tags to input\n */\n tags?: React.ReactElement[] | null;\n\n /**\n * Disables stripping of tags and shows all tags\n */\n showAllTags?: boolean;\n\n /**\n * State variable of active tag index\n */\n activeTagIndex?: number;\n\n /**\n * Is this input SelectInput or AutoComplete\n */\n isDropdownTrigger?: boolean;\n\n /**\n * Is the label expected to be rendered inside input?\n * Used in AutoComplete and Select when label can't exist outside\n *\n */\n isLabelInsideInput?: boolean;\n\n /**\n * State setter for active tag index\n */\n setActiveTagIndex?: (activeTagIndex: number) => void;\n /**\n * Sets the size of the input field\n * @default medium\n */\n size?: 'medium' | 'large';\n /**\n * Link button to be rendered at the end of the input field.\n * **Note:** `size` of the Link will be set to the same size as the input field, `isDisabled` will follow Input's `isDisabled`, & `variant` will be set to `button`.\n * Example:\n * ```tsx\n * trailingButton={<Link onClick={handleClick}>Apply</Link>}\n * ```\n */\n trailingButton?: React.ReactElement<LinkProps>;\n /**\n * Whether to use Text or Heading component for Input text\n * @default text\n **/\n valueComponentType?: 'text' | 'heading';\n /**\n * Whether to render the input as a table cell\n * @default true\n **/\n isTableInputCell?: boolean;\n\n /**\n * Hides the form hints and shows them as tooltip of trailing\n */\n showHintsAsTooltip?: boolean;\n } & TestID &\n Platform.Select<{\n native: {\n /**\n * The callback function to be invoked when the value of the input field is submitted.\n */\n onSubmit?: FormInputOnEvent;\n /**\n * determines what autoComplete suggestion type to show\n *\n * Internally it'll render platform specific attributes:\n *\n * - web: `autocomplete`\n * - iOS: `textContentType`\n * - android: `autoComplete`\n *\n */\n autoCompleteSuggestionType?: CommonAutoCompleteSuggestionTypes;\n };\n web: {\n /**\n * This is a react-native only prop and has no effect on web.\n */\n onSubmit?: undefined;\n /**\n * determines what autoComplete suggestion type to show\n *\n * Internally it'll render platform specific attributes:\n *\n * - web: `autocomplete`\n * - iOS: `textContentType`\n * - android: `autoComplete`\n *\n */\n autoCompleteSuggestionType?: WebAutoCompleteSuggestionType;\n };\n }> &\n StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype BaseInputPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype BaseInputPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\nexport type BaseInputProps = (BaseInputPropsWithA11yLabel | BaseInputPropsWithLabel) &\n BaseInputCommonProps;\n\nconst autoCompleteSuggestionTypeValues = [\n 'none',\n 'on',\n 'name',\n 'email',\n 'username',\n 'password',\n 'newPassword',\n 'oneTimeCode',\n 'telephone',\n 'postalCode',\n 'countryName',\n 'creditCardNumber',\n 'creditCardCSC',\n 'creditCardExpiry',\n 'creditCardExpiryMonth',\n 'creditCardExpiryYear',\n];\n\ntype OnInputKeydownTagHandlerType = (key: string | undefined) => void;\nconst useTags = (\n tags: BaseInputProps['tags'],\n activeTagIndex: number,\n setActiveTagIndex?: (activeTagIndex: number) => void,\n): {\n onInputKeydownTagHandler: OnInputKeydownTagHandlerType;\n visibleTagsCountRef: React.MutableRefObject<number>;\n} => {\n const visibleTagsCountRef = React.useRef<number>(0);\n\n React.useEffect(() => {\n if (tags && activeTagIndex >= 0 && activeTagIndex < tags.length) {\n const tagTitle = tags[activeTagIndex]?.props?.children;\n if (tagTitle) {\n announce(`Close ${tagTitle} Tag`);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeTagIndex, tags?.length]);\n\n const onTagLeft = (): void => {\n if (activeTagIndex < 0) {\n setActiveTagIndex?.(visibleTagsCountRef.current - 1);\n }\n\n if (activeTagIndex > 0) {\n setActiveTagIndex?.(activeTagIndex - 1);\n }\n };\n\n const onTagRight = (): void => {\n if (activeTagIndex < visibleTagsCountRef.current - 1) {\n setActiveTagIndex?.(activeTagIndex + 1);\n }\n };\n\n const onTagRemove = (): void => {\n if (activeTagIndex >= 0 && activeTagIndex < visibleTagsCountRef.current && tags) {\n tags[activeTagIndex].props.onDismiss({ tagIndex: activeTagIndex });\n }\n };\n\n const onInputKeydownTagHandler: OnInputKeydownTagHandlerType = (key) => {\n if (tags && tags.length > 0) {\n if (key === 'ArrowRight') {\n onTagRight();\n }\n\n if (key === 'ArrowLeft') {\n onTagLeft();\n }\n\n if (key === 'Backspace') {\n onTagRemove();\n }\n }\n };\n\n return {\n onInputKeydownTagHandler,\n visibleTagsCountRef,\n };\n};\n\nconst useInput = ({\n value,\n defaultValue,\n onClick,\n onFocus,\n onChange,\n onBlur,\n onSubmit,\n onInput,\n onKeyDown,\n onInputKeydownTagHandler,\n}: Pick<\n BaseInputProps,\n | 'value'\n | 'defaultValue'\n | 'onFocus'\n | 'onChange'\n | 'onBlur'\n | 'onInput'\n | 'onKeyDown'\n | 'onClick'\n | 'onSubmit'\n> & {\n onInputKeydownTagHandler: OnInputKeydownTagHandlerType;\n}): {\n handleOnFocus: FormInputHandleOnEvent;\n handleOnClick: FormInputHandleOnClickEvent;\n handleOnChange: FormInputHandleOnEvent;\n handleOnBlur: FormInputHandleOnEvent;\n handleOnSubmit: FormInputHandleOnEvent;\n handleOnInput: FormInputHandleOnEvent;\n handleOnKeyDown: FormInputHandleOnKeyDownEvent;\n inputValue?: string;\n} => {\n if (__DEV__) {\n if (value && defaultValue) {\n throwBladeError({\n message: `Either 'value' or 'defaultValue' shall be passed. This decides if the input field is controlled or uncontrolled`,\n moduleName: 'Input',\n });\n }\n }\n\n const [inputValue, setInputValue] = React.useState(defaultValue ?? value);\n\n const handleOnFocus: FormInputHandleOnEvent = React.useCallback(\n ({ name, value }) => {\n let _value = '';\n\n if (getPlatformType() === 'react-native' && typeof value === 'string') {\n _value = value;\n } else if (typeof value !== 'string') {\n // Could have just done \"getPlatformType() === 'react-native' ? value : value?.target.value\" but TS doesn't understands that\n _value = value?.target.value ?? '';\n }\n\n onFocus?.({\n name,\n value: _value,\n });\n },\n [onFocus],\n );\n\n const handleOnClick: FormInputHandleOnClickEvent = React.useCallback(\n ({ name, value }) => {\n let _value = '';\n\n if (getPlatformType() === 'react-native' && typeof value === 'string') {\n _value = value;\n } else if (typeof value !== 'string') {\n // Could have just done \"getPlatformType() === 'react-native' ? value : value?.target.value\" but TS doesn't understands that\n _value = value?.currentTarget.value ?? '';\n }\n\n onClick?.({\n name,\n value: _value,\n });\n },\n [onClick],\n );\n\n const handleOnSubmit: FormInputHandleOnEvent = React.useCallback(\n ({ name, value }) => {\n let _value = '';\n\n if (getPlatformType() === 'react-native' && typeof value === 'string') {\n _value = value;\n } else if (typeof value !== 'string') {\n // Could have just done \"getPlatformType() === 'react-native' ? value : value?.target.value\" but TS doesn't understands that\n _value = value?.target.value ?? '';\n }\n if (isReactNative()) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error\n //@ts-ignore need to ignore this since it will throw a TS error for web but not for native\n onSubmit?.({\n name,\n value: _value,\n });\n }\n },\n [onSubmit],\n );\n\n const handleOnBlur: FormInputHandleOnEvent = React.useCallback(\n ({ name, value }) => {\n let _value = '';\n if (getPlatformType() === 'react-native' && typeof value == 'string') {\n _value = value;\n } else if (typeof value !== 'string') {\n // Could have just done \"getPlatformType() === 'react-native' ? value : value?.target.value\" but TS doesn't understands that\n _value = value?.target.value ?? '';\n }\n\n onBlur?.({\n name,\n value: _value,\n });\n },\n [onBlur],\n );\n\n const handleOnChange: FormInputHandleOnEvent = React.useCallback(\n ({ name, value }) => {\n let _value = '';\n\n if (getPlatformType() === 'react-native' && typeof value === 'string') {\n _value = value;\n } else if (typeof value !== 'string') {\n // Could have just done \"getPlatformType() === 'react-native' ? value : value?.target.value\" but TS doesn't understands that\n _value = value?.target.value ?? '';\n }\n\n onChange?.({\n name,\n value: _value,\n });\n setInputValue(_value);\n },\n [onChange],\n );\n\n const handleOnInput: FormInputHandleOnEvent = React.useCallback(\n ({ name, value }) => {\n let _value = '';\n if (getPlatformType() === 'react-native' && typeof value == 'string') {\n _value = value;\n } else if (typeof value !== 'string') {\n // Could have just done \"getPlatformType() === 'react-native' ? value : value?.target.value\" but TS doesn't understands that\n _value = value?.target.value ?? '';\n }\n\n onInput?.({\n name,\n value: _value,\n });\n },\n [onInput],\n );\n\n const handleOnKeyDown: FormInputHandleOnKeyDownEvent = React.useCallback(\n ({ name, key, code, event }) => {\n onInputKeydownTagHandler(key);\n onKeyDown?.({\n name,\n key,\n code,\n event,\n });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [onKeyDown],\n );\n\n return {\n handleOnFocus,\n handleOnClick,\n handleOnChange,\n handleOnBlur,\n handleOnSubmit,\n handleOnInput,\n handleOnKeyDown,\n inputValue,\n };\n};\n\nexport const getHintType = ({\n validationState,\n hasHelpText,\n}: {\n validationState: BaseInputProps['validationState'];\n hasHelpText: boolean;\n}): FormHintProps['type'] => {\n if (validationState === 'error') {\n return 'error';\n }\n\n if (validationState === 'success') {\n return 'success';\n }\n\n if (hasHelpText) {\n return 'help';\n }\n\n return 'help';\n};\n\nconst getDescribedByElementId = ({\n validationState,\n hasErrorText,\n hasSuccessText,\n hasHelpText,\n errorTextId,\n successTextId,\n helpTextId,\n}: {\n validationState: BaseInputProps['validationState'];\n hasErrorText: boolean;\n hasSuccessText: boolean;\n hasHelpText: boolean;\n errorTextId: string;\n successTextId: string;\n helpTextId: string;\n}): string => {\n if (validationState === 'error' && hasErrorText) {\n return errorTextId;\n }\n\n if (validationState === 'success' && hasSuccessText) {\n return successTextId;\n }\n\n if (hasHelpText) {\n return helpTextId;\n }\n\n return '';\n};\n\nconst FocusRingWrapper = styled(BaseBox)<{\n currentInteraction: ActionStates;\n isTableInputCell: NonNullable<BaseInputProps['isTableInputCell']>;\n}>(({ theme, currentInteraction, isTableInputCell }) => ({\n borderRadius: makeBorderSize(\n isTableInputCell ? theme.border.radius.none : theme.border.radius.medium,\n ),\n width: '100%',\n '&:focus-within': !isTableInputCell\n ? {\n ...getFocusRingStyles({\n theme,\n }),\n transitionDuration: castWebType(\n makeMotionTime(\n getIn(\n theme.motion.duration,\n baseInputBorderBackgroundMotion[currentInteraction === 'focus' ? 'enter' : 'exit']\n .duration,\n ),\n ),\n ),\n transitionTimingFunction: castWebType(\n getIn(\n theme.motion.easing,\n baseInputBorderBackgroundMotion[currentInteraction === 'focus' ? 'enter' : 'exit']\n .easing,\n ),\n ),\n }\n : {},\n}));\n\nconst _BaseInput: React.ForwardRefRenderFunction<BladeElementRef, BaseInputProps> = (\n {\n as = 'input',\n label,\n labelPosition = 'top',\n placeholder,\n type = 'text',\n defaultValue,\n tags,\n showAllTags = false,\n activeTagIndex = -1,\n setActiveTagIndex,\n name,\n value,\n onFocus,\n onChange,\n onInput,\n onBlur,\n onSubmit,\n onClick,\n onKeyDown,\n isDisabled,\n necessityIndicator,\n validationState,\n errorText,\n helpText,\n successText,\n isRequired,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n maxCharacters,\n textAlign,\n autoFocus,\n keyboardReturnKeyType,\n keyboardType,\n autoCompleteSuggestionType,\n trailingHeaderSlot,\n trailingFooterSlot,\n numberOfLines,\n id,\n componentName,\n accessibilityLabel,\n labelId,\n activeDescendant,\n hideLabelText,\n hideFormHint,\n hasPopup,\n popupId,\n isPopupExpanded,\n maxTagRows,\n shouldIgnoreBlurAnimation,\n setShouldIgnoreBlurAnimation,\n autoCapitalize,\n setInputWrapperRef,\n testID,\n isDropdownTrigger,\n isLabelInsideInput,\n size = 'medium',\n trailingButton,\n valueComponentType = 'text',\n isTableInputCell = false,\n showHintsAsTooltip = false,\n ...styledProps\n },\n ref,\n) => {\n const { theme } = useTheme();\n const inputRef = React.useRef<BladeElementRef>(null);\n const mergedInputRef = useMergeRefs(ref, inputRef);\n const inputWrapperRef: InputWrapperRef = React.useRef(null);\n const { onInputKeydownTagHandler, visibleTagsCountRef } = useTags(\n tags,\n activeTagIndex,\n setActiveTagIndex,\n );\n const [showAllTagsWithAnimation, setShowAllTagsWithAnimation] = React.useState(false);\n const isReactNative = getPlatformType() === 'react-native';\n\n React.useEffect(() => {\n if (showAllTags) {\n setShowAllTagsWithAnimation(true);\n } else if (maxTagRows !== 'expandable') {\n setShowAllTagsWithAnimation(false);\n }\n }, [showAllTags, maxTagRows]);\n\n const {\n handleOnFocus,\n handleOnChange,\n handleOnClick,\n handleOnBlur,\n handleOnSubmit,\n handleOnInput,\n handleOnKeyDown,\n inputValue,\n } = useInput({\n defaultValue,\n value,\n onFocus,\n onClick,\n onChange,\n onBlur,\n onSubmit,\n onInput,\n onKeyDown,\n onInputKeydownTagHandler,\n });\n const { inputId, helpTextId, errorTextId, successTextId } = useFormId(id);\n const { matchedDeviceType } = useBreakpoint({ breakpoints: theme.breakpoints });\n const isLabelLeftPositioned = labelPosition === 'left' && matchedDeviceType === 'desktop';\n const { currentInteraction, setCurrentInteraction } = useInteraction();\n const _isRequired = isRequired || necessityIndicator === 'required';\n\n const accessibilityProps = makeAccessible({\n required: Boolean(_isRequired),\n disabled: Boolean(isDisabled),\n invalid: Boolean(validationState === 'error'),\n describedBy: getDescribedByElementId({\n validationState,\n hasErrorText: Boolean(errorText),\n hasSuccessText: Boolean(successText),\n hasHelpText: Boolean(helpText),\n errorTextId,\n successTextId,\n helpTextId,\n }),\n label: accessibilityLabel,\n hasPopup,\n expanded: hasPopup ? isPopupExpanded : undefined,\n controls: hasPopup ? popupId : undefined,\n role: hasPopup ? 'combobox' : undefined,\n activeDescendant,\n });\n\n const willRenderHintText = Boolean(helpText) || Boolean(successText) || Boolean(errorText);\n\n if (__DEV__) {\n if (\n autoCompleteSuggestionType &&\n !autoCompleteSuggestionTypeValues.includes(autoCompleteSuggestionType)\n ) {\n throwBladeError({\n message: `Expected autoCompleteSuggestionType to be one of ${autoCompleteSuggestionTypeValues.join(\n ', ',\n )} but received ${autoCompleteSuggestionType}`,\n moduleName: 'Input',\n });\n }\n }\n\n const isTextArea = as === 'textarea';\n return (\n <BaseBox {...metaAttribute({ name: componentName, testID })} {...getStyledProps(styledProps)}>\n <BaseBox\n display=\"flex\"\n flexDirection={isLabelLeftPositioned ? 'row' : 'column'}\n justifyContent={isLabelLeftPositioned ? 'center' : undefined}\n alignItems={isLabelLeftPositioned ? 'center' : undefined}\n position=\"relative\"\n width=\"100%\"\n >\n {!hideLabelText && !isLabelInsideInput && label && (\n <BaseBox\n display=\"flex\"\n flexDirection={isLabelLeftPositioned ? 'column' : 'row'}\n justifyContent=\"space-between\"\n alignSelf={isTextArea ? 'flex-start' : undefined}\n marginY={isTextArea && isLabelLeftPositioned ? 'spacing.3' : 'spacing.0'}\n >\n <FormLabel\n as=\"label\"\n necessityIndicator={necessityIndicator}\n position={labelPosition}\n id={labelId}\n htmlFor={inputId}\n size={size}\n >\n {label}\n </FormLabel>\n {trailingHeaderSlot?.(value ?? inputValue)}\n </BaseBox>\n )}\n <FocusRingWrapper\n currentInteraction={currentInteraction}\n isTableInputCell={isTableInputCell}\n >\n <BaseInputWrapper\n isDropdownTrigger={isDropdownTrigger}\n isTextArea={isTextArea}\n isDisabled={isDisabled}\n validationState={validationState}\n currentInteraction={currentInteraction}\n isLabelLeftPositioned={isLabelLeftPositioned}\n showAllTags={showAllTags}\n setShowAllTagsWithAnimation={setShowAllTagsWithAnimation}\n ref={(refNode) => {\n if (refNode) {\n setInputWrapperRef?.(refNode);\n inputWrapperRef.current = refNode;\n }\n }}\n maxTagRows={maxTagRows}\n size={size}\n numberOfLines={numberOfLines}\n onClick={() => {\n if (!isReactNative) {\n inputRef.current?.focus();\n }\n }}\n isTableInputCell={isTableInputCell}\n >\n <BaseInputVisuals\n size={size}\n leadingIcon={leadingIcon}\n prefix={prefix}\n isDisabled={isDisabled}\n leadingInteractionElement={leadingInteractionElement}\n />\n <BaseInputTagSlot\n renderAs={as}\n tags={tags}\n isDisabled={isDisabled}\n showAllTags={showAllTagsWithAnimation}\n setFocusOnInput={() => {\n if (ref && !isReactNative && 'current' in ref) {\n ref.current?.focus();\n }\n }}\n labelPrefix={isLabelInsideInput ? label : undefined}\n isDropdownTrigger={isDropdownTrigger}\n visibleTagsCountRef={visibleTagsCountRef}\n handleOnInputClick={(e) => {\n handleOnClick({ name, value: isReactNative ? value : e });\n }}\n setShouldIgnoreBlurAnimation={setShouldIgnoreBlurAnimation}\n maxTagRows={maxTagRows}\n inputWrapperRef={inputWrapperRef}\n size={size}\n numberOfLines={numberOfLines}\n isTextArea={isTextArea}\n >\n <StyledBaseInput\n as={as}\n id={inputId}\n ref={mergedInputRef as any}\n name={name}\n type={type}\n defaultValue={defaultValue}\n value={value}\n placeholder={placeholder}\n isDisabled={isDisabled}\n validationState={validationState}\n isRequired={_isRequired}\n handleOnFocus={handleOnFocus}\n handleOnChange={handleOnChange}\n handleOnBlur={handleOnBlur}\n handleOnSubmit={handleOnSubmit}\n handleOnInput={handleOnInput}\n handleOnKeyDown={handleOnKeyDown}\n handleOnClick={handleOnClick}\n leadingIcon={leadingIcon}\n prefix={prefix}\n trailingInteractionElement={trailingInteractionElement}\n leadingInteractionElement={leadingInteractionElement}\n suffix={suffix}\n trailingIcon={trailingIcon}\n maxCharacters={maxCharacters}\n textAlign={textAlign}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n keyboardReturnKeyType={keyboardReturnKeyType}\n keyboardType={keyboardType}\n autoCompleteSuggestionType={autoCompleteSuggestionType}\n accessibilityProps={accessibilityProps}\n currentInteraction={currentInteraction}\n setCurrentInteraction={setCurrentInteraction}\n numberOfLines={numberOfLines}\n isTextArea={isTextArea || maxTagRows === 'multiple' || maxTagRows === 'expandable'}\n hasPopup={hasPopup}\n hasTags={!!(tags && tags.length > 0)}\n shouldIgnoreBlurAnimation={shouldIgnoreBlurAnimation}\n autoCapitalize={autoCapitalize}\n isDropdownTrigger={isDropdownTrigger}\n $size={size}\n valueComponentType={valueComponentType}\n isTableInputCell={isTableInputCell}\n {...metaAttribute({ name: MetaConstants.StyledBaseInput })}\n />\n </BaseInputTagSlot>\n <BaseInputVisuals\n trailingInteractionElement={trailingInteractionElement}\n suffix={suffix}\n trailingIcon={trailingIcon}\n isDisabled={isDisabled}\n validationState={validationState}\n trailingButton={trailingButton}\n size={size}\n errorText={errorText}\n successText={successText}\n showHintsAsTooltip={showHintsAsTooltip}\n />\n </BaseInputWrapper>\n </FocusRingWrapper>\n </BaseBox>\n\n {hideFormHint || showHintsAsTooltip ? null : (\n <BaseBox\n marginLeft={makeSize(\n isLabelLeftPositioned && !hideLabelText ? formHintLeftLabelMarginLeft[size] : 0,\n )}\n >\n <BaseBox\n display=\"flex\"\n flexDirection=\"row\"\n justifyContent={willRenderHintText ? 'space-between' : 'flex-end'}\n >\n <FormHint\n type={getHintType({ validationState, hasHelpText: Boolean(helpText) })}\n helpText={helpText}\n errorText={errorText}\n successText={successText}\n helpTextId={helpTextId}\n errorTextId={errorTextId}\n successTextId={successTextId}\n size={size}\n />\n {trailingFooterSlot?.(value ?? inputValue)}\n </BaseBox>\n </BaseBox>\n )}\n </BaseBox>\n );\n};\n\nconst BaseInputWithRef = React.forwardRef(_BaseInput);\nconst BaseInput = assignWithoutSideEffects(BaseInputWithRef, { displayName: 'BaseInput' });\n\nexport { BaseInput };\n"],"names":["autoCompleteSuggestionTypeValues","useTags","tags","activeTagIndex","setActiveTagIndex","visibleTagsCountRef","React","useRef","useEffect","length","_tags$activeTagIndex","_tags$activeTagIndex$","tagTitle","props","children","announce","onTagLeft","current","onTagRight","onTagRemove","onDismiss","tagIndex","onInputKeydownTagHandler","key","useInput","_ref","value","defaultValue","onClick","onFocus","onChange","onBlur","onSubmit","onInput","onKeyDown","__DEV__","throwBladeError","message","moduleName","_React$useState","useState","_React$useState2","_slicedToArray","inputValue","setInputValue","handleOnFocus","useCallback","_ref2","name","_value","getPlatformType","_value$target$value","target","handleOnClick","_ref3","_value$currentTarget$","currentTarget","handleOnSubmit","_ref4","_value$target$value2","isReactNative","handleOnBlur","_ref5","_value$target$value3","handleOnChange","_ref6","_value$target$value4","handleOnInput","_ref7","_value$target$value5","handleOnKeyDown","_ref8","code","event","getHintType","_ref9","validationState","hasHelpText","getDescribedByElementId","_ref10","hasErrorText","hasSuccessText","errorTextId","successTextId","helpTextId","FocusRingWrapper","styled","BaseBox","_ref11","theme","currentInteraction","isTableInputCell","borderRadius","makeBorderSize","border","radius","none","medium","width","Object","assign","getFocusRingStyles","transitionDuration","castWebType","makeMotionTime","getIn","motion","duration","baseInputBorderBackgroundMotion","transitionTimingFunction","easing","_BaseInput","_ref12","ref","_ref12$as","as","label","_ref12$labelPosition","labelPosition","placeholder","_ref12$type","type","_ref12$showAllTags","showAllTags","_ref12$activeTagIndex","isDisabled","necessityIndicator","errorText","helpText","successText","isRequired","leadingIcon","prefix","trailingInteractionElement","leadingInteractionElement","suffix","trailingIcon","maxCharacters","textAlign","autoFocus","keyboardReturnKeyType","keyboardType","autoCompleteSuggestionType","trailingHeaderSlot","trailingFooterSlot","numberOfLines","id","componentName","accessibilityLabel","labelId","activeDescendant","hideLabelText","hideFormHint","hasPopup","popupId","isPopupExpanded","maxTagRows","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","autoCapitalize","setInputWrapperRef","testID","isDropdownTrigger","isLabelInsideInput","_ref12$size","size","trailingButton","_ref12$valueComponent","valueComponentType","_ref12$isTableInputCe","_ref12$showHintsAsToo","showHintsAsTooltip","styledProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","inputRef","mergedInputRef","useMergeRefs","inputWrapperRef","_useTags","_React$useState3","_React$useState4","showAllTagsWithAnimation","setShowAllTagsWithAnimation","_useInput","_useFormId","useFormId","inputId","_useBreakpoint","useBreakpoint","breakpoints","matchedDeviceType","isLabelLeftPositioned","_useInteraction","useInteraction","setCurrentInteraction","_isRequired","accessibilityProps","makeAccessible","required","Boolean","disabled","invalid","describedBy","expanded","undefined","controls","role","willRenderHintText","includes","join","isTextArea","_jsxs","metaAttribute","getStyledProps","display","flexDirection","justifyContent","alignItems","position","alignSelf","marginY","_jsx","FormLabel","htmlFor","BaseInputWrapper","refNode","_inputRef$current","focus","BaseInputVisuals","BaseInputTagSlot","renderAs","setFocusOnInput","_ref$current","labelPrefix","handleOnInputClick","e","StyledBaseInput","hasTags","$size","MetaConstants","marginLeft","makeSize","formHintLeftLabelMarginLeft","FormHint","BaseInputWithRef","forwardRef","BaseInput","assignWithoutSideEffects","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;y9BAmZA,IAAMA,gCAAgC,CAAG,CACvC,MAAM,CACN,IAAI,CACJ,MAAM,CACN,OAAO,CACP,UAAU,CACV,UAAU,CACV,aAAa,CACb,aAAa,CACb,WAAW,CACX,YAAY,CACZ,aAAa,CACb,kBAAkB,CAClB,eAAe,CACf,kBAAkB,CAClB,uBAAuB,CACvB,sBAAsB,CACvB,CAGD,IAAMC,OAAO,CAAG,SAAVA,OAAOA,CACXC,IAA4B,CAC5BC,cAAsB,CACtBC,iBAAoD,CAIjD,CACH,IAAMC,mBAAmB,CAAGC,cAAK,CAACC,MAAM,CAAS,CAAC,CAAC,CAEnDD,cAAK,CAACE,SAAS,CAAC,UAAM,CACpB,GAAIN,IAAI,EAAIC,cAAc,EAAI,CAAC,EAAIA,cAAc,CAAGD,IAAI,CAACO,MAAM,CAAE,CAAA,IAAAC,oBAAA,CAAAC,qBAAA,CAC/D,IAAMC,QAAQ,CAAAF,CAAAA,oBAAA,CAAGR,IAAI,CAACC,cAAc,CAAC,GAAAQ,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CAAAA,qBAAA,CAApBD,oBAAA,CAAsBG,KAAK,eAA3BF,qBAAA,CAA6BG,QAAQ,CACtD,GAAIF,QAAQ,CAAE,CACZG,QAAQ,CAAE,CAAQH,MAAAA,EAAAA,QAAS,MAAK,CAAC,CACnC,CACF,CAEF,CAAC,CAAE,CAACT,cAAc,CAAED,IA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AEA,kBAAmB,CACxC,CAAC,EACc,CAAC,CACH,CAAC,CACZ,CAAA,CAAC,CAETnB,YAAY,EAAImB,kBAAkB,CAAG,IAAI,CACxCqD,GAAA,CAACzI,OAAO,CAAA,CACN4J,UAAU,CAAEC,QAAQ,CAClBlD,qBAAqB,EAAI,CAAC3C,aAAa,CAAG8F,2BAA2B,CAAChF,IAAI,CAAC,CAAG,CAChF,CAAE,CAAAvJ,QAAA,CAEFwM,IAAA,CAAC/H,OAAO,CAAA,CACNkI,OAAO,CAAC,MAAM,CACdC,aAAa,CAAC,KAAK,CACnBC,cAAc,CAAET,kBAAkB,CAAG,eAAe,CAAG,UAAW,CAAApM,QAAA,EAElEkN,GAAA,CAACsB,QAAQ,CAAA,CACP7H,IAAI,CAAE/C,WAAW,CAAC,CAAEE,eAAe,CAAfA,eAAe,CAAEC,WAAW,CAAE6H,OAAO,CAAC1E,QAAQ,CAAE,CAAC,CAAE,CACvEA,QAAQ,CAAEA,QAAS,CACnBD,SAAS,CAAEA,SAAU,CACrBE,WAAW,CAAEA,WAAY,CACzB7C,UAAU,CAAEA,UAAW,CACvBF,WAAW,CAAEA,WAAY,CACzBC,aAAa,CAAEA,aAAc,CAC7BkF,IAAI,CAAEA,IAAK,CACZ,CAAC,CACDrB,kBAAkB,EAAlBA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,kBAAkB,CAAGtH,KAAK,EAALA,IAAAA,CAAAA,KAAK,CAAIiB,UAAU,CAAC,CACnC,CAAA,CAAC,CACH,CACV,GACM,CAAC,CAEd,CAAC,CAED,IAAM4M,gBAAgB,CAAGjP,cAAK,CAACkP,UAAU,CAACzI,UAAU,CAAC,CAC/C,IAAA0I,SAAS,CAAGC,wBAAwB,CAACH,gBAAgB,CAAE,CAAEI,WAAW,CAAE,WAAY,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"BaseInput.js","sources":["../../../../../../src/components/Input/BaseInput/BaseInput.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport type { ReactNode } from 'react';\nimport styled from 'styled-components';\nimport { StyledBaseInput } from './StyledBaseInput';\nimport { BaseInputVisuals } from './BaseInputVisuals';\nimport { BaseInputWrapper } from './BaseInputWrapper';\nimport { BaseInputTagSlot } from './BaseInputTagSlot';\nimport type { InputWrapperRef } from './types';\nimport { baseInputBorderBackgroundMotion, formHintLeftLabelMarginLeft } from './baseInputTokens';\nimport type {\n FormInputLabelProps,\n FormInputValidationProps,\n FormInputHandleOnEvent,\n FormInputOnEvent,\n FormHintProps,\n} from '~components/Form';\nimport { FormHint, FormLabel } from '~components/Form';\nimport type { IconComponent } from '~components/Icons';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport {\n castWebType,\n getPlatformType,\n isReactNative,\n makeBorderSize,\n makeMotionTime,\n useBreakpoint,\n} from '~utils';\nimport type { Platform } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useFormId } from '~components/Form/useFormId';\nimport { useTheme } from '~components/BladeProvider';\nimport useInteraction from '~utils/useInteraction';\nimport type { ActionStates } from '~utils/useInteraction';\nimport type {\n FormInputHandleOnClickEvent,\n FormInputHandleOnKeyDownEvent,\n} from '~components/Form/FormTypes';\nimport type { BladeElementRef, ContainerElementType, TestID } from '~utils/types';\nimport { makeSize } from '~utils/makeSize';\nimport type { AriaAttributes } from '~utils/makeAccessible';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\nimport { announce } from '~components/LiveAnnouncer/LiveAnnouncer';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { LinkProps } from '~components/Link';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\nimport getIn from '~utils/lodashButBetter/get';\nimport { useMergeRefs } from '~utils/useMergeRefs';\n\ntype CommonAutoCompleteSuggestionTypes =\n | 'none'\n | 'name'\n | 'email'\n | 'username'\n | 'password'\n | 'newPassword'\n | 'oneTimeCode'\n | 'telephone'\n | 'postalCode'\n | 'countryName'\n | 'creditCardNumber'\n | 'creditCardCSC'\n | 'creditCardExpiry'\n | 'creditCardExpiryMonth'\n | 'creditCardExpiryYear';\n\ntype WebAutoCompleteSuggestionType = CommonAutoCompleteSuggestionTypes | 'on';\n\ntype BaseInputCommonProps = FormInputLabelProps &\n FormInputValidationProps & {\n /**\n * Determines if it needs to be rendered as input, textarea or button\n */\n as?: 'input' | 'textarea' | 'button';\n /**\n * ID that will be used for accessibility\n */\n id: string;\n /**\n * Placeholder text to be displayed inside the input field\n */\n placeholder?: string;\n /**\n * Type of Input Field to be rendered.\n *\n * @default text\n */\n type?: 'text' | 'telephone' | 'email' | 'url' | 'number' | 'search' | 'password';\n /**\n * Used to set the default value of input field when it's uncontrolled\n */\n defaultValue?: string;\n /**\n * The name of the input field.\n *\n * Useful in form submissions\n */\n name?: string;\n /**\n * The callback function to be invoked when the input field gets focus\n */\n onFocus?: FormInputOnEvent;\n /**\n * The callback function to be invoked when the value of the input field changes\n */\n onChange?: FormInputOnEvent;\n /**\n * The callback function to be invoked when input is clicked\n */\n onClick?: FormInputOnEvent;\n /**\n * The callback function to be invoked when the value of the input field has any input\n */\n onInput?: FormInputOnEvent;\n /**\n * The callback function to be invoked whenever there is a keyDown event\n */\n onKeyDown?: FormInputHandleOnKeyDownEvent;\n /**\n * The callback function to be invoked when the the input field loses focus\n *\n * For React Native this will call `onEndEditing` event since we want to get the last value of the input field\n */\n onBlur?: FormInputOnEvent;\n /**\n * Ignores the blur event animation (Used in Select to ignore blur animation when item in option is clicked)\n */\n shouldIgnoreBlurAnimation?: boolean;\n /**\n * sets boolean that ignores the blur animations on baseinput\n */\n setShouldIgnoreBlurAnimation?: (shouldIgnoreBlurAnimation: boolean) => void;\n /**\n * Used to turn the input field to controlled so user can control the value\n */\n value?: string;\n /**\n * Used to disable the input field\n */\n isDisabled?: boolean;\n /**\n * If true, the input is marked as required, and `required` attribute will be added\n */\n isRequired?: boolean;\n /**\n * Icon to be shown at the start of the input field\n */\n leadingIcon?: IconComponent;\n /**\n * Prefix symbol to be displayed at the beginning of the input field. If leadingIcon is provided it'll be placed after it\n */\n prefix?: string;\n /**\n * Element to be rendered before suffix. This is decided by the component which is extending BaseInput\n *\n * eg: consumers can render a loader or they could render a clear button\n */\n trailingInteractionElement?: ReactNode;\n /**\n * Callback to be invoked when the TrailingInteractionElement is clicked\n */\n onTrailingInteractionElementClick?: () => void;\n /**\n * Element to be rendered before prefix. This is decided by the component which is extending BaseInput\n *\n * eg: consumers can render a country selector or button\n */\n leadingInteractionElement?: ReactNode;\n /**\n * Suffix symbol to be displayed at the end of the input field. If trailingIcon is provided it'll be placed before it\n */\n suffix?: string;\n /**\n * Icon to be displayed at the end of the input field\n */\n trailingIcon?: IconComponent;\n /**\n * Displays the character counter under the input field\n */\n maxCharacters?: number;\n /**\n * alignment of the text inside input field\n */\n textAlign?: 'left' | 'center' | 'right';\n /**\n * If true, focuses the input field on load\n *\n * **Note:**\n * Automatically focusing a form control can confuse visually-impaired people using screen-reading technology and people with cognitive impairments.\n * When autofocus is assigned, screen-readers \"teleport\" their user to the form control without warning them beforehand.\n */\n autoFocus?: boolean;\n /**\n * Hints the platform to display an appropriate virtual keyboard\n *\n * **Native:** Passes as is the `keyboardType` attribute\n *\n * **Web:** Passes the value to the `inputMode` attribute\n */\n keyboardType?: 'text' | 'search' | 'telephone' | 'email' | 'url' | 'decimal';\n /**\n * determines what return key to show on the keyboard of mobile devices/virtual keyboard\n * **Note**: Few values are platform dependent and might not render on all the platforms\n *\n * `default` is only available on native. it'll be mapped to `enter` for web\n * `previous` is only available on native android\n */\n keyboardReturnKeyType?: 'default' | 'go' | 'done' | 'next' | 'previous' | 'search' | 'send';\n /**\n * Element to be rendered on the trailing slot of input field label\n */\n trailingHeaderSlot?: (value?: string) => ReactNode;\n /**\n * Element to be rendered on the trailing slot of input field footer\n */\n trailingFooterSlot?: (value?: string) => ReactNode;\n /**\n * Sets the textarea's number of lines\n */\n numberOfLines?: 2 | 3 | 4 | 5;\n /**\n * Sets the accessibility label for the input\n */\n accessibilityLabel?: string;\n /**\n * Sets the id of the label\n *\n * (Useful when assigning one label to multiple elements using aria-labelledby)\n */\n labelId?: string;\n /**\n * Can be used in select to set the id of the active descendant from the listbox\n */\n activeDescendant?: string;\n /**\n * Hides the label text\n */\n hideLabelText?: boolean;\n /**\n * Hides the form hint text\n */\n hideFormHint?: boolean;\n /**\n * componentName prop sets the data-blade-component attribute name\n * for internal metric collection purposes\n */\n componentName?: string;\n /**\n * whether the input has a popup\n */\n hasPopup?: AriaAttributes['hasPopup'];\n /**\n * id of the popup\n */\n popupId?: string;\n /**\n * true if popup is in expanded state\n */\n isPopupExpanded?: boolean;\n setInputWrapperRef?: (node: ContainerElementType) => void;\n /**\n * sets the autocapitalize behavior for the input\n */\n autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters';\n\n /**\n * constraints the height of input to given number rows\n *\n * When set to expandable, input takes 1 row in the begining and expands to take 3 when active\n *\n * @default 'single'\n */\n maxTagRows?: 'single' | 'multiple' | 'expandable';\n\n /**\n * A slot for adding tags to input\n */\n tags?: React.ReactElement[] | null;\n\n /**\n * Disables stripping of tags and shows all tags\n */\n showAllTags?: boolean;\n\n /**\n * State variable of active tag index\n */\n activeTagIndex?: number;\n\n /**\n * Is this input SelectInput or AutoComplete\n */\n isDropdownTrigger?: boolean;\n\n /**\n * Is the label expected to be rendered inside input?\n * Used in AutoComplete and Select when label can't exist outside\n *\n */\n isLabelInsideInput?: boolean;\n\n /**\n * State setter for active tag index\n */\n setActiveTagIndex?: (activeTagIndex: number) => void;\n /**\n * Sets the size of the input field\n * @default medium\n */\n size?: 'medium' | 'large';\n /**\n * Link button to be rendered at the end of the input field.\n * **Note:** `size` of the Link will be set to the same size as the input field, `isDisabled` will follow Input's `isDisabled`, & `variant` will be set to `button`.\n * Example:\n * ```tsx\n * trailingButton={<Link onClick={handleClick}>Apply</Link>}\n * ```\n */\n trailingButton?: React.ReactElement<LinkProps>;\n /**\n * Whether to use Text or Heading component for Input text\n * @default text\n **/\n valueComponentType?: 'text' | 'heading';\n /**\n * Whether to render the input as a table cell\n * @default true\n **/\n isTableInputCell?: boolean;\n /**\n * Hides the form hints and shows them as tooltip of trailing\n */\n showHintsAsTooltip?: boolean;\n } & TestID &\n Platform.Select<{\n native: {\n /**\n * The callback function to be invoked when the value of the input field is submitted.\n */\n onSubmit?: FormInputOnEvent;\n /**\n * determines what autoComplete suggestion type to show\n *\n * Internally it'll render platform specific attributes:\n *\n * - web: `autocomplete`\n * - iOS: `textContentType`\n * - android: `autoComplete`\n *\n */\n autoCompleteSuggestionType?: CommonAutoCompleteSuggestionTypes;\n };\n web: {\n /**\n * This is a react-native only prop and has no effect on web.\n */\n onSubmit?: undefined;\n /**\n * determines what autoComplete suggestion type to show\n *\n * Internally it'll render platform specific attributes:\n *\n * - web: `autocomplete`\n * - iOS: `textContentType`\n * - android: `autoComplete`\n *\n */\n autoCompleteSuggestionType?: WebAutoCompleteSuggestionType;\n };\n }> &\n StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype BaseInputPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype BaseInputPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\nexport type BaseInputProps = (BaseInputPropsWithA11yLabel | BaseInputPropsWithLabel) &\n BaseInputCommonProps;\n\nconst autoCompleteSuggestionTypeValues = [\n 'none',\n 'on',\n 'name',\n 'email',\n 'username',\n 'password',\n 'newPassword',\n 'oneTimeCode',\n 'telephone',\n 'postalCode',\n 'countryName',\n 'creditCardNumber',\n 'creditCardCSC',\n 'creditCardExpiry',\n 'creditCardExpiryMonth',\n 'creditCardExpiryYear',\n];\n\ntype OnInputKeydownTagHandlerType = (key: string | undefined) => void;\nconst useTags = (\n tags: BaseInputProps['tags'],\n activeTagIndex: number,\n setActiveTagIndex?: (activeTagIndex: number) => void,\n): {\n onInputKeydownTagHandler: OnInputKeydownTagHandlerType;\n visibleTagsCountRef: React.MutableRefObject<number>;\n} => {\n const visibleTagsCountRef = React.useRef<number>(0);\n\n React.useEffect(() => {\n if (tags && activeTagIndex >= 0 && activeTagIndex < tags.length) {\n const tagTitle = tags[activeTagIndex]?.props?.children;\n if (tagTitle) {\n announce(`Close ${tagTitle} Tag`);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeTagIndex, tags?.length]);\n\n const onTagLeft = (): void => {\n if (activeTagIndex < 0) {\n setActiveTagIndex?.(visibleTagsCountRef.current - 1);\n }\n\n if (activeTagIndex > 0) {\n setActiveTagIndex?.(activeTagIndex - 1);\n }\n };\n\n const onTagRight = (): void => {\n if (activeTagIndex < visibleTagsCountRef.current - 1) {\n setActiveTagIndex?.(activeTagIndex + 1);\n }\n };\n\n const onTagRemove = (): void => {\n if (activeTagIndex >= 0 && activeTagIndex < visibleTagsCountRef.current && tags) {\n tags[activeTagIndex].props.onDismiss({ tagIndex: activeTagIndex });\n }\n };\n\n const onInputKeydownTagHandler: OnInputKeydownTagHandlerType = (key) => {\n if (tags && tags.length > 0) {\n if (key === 'ArrowRight') {\n onTagRight();\n }\n\n if (key === 'ArrowLeft') {\n onTagLeft();\n }\n\n if (key === 'Backspace') {\n onTagRemove();\n }\n }\n };\n\n return {\n onInputKeydownTagHandler,\n visibleTagsCountRef,\n };\n};\n\nconst useInput = ({\n value,\n defaultValue,\n onClick,\n onFocus,\n onChange,\n onBlur,\n onSubmit,\n onInput,\n onKeyDown,\n onInputKeydownTagHandler,\n}: Pick<\n BaseInputProps,\n | 'value'\n | 'defaultValue'\n | 'onFocus'\n | 'onChange'\n | 'onBlur'\n | 'onInput'\n | 'onKeyDown'\n | 'onClick'\n | 'onSubmit'\n> & {\n onInputKeydownTagHandler: OnInputKeydownTagHandlerType;\n}): {\n handleOnFocus: FormInputHandleOnEvent;\n handleOnClick: FormInputHandleOnClickEvent;\n handleOnChange: FormInputHandleOnEvent;\n handleOnBlur: FormInputHandleOnEvent;\n handleOnSubmit: FormInputHandleOnEvent;\n handleOnInput: FormInputHandleOnEvent;\n handleOnKeyDown: FormInputHandleOnKeyDownEvent;\n inputValue?: string;\n} => {\n if (__DEV__) {\n if (value && defaultValue) {\n throwBladeError({\n message: `Either 'value' or 'defaultValue' shall be passed. This decides if the input field is controlled or uncontrolled`,\n moduleName: 'Input',\n });\n }\n }\n\n const [inputValue, setInputValue] = React.useState(defaultValue ?? value);\n\n const handleOnFocus: FormInputHandleOnEvent = React.useCallback(\n ({ name, value }) => {\n let _value = '';\n\n if (getPlatformType() === 'react-native' && typeof value === 'string') {\n _value = value;\n } else if (typeof value !== 'string') {\n // Could have just done \"getPlatformType() === 'react-native' ? value : value?.target.value\" but TS doesn't understands that\n _value = value?.target.value ?? '';\n }\n\n onFocus?.({\n name,\n value: _value,\n });\n },\n [onFocus],\n );\n\n const handleOnClick: FormInputHandleOnClickEvent = React.useCallback(\n ({ name, value }) => {\n let _value = '';\n\n if (getPlatformType() === 'react-native' && typeof value === 'string') {\n _value = value;\n } else if (typeof value !== 'string') {\n // Could have just done \"getPlatformType() === 'react-native' ? value : value?.target.value\" but TS doesn't understands that\n _value = value?.currentTarget.value ?? '';\n }\n\n onClick?.({\n name,\n value: _value,\n });\n },\n [onClick],\n );\n\n const handleOnSubmit: FormInputHandleOnEvent = React.useCallback(\n ({ name, value }) => {\n let _value = '';\n\n if (getPlatformType() === 'react-native' && typeof value === 'string') {\n _value = value;\n } else if (typeof value !== 'string') {\n // Could have just done \"getPlatformType() === 'react-native' ? value : value?.target.value\" but TS doesn't understands that\n _value = value?.target.value ?? '';\n }\n if (isReactNative()) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error\n //@ts-ignore need to ignore this since it will throw a TS error for web but not for native\n onSubmit?.({\n name,\n value: _value,\n });\n }\n },\n [onSubmit],\n );\n\n const handleOnBlur: FormInputHandleOnEvent = React.useCallback(\n ({ name, value }) => {\n let _value = '';\n if (getPlatformType() === 'react-native' && typeof value == 'string') {\n _value = value;\n } else if (typeof value !== 'string') {\n // Could have just done \"getPlatformType() === 'react-native' ? value : value?.target.value\" but TS doesn't understands that\n _value = value?.target.value ?? '';\n }\n\n onBlur?.({\n name,\n value: _value,\n });\n },\n [onBlur],\n );\n\n const handleOnChange: FormInputHandleOnEvent = React.useCallback(\n ({ name, value }) => {\n let _value = '';\n\n if (getPlatformType() === 'react-native' && typeof value === 'string') {\n _value = value;\n } else if (typeof value !== 'string') {\n // Could have just done \"getPlatformType() === 'react-native' ? value : value?.target.value\" but TS doesn't understands that\n _value = value?.target.value ?? '';\n }\n\n onChange?.({\n name,\n value: _value,\n });\n setInputValue(_value);\n },\n [onChange],\n );\n\n const handleOnInput: FormInputHandleOnEvent = React.useCallback(\n ({ name, value }) => {\n let _value = '';\n if (getPlatformType() === 'react-native' && typeof value == 'string') {\n _value = value;\n } else if (typeof value !== 'string') {\n // Could have just done \"getPlatformType() === 'react-native' ? value : value?.target.value\" but TS doesn't understands that\n _value = value?.target.value ?? '';\n }\n\n onInput?.({\n name,\n value: _value,\n });\n },\n [onInput],\n );\n\n const handleOnKeyDown: FormInputHandleOnKeyDownEvent = React.useCallback(\n ({ name, key, code, event }) => {\n onInputKeydownTagHandler(key);\n onKeyDown?.({\n name,\n key,\n code,\n event,\n });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [onKeyDown],\n );\n\n return {\n handleOnFocus,\n handleOnClick,\n handleOnChange,\n handleOnBlur,\n handleOnSubmit,\n handleOnInput,\n handleOnKeyDown,\n inputValue,\n };\n};\n\nexport const getHintType = ({\n validationState,\n hasHelpText,\n}: {\n validationState: BaseInputProps['validationState'];\n hasHelpText: boolean;\n}): FormHintProps['type'] => {\n if (validationState === 'error') {\n return 'error';\n }\n\n if (validationState === 'success') {\n return 'success';\n }\n\n if (hasHelpText) {\n return 'help';\n }\n\n return 'help';\n};\n\nconst getDescribedByElementId = ({\n validationState,\n hasErrorText,\n hasSuccessText,\n hasHelpText,\n errorTextId,\n successTextId,\n helpTextId,\n}: {\n validationState: BaseInputProps['validationState'];\n hasErrorText: boolean;\n hasSuccessText: boolean;\n hasHelpText: boolean;\n errorTextId: string;\n successTextId: string;\n helpTextId: string;\n}): string => {\n if (validationState === 'error' && hasErrorText) {\n return errorTextId;\n }\n\n if (validationState === 'success' && hasSuccessText) {\n return successTextId;\n }\n\n if (hasHelpText) {\n return helpTextId;\n }\n\n return '';\n};\n\nconst FocusRingWrapper = styled(BaseBox)<{\n currentInteraction: ActionStates;\n isTableInputCell: NonNullable<BaseInputProps['isTableInputCell']>;\n}>(({ theme, currentInteraction, isTableInputCell }) => ({\n borderRadius: makeBorderSize(\n isTableInputCell ? theme.border.radius.none : theme.border.radius.medium,\n ),\n width: '100%',\n '&:focus-within': !isTableInputCell\n ? {\n ...getFocusRingStyles({\n theme,\n }),\n transitionDuration: castWebType(\n makeMotionTime(\n getIn(\n theme.motion.duration,\n baseInputBorderBackgroundMotion[currentInteraction === 'focus' ? 'enter' : 'exit']\n .duration,\n ),\n ),\n ),\n transitionTimingFunction: castWebType(\n getIn(\n theme.motion.easing,\n baseInputBorderBackgroundMotion[currentInteraction === 'focus' ? 'enter' : 'exit']\n .easing,\n ),\n ),\n }\n : {},\n}));\n\nconst _BaseInput: React.ForwardRefRenderFunction<BladeElementRef, BaseInputProps> = (\n {\n as = 'input',\n label,\n labelPosition = 'top',\n placeholder,\n type = 'text',\n defaultValue,\n tags,\n showAllTags = false,\n activeTagIndex = -1,\n setActiveTagIndex,\n name,\n value,\n onFocus,\n onChange,\n onInput,\n onBlur,\n onSubmit,\n onClick,\n onKeyDown,\n isDisabled,\n necessityIndicator,\n validationState,\n errorText,\n helpText,\n successText,\n isRequired,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n onTrailingInteractionElementClick,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n maxCharacters,\n textAlign,\n autoFocus,\n keyboardReturnKeyType,\n keyboardType,\n autoCompleteSuggestionType,\n trailingHeaderSlot,\n trailingFooterSlot,\n numberOfLines,\n id,\n componentName,\n accessibilityLabel,\n labelId,\n activeDescendant,\n hideLabelText,\n hideFormHint,\n hasPopup,\n popupId,\n isPopupExpanded,\n maxTagRows,\n shouldIgnoreBlurAnimation,\n setShouldIgnoreBlurAnimation,\n autoCapitalize,\n setInputWrapperRef,\n testID,\n isDropdownTrigger,\n isLabelInsideInput,\n size = 'medium',\n trailingButton,\n valueComponentType = 'text',\n isTableInputCell = false,\n showHintsAsTooltip = false,\n ...styledProps\n },\n ref,\n) => {\n const { theme } = useTheme();\n const inputRef = React.useRef<BladeElementRef>(null);\n const mergedInputRef = useMergeRefs(ref, inputRef);\n const inputWrapperRef: InputWrapperRef = React.useRef(null);\n const { onInputKeydownTagHandler, visibleTagsCountRef } = useTags(\n tags,\n activeTagIndex,\n setActiveTagIndex,\n );\n const [showAllTagsWithAnimation, setShowAllTagsWithAnimation] = React.useState(false);\n const isReactNative = getPlatformType() === 'react-native';\n\n React.useEffect(() => {\n if (showAllTags) {\n setShowAllTagsWithAnimation(true);\n } else if (maxTagRows !== 'expandable') {\n setShowAllTagsWithAnimation(false);\n }\n }, [showAllTags, maxTagRows]);\n\n const {\n handleOnFocus,\n handleOnChange,\n handleOnClick,\n handleOnBlur,\n handleOnSubmit,\n handleOnInput,\n handleOnKeyDown,\n inputValue,\n } = useInput({\n defaultValue,\n value,\n onFocus,\n onClick,\n onChange,\n onBlur,\n onSubmit,\n onInput,\n onKeyDown,\n onInputKeydownTagHandler,\n });\n const { inputId, helpTextId, errorTextId, successTextId } = useFormId(id);\n const { matchedDeviceType } = useBreakpoint({ breakpoints: theme.breakpoints });\n const isLabelLeftPositioned = labelPosition === 'left' && matchedDeviceType === 'desktop';\n const { currentInteraction, setCurrentInteraction } = useInteraction();\n const _isRequired = isRequired || necessityIndicator === 'required';\n\n const accessibilityProps = makeAccessible({\n required: Boolean(_isRequired),\n disabled: Boolean(isDisabled),\n invalid: Boolean(validationState === 'error'),\n describedBy: getDescribedByElementId({\n validationState,\n hasErrorText: Boolean(errorText),\n hasSuccessText: Boolean(successText),\n hasHelpText: Boolean(helpText),\n errorTextId,\n successTextId,\n helpTextId,\n }),\n label: accessibilityLabel,\n hasPopup,\n expanded: hasPopup ? isPopupExpanded : undefined,\n controls: hasPopup ? popupId : undefined,\n role: hasPopup ? 'combobox' : undefined,\n activeDescendant,\n });\n\n const willRenderHintText = Boolean(helpText) || Boolean(successText) || Boolean(errorText);\n\n if (__DEV__) {\n if (\n autoCompleteSuggestionType &&\n !autoCompleteSuggestionTypeValues.includes(autoCompleteSuggestionType)\n ) {\n throwBladeError({\n message: `Expected autoCompleteSuggestionType to be one of ${autoCompleteSuggestionTypeValues.join(\n ', ',\n )} but received ${autoCompleteSuggestionType}`,\n moduleName: 'Input',\n });\n }\n }\n\n const isTextArea = as === 'textarea';\n return (\n <BaseBox {...metaAttribute({ name: componentName, testID })} {...getStyledProps(styledProps)}>\n <BaseBox\n display=\"flex\"\n flexDirection={isLabelLeftPositioned ? 'row' : 'column'}\n justifyContent={isLabelLeftPositioned ? 'center' : undefined}\n alignItems={isLabelLeftPositioned ? 'center' : undefined}\n position=\"relative\"\n width=\"100%\"\n >\n {!hideLabelText && !isLabelInsideInput && label && (\n <BaseBox\n display=\"flex\"\n flexDirection={isLabelLeftPositioned ? 'column' : 'row'}\n justifyContent=\"space-between\"\n alignSelf={isTextArea ? 'flex-start' : undefined}\n marginY={isTextArea && isLabelLeftPositioned ? 'spacing.3' : 'spacing.0'}\n >\n <FormLabel\n as=\"label\"\n necessityIndicator={necessityIndicator}\n position={labelPosition}\n id={labelId}\n htmlFor={inputId}\n size={size}\n >\n {label}\n </FormLabel>\n {trailingHeaderSlot?.(value ?? inputValue)}\n </BaseBox>\n )}\n <FocusRingWrapper\n currentInteraction={currentInteraction}\n isTableInputCell={isTableInputCell}\n >\n <BaseInputWrapper\n isDropdownTrigger={isDropdownTrigger}\n isTextArea={isTextArea}\n isDisabled={isDisabled}\n validationState={validationState}\n currentInteraction={currentInteraction}\n isLabelLeftPositioned={isLabelLeftPositioned}\n showAllTags={showAllTags}\n setShowAllTagsWithAnimation={setShowAllTagsWithAnimation}\n ref={(refNode) => {\n if (refNode) {\n setInputWrapperRef?.(refNode);\n inputWrapperRef.current = refNode;\n }\n }}\n maxTagRows={maxTagRows}\n size={size}\n numberOfLines={numberOfLines}\n onClick={() => {\n if (!isReactNative) {\n inputRef.current?.focus();\n }\n }}\n isTableInputCell={isTableInputCell}\n >\n <BaseInputVisuals\n size={size}\n leadingIcon={leadingIcon}\n prefix={prefix}\n isDisabled={isDisabled}\n leadingInteractionElement={leadingInteractionElement}\n />\n <BaseInputTagSlot\n renderAs={as}\n tags={tags}\n isDisabled={isDisabled}\n showAllTags={showAllTagsWithAnimation}\n setFocusOnInput={() => {\n if (ref && !isReactNative && 'current' in ref) {\n ref.current?.focus();\n }\n }}\n labelPrefix={isLabelInsideInput ? label : undefined}\n isDropdownTrigger={isDropdownTrigger}\n visibleTagsCountRef={visibleTagsCountRef}\n handleOnInputClick={(e) => {\n handleOnClick({ name, value: isReactNative ? value : e });\n }}\n setShouldIgnoreBlurAnimation={setShouldIgnoreBlurAnimation}\n maxTagRows={maxTagRows}\n inputWrapperRef={inputWrapperRef}\n size={size}\n numberOfLines={numberOfLines}\n isTextArea={isTextArea}\n >\n <StyledBaseInput\n as={as}\n id={inputId}\n ref={mergedInputRef as any}\n name={name}\n type={type}\n defaultValue={defaultValue}\n value={value}\n placeholder={placeholder}\n isDisabled={isDisabled}\n validationState={validationState}\n isRequired={_isRequired}\n handleOnFocus={handleOnFocus}\n handleOnChange={handleOnChange}\n handleOnBlur={handleOnBlur}\n handleOnSubmit={handleOnSubmit}\n handleOnInput={handleOnInput}\n handleOnKeyDown={handleOnKeyDown}\n handleOnClick={handleOnClick}\n leadingIcon={leadingIcon}\n prefix={prefix}\n trailingInteractionElement={trailingInteractionElement}\n leadingInteractionElement={leadingInteractionElement}\n suffix={suffix}\n trailingIcon={trailingIcon}\n maxCharacters={maxCharacters}\n textAlign={textAlign}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n keyboardReturnKeyType={keyboardReturnKeyType}\n keyboardType={keyboardType}\n autoCompleteSuggestionType={autoCompleteSuggestionType}\n accessibilityProps={accessibilityProps}\n currentInteraction={currentInteraction}\n setCurrentInteraction={setCurrentInteraction}\n numberOfLines={numberOfLines}\n isTextArea={isTextArea || maxTagRows === 'multiple' || maxTagRows === 'expandable'}\n hasPopup={hasPopup}\n hasTags={!!(tags && tags.length > 0)}\n shouldIgnoreBlurAnimation={shouldIgnoreBlurAnimation}\n autoCapitalize={autoCapitalize}\n isDropdownTrigger={isDropdownTrigger}\n $size={size}\n valueComponentType={valueComponentType}\n isTableInputCell={isTableInputCell}\n {...metaAttribute({ name: MetaConstants.StyledBaseInput })}\n />\n </BaseInputTagSlot>\n <BaseInputVisuals\n trailingInteractionElement={trailingInteractionElement}\n onTrailingInteractionElementClick={onTrailingInteractionElementClick}\n suffix={suffix}\n trailingIcon={trailingIcon}\n isDisabled={isDisabled}\n validationState={validationState}\n trailingButton={trailingButton}\n size={size}\n errorText={errorText}\n successText={successText}\n showHintsAsTooltip={showHintsAsTooltip}\n />\n </BaseInputWrapper>\n </FocusRingWrapper>\n </BaseBox>\n\n {hideFormHint || showHintsAsTooltip ? null : (\n <BaseBox\n marginLeft={makeSize(\n isLabelLeftPositioned && !hideLabelText ? formHintLeftLabelMarginLeft[size] : 0,\n )}\n >\n <BaseBox\n display=\"flex\"\n flexDirection=\"row\"\n justifyContent={willRenderHintText ? 'space-between' : 'flex-end'}\n >\n <FormHint\n type={getHintType({ validationState, hasHelpText: Boolean(helpText) })}\n helpText={helpText}\n errorText={errorText}\n successText={successText}\n helpTextId={helpTextId}\n errorTextId={errorTextId}\n successTextId={successTextId}\n size={size}\n />\n {trailingFooterSlot?.(value ?? inputValue)}\n </BaseBox>\n </BaseBox>\n )}\n </BaseBox>\n );\n};\n\nconst BaseInputWithRef = React.forwardRef(_BaseInput);\nconst BaseInput = assignWithoutSideEffects(BaseInputWithRef, { displayName: 'BaseInput' });\n\nexport { BaseInput };\n"],"names":["autoCompleteSuggestionTypeValues","useTags","tags","activeTagIndex","setActiveTagIndex","visibleTagsCountRef","React","useRef","useEffect","length","_tags$activeTagIndex","_tags$activeTagIndex$","tagTitle","props","children","announce","onTagLeft","current","onTagRight","onTagRemove","onDismiss","tagIndex","onInputKeydownTagHandler","key","useInput","_ref","value","defaultValue","onClick","onFocus","onChange","onBlur","onSubmit","onInput","onKeyDown","__DEV__","throwBladeError","message","moduleName","_React$useState","useState","_React$useState2","_slicedToArray","inputValue","setInputValue","handleOnFocus","useCallback","_ref2","name","_value","getPlatformType","_value$target$value","target","handleOnClick","_ref3","_value$currentTarget$","currentTarget","handleOnSubmit","_ref4","_value$target$value2","isReactNative","handleOnBlur","_ref5","_value$target$value3","handleOnChange","_ref6","_value$target$value4","handleOnInput","_ref7","_value$target$value5","handleOnKeyDown","_ref8","code","event","getHintType","_ref9","validationState","hasHelpText","getDescribedByElementId","_ref10","hasErrorText","hasSuccessText","errorTextId","successTextId","helpTextId","FocusRingWrapper","styled","BaseBox","_ref11","theme","currentInteraction","isTableInputCell","borderRadius","makeBorderSize","border","radius","none","medium","width","Object","assign","getFocusRingStyles","transitionDuration","castWebType","makeMotionTime","getIn","motion","duration","baseInputBorderBackgroundMotion","transitionTimingFunction","easing","_BaseInput","_ref12","ref","_ref12$as","as","label","_ref12$labelPosition","labelPosition","placeholder","_ref12$type","type","_ref12$showAllTags","showAllTags","_ref12$activeTagIndex","isDisabled","necessityIndicator","errorText","helpText","successText","isRequired","leadingIcon","prefix","trailingInteractionElement","onTrailingInteractionElementClick","leadingInteractionElement","suffix","trailingIcon","maxCharacters","textAlign","autoFocus","keyboardReturnKeyType","keyboardType","autoCompleteSuggestionType","trailingHeaderSlot","trailingFooterSlot","numberOfLines","id","componentName","accessibilityLabel","labelId","activeDescendant","hideLabelText","hideFormHint","hasPopup","popupId","isPopupExpanded","maxTagRows","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","autoCapitalize","setInputWrapperRef","testID","isDropdownTrigger","isLabelInsideInput","_ref12$size","size","trailingButton","_ref12$valueComponent","valueComponentType","_ref12$isTableInputCe","_ref12$showHintsAsToo","showHintsAsTooltip","styledProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","inputRef","mergedInputRef","useMergeRefs","inputWrapperRef","_useTags","_React$useState3","_React$useState4","showAllTagsWithAnimation","setShowAllTagsWithAnimation","_useInput","_useFormId","useFormId","inputId","_useBreakpoint","useBreakpoint","breakpoints","matchedDeviceType","isLabelLeftPositioned","_useInteraction","useInteraction","setCurrentInteraction","_isRequired","accessibilityProps","makeAccessible","required","Boolean","disabled","invalid","describedBy","expanded","undefined","controls","role","willRenderHintText","includes","join","isTextArea","_jsxs","metaAttribute","getStyledProps","display","flexDirection","justifyContent","alignItems","position","alignSelf","marginY","_jsx","FormLabel","htmlFor","BaseInputWrapper","refNode","_inputRef$current","focus","BaseInputVisuals","BaseInputTagSlot","renderAs","setFocusOnInput","_ref$current","labelPrefix","handleOnInputClick","e","StyledBaseInput","hasTags","$size","MetaConstants","marginLeft","makeSize","formHintLeftLabelMarginLeft","FormHint","BaseInputWithRef","forwardRef","BaseInput","assignWithoutSideEffects","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6/BAsZA,IAAMA,gCAAgC,CAAG,CACvC,MAAM,CACN,IAAI,CACJ,MAAM,CACN,OAAO,CACP,UAAU,CACV,UAAU,CACV,aAAa,CACb,aAAa,CACb,WAAW,CACX,YAAY,CACZ,aAAa,CACb,kB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qD,GAAA,CAAC1I,OAAO,CAAA,CACN6J,UAAU,CAAEC,QAAQ,CAClBlD,qBAAqB,EAAI,CAAC3C,aAAa,CAAG8F,2BAA2B,CAAChF,IAAI,CAAC,CAAG,CAChF,CAAE,CAAAxJ,QAAA,CAEFyM,IAAA,CAAChI,OAAO,CAAA,CACNmI,OAAO,CAAC,MAAM,CACdC,aAAa,CAAC,KAAK,CACnBC,cAAc,CAAET,kBAAkB,CAAG,eAAe,CAAG,UAAW,CAAArM,QAAA,EAElEmN,GAAA,CAACsB,QAAQ,CAAA,CACP9H,IAAI,CAAE/C,WAAW,CAAC,CAAEE,eAAe,CAAfA,eAAe,CAAEC,WAAW,CAAE8H,OAAO,CAAC3E,QAAQ,CAAE,CAAC,CAAE,CACvEA,QAAQ,CAAEA,QAAS,CACnBD,SAAS,CAAEA,SAAU,CACrBE,WAAW,CAAEA,WAAY,CACzB7C,UAAU,CAAEA,UAAW,CACvBF,WAAW,CAAEA,WAAY,CACzBC,aAAa,CAAEA,aAAc,CAC7BmF,IAAI,CAAEA,IAAK,CACZ,CAAC,CACDrB,kBAAkB,EAAlBA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,kBAAkB,CAAGvH,KAAK,EAALA,IAAAA,CAAAA,KAAK,CAAIiB,UAAU,CAAC,CACnC,CAAA,CAAC,CACH,CACV,GACM,CAAC,CAEd,CAAC,CAED,IAAM6M,gBAAgB,CAAGlP,cAAK,CAACmP,UAAU,CAAC1I,UAAU,CAAC,CAC/C,IAAA2I,SAAS,CAAGC,wBAAwB,CAACH,gBAAgB,CAAE,CAAEI,WAAW,CAAE,WAAY,CAAC;;;;"}
|
|
@@ -7,6 +7,7 @@ import '@babel/runtime/helpers/slicedToArray';
|
|
|
7
7
|
import 'react-native';
|
|
8
8
|
import '../../../tokens/global/typography.js';
|
|
9
9
|
import '../../../tokens/global/motion.js';
|
|
10
|
+
import { isReactNative } from '../../../utils/platform/isReactNative.js';
|
|
10
11
|
import '../../BladeProvider/useTheme.js';
|
|
11
12
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
12
13
|
import { Text } from '../../Typography/Text/Text.js';
|
|
@@ -16,7 +17,7 @@ import { Tooltip } from '../../Tooltip/Tooltip.native.js';
|
|
|
16
17
|
import '../../Tooltip/TooltipInteractiveWrapper.native.js';
|
|
17
18
|
import { Box } from '../../Box/Box.js';
|
|
18
19
|
|
|
19
|
-
var getVisualContainerStyles=function getVisualContainerStyles(){return {display:'flex',flexDirection:'row',alignItems:'center',alignSelf:'center'};};var trailingIconColor={none:'surface.icon.gray.subtle',error:'feedback.icon.negative.intense',success:'feedback.icon.positive.intense'};var iconSize={medium:'medium',large:'large'};var textSize={medium:'medium',large:'large'};var getPrefixStyles=function getPrefixStyles(
|
|
20
|
+
var getVisualContainerStyles=function getVisualContainerStyles(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},shouldStretchTrailingBox=_ref.shouldStretchTrailingBox;return {display:'flex',flexDirection:'row',alignItems:'center',alignSelf:shouldStretchTrailingBox?'stretch':'center'};};var trailingIconColor={none:'surface.icon.gray.subtle',error:'feedback.icon.negative.intense',success:'feedback.icon.positive.intense'};var iconSize={medium:'medium',large:'large'};var textSize={medium:'medium',large:'large'};var getPrefixStyles=function getPrefixStyles(_ref2){var hasLeadingIcon=_ref2.hasLeadingIcon,hasPrefix=_ref2.hasPrefix;if(hasPrefix&&hasLeadingIcon){return {paddingLeft:'spacing.3'};}if(hasPrefix&&!hasLeadingIcon){return {paddingLeft:'spacing.4'};}return {paddingLeft:'spacing.0'};};var getInteractionElementStyles=function getInteractionElementStyles(_ref3){var hasTrailingIcon=_ref3.hasTrailingIcon,hasLeadingInteractionElement=_ref3.hasLeadingInteractionElement,hasTrailingInteractionElement=_ref3.hasTrailingInteractionElement,hasSuffix=_ref3.hasSuffix,hasTrailingButton=_ref3.hasTrailingButton;if(hasTrailingInteractionElement&&(hasSuffix||hasTrailingIcon||hasTrailingButton)){return 'spacing.2';}if(hasTrailingInteractionElement&&!hasSuffix&&!hasTrailingIcon&&!hasTrailingButton){return 'spacing.4';}if(hasLeadingInteractionElement){return 'spacing.3';}return 'spacing.0';};var getSuffixStyles=function getSuffixStyles(_ref4){var hasTrailingIcon=_ref4.hasTrailingIcon,hasSuffix=_ref4.hasSuffix,hasTrailingButton=_ref4.hasTrailingButton;if(hasSuffix&&(hasTrailingIcon||hasTrailingButton)){return {paddingRight:'spacing.3'};}if(hasSuffix&&!hasTrailingIcon&&!hasTrailingButton){return {paddingRight:'spacing.4'};}return {paddingRight:'spacing.0'};};var getTrailingIconStyles=function getTrailingIconStyles(_ref5){var hasTrailingIcon=_ref5.hasTrailingIcon,hasTrailingButton=_ref5.hasTrailingButton;if(hasTrailingIcon&&hasTrailingButton){return {paddingRight:'spacing.3'};}if(hasTrailingIcon&&!hasTrailingButton){return {paddingRight:'spacing.4'};}return {paddingRight:'spacing.0'};};var getInputVisualsToBeRendered=function getInputVisualsToBeRendered(_ref6){var leadingIcon=_ref6.leadingIcon,prefix=_ref6.prefix,trailingInteractionElement=_ref6.trailingInteractionElement,leadingInteractionElement=_ref6.leadingInteractionElement,suffix=_ref6.suffix,trailingIcon=_ref6.trailingIcon,trailingButton=_ref6.trailingButton;return {hasLeadingIcon:Boolean(leadingIcon),hasPrefix:Boolean(prefix),hasTrailingInteractionElement:Boolean(trailingInteractionElement),hasLeadingInteractionElement:Boolean(leadingInteractionElement),hasSuffix:Boolean(suffix),hasTrailingIcon:Boolean(trailingIcon),hasTrailingButton:Boolean(trailingButton)};};var getTooltipContent=function getTooltipContent(_ref7){var validationState=_ref7.validationState,errorText=_ref7.errorText,successText=_ref7.successText;if(validationState==='error'&&errorText){return errorText;}if(validationState==='success'&&successText){return successText;}return '';};var ValidationIconTooltip=function ValidationIconTooltip(_ref8){var children=_ref8.children,validationState=_ref8.validationState,errorText=_ref8.errorText,successText=_ref8.successText,showHintsAsTooltip=_ref8.showHintsAsTooltip;if(showHintsAsTooltip&&validationState==='error'&&errorText||validationState==='success'&&successText){return jsx(Tooltip,{content:getTooltipContent({validationState:validationState,errorText:errorText,successText:successText}),children:jsx(Box,{display:"flex",justifyContent:"center",alignItems:"center",children:children})});}return children;};var BaseInputVisuals=function BaseInputVisuals(_ref9){var LeadingIcon=_ref9.leadingIcon,prefix=_ref9.prefix,trailingInteractionElement=_ref9.trailingInteractionElement,onTrailingInteractionElementClick=_ref9.onTrailingInteractionElementClick,leadingInteractionElement=_ref9.leadingInteractionElement,suffix=_ref9.suffix,TrailingIcon=_ref9.trailingIcon,isDisabled=_ref9.isDisabled,_ref9$validationState=_ref9.validationState,validationState=_ref9$validationState===void 0?'none':_ref9$validationState,size=_ref9.size,showHintsAsTooltip=_ref9.showHintsAsTooltip,errorText=_ref9.errorText,successText=_ref9.successText,TrailingButton=_ref9.trailingButton;var _getInputVisualsToBeR=getInputVisualsToBeRendered({leadingIcon:LeadingIcon,prefix:prefix,leadingInteractionElement:leadingInteractionElement,trailingInteractionElement:trailingInteractionElement,suffix:suffix,trailingIcon:TrailingIcon,trailingButton:TrailingButton,size:size}),hasLeadingIcon=_getInputVisualsToBeR.hasLeadingIcon,hasPrefix=_getInputVisualsToBeR.hasPrefix,hasSuffix=_getInputVisualsToBeR.hasSuffix,hasTrailingInteractionElement=_getInputVisualsToBeR.hasTrailingInteractionElement,hasLeadingInteractionElement=_getInputVisualsToBeR.hasLeadingInteractionElement,hasTrailingIcon=_getInputVisualsToBeR.hasTrailingIcon,hasTrailingButton=_getInputVisualsToBeR.hasTrailingButton;var hasLeadingVisuals=hasLeadingInteractionElement||hasLeadingIcon||hasPrefix;var hasTrailingVisuals=hasTrailingInteractionElement||hasSuffix||hasTrailingIcon||hasTrailingButton;if(__DEV__){if(hasTrailingButton&&!isValidAllowedChildren(TrailingButton,'Link')){throwBladeError({message:'trailingButton must be a valid Blade Link component',moduleName:'BaseInput'});}}if(hasLeadingVisuals){return jsxs(BaseBox,Object.assign({},getVisualContainerStyles(),{children:[hasLeadingInteractionElement?jsx(BaseBox,{paddingLeft:getInteractionElementStyles({hasTrailingIcon:hasTrailingIcon,hasLeadingInteractionElement:hasLeadingInteractionElement,hasSuffix:hasSuffix,hasTrailingButton:hasTrailingButton}),display:"flex",alignItems:"stretch",alignSelf:"stretch",children:leadingInteractionElement}):null,LeadingIcon?jsx(BaseBox,{paddingLeft:"spacing.4",display:"flex",children:jsx(LeadingIcon,{size:iconSize[size],color:isDisabled?'surface.icon.gray.disabled':'surface.icon.gray.muted'})}):null,hasPrefix?jsx(BaseBox,Object.assign({},getPrefixStyles({hasLeadingIcon:hasLeadingIcon,hasPrefix:hasPrefix}),{children:jsx(Text,{size:textSize[size],variant:"body",weight:"regular",color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.subtle',children:prefix})})):null]}));}if(hasTrailingVisuals){return jsxs(BaseBox,Object.assign({},getVisualContainerStyles({shouldStretchTrailingBox:hasTrailingInteractionElement&&Boolean(onTrailingInteractionElementClick)}),{children:[hasTrailingInteractionElement?jsx(BaseBox,Object.assign({},getVisualContainerStyles({shouldStretchTrailingBox:hasTrailingInteractionElement&&Boolean(onTrailingInteractionElementClick)}),{children:jsx(BaseBox,Object.assign({paddingRight:getInteractionElementStyles({hasTrailingIcon:hasTrailingIcon,hasTrailingInteractionElement:hasTrailingInteractionElement,hasSuffix:hasSuffix,hasTrailingButton:hasTrailingButton}),display:"flex",alignItems:"stretch",alignSelf:"stretch"},!isReactNative()&&{onClick:onTrailingInteractionElementClick},{children:trailingInteractionElement}))})):null,hasSuffix?jsx(BaseBox,Object.assign({},getSuffixStyles({hasTrailingIcon:hasTrailingIcon,hasSuffix:hasSuffix,hasTrailingButton:hasTrailingButton}),{children:jsx(Text,{size:textSize[size],variant:"body",weight:"regular",color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.subtle',children:suffix})})):null,TrailingIcon?jsx(BaseBox,Object.assign({display:"flex",justifyContent:"center",alignItems:"center"},getTrailingIconStyles({hasTrailingIcon:hasTrailingIcon,hasTrailingButton:hasTrailingButton}),{children:jsx(ValidationIconTooltip,{showHintsAsTooltip:showHintsAsTooltip,errorText:errorText,successText:successText,validationState:validationState,children:jsx(TrailingIcon,{size:iconSize[size],color:isDisabled?'interactive.icon.gray.disabled':trailingIconColor[validationState]})})})):null,TrailingButton?jsx(BaseBox,{paddingRight:"spacing.4",display:"flex",children:React__default.cloneElement(TrailingButton,{size:size,variant:'button',isDisabled:isDisabled})}):null]}));}return null;};
|
|
20
21
|
|
|
21
22
|
export { BaseInputVisuals, getInputVisualsToBeRendered };
|
|
22
23
|
//# sourceMappingURL=BaseInputVisuals.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInputVisuals.js","sources":["../../../../../../src/components/Input/BaseInput/BaseInputVisuals.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport React from 'react';\nimport type { ReactElement } from 'react';\nimport type { BaseInputProps } from './BaseInput';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport type { BaseBoxProps, SpacingValueType } from '~components/Box/BaseBox';\nimport type { IconColors } from '~components/Icons';\nimport { isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\nimport { Tooltip } from '~components/Tooltip';\nimport { Box } from '~components/Box';\n\ntype InputVisuals = Pick<\n BaseInputProps,\n | 'leadingIcon'\n | 'prefix'\n | 'trailingInteractionElement'\n | 'leadingInteractionElement'\n | 'suffix'\n | 'trailingIcon'\n | 'isDisabled'\n | 'validationState'\n | 'size'\n | 'trailingButton'\n | 'showHintsAsTooltip'\n | 'errorText'\n | 'successText'\n> & {\n size: NonNullable<BaseInputProps['size']>;\n};\n\nconst getVisualContainerStyles = (): Pick<\n BaseBoxProps,\n 'display' | 'flexDirection' | 'alignItems' | 'alignSelf'\n> => ({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n alignSelf: 'center',\n});\n\nconst trailingIconColor: Record<NonNullable<InputVisuals['validationState']>, IconColors> = {\n none: 'surface.icon.gray.subtle',\n error: 'feedback.icon.negative.intense',\n success: 'feedback.icon.positive.intense',\n};\n\nconst iconSize = {\n medium: 'medium',\n large: 'large',\n} as const;\n\nconst textSize = {\n medium: 'medium',\n large: 'large',\n} as const;\n\nconst getPrefixStyles = ({\n hasLeadingIcon,\n hasPrefix,\n}: {\n hasLeadingIcon: boolean;\n hasPrefix: boolean;\n}): Pick<BaseBoxProps, 'paddingLeft'> => {\n if (hasPrefix && hasLeadingIcon) {\n return {\n paddingLeft: 'spacing.3',\n };\n }\n\n if (hasPrefix && !hasLeadingIcon) {\n return {\n paddingLeft: 'spacing.4',\n };\n }\n\n return {\n paddingLeft: 'spacing.0',\n };\n};\n\nconst getInteractionElementStyles = ({\n hasTrailingIcon,\n hasLeadingInteractionElement,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingButton,\n}: {\n hasTrailingIcon: boolean;\n hasLeadingInteractionElement?: boolean;\n hasTrailingInteractionElement?: boolean;\n hasSuffix: boolean;\n hasTrailingButton: boolean;\n}): SpacingValueType => {\n if (hasTrailingInteractionElement && (hasSuffix || hasTrailingIcon || hasTrailingButton)) {\n return 'spacing.2';\n }\n\n if (hasTrailingInteractionElement && !hasSuffix && !hasTrailingIcon && !hasTrailingButton) {\n return 'spacing.4';\n }\n\n if (hasLeadingInteractionElement) {\n return 'spacing.3';\n }\n\n return 'spacing.0';\n};\n\nconst getSuffixStyles = ({\n hasTrailingIcon,\n hasSuffix,\n hasTrailingButton,\n}: {\n hasTrailingIcon: boolean;\n hasSuffix: boolean;\n hasTrailingButton: boolean;\n}): Pick<BaseBoxProps, 'paddingRight'> => {\n if (hasSuffix && (hasTrailingIcon || hasTrailingButton)) {\n return {\n paddingRight: 'spacing.3',\n };\n }\n\n if (hasSuffix && !hasTrailingIcon && !hasTrailingButton) {\n return {\n paddingRight: 'spacing.4',\n };\n }\n\n return {\n paddingRight: 'spacing.0',\n };\n};\n\nconst getTrailingIconStyles = ({\n hasTrailingIcon,\n hasTrailingButton,\n}: {\n hasTrailingIcon: boolean;\n hasTrailingButton: boolean;\n}): Pick<BaseBoxProps, 'paddingRight'> => {\n if (hasTrailingIcon && hasTrailingButton) {\n return {\n paddingRight: 'spacing.3',\n };\n }\n\n if (hasTrailingIcon && !hasTrailingButton) {\n return {\n paddingRight: 'spacing.4',\n };\n }\n\n return {\n paddingRight: 'spacing.0',\n };\n};\n\nexport const getInputVisualsToBeRendered = ({\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n trailingButton,\n}: InputVisuals) => ({\n hasLeadingIcon: Boolean(leadingIcon),\n hasPrefix: Boolean(prefix),\n hasTrailingInteractionElement: Boolean(trailingInteractionElement),\n hasLeadingInteractionElement: Boolean(leadingInteractionElement),\n hasSuffix: Boolean(suffix),\n hasTrailingIcon: Boolean(trailingIcon),\n hasTrailingButton: Boolean(trailingButton),\n});\n\nconst getTooltipContent = ({\n validationState,\n errorText,\n successText,\n}: {\n validationState: BaseInputProps['validationState'];\n errorText: BaseInputProps['errorText'];\n successText: BaseInputProps['errorText'];\n}): string => {\n if (validationState === 'error' && errorText) {\n return errorText;\n }\n\n if (validationState === 'success' && successText) {\n return successText;\n }\n\n return '';\n};\n\nconst ValidationIconTooltip = ({\n children,\n validationState,\n errorText,\n successText,\n showHintsAsTooltip,\n}: {\n children: ReactElement;\n validationState: BaseInputProps['validationState'];\n errorText: BaseInputProps['errorText'];\n successText: BaseInputProps['errorText'];\n showHintsAsTooltip: BaseInputProps['showHintsAsTooltip'];\n}) => {\n if (\n (showHintsAsTooltip && validationState === 'error' && errorText) ||\n (validationState === 'success' && successText)\n ) {\n return (\n <Tooltip content={getTooltipContent({ validationState, errorText, successText })}>\n <Box display=\"flex\" justifyContent=\"center\" alignItems=\"center\">\n {children}\n </Box>\n </Tooltip>\n );\n }\n\n return children;\n};\n\nexport const BaseInputVisuals = ({\n leadingIcon: LeadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon: TrailingIcon,\n isDisabled,\n validationState = 'none',\n size,\n showHintsAsTooltip,\n errorText,\n successText,\n trailingButton: TrailingButton,\n}: InputVisuals): ReactElement | null => {\n const {\n hasLeadingIcon,\n hasPrefix,\n hasSuffix,\n hasTrailingInteractionElement,\n hasLeadingInteractionElement,\n hasTrailingIcon,\n hasTrailingButton,\n } = getInputVisualsToBeRendered({\n leadingIcon: LeadingIcon,\n prefix,\n leadingInteractionElement,\n trailingInteractionElement,\n suffix,\n trailingIcon: TrailingIcon,\n trailingButton: TrailingButton,\n size,\n });\n\n const hasLeadingVisuals = hasLeadingInteractionElement || hasLeadingIcon || hasPrefix;\n const hasTrailingVisuals =\n hasTrailingInteractionElement || hasSuffix || hasTrailingIcon || hasTrailingButton;\n\n if (__DEV__) {\n if (hasTrailingButton && !isValidAllowedChildren(TrailingButton, 'Link')) {\n throwBladeError({\n message: 'trailingButton must be a valid Blade Link component',\n moduleName: 'BaseInput',\n });\n }\n }\n\n if (hasLeadingVisuals) {\n return (\n <BaseBox {...getVisualContainerStyles()}>\n {hasLeadingInteractionElement ? (\n <BaseBox\n paddingLeft={getInteractionElementStyles({\n hasTrailingIcon,\n hasLeadingInteractionElement,\n hasSuffix,\n hasTrailingButton,\n })}\n display=\"flex\"\n alignItems=\"stretch\"\n alignSelf=\"stretch\"\n >\n {leadingInteractionElement}\n </BaseBox>\n ) : null}\n {LeadingIcon ? (\n <BaseBox paddingLeft=\"spacing.4\" display=\"flex\">\n <LeadingIcon\n size={iconSize[size]}\n color={isDisabled ? 'surface.icon.gray.disabled' : 'surface.icon.gray.muted'}\n />\n </BaseBox>\n ) : null}\n {hasPrefix ? (\n <BaseBox {...getPrefixStyles({ hasLeadingIcon, hasPrefix })}>\n <Text\n size={textSize[size]}\n variant=\"body\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle'}\n >\n {prefix}\n </Text>\n </BaseBox>\n ) : null}\n </BaseBox>\n );\n }\n\n if (hasTrailingVisuals) {\n return (\n <BaseBox alignSelf=\"stretch\" alignItems=\"stretch\" {...getVisualContainerStyles()}>\n {hasTrailingInteractionElement ? (\n <BaseBox\n paddingRight={getInteractionElementStyles({\n hasTrailingIcon,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingButton,\n })}\n display=\"flex\"\n alignItems=\"stretch\"\n alignSelf=\"stretch\"\n >\n {trailingInteractionElement}\n </BaseBox>\n ) : null}\n {hasSuffix ? (\n <BaseBox {...getSuffixStyles({ hasTrailingIcon, hasSuffix, hasTrailingButton })}>\n <Text\n size={textSize[size]}\n variant=\"body\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle'}\n >\n {suffix}\n </Text>\n </BaseBox>\n ) : null}\n {TrailingIcon ? (\n <BaseBox\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n {...getTrailingIconStyles({ hasTrailingIcon, hasTrailingButton })}\n >\n <ValidationIconTooltip\n showHintsAsTooltip={showHintsAsTooltip}\n errorText={errorText}\n successText={successText}\n validationState={validationState}\n >\n <TrailingIcon\n size={iconSize[size]}\n color={\n isDisabled ? 'interactive.icon.gray.disabled' : trailingIconColor[validationState]\n }\n />\n </ValidationIconTooltip>\n </BaseBox>\n ) : null}\n {TrailingButton ? (\n <BaseBox paddingRight=\"spacing.4\" display=\"flex\">\n {React.cloneElement(TrailingButton, {\n size,\n variant: 'button',\n isDisabled,\n })}\n </BaseBox>\n ) : null}\n </BaseBox>\n );\n }\n\n return null;\n};\n"],"names":["getVisualContainerStyles","display","flexDirection","alignItems","alignSelf","trailingIconColor","none","error","success","iconSize","medium","large","textSize","getPrefixStyles","_ref","hasLeadingIcon","hasPrefix","paddingLeft","getInteractionElementStyles","_ref2","hasTrailingIcon","hasLeadingInteractionElement","hasTrailingInteractionElement","hasSuffix","hasTrailingButton","getSuffixStyles","_ref3","paddingRight","getTrailingIconStyles","_ref4","getInputVisualsToBeRendered","_ref5","leadingIcon","prefix","trailingInteractionElement","leadingInteractionElement","suffix","trailingIcon","trailingButton","Boolean","getTooltipContent","_ref6","validationState","errorText","successText","ValidationIconTooltip","_ref7","children","showHintsAsTooltip","_jsx","Tooltip","content","Box","justifyContent","BaseInputVisuals","_ref8","LeadingIcon","TrailingIcon","isDisabled","_ref8$validationState","size","TrailingButton","_getInputVisualsToBeR","hasLeadingVisuals","hasTrailingVisuals","__DEV__","isValidAllowedChildren","throwBladeError","message","moduleName","_jsxs","BaseBox","Object","assign","color","Text","variant","weight","React","cloneElement"],"mappings":";;;;;;;;;;;;;;;;;;AAgCA,IAAMA,wBAAwB,CAAG,SAA3BA,wBAAwBA,EAAA,CAAA,OAGxB,CACJC,OAAO,CAAE,MAAM,CACfC,aAAa,CAAE,KAAK,CACpBC,UAAU,CAAE,QAAQ,CACpBC,SAAS,CAAE,QACb,CAAC,CAAC,CAAA,CAEF,IAAMC,iBAAmF,CAAG,CAC1FC,IAAI,CAAE,0BAA0B,CAChCC,KAAK,CAAE,gCAAgC,CACvCC,OAAO,CAAE,gCACX,CAAC,CAED,IAAMC,QAAQ,CAAG,CACfC,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,OACT,CAAU,CAEV,IAAMC,QAAQ,CAAG,CACfF,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,OACT,CAAU,CAEV,IAAME,eAAe,CAAG,SAAlBA,eAAeA,CAAAC,IAAA,CAMoB,CALvC,IAAAC,cAAc,CAAAD,IAAA,CAAdC,cAAc,CACdC,SAAS,CAAAF,IAAA,CAATE,SAAS,CAKT,GAAIA,SAAS,EAAID,cAAc,CAAE,CAC/B,OAAO,CACLE,WAAW,CAAE,WACf,CAAC,CACH,CAEA,GAAID,SAAS,EAAI,CAACD,cAAc,CAAE,CAChC,OAAO,CACLE,WAAW,CAAE,WACf,CAAC,CACH,CAEA,OAAO,CACLA,WAAW,CAAE,WACf,CAAC,CACH,CAAC,CAED,IAAMC,2BAA2B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pBG,kBAAkB,CAAEA,kBAAmB,CACvCL,SAAS,CAAEA,SAAU,CACrBC,WAAW,CAAEA,WAAY,CACzBF,eAAe,CAAEA,eAAgB,CAAAK,QAAA,CAEjCE,GAAA,CAACQ,YAAY,CACXG,CAAAA,IAAI,CAAEnD,QAAQ,CAACmD,IAAI,CAAE,CACrBc,KAAK,CACHhB,UAAU,CAAG,gCAAgC,CAAGrD,iBAAiB,CAACqC,eAAe,CAClF,CACF,CAAC,CACmB,CAAC,CACjB,CAAA,CAAC,CACR,IAAI,CACPmB,cAAc,CACbZ,GAAA,CAACsB,OAAO,CAAA,CAAC5C,YAAY,CAAC,WAAW,CAAC1B,OAAO,CAAC,MAAM,CAAA8C,QAAA,CAC7C+B,cAAK,CAACC,YAAY,CAAClB,cAAc,CAAE,CAClCD,IAAI,CAAJA,IAAI,CACJgB,OAAO,CAAE,QAAQ,CACjBlB,UAAU,CAAVA,UACF,CAAC,CAAC,CACK,CAAC,CACR,IAAI,GACD,CAAC,CAEd,CAEA,OAAO,IAAI,CACb;;;;"}
|
|
1
|
+
{"version":3,"file":"BaseInputVisuals.js","sources":["../../../../../../src/components/Input/BaseInput/BaseInputVisuals.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport React from 'react';\nimport type { ReactElement } from 'react';\nimport type { BaseInputProps } from './BaseInput';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport type { BaseBoxProps, SpacingValueType } from '~components/Box/BaseBox';\nimport type { IconColors } from '~components/Icons';\nimport { isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\nimport { Tooltip } from '~components/Tooltip';\nimport { Box } from '~components/Box';\nimport { isReactNative } from '~utils';\n\ntype InputVisuals = Pick<\n BaseInputProps,\n | 'leadingIcon'\n | 'prefix'\n | 'trailingInteractionElement'\n | 'onTrailingInteractionElementClick'\n | 'leadingInteractionElement'\n | 'suffix'\n | 'trailingIcon'\n | 'isDisabled'\n | 'validationState'\n | 'size'\n | 'trailingButton'\n | 'showHintsAsTooltip'\n | 'errorText'\n | 'successText'\n> & {\n size: NonNullable<BaseInputProps['size']>;\n};\n\nconst getVisualContainerStyles = ({\n shouldStretchTrailingBox,\n}: {\n shouldStretchTrailingBox?: boolean;\n} = {}): Pick<BaseBoxProps, 'display' | 'flexDirection' | 'alignItems' | 'alignSelf'> => ({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n alignSelf: shouldStretchTrailingBox ? 'stretch' : 'center',\n});\n\nconst trailingIconColor: Record<NonNullable<InputVisuals['validationState']>, IconColors> = {\n none: 'surface.icon.gray.subtle',\n error: 'feedback.icon.negative.intense',\n success: 'feedback.icon.positive.intense',\n};\n\nconst iconSize = {\n medium: 'medium',\n large: 'large',\n} as const;\n\nconst textSize = {\n medium: 'medium',\n large: 'large',\n} as const;\n\nconst getPrefixStyles = ({\n hasLeadingIcon,\n hasPrefix,\n}: {\n hasLeadingIcon: boolean;\n hasPrefix: boolean;\n}): Pick<BaseBoxProps, 'paddingLeft'> => {\n if (hasPrefix && hasLeadingIcon) {\n return {\n paddingLeft: 'spacing.3',\n };\n }\n\n if (hasPrefix && !hasLeadingIcon) {\n return {\n paddingLeft: 'spacing.4',\n };\n }\n\n return {\n paddingLeft: 'spacing.0',\n };\n};\n\nconst getInteractionElementStyles = ({\n hasTrailingIcon,\n hasLeadingInteractionElement,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingButton,\n}: {\n hasTrailingIcon: boolean;\n hasLeadingInteractionElement?: boolean;\n hasTrailingInteractionElement?: boolean;\n hasSuffix: boolean;\n hasTrailingButton: boolean;\n}): SpacingValueType => {\n if (hasTrailingInteractionElement && (hasSuffix || hasTrailingIcon || hasTrailingButton)) {\n return 'spacing.2';\n }\n\n if (hasTrailingInteractionElement && !hasSuffix && !hasTrailingIcon && !hasTrailingButton) {\n return 'spacing.4';\n }\n\n if (hasLeadingInteractionElement) {\n return 'spacing.3';\n }\n\n return 'spacing.0';\n};\n\nconst getSuffixStyles = ({\n hasTrailingIcon,\n hasSuffix,\n hasTrailingButton,\n}: {\n hasTrailingIcon: boolean;\n hasSuffix: boolean;\n hasTrailingButton: boolean;\n}): Pick<BaseBoxProps, 'paddingRight'> => {\n if (hasSuffix && (hasTrailingIcon || hasTrailingButton)) {\n return {\n paddingRight: 'spacing.3',\n };\n }\n\n if (hasSuffix && !hasTrailingIcon && !hasTrailingButton) {\n return {\n paddingRight: 'spacing.4',\n };\n }\n\n return {\n paddingRight: 'spacing.0',\n };\n};\n\nconst getTrailingIconStyles = ({\n hasTrailingIcon,\n hasTrailingButton,\n}: {\n hasTrailingIcon: boolean;\n hasTrailingButton: boolean;\n}): Pick<BaseBoxProps, 'paddingRight'> => {\n if (hasTrailingIcon && hasTrailingButton) {\n return {\n paddingRight: 'spacing.3',\n };\n }\n\n if (hasTrailingIcon && !hasTrailingButton) {\n return {\n paddingRight: 'spacing.4',\n };\n }\n\n return {\n paddingRight: 'spacing.0',\n };\n};\n\nexport const getInputVisualsToBeRendered = ({\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n trailingButton,\n}: InputVisuals) => ({\n hasLeadingIcon: Boolean(leadingIcon),\n hasPrefix: Boolean(prefix),\n hasTrailingInteractionElement: Boolean(trailingInteractionElement),\n hasLeadingInteractionElement: Boolean(leadingInteractionElement),\n hasSuffix: Boolean(suffix),\n hasTrailingIcon: Boolean(trailingIcon),\n hasTrailingButton: Boolean(trailingButton),\n});\n\nconst getTooltipContent = ({\n validationState,\n errorText,\n successText,\n}: {\n validationState: BaseInputProps['validationState'];\n errorText: BaseInputProps['errorText'];\n successText: BaseInputProps['errorText'];\n}): string => {\n if (validationState === 'error' && errorText) {\n return errorText;\n }\n\n if (validationState === 'success' && successText) {\n return successText;\n }\n\n return '';\n};\n\nconst ValidationIconTooltip = ({\n children,\n validationState,\n errorText,\n successText,\n showHintsAsTooltip,\n}: {\n children: ReactElement;\n validationState: BaseInputProps['validationState'];\n errorText: BaseInputProps['errorText'];\n successText: BaseInputProps['errorText'];\n showHintsAsTooltip: BaseInputProps['showHintsAsTooltip'];\n}) => {\n if (\n (showHintsAsTooltip && validationState === 'error' && errorText) ||\n (validationState === 'success' && successText)\n ) {\n return (\n <Tooltip content={getTooltipContent({ validationState, errorText, successText })}>\n <Box display=\"flex\" justifyContent=\"center\" alignItems=\"center\">\n {children}\n </Box>\n </Tooltip>\n );\n }\n\n return children;\n};\n\nexport const BaseInputVisuals = ({\n leadingIcon: LeadingIcon,\n prefix,\n trailingInteractionElement,\n onTrailingInteractionElementClick,\n leadingInteractionElement,\n suffix,\n trailingIcon: TrailingIcon,\n isDisabled,\n validationState = 'none',\n size,\n showHintsAsTooltip,\n errorText,\n successText,\n trailingButton: TrailingButton,\n}: InputVisuals): ReactElement | null => {\n const {\n hasLeadingIcon,\n hasPrefix,\n hasSuffix,\n hasTrailingInteractionElement,\n hasLeadingInteractionElement,\n hasTrailingIcon,\n hasTrailingButton,\n } = getInputVisualsToBeRendered({\n leadingIcon: LeadingIcon,\n prefix,\n leadingInteractionElement,\n trailingInteractionElement,\n suffix,\n trailingIcon: TrailingIcon,\n trailingButton: TrailingButton,\n size,\n });\n\n const hasLeadingVisuals = hasLeadingInteractionElement || hasLeadingIcon || hasPrefix;\n const hasTrailingVisuals =\n hasTrailingInteractionElement || hasSuffix || hasTrailingIcon || hasTrailingButton;\n\n if (__DEV__) {\n if (hasTrailingButton && !isValidAllowedChildren(TrailingButton, 'Link')) {\n throwBladeError({\n message: 'trailingButton must be a valid Blade Link component',\n moduleName: 'BaseInput',\n });\n }\n }\n\n if (hasLeadingVisuals) {\n return (\n <BaseBox {...getVisualContainerStyles()}>\n {hasLeadingInteractionElement ? (\n <BaseBox\n paddingLeft={getInteractionElementStyles({\n hasTrailingIcon,\n hasLeadingInteractionElement,\n hasSuffix,\n hasTrailingButton,\n })}\n display=\"flex\"\n alignItems=\"stretch\"\n alignSelf=\"stretch\"\n >\n {leadingInteractionElement}\n </BaseBox>\n ) : null}\n {LeadingIcon ? (\n <BaseBox paddingLeft=\"spacing.4\" display=\"flex\">\n <LeadingIcon\n size={iconSize[size]}\n color={isDisabled ? 'surface.icon.gray.disabled' : 'surface.icon.gray.muted'}\n />\n </BaseBox>\n ) : null}\n {hasPrefix ? (\n <BaseBox {...getPrefixStyles({ hasLeadingIcon, hasPrefix })}>\n <Text\n size={textSize[size]}\n variant=\"body\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle'}\n >\n {prefix}\n </Text>\n </BaseBox>\n ) : null}\n </BaseBox>\n );\n }\n\n if (hasTrailingVisuals) {\n return (\n <BaseBox\n {...getVisualContainerStyles({\n shouldStretchTrailingBox:\n hasTrailingInteractionElement && Boolean(onTrailingInteractionElementClick),\n })}\n >\n {hasTrailingInteractionElement ? (\n <BaseBox\n {...getVisualContainerStyles({\n shouldStretchTrailingBox:\n hasTrailingInteractionElement && Boolean(onTrailingInteractionElementClick),\n })}\n >\n <BaseBox\n paddingRight={getInteractionElementStyles({\n hasTrailingIcon,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingButton,\n })}\n display=\"flex\"\n alignItems=\"stretch\"\n alignSelf=\"stretch\"\n {...(!isReactNative() && { onClick: onTrailingInteractionElementClick })}\n >\n {trailingInteractionElement}\n </BaseBox>\n </BaseBox>\n ) : null}\n {hasSuffix ? (\n <BaseBox {...getSuffixStyles({ hasTrailingIcon, hasSuffix, hasTrailingButton })}>\n <Text\n size={textSize[size]}\n variant=\"body\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle'}\n >\n {suffix}\n </Text>\n </BaseBox>\n ) : null}\n {TrailingIcon ? (\n <BaseBox\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n {...getTrailingIconStyles({ hasTrailingIcon, hasTrailingButton })}\n >\n <ValidationIconTooltip\n showHintsAsTooltip={showHintsAsTooltip}\n errorText={errorText}\n successText={successText}\n validationState={validationState}\n >\n <TrailingIcon\n size={iconSize[size]}\n color={\n isDisabled ? 'interactive.icon.gray.disabled' : trailingIconColor[validationState]\n }\n />\n </ValidationIconTooltip>\n </BaseBox>\n ) : null}\n {TrailingButton ? (\n <BaseBox paddingRight=\"spacing.4\" display=\"flex\">\n {React.cloneElement(TrailingButton, {\n size,\n variant: 'button',\n isDisabled,\n })}\n </BaseBox>\n ) : null}\n </BaseBox>\n );\n }\n\n return null;\n};\n"],"names":["getVisualContainerStyles","_ref","arguments","length","undefined","shouldStretchTrailingBox","display","flexDirection","alignItems","alignSelf","trailingIconColor","none","error","success","iconSize","medium","large","textSize","getPrefixStyles","_ref2","hasLeadingIcon","hasPrefix","paddingLeft","getInteractionElementStyles","_ref3","hasTrailingIcon","hasLeadingInteractionElement","hasTrailingInteractionElement","hasSuffix","hasTrailingButton","getSuffixStyles","_ref4","paddingRight","getTrailingIconStyles","_ref5","getInputVisualsToBeRendered","_ref6","leadingIcon","prefix","trailingInteractionElement","leadingInteractionElement","suffix","trailingIcon","trailingButton","Boolean","getTooltipContent","_ref7","validationState","errorText","successText","ValidationIconTooltip","_ref8","children","showHintsAsTooltip","_jsx","Tooltip","content","Box","justifyContent","BaseInputVisuals","_ref9","LeadingIcon","onTrailingInteractionElementClick","TrailingIcon","isDisabled","_ref9$validationState","size","TrailingButton","_getInputVisualsToBeR","hasLeadingVisuals","hasTrailingVisuals","__DEV__","isValidAllowedChildren","throwBladeError","message","moduleName","_jsxs","BaseBox","Object","assign","color","Text","variant","weight","isReactNative","onClick","React","cloneElement"],"mappings":";;;;;;;;;;;;;;;;;;;AAkCA,IAAMA,wBAAwB,CAAG,SAA3BA,wBAAwBA,EAAA,CAAA,IAAAC,IAAA,CAAAC,SAAA,CAAAC,MAAA,CAAA,CAAA,EAAAD,SAAA,CAAAE,CAAAA,CAAAA,GAAAA,SAAA,CAAAF,SAAA,IAI1B,EAAE,CAHJG,wBA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