@razorpay/blade 9.0.0 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/index.native.js +1 -1
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +12 -3
- package/build/components/index.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 +1 -1
|
@@ -71,7 +71,7 @@ var isRoleMenu=function isRoleMenu(dropdownTriggerer){return isReactNative$4()||
|
|
|
71
71
|
|
|
72
72
|
var componentIds={ActionList:'ActionList',ActionListItem:'ActionListItem',ActionListItemAsset:'ActionListItemAsset',ActionListItemIcon:'ActionListItemIcon',ActionListItemText:'ActionListItemText',ActionListSection:'ActionListSection'};
|
|
73
73
|
|
|
74
|
-
var getComponentId=function getComponentId(component){var _component$type;if(!React__default.isValidElement(component))return null;return (_component$type=component.type)==null?void 0:_component$type.componentId;};var isValidAllowedChildren=function isValidAllowedChildren(component,id){return getComponentId(component)===id;};
|
|
74
|
+
var getComponentId=function getComponentId(component){var _component$props,_component$props2,_component$props2$ori,_component$type;if(!React__default.isValidElement(component))return null;if(component!=null&&(_component$props=component.props)!=null&&_component$props.mdxType&&component!=null&&(_component$props2=component.props)!=null&&(_component$props2$ori=_component$props2.originalType)!=null&&_component$props2$ori.componentId){return component.props.originalType.componentId;}return (_component$type=component.type)==null?void 0:_component$type.componentId;};var isValidAllowedChildren=function isValidAllowedChildren(component,id){return getComponentId(component)===id;};
|
|
75
75
|
|
|
76
76
|
var getActionListSectionPosition=function getActionListSectionPosition(children){var childComponentIdArray=React__default.Children.toArray(children).map(function(child){return getComponentId(child);});var lastActionListSectionIndex=childComponentIdArray.lastIndexOf(componentIds.ActionListSection);var isActionListItemPresentAfterSection=childComponentIdArray.slice(lastActionListSectionIndex).includes(componentIds.ActionListItem);return {isActionListItemPresentAfterSection:isActionListItemPresentAfterSection,lastActionListSectionIndex:lastActionListSectionIndex};};var actionListAllowedChildren=[componentIds.ActionListItem,componentIds.ActionListSection];var getActionListProperties=function getActionListProperties(children){var sectionData=[];var currentSection=null;var actionListOptions=[];var getActionListItemWithId=function getActionListItemWithId(child,hideDivider){if(React__default.isValidElement(child)&&!child.props.isDisabled){actionListOptions.push({title:child.props.title,value:child.props.value,onClickTrigger:function onClickTrigger(value){var _child$props$isSelect;var anchorLink=child.props.href;child.props.onClick==null?void 0:child.props.onClick({name:child.props.value,value:(_child$props$isSelect=child.props.isSelected)!=null?_child$props$isSelect:value});if(anchorLink&&!isReactNative$4()){var _child$props$target;var target=(_child$props$target=child.props.target)!=null?_child$props$target:'_self';window.open(anchorLink,target);if(window.top){window.top.open(anchorLink,target);}}}});var currentIndex=actionListOptions.length-1;var foundSection=sectionData.find(function(v){return v.title===currentSection;});if(foundSection){foundSection==null?void 0:foundSection.data.push(_extends({},child.props,{_index:currentIndex}));}else {sectionData.push({title:currentSection,hideDivider:hideDivider,data:[_extends({},child.props,{_index:currentIndex})]});}var clonedChild=React__default.cloneElement(child,{_index:currentIndex});return clonedChild;}return child;};var isActionListItemPresentAfterSection;var lastActionListSectionIndex;if(isReactNative$4()){var _getActionListSection=getActionListSectionPosition(children);isActionListItemPresentAfterSection=_getActionListSection.isActionListItemPresentAfterSection;lastActionListSectionIndex=_getActionListSection.lastActionListSectionIndex;}var childrenWithId=React__default.Children.map(children,function(child,index){if(React__default.isValidElement(child)){if(isValidAllowedChildren(child,componentIds.ActionListSection)){var shouldHideDivider=index===lastActionListSectionIndex&&!isActionListItemPresentAfterSection;return React__default.cloneElement(child,{children:React__default.Children.map(child.props.children,function(childInSection){currentSection=child.props.title;if(isValidAllowedChildren(childInSection,componentIds.ActionListItem)){return getActionListItemWithId(childInSection,shouldHideDivider);}return childInSection;}),_hideDivider:isReactNative$4()?shouldHideDivider:undefined});}if(isValidAllowedChildren(child,componentIds.ActionListItem)){return getActionListItemWithId(child,true);}throw new Error("[ActionList]: Only "+actionListAllowedChildren.join(', ')+" supported inside ActionList");}return child;});return {sectionData:sectionData,childrenWithId:childrenWithId,actionListOptions:actionListOptions};};var validateActionListItemProps=function validateActionListItemProps(_ref){var leading=_ref.leading,trailing=_ref.trailing;React__default.Children.map(trailing,function(child){if(!isValidAllowedChildren(child,componentIds.ActionListItemIcon)&&!isValidAllowedChildren(child,componentIds.ActionListItemText)){throw new Error("[ActionListItem]: Only "+componentIds.ActionListItemIcon+" and "+componentIds.ActionListItemText+" are allowed in trailing prop");}});React__default.Children.map(leading,function(child){if(!isValidAllowedChildren(child,componentIds.ActionListItemIcon)&&!isValidAllowedChildren(child,componentIds.ActionListItemText)&&!isValidAllowedChildren(child,componentIds.ActionListItemAsset)){throw new Error("[ActionListItem]: Only "+componentIds.ActionListItemIcon+", "+componentIds.ActionListItemAsset+", and "+componentIds.ActionListItemText+" are allowed in leading prop");}});};var getNormalTextColor=function getNormalTextColor(isDisabled){var _ref2=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},isMuted=_ref2.isMuted;if(isDisabled){return 'surface.text.placeholder.lowContrast';}if(isMuted){return 'surface.text.muted.lowContrast';}return 'surface.text.normal.lowContrast';};
|
|
77
77
|
|