@razorpay/blade 10.19.1 → 10.20.0
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/components/index.d.ts +3 -1
- package/build/components/index.development.web.js +191 -204
- package/build/components/index.development.web.js.map +1 -1
- package/build/components/index.native.d.ts +3 -1
- package/build/components/index.native.js +3 -3
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.production.web.js +191 -204
- package/build/components/index.production.web.js.map +1 -1
- package/build/css/bankingThemeDarkDesktop.css +1 -1
- package/build/css/bankingThemeDarkMobile.css +1 -1
- package/build/css/bankingThemeLightDesktop.css +1 -1
- package/build/css/bankingThemeLightMobile.css +1 -1
- package/build/css/paymentThemeDarkDesktop.css +1 -1
- package/build/css/paymentThemeDarkMobile.css +1 -1
- package/build/css/paymentThemeLightDesktop.css +1 -1
- package/build/css/paymentThemeLightMobile.css +1 -1
- package/package.json +2 -2
|
@@ -2946,6 +2946,7 @@ declare type BaseTextProps = {
|
|
|
2946
2946
|
fontStyle?: 'italic' | 'normal';
|
|
2947
2947
|
textDecorationLine?: 'line-through' | 'none' | 'underline';
|
|
2948
2948
|
lineHeight?: keyof Theme['typography']['lineHeights'];
|
|
2949
|
+
wordBreak?: 'normal' | 'break-all' | 'keep-all' | 'break-word';
|
|
2949
2950
|
/**
|
|
2950
2951
|
* Web only
|
|
2951
2952
|
*/
|
|
@@ -3305,6 +3306,7 @@ declare type TextCommonProps = {
|
|
|
3305
3306
|
color?: BaseTextProps['color'];
|
|
3306
3307
|
textAlign?: BaseTextProps['textAlign'];
|
|
3307
3308
|
textDecorationLine?: BaseTextProps['textDecorationLine'];
|
|
3309
|
+
wordBreak?: BaseTextProps['wordBreak'];
|
|
3308
3310
|
} & TestID & StyledPropsBlade;
|
|
3309
3311
|
declare type TextVariant = 'body' | 'caption';
|
|
3310
3312
|
declare type TextBodyVariant = TextCommonProps & {
|
|
@@ -3331,7 +3333,7 @@ declare const getTextProps: <T extends {
|
|
|
3331
3333
|
}>({ variant, type, weight, size, color, contrast, testID, textAlign, textDecorationLine, }: GetTextProps<T>) => GetTextPropsReturn;
|
|
3332
3334
|
declare const Text: <T extends {
|
|
3333
3335
|
variant: TextVariant;
|
|
3334
|
-
}>({ as, variant, weight, size, type, contrast, truncateAfterLines, children, color, testID, textAlign, textDecorationLine, ...styledProps }: TextProps<T>) => ReactElement;
|
|
3336
|
+
}>({ as, variant, weight, size, type, contrast, truncateAfterLines, children, color, testID, textAlign, textDecorationLine, wordBreak, ...styledProps }: TextProps<T>) => ReactElement;
|
|
3335
3337
|
|
|
3336
3338
|
declare type CodeCommonProps = {
|
|
3337
3339
|
/**
|
|
@@ -2020,7 +2020,7 @@ var SelectActions={Close:'Close',CloseSelect:'CloseSelect',First:'First',Last:'L
|
|
|
2020
2020
|
|
|
2021
2021
|
var _excluded$56=["isOpen","setIsOpen","close","selectedIndices","setSelectedIndices","activeIndex","setActiveIndex","activeTagIndex","setActiveTagIndex","visibleTagsCountRef","isKeydownPressed","setIsKeydownPressed","options","selectionType","changeCallbackTriggerer","setChangeCallbackTriggerer","isControlled","setControlledValueIndices","filteredValues","dropdownTriggerer"];var noop=function noop(){};var DropdownContext=React__default.createContext({isOpen:false,setIsOpen:noop,close:noop,selectedIndices:[],setSelectedIndices:noop,controlledValueIndices:[],setControlledValueIndices:noop,options:[],setOptions:noop,filteredValues:[],setFilteredValues:noop,activeIndex:-1,setActiveIndex:noop,activeTagIndex:-1,setActiveTagIndex:noop,shouldIgnoreBlurAnimation:false,setShouldIgnoreBlurAnimation:noop,hasFooterAction:false,setHasFooterAction:noop,hasAutoCompleteInBottomSheetHeader:false,setHasAutoCompleteInBottomSheetHeader:noop,isKeydownPressed:false,setIsKeydownPressed:noop,changeCallbackTriggerer:0,setChangeCallbackTriggerer:noop,isControlled:false,setIsControlled:noop,dropdownBaseId:'',actionListItemRef:{current:null},triggererRef:{current:null},isTagDismissedRef:{current:null},visibleTagsCountRef:{current:null},triggererWrapperRef:{current:null}});var searchTimeout;var searchString='';var useDropdown=function useDropdown(){var _React$useContext=React__default.useContext(DropdownContext),isOpen=_React$useContext.isOpen,setIsOpen=_React$useContext.setIsOpen,close=_React$useContext.close,selectedIndices=_React$useContext.selectedIndices,setSelectedIndices=_React$useContext.setSelectedIndices,activeIndex=_React$useContext.activeIndex,setActiveIndex=_React$useContext.setActiveIndex,activeTagIndex=_React$useContext.activeTagIndex,setActiveTagIndex=_React$useContext.setActiveTagIndex,visibleTagsCountRef=_React$useContext.visibleTagsCountRef,isKeydownPressed=_React$useContext.isKeydownPressed,setIsKeydownPressed=_React$useContext.setIsKeydownPressed,options=_React$useContext.options,selectionType=_React$useContext.selectionType,changeCallbackTriggerer=_React$useContext.changeCallbackTriggerer,setChangeCallbackTriggerer=_React$useContext.setChangeCallbackTriggerer,isControlled=_React$useContext.isControlled,setControlledValueIndices=_React$useContext.setControlledValueIndices,filteredValues=_React$useContext.filteredValues,dropdownTriggerer=_React$useContext.dropdownTriggerer,rest=_objectWithoutProperties(_React$useContext,_excluded$56);var setIndices=function setIndices(indices){if(isControlled){setControlledValueIndices(indices);}else {setSelectedIndices(indices);}};var removeOption=function removeOption(index){var existingItemIndex=selectedIndices.indexOf(index);if(existingItemIndex<0){return;}setIndices([].concat(_toConsumableArray(selectedIndices.slice(0,existingItemIndex)),_toConsumableArray(selectedIndices.slice(existingItemIndex+1))));};var selectOption=function selectOption(index){var properties=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{closeOnSelection:true};var isSelected=false;if(index<0||index>options.length-1){return isSelected;}if(selectionType==='multiple'){if(selectedIndices.includes(index)){removeOption(index);isSelected=false;}else {setIndices([].concat(_toConsumableArray(selectedIndices),[index]));isSelected=true;}}else {setIndices([index]);isSelected=true;}setChangeCallbackTriggerer(changeCallbackTriggerer+1);if(activeIndex!==index){setActiveIndex(index);}if(properties!=null&&properties.closeOnSelection&&selectionType!=='multiple'){close();}return isSelected;};var onTriggerClick=function onTriggerClick(){if(isOpen){close();}else {setIsOpen(true);}};var onOptionChange=function onOptionChange(actionType,index){setActiveTagIndex(-1);var newIndex=index!=null?index:activeIndex;var updatedIndex;var hasAutoComplete=rest.hasAutoCompleteInBottomSheetHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete;if(hasAutoComplete&&filteredValues.length>0){var filteredIndexes=filteredValues.map(function(filteredValue){return options.findIndex(function(option){return option.value===filteredValue;});}).sort();updatedIndex=filteredIndexes[getUpdatedIndex({currentIndex:filteredIndexes.indexOf(newIndex),maxIndex:filteredIndexes.length-1,actionType:actionType})];}else {updatedIndex=getUpdatedIndex({currentIndex:newIndex,maxIndex:options.length-1,actionType:actionType});}setActiveIndex(updatedIndex);var optionValues=options.map(function(option){return option.value;});ensureScrollVisiblity(newIndex,rest.actionListItemRef.current,optionValues);};var onOptionClick=function onOptionClick(e,index){var actionType=getActionFromKey(e,isOpen,dropdownTriggerer);if(typeof actionType==='number'){onOptionChange(actionType,index);}selectOption(index);if(!isReactNative$4()){var _rest$triggererRef$cu;(_rest$triggererRef$cu=rest.triggererRef.current)==null?void 0:_rest$triggererRef$cu.focus();}};var onComboType=function onComboType(letter,actionType){setIsOpen(true);if(rest.hasAutoCompleteInBottomSheetHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete){return;}if(typeof searchTimeout==='number'){window.clearTimeout(searchTimeout);}searchTimeout=window.setTimeout(function(){searchString='';},500);searchString=searchString+letter;var optionTitles=options.map(function(option){return option.title;});var searchIndex=getIndexByLetter(optionTitles,searchString,activeIndex+1);if(searchIndex>=0){onOptionChange(actionType,searchIndex);}else {window.clearTimeout(searchTimeout);searchString='';}};var onTriggerKeydown=function onTriggerKeydown(e){if(!isKeydownPressed&&![' ','Enter','Escape','Meta'].includes(e.event.key)){setIsKeydownPressed(true);}var actionType=getActionFromKey(e.event,isOpen,dropdownTriggerer);if(actionType){performAction(actionType,e,{setIsOpen:setIsOpen,close:close,onOptionChange:onOptionChange,onComboType:onComboType,selectCurrentOption:function selectCurrentOption(){var _options$activeIndex$,_options$activeIndex;if(activeIndex<0){return;}var isSelected=selectOption(activeIndex);if(rest.hasFooterAction&&!isReactNative$4()){var _rest$triggererRef$cu2;(_rest$triggererRef$cu2=rest.triggererRef.current)==null?void 0:_rest$triggererRef$cu2.focus();}(_options$activeIndex$=(_options$activeIndex=options[activeIndex]).onClickTrigger)==null?void 0:_options$activeIndex$.call(_options$activeIndex,isSelected);}});}};return Object.assign({isOpen:isOpen,setIsOpen:setIsOpen,close:close,selectedIndices:selectedIndices,setSelectedIndices:setSelectedIndices,filteredValues:filteredValues,removeOption:removeOption,setControlledValueIndices:setControlledValueIndices,onTriggerClick:onTriggerClick,onTriggerKeydown:onTriggerKeydown,onOptionClick:onOptionClick,activeIndex:activeIndex,setActiveIndex:setActiveIndex,activeTagIndex:activeTagIndex,setActiveTagIndex:setActiveTagIndex,visibleTagsCountRef:visibleTagsCountRef,isKeydownPressed:isKeydownPressed,setIsKeydownPressed:setIsKeydownPressed,changeCallbackTriggerer:changeCallbackTriggerer,setChangeCallbackTriggerer:setChangeCallbackTriggerer,isControlled:isControlled,options:options,value:makeInputValue(selectedIndices,options),displayValue:makeInputDisplayValue(selectedIndices,options),selectionType:selectionType,dropdownTriggerer:dropdownTriggerer},rest);};
|
|
2022
2022
|
|
|
2023
|
-
var getBaseTextStyles=function getBaseTextStyles(_ref){var _ref$color=_ref.color,color=_ref$color===void 0?'surface.text.normal.lowContrast':_ref$color,_ref$fontFamily=_ref.fontFamily,fontFamily=_ref$fontFamily===void 0?'text':_ref$fontFamily,_ref$fontSize=_ref.fontSize,fontSize=_ref$fontSize===void 0?200:_ref$fontSize,_ref$fontWeight=_ref.fontWeight,fontWeight=_ref$fontWeight===void 0?'regular':_ref$fontWeight,_ref$fontStyle=_ref.fontStyle,fontStyle=_ref$fontStyle===void 0?'normal':_ref$fontStyle,_ref$textDecorationLi=_ref.textDecorationLine,textDecorationLine=_ref$textDecorationLi===void 0?'none':_ref$textDecorationLi,numberOfLines=_ref.numberOfLines,_ref$lineHeight=_ref.lineHeight,lineHeight=_ref$lineHeight===void 0?100:_ref$lineHeight,textAlign=_ref.textAlign,theme=_ref.theme;var textColor=get$1(theme.colors,color);var themeFontFamily=theme.typography.fonts.family[fontFamily];var themeFontSize=makeTypographySize(theme.typography.fonts.size[fontSize]);var themeFontWeight=theme.typography.fonts.weight[fontWeight];var themeLineHeight=makeTypographySize(theme.typography.lineHeights[lineHeight]);var truncateStyles={};if(numberOfLines!==undefined){if(isReactNative$4()){truncateStyles={};}else {truncateStyles={overflow:'hidden',display:'-webkit-box','line-clamp':`${numberOfLines}`,'-webkit-line-clamp':`${numberOfLines}`,'-webkit-box-orient':'vertical'};}}return Object.assign({color:textColor,fontFamily:themeFontFamily,fontSize:themeFontSize,fontWeight:themeFontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine},textDecorationLine!=='none'&&{textDecorationColor:textColor},{lineHeight:themeLineHeight,textAlign:textAlign,margin:0,padding:0},truncateStyles);};
|
|
2023
|
+
var getBaseTextStyles=function getBaseTextStyles(_ref){var _ref$color=_ref.color,color=_ref$color===void 0?'surface.text.normal.lowContrast':_ref$color,_ref$fontFamily=_ref.fontFamily,fontFamily=_ref$fontFamily===void 0?'text':_ref$fontFamily,_ref$fontSize=_ref.fontSize,fontSize=_ref$fontSize===void 0?200:_ref$fontSize,_ref$fontWeight=_ref.fontWeight,fontWeight=_ref$fontWeight===void 0?'regular':_ref$fontWeight,_ref$fontStyle=_ref.fontStyle,fontStyle=_ref$fontStyle===void 0?'normal':_ref$fontStyle,_ref$textDecorationLi=_ref.textDecorationLine,textDecorationLine=_ref$textDecorationLi===void 0?'none':_ref$textDecorationLi,numberOfLines=_ref.numberOfLines,wordBreak=_ref.wordBreak,_ref$lineHeight=_ref.lineHeight,lineHeight=_ref$lineHeight===void 0?100:_ref$lineHeight,textAlign=_ref.textAlign,theme=_ref.theme;var textColor=get$1(theme.colors,color);var themeFontFamily=theme.typography.fonts.family[fontFamily];var themeFontSize=makeTypographySize(theme.typography.fonts.size[fontSize]);var themeFontWeight=theme.typography.fonts.weight[fontWeight];var themeLineHeight=makeTypographySize(theme.typography.lineHeights[lineHeight]);var truncateStyles={};var wordBreakStyles={};if(numberOfLines!==undefined){if(isReactNative$4()){truncateStyles={};}else {truncateStyles={overflow:'hidden',display:'-webkit-box','line-clamp':`${numberOfLines}`,'-webkit-line-clamp':`${numberOfLines}`,'-webkit-box-orient':'vertical'};}}if(wordBreak!==undefined){if(isReactNative$4()){wordBreakStyles={};}else {wordBreakStyles={wordBreak:wordBreak};}}return Object.assign({color:textColor,fontFamily:themeFontFamily,fontSize:themeFontSize,fontWeight:themeFontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine},textDecorationLine!=='none'&&{textDecorationColor:textColor},{lineHeight:themeLineHeight,textAlign:textAlign,margin:0,padding:0},truncateStyles,wordBreakStyles);};
|
|
2024
2024
|
|
|
2025
2025
|
var _excluded$55=["color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","numberOfLines","lineHeight","textAlign","as"],_excluded2$2=["id","color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","lineHeight","textAlign","children","truncateAfterLines","className","style","accessibilityProps","componentName","testID"];var StyledBaseText=styled.Text(function(_ref){var color=_ref.color,fontFamily=_ref.fontFamily,fontSize=_ref.fontSize,fontWeight=_ref.fontWeight,fontStyle=_ref.fontStyle,textDecorationLine=_ref.textDecorationLine,numberOfLines=_ref.numberOfLines,lineHeight=_ref.lineHeight,textAlign=_ref.textAlign;_ref.as;var props=_objectWithoutProperties(_ref,_excluded$55);var styledPropsCSSObject=useStyledProps(props);return Object.assign({},getBaseTextStyles({color:color,fontFamily:fontFamily,fontSize:fontSize,fontWeight:fontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine,numberOfLines:numberOfLines,lineHeight:lineHeight,textAlign:textAlign,theme:props.theme}),styledPropsCSSObject);});var BaseText=function BaseText(_ref2){var id=_ref2.id,color=_ref2.color,fontFamily=_ref2.fontFamily,fontSize=_ref2.fontSize,fontWeight=_ref2.fontWeight,fontStyle=_ref2.fontStyle,textDecorationLine=_ref2.textDecorationLine,lineHeight=_ref2.lineHeight,textAlign=_ref2.textAlign,children=_ref2.children,truncateAfterLines=_ref2.truncateAfterLines,className=_ref2.className,style=_ref2.style,_ref2$accessibilityPr=_ref2.accessibilityProps,accessibilityProps=_ref2$accessibilityPr===void 0?{}:_ref2$accessibilityPr,_ref2$componentName=_ref2.componentName,componentName=_ref2$componentName===void 0?MetaConstants.BaseText:_ref2$componentName,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded2$2);return jsx(StyledBaseText,Object.assign({},getStyledProps(styledProps),{color:color,fontFamily:fontFamily,fontSize:fontSize,fontWeight:fontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine,lineHeight:lineHeight,as:undefined,textAlign:textAlign,numberOfLines:truncateAfterLines,className:className,style:style,id:id},makeAccessible(accessibilityProps),metaAttribute({name:componentName,testID:testID}),{children:children}));};
|
|
2026
2026
|
|
|
@@ -2030,7 +2030,7 @@ var _excluded$54=["as","size","type","contrast","color","children","testID","tex
|
|
|
2030
2030
|
|
|
2031
2031
|
var _excluded$53=["as","variant","size","type","weight","contrast","color","children","testID","textAlign","textDecorationLine"];var validAsValues$2=['span','h1','h2','h3','h4','h5','h6'];var getProps$3=function getProps(_ref){var as=_ref.as,variant=_ref.variant,size=_ref.size,type=_ref.type,weight=_ref.weight,contrast=_ref.contrast,color=_ref.color,testID=_ref.testID;var colorContrast=contrast?`${contrast}Contrast`:'lowContrast';var props={color:color!=null?color:`surface.text.${type!=null?type:'normal'}.${colorContrast}`,fontSize:200,fontWeight:weight!=null?weight:'bold',fontStyle:'normal',lineHeight:300,fontFamily:'text',accessibilityProps:isReactNative$4()?{role:'heading'}:{},componentName:'heading',testID:testID};if(variant==='regular'){if(!size||size==='small'){props.fontSize=200;props.lineHeight=300;props.as='h6';}else if(size==='medium'){props.fontSize=300;props.lineHeight=200;props.as='h5';}else if(size==='large'){props.fontSize=400;props.lineHeight=400;props.as='h4';}}else if(variant==='subheading'){if(__DEV__){if(weight==='regular'){throwBladeError({moduleName:'Heading',message:`weight cannot be 'regular' when variant is 'subheading'`});}if(size){throwBladeError({moduleName:'Heading',message:`size prop cannot be added when variant is 'subheading'. Use variant 'regular' or remove size prop`});}}props.fontSize=75;props.lineHeight=50;props.as='p';}props.as=as||props.as;return props;};var Heading=function Heading(_ref2){var as=_ref2.as,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'regular':_ref2$variant,size=_ref2.size,_ref2$type=_ref2.type,type=_ref2$type===void 0?'normal':_ref2$type,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'bold':_ref2$weight,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,color=_ref2.color,children=_ref2.children,testID=_ref2.testID,textAlign=_ref2.textAlign,textDecorationLine=_ref2.textDecorationLine,styledProps=_objectWithoutProperties(_ref2,_excluded$53);useValidateAsProp({componentName:'Heading',as:as,validAsValues:validAsValues$2});var props=getProps$3({as:as,variant:variant,size:size,type:type,weight:weight,color:color,contrast:contrast,testID:testID});return jsx(BaseText,Object.assign({},props,{textAlign:textAlign,textDecorationLine:textDecorationLine},getStyledProps(styledProps),{children:children}));};
|
|
2032
2032
|
|
|
2033
|
-
var _excluded$52=["as","variant","weight","size","type","contrast","truncateAfterLines","children","color","testID","textAlign","textDecorationLine"];var validAsValues$1=['p','span','div','abbr','figcaption','cite','q'];var getTextProps=function getTextProps(_ref){var variant=_ref.variant,type=_ref.type,weight=_ref.weight,size=_ref.size,color=_ref.color,contrast=_ref.contrast,testID=_ref.testID,textAlign=_ref.textAlign,textDecorationLine=_ref.textDecorationLine;var colorContrast=contrast?`${contrast}Contrast`:'lowContrast';var props={color:color!=null?color:`surface.text.${type!=null?type:'normal'}.${colorContrast}`,fontSize:100,fontWeight:weight!=null?weight:'regular',fontStyle:'normal',lineHeight:100,fontFamily:'text',componentName:'text',testID:testID,textAlign:textAlign,textDecorationLine:textDecorationLine};if(variant==='body'){if(size==='xsmall'){props.fontSize=25;props.lineHeight=50;}if(size==='small'){props.fontSize=75;props.lineHeight=50;}if(size==='medium'){props.fontSize=100;props.lineHeight=100;}if(size==='large'){props.fontSize=200;props.lineHeight=300;}}if(variant==='caption'){if(size==='medium'){props.fontSize=50;props.lineHeight=50;}else if(__DEV__){throwBladeError({moduleName:'Text',message:`size cannot be '${size}' when variant is 'caption'`});}props.fontStyle='italic';}return props;};var _Text=function _Text(_ref2){var _ref2$as=_ref2.as,as=_ref2$as===void 0?'p':_ref2$as,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'body':_ref2$variant,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'regular':_ref2$weight,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,_ref2$type=_ref2.type,type=_ref2$type===void 0?'normal':_ref2$type,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,truncateAfterLines=_ref2.truncateAfterLines,children=_ref2.children,color=_ref2.color,testID=_ref2.testID,textAlign=_ref2.textAlign,textDecorationLine=_ref2.textDecorationLine,styledProps=_objectWithoutProperties(_ref2,_excluded$52);var props=Object.assign({as:as,truncateAfterLines:truncateAfterLines},getTextProps({variant:variant,type:type,weight:weight,color:color,size:size,contrast:contrast,testID:testID,textAlign:textAlign,textDecorationLine:textDecorationLine}));useValidateAsProp({componentName:'Text',as:as,validAsValues:validAsValues$1});return jsx(BaseText,Object.assign({},props,getStyledProps(styledProps),{children:children}));};var Text=assignWithoutSideEffects(_Text,{displayName:'Text',componentId:'Text'});
|
|
2033
|
+
var _excluded$52=["as","variant","weight","size","type","contrast","truncateAfterLines","children","color","testID","textAlign","textDecorationLine","wordBreak"];var validAsValues$1=['p','span','div','abbr','figcaption','cite','q'];var getTextProps=function getTextProps(_ref){var variant=_ref.variant,type=_ref.type,weight=_ref.weight,size=_ref.size,color=_ref.color,contrast=_ref.contrast,testID=_ref.testID,textAlign=_ref.textAlign,textDecorationLine=_ref.textDecorationLine;var colorContrast=contrast?`${contrast}Contrast`:'lowContrast';var props={color:color!=null?color:`surface.text.${type!=null?type:'normal'}.${colorContrast}`,fontSize:100,fontWeight:weight!=null?weight:'regular',fontStyle:'normal',lineHeight:100,fontFamily:'text',componentName:'text',testID:testID,textAlign:textAlign,textDecorationLine:textDecorationLine};if(variant==='body'){if(size==='xsmall'){props.fontSize=25;props.lineHeight=50;}if(size==='small'){props.fontSize=75;props.lineHeight=50;}if(size==='medium'){props.fontSize=100;props.lineHeight=100;}if(size==='large'){props.fontSize=200;props.lineHeight=300;}}if(variant==='caption'){if(size==='medium'){props.fontSize=50;props.lineHeight=50;}else if(__DEV__){throwBladeError({moduleName:'Text',message:`size cannot be '${size}' when variant is 'caption'`});}props.fontStyle='italic';}return props;};var _Text=function _Text(_ref2){var _ref2$as=_ref2.as,as=_ref2$as===void 0?'p':_ref2$as,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'body':_ref2$variant,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'regular':_ref2$weight,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,_ref2$type=_ref2.type,type=_ref2$type===void 0?'normal':_ref2$type,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,truncateAfterLines=_ref2.truncateAfterLines,children=_ref2.children,color=_ref2.color,testID=_ref2.testID,textAlign=_ref2.textAlign,textDecorationLine=_ref2.textDecorationLine,wordBreak=_ref2.wordBreak,styledProps=_objectWithoutProperties(_ref2,_excluded$52);var props=Object.assign({as:as,truncateAfterLines:truncateAfterLines,wordBreak:wordBreak},getTextProps({variant:variant,type:type,weight:weight,color:color,size:size,contrast:contrast,testID:testID,textAlign:textAlign,textDecorationLine:textDecorationLine}));useValidateAsProp({componentName:'Text',as:as,validAsValues:validAsValues$1});return jsx(BaseText,Object.assign({},props,getStyledProps(styledProps),{children:children}));};var Text=assignWithoutSideEffects(_Text,{displayName:'Text',componentId:'Text'});
|
|
2034
2034
|
|
|
2035
2035
|
var _excluded$51=["children","size","weight","isHighlighted","color","testID"];var platformType=getPlatformType();var isPlatformWeb=platformType==='browser'||platformType==='node';var getCodeFontSizeAndLineHeight=function getCodeFontSizeAndLineHeight(size){switch(size){case'medium':return {fontSize:75,lineHeight:75};case'small':return {fontSize:25,lineHeight:25};default:if(__DEV__){throwBladeError({moduleName:'Code',message:`Unexpected size: ${size}`});}return undefined;}};var CodeContainer=styled(BaseBox)(function(props){var padding=`${makeSpace(props.theme.spacing[0])} ${makeSpace(props.theme.spacing[2])}`;return {padding:padding,backgroundColor:props.isHighlighted?props.theme.colors.brand.gray.a100.lowContrast:undefined,borderRadius:props.theme.border.radius.medium,display:isPlatformWeb?'inline-block':'flex',alignSelf:isPlatformWeb?undefined:'center',verticalAlign:'middle',lineHeight:makeTypographySize(props.theme.typography.lineHeights[0])};});var getCodeColor=function getCodeColor(_ref){var isHighlighted=_ref.isHighlighted,color=_ref.color;if(isHighlighted){if(__DEV__){if(color){throwBladeError({moduleName:'Code',message:'`color` prop cannot be used without `isHighlighted={false}`'});}}return 'surface.text.subtle.lowContrast';}if(color){return color;}return 'surface.text.normal.lowContrast';};var Code=function Code(_ref2){var children=_ref2.children,_ref2$size=_ref2.size,size=_ref2$size===void 0?'small':_ref2$size,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'regular':_ref2$weight,_ref2$isHighlighted=_ref2.isHighlighted,isHighlighted=_ref2$isHighlighted===void 0?true:_ref2$isHighlighted,color=_ref2.color,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded$51);var _ref3=getCodeFontSizeAndLineHeight(size),fontSize=_ref3.fontSize,lineHeight=_ref3.lineHeight;var codeTextColor=React__default.useMemo(function(){return getCodeColor({isHighlighted:isHighlighted,color:color});},[isHighlighted,color]);return jsx(CodeContainer,Object.assign({size:size,isHighlighted:isHighlighted,as:isPlatformWeb?'span':undefined},metaAttribute({name:MetaConstants.Code,testID:testID}),getStyledProps(styledProps),{children:jsx(BaseText,{color:codeTextColor,fontFamily:"code",fontSize:fontSize,fontWeight:weight,as:isPlatformWeb?'code':undefined,lineHeight:lineHeight,children:children})}));};
|
|
2036
2036
|
|
|
@@ -2650,7 +2650,7 @@ var screenReaderStyles={border:0,clip:'rect(0 0 0 0)',clipPath:'inset(50%)',heig
|
|
|
2650
2650
|
|
|
2651
2651
|
var StyledVisuallyHidden=styled.View(screenReaderStyles);var VisuallyHidden=function VisuallyHidden(_ref){var children=_ref.children,testID=_ref.testID;return jsx(StyledVisuallyHidden,Object.assign({},metaAttribute({name:MetaConstants.VisuallyHidden,testID:testID}),{children:children}));};
|
|
2652
2652
|
|
|
2653
|
-
var FormLabel=function FormLabel(_ref){var _ref$as=_ref.as,as=_ref$as===void 0?'span':_ref$as,_ref$position=_ref.position,position=_ref$position===void 0?'top':_ref$position,_ref$necessityIndicat=_ref.necessityIndicator,necessityIndicator=_ref$necessityIndicat===void 0?'none':_ref$necessityIndicat,accessibilityText=_ref.accessibilityText,children=_ref.children,id=_ref.id,htmlFor=_ref.htmlFor,_ref$contrast=_ref.contrast,contrast=_ref$contrast===void 0?'low':_ref$contrast;var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var isDesktop=matchedDeviceType==='desktop';var isReactNative=getPlatformType()==='react-native';var necessityLabel=null;var isLabelLeftPositioned=position==='left'&&isDesktop;if(necessityIndicator==='optional'){necessityLabel=jsx(Text,{variant:"caption",weight:"regular",type:"placeholder",children:"(optional)"});}if(necessityIndicator==='required'){necessityLabel=jsx(BaseText,{lineHeight:100,fontFamily:"text",fontStyle:"normal",fontSize:75,fontWeight:"bold",color:"feedback.text.negative.lowContrast",children:"*"});}var computedAccessibilityNode=jsxs(VisuallyHidden,{children:[necessityIndicator!=='none'&&jsx(Text,{children:necessityIndicator}),jsx(Text,{children:accessibilityText})]});var textNode=jsxs(BaseBox,{gap:necessityIndicator==='optional'?'spacing.2':'spacing.0',display:"flex",flexDirection:"row",alignItems:"center",flexWrap:"wrap",maxHeight:makeSpace(size[36]),children:[jsx(Text,{type:"subdued",variant:"body",contrast:contrast,size:isLabelLeftPositioned?'medium':'small',truncateAfterLines:2,weight:"bold",children:children}),computedAccessibilityNode,necessityLabel]});if(isReactNative){return jsx(BaseBox,{marginRight:"spacing.5",marginBottom:"spacing.2",children:textNode});}var Component=as;var width=isLabelLeftPositioned&&isDesktop?makeSize(size[120]):'auto';return jsx(Component,Object.assign({htmlFor:htmlFor,style:{width:width,flexShrink:0,marginRight:makeSpace(theme.spacing[5])},id:id},metaAttribute({name:MetaConstants.FormLabel}),{children:jsx(BaseBox,{marginBottom:isLabelLeftPositioned?'spacing.0':'spacing.2',children:textNode})}));};
|
|
2653
|
+
var FormLabel=function FormLabel(_ref){var _ref$as=_ref.as,as=_ref$as===void 0?'span':_ref$as,_ref$position=_ref.position,position=_ref$position===void 0?'top':_ref$position,_ref$necessityIndicat=_ref.necessityIndicator,necessityIndicator=_ref$necessityIndicat===void 0?'none':_ref$necessityIndicat,accessibilityText=_ref.accessibilityText,children=_ref.children,id=_ref.id,htmlFor=_ref.htmlFor,_ref$contrast=_ref.contrast,contrast=_ref$contrast===void 0?'low':_ref$contrast;var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var isDesktop=matchedDeviceType==='desktop';var isReactNative=getPlatformType()==='react-native';var necessityLabel=null;var isLabelLeftPositioned=position==='left'&&isDesktop;if(necessityIndicator==='optional'){necessityLabel=jsx(Text,{variant:"caption",weight:"regular",type:"placeholder",children:"(optional)"});}if(necessityIndicator==='required'){necessityLabel=jsx(BaseText,{lineHeight:100,fontFamily:"text",fontStyle:"normal",fontSize:75,fontWeight:"bold",color:"feedback.text.negative.lowContrast",children:"*"});}var computedAccessibilityNode=jsxs(VisuallyHidden,{children:[necessityIndicator!=='none'&&jsx(Text,{children:necessityIndicator}),jsx(Text,{children:accessibilityText})]});var textNode=jsxs(BaseBox,{gap:necessityIndicator==='optional'?'spacing.2':'spacing.0',display:"flex",flexDirection:"row",alignItems:"center",flexWrap:"wrap",maxHeight:makeSpace(size[36]),children:[jsx(Text,{type:"subdued",variant:"body",contrast:contrast,size:isLabelLeftPositioned?'medium':'small',truncateAfterLines:2,weight:"bold",wordBreak:isLabelLeftPositioned?'break-word':undefined,children:children}),computedAccessibilityNode,necessityLabel]});if(isReactNative){return jsx(BaseBox,{marginRight:"spacing.5",marginBottom:"spacing.2",children:textNode});}var Component=as;var width=isLabelLeftPositioned&&isDesktop?makeSize(size[120]):'auto';return jsx(Component,Object.assign({htmlFor:htmlFor,style:{width:width,flexShrink:0,marginRight:makeSpace(theme.spacing[5])},id:id},metaAttribute({name:MetaConstants.FormLabel}),{children:jsx(BaseBox,{marginBottom:isLabelLeftPositioned?'spacing.0':'spacing.2',children:textNode})}));};
|
|
2654
2654
|
|
|
2655
2655
|
var StyledSelectorLabel=styled.Pressable(function(_ref){var theme=_ref.theme;return {display:'flex',flexDirection:'row',marginTop:makeSpace(theme.spacing[1]),marginBottom:makeSpace(theme.spacing[1])};});var SelectorLabel=function SelectorLabel(_ref2){var children=_ref2.children,inputProps=_ref2.inputProps,testID=_ref2.testID,onMouseDown=_ref2.onMouseDown,onMouseUp=_ref2.onMouseUp;return jsx(StyledSelectorLabel,Object.assign({onPressIn:onMouseDown,onPressOut:onMouseUp},inputProps,metaAttribute({testID:testID}),{children:children}));};
|
|
2656
2656
|
|