@razorpay/blade 8.14.0 → 8.15.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.d.ts +60 -87
- package/build/components/index.native.d.ts +57 -79
- package/build/components/index.native.js +38 -42
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +1519 -1623
- 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
|
@@ -5,15 +5,15 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
|
5
5
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
6
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
7
7
|
import '@floating-ui/react';
|
|
8
|
-
import { Platform, Appearance,
|
|
8
|
+
import { Platform, Appearance, SectionList, TouchableOpacity, View, Image, Pressable, Linking, AccessibilityInfo, Dimensions, Keyboard, findNodeHandle, StyleSheet, Modal as Modal$1 } from 'react-native';
|
|
9
9
|
import Animated, { Easing, Keyframe, useSharedValue, useAnimatedStyle, withTiming, withRepeat, cancelAnimation, interpolate, withSequence, withDelay, interpolateColor, useDerivedValue, runOnJS } from 'react-native-reanimated';
|
|
10
10
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
11
|
+
import GorhomBottomSheet, { BottomSheetSectionList, BottomSheetScrollView, BottomSheetBackdrop as BottomSheetBackdrop$1, BottomSheetFooter as BottomSheetFooter$1 } from '@gorhom/bottom-sheet';
|
|
11
12
|
import styled, { ThemeProvider } from 'styled-components/native';
|
|
12
13
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
14
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
15
|
import { PortalProvider, PortalHost, Portal } from '@gorhom/portal';
|
|
14
16
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
15
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
16
|
-
import GorhomBottomSheet, { BottomSheetSectionList, BottomSheetScrollView, BottomSheetBackdrop as BottomSheetBackdrop$1, BottomSheetFooter as BottomSheetFooter$1 } from '@gorhom/bottom-sheet';
|
|
17
17
|
import { ClipPath as ClipPath$1, Circle as Circle$1, Defs as Defs$1, G as G$1, Path as Path$1, Rect as Rect$1, Svg as Svg$1 } from 'react-native-svg';
|
|
18
18
|
import { useFloating, shift, flip, offset, arrow } from '@floating-ui/react-native';
|
|
19
19
|
|
|
@@ -63,17 +63,23 @@ function usePrevious(value){var ref=useRef();useEffect(function(){ref.current=va
|
|
|
63
63
|
|
|
64
64
|
var BottomSheetContext=React__default.createContext({headerHeight:0,contentHeight:0,footerHeight:0,isHeaderFloating:false,setContentHeight:function setContentHeight(){},setHeaderHeight:function setHeaderHeight(){},setFooterHeight:function setFooterHeight(){},setHasBodyPadding:function setHasBodyPadding(){},setIsHeaderEmpty:function setIsHeaderEmpty(){},close:function close(){},scrollRef:null,bind:null,isOpen:false,positionY:0,isInBottomSheet:false,defaultInitialFocusRef:{current:null}});var useBottomSheetContext=function useBottomSheetContext(){var state=React__default.useContext(BottomSheetContext);return state;};var BottomSheetAndDropdownGlueContext=React__default.createContext(null);var useBottomSheetAndDropdownGlue=function useBottomSheetAndDropdownGlue(){var state=React__default.useContext(BottomSheetAndDropdownGlueContext);return state;};
|
|
65
65
|
|
|
66
|
-
var _excluded$
|
|
66
|
+
var _excluded$4V=["isOpen","setIsOpen","close","selectedIndices","setSelectedIndices","activeIndex","setActiveIndex","shouldIgnoreBlur","setShouldIgnoreBlur","isKeydownPressed","setIsKeydownPressed","options","selectionType","changeCallbackTriggerer","setChangeCallbackTriggerer","isControlled","setControlledValueIndices"];var noop=function noop(){};var DropdownContext=React__default.createContext({isOpen:false,setIsOpen:noop,close:noop,selectedIndices:[],setSelectedIndices:noop,controlledValueIndices:[],setControlledValueIndices:noop,options:[],setOptions:noop,activeIndex:-1,setActiveIndex:noop,shouldIgnoreBlur:false,setShouldIgnoreBlur:noop,shouldIgnoreBlurAnimation:false,setShouldIgnoreBlurAnimation:noop,hasFooterAction:false,setHasFooterAction:noop,hasLabelOnLeft:false,setHasLabelOnLeft:noop,isKeydownPressed:false,setIsKeydownPressed:noop,changeCallbackTriggerer:0,setChangeCallbackTriggerer:noop,isControlled:false,setIsControlled:noop,dropdownBaseId:'',actionListItemRef:{current:null},triggererRef:{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,shouldIgnoreBlur=_React$useContext.shouldIgnoreBlur,setShouldIgnoreBlur=_React$useContext.setShouldIgnoreBlur,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,rest=_objectWithoutProperties(_React$useContext,_excluded$4V);var bottomSheetAndDropdownGlue=useBottomSheetAndDropdownGlue();var setIndices=function setIndices(indices){if(isControlled){setControlledValueIndices(indices);}else {setSelectedIndices(indices);}};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)){var existingItemIndex=selectedIndices.indexOf(index);setIndices([].concat(_toConsumableArray(selectedIndices.slice(0,existingItemIndex)),_toConsumableArray(selectedIndices.slice(existingItemIndex+1))));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 onTriggerBlur=function onTriggerBlur(_ref){var name=_ref.name,value=_ref.value,onBlurCallback=_ref.onBlurCallback;if(rest.hasFooterAction){setActiveIndex(-1);}if(bottomSheetAndDropdownGlue!=null&&bottomSheetAndDropdownGlue.dropdownHasBottomSheet){setShouldIgnoreBlur(true);return;}if(shouldIgnoreBlur){setShouldIgnoreBlur(false);return;}onBlurCallback==null?void 0:onBlurCallback({name:name,value:value});if(isOpen){if(selectionType!=='multiple'){selectOption(activeIndex);}if(!(bottomSheetAndDropdownGlue!=null&&bottomSheetAndDropdownGlue.dropdownHasBottomSheet)){close();}}};var onOptionChange=function onOptionChange(actionType,index){var max=options.length-1;var newIndex=index!=null?index:activeIndex;setActiveIndex(getUpdatedIndex(newIndex,max,actionType));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);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(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(e.event.key==='Tab'&&rest.hasFooterAction){setShouldIgnoreBlur(true);}if(bottomSheetAndDropdownGlue!=null&&bottomSheetAndDropdownGlue.dropdownHasBottomSheet){setShouldIgnoreBlur(true);}if(!isKeydownPressed&&![' ','Enter','Escape','Meta'].includes(e.event.key)){setIsKeydownPressed(true);}var actionType=getActionFromKey(e.event,isOpen);if(actionType){performAction(actionType,e,{setIsOpen:setIsOpen,close:close,onOptionChange:onOptionChange,onComboType:onComboType,selectCurrentOption:function selectCurrentOption(){var _options$activeIndex$,_options$activeIndex;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 _extends({isOpen:isOpen,setIsOpen:setIsOpen,close:close,selectedIndices:selectedIndices,setSelectedIndices:setSelectedIndices,setControlledValueIndices:setControlledValueIndices,onTriggerClick:onTriggerClick,onTriggerKeydown:onTriggerKeydown,onTriggerBlur:onTriggerBlur,onOptionClick:onOptionClick,activeIndex:activeIndex,setActiveIndex:setActiveIndex,shouldIgnoreBlur:shouldIgnoreBlur,setShouldIgnoreBlur:setShouldIgnoreBlur,isKeydownPressed:isKeydownPressed,setIsKeydownPressed:setIsKeydownPressed,changeCallbackTriggerer:changeCallbackTriggerer,setChangeCallbackTriggerer:setChangeCallbackTriggerer,isControlled:isControlled,options:options,value:makeInputValue(selectedIndices,options),displayValue:makeInputDisplayValue(selectedIndices,options),selectionType:selectionType},rest);};
|
|
67
67
|
|
|
68
|
-
var isRoleMenu=function isRoleMenu(dropdownTriggerer){return isReactNative$4()||dropdownTriggerer!=='SelectInput';};var getActionListContainerRole=function getActionListContainerRole(hasFooterAction,dropdownTriggerer){if(hasFooterAction){return 'dialog';}if(isRoleMenu(dropdownTriggerer)){return 'menu';}return 'listbox';};var getActionListSectionRole=function getActionListSectionRole(){if(isReactNative$4()){return undefined;}return 'group';};var
|
|
68
|
+
var isRoleMenu=function isRoleMenu(dropdownTriggerer){return isReactNative$4()||dropdownTriggerer!=='SelectInput';};var getActionListContainerRole=function getActionListContainerRole(hasFooterAction,dropdownTriggerer){if(hasFooterAction){return 'dialog';}if(isRoleMenu(dropdownTriggerer)){return 'menu';}return 'listbox';};var getActionListSectionRole=function getActionListSectionRole(){if(isReactNative$4()){return undefined;}return 'group';};var getSeparatorRole=function getSeparatorRole(){if(isReactNative$4()){return undefined;}return 'separator';};var getActionListItemWrapperRole=function getActionListItemWrapperRole(hasFooterAction,dropdownTriggerer){if(isRoleMenu(dropdownTriggerer)){return undefined;}if(hasFooterAction){return 'listbox';}return undefined;};var getActionListItemRole=function getActionListItemRole(dropdownTriggerer,href,selectionType){if(href){return 'link';}if(isRoleMenu(dropdownTriggerer)){if(selectionType==='multiple'){return 'menuitemcheckbox';}return 'menuitem';}return 'option';};
|
|
69
69
|
|
|
70
|
-
var componentIds={ActionList:'ActionList',
|
|
70
|
+
var componentIds={ActionList:'ActionList',ActionListItem:'ActionListItem',ActionListItemAsset:'ActionListItemAsset',ActionListItemIcon:'ActionListItemIcon',ActionListItemText:'ActionListItemText',ActionListSection:'ActionListSection'};
|
|
71
71
|
|
|
72
72
|
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;};
|
|
73
73
|
|
|
74
|
-
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.
|
|
74
|
+
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';};
|
|
75
|
+
|
|
76
|
+
var getBaseListBoxWrapperStyles=function getBaseListBoxWrapperStyles(props){return {maxHeight:props.isInBottomSheet?undefined:makeSize(size[300]),padding:props.isInBottomSheet?undefined:makeSize(props.theme.spacing[3])};};
|
|
75
77
|
|
|
76
|
-
var
|
|
78
|
+
var StyledListBoxWrapper=styled(SectionList)(function(props){return _extends({},getBaseListBoxWrapperStyles({theme:props.theme,isInBottomSheet:props.isInBottomSheet}),{padding:makeSize(props.theme.spacing[3]),marginBottom:makeSize(props.marginBottom)});});
|
|
79
|
+
|
|
80
|
+
var getBaseActionListItemStyles=function getBaseActionListItemStyles(props){return {borderWidth:makeSize(props.theme.spacing[2]),borderStyle:'solid',borderColor:'transparent',textAlign:isReactNative$4()?undefined:'left',backgroundColor:'transparent',padding:makeSize(props.isMobile?props.theme.spacing[3]:props.theme.spacing[2]),borderRadius:makeSize(props.theme.border.radius.medium),textDecoration:'none',cursor:'pointer',width:'100%'};};
|
|
81
|
+
|
|
82
|
+
var StyledActionListItem=styled(TouchableOpacity)(function(props){return _extends({},getBaseActionListItemStyles(props),{backgroundColor:props.isSelected&&props.selectionType==='single'?props.theme.colors.brand.primary[300]:undefined});});
|
|
77
83
|
|
|
78
84
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
79
85
|
|
|
@@ -1961,32 +1967,14 @@ function isEmpty(value) {
|
|
|
1961
1967
|
|
|
1962
1968
|
var isEmpty_1 = isEmpty;
|
|
1963
1969
|
|
|
1964
|
-
var _excluded$
|
|
1970
|
+
var _excluded$4U=["base"];var getResponsiveValue=function getResponsiveValue(value){var breakpoint=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'base';if(value===undefined||value===null){return undefined;}if(typeof value==='string'||typeof value==='number'||Array.isArray(value)){if(breakpoint==='base'){return value;}return undefined;}if(isEmpty_1(value)){return undefined;}if(isReactNative$4()){var priorityArray=[value.s,value.xs,value.base];return priorityArray.find(function(val){return val!==undefined;});}return value[breakpoint];};var getSpacingValue=function getSpacingValue(spacingValue,theme,breakpoint){if(isEmpty_1(spacingValue)){return undefined;}var responsiveSpacingValue=getResponsiveValue(spacingValue,breakpoint);if(isEmpty_1(responsiveSpacingValue)){return undefined;}if(responsiveSpacingValue==='auto'){return responsiveSpacingValue;}if(Array.isArray(responsiveSpacingValue)){return responsiveSpacingValue.map(function(value){return getSpacingValue(value,theme);}).join(' ');}if(typeof responsiveSpacingValue==='string'&&responsiveSpacingValue.startsWith('spacing.')){var spacingReturnValue=get_1(theme,responsiveSpacingValue);return isEmpty_1(spacingReturnValue)?makeSpace(spacingReturnValue):undefined;}return responsiveSpacingValue;};var getColorValue=function getColorValue(color,theme,breakpoint){var responsiveBackgroundValue=getResponsiveValue(color,breakpoint);var tokenValue=get_1(theme,"colors."+responsiveBackgroundValue);return tokenValue!=null?tokenValue:responsiveBackgroundValue;};var getBorderRadiusValue=function getBorderRadiusValue(borderRadius,theme,breakpoint){var responsiveBorderRadiusValue=getResponsiveValue(borderRadius,breakpoint);return isEmpty_1(responsiveBorderRadiusValue)?undefined:makeBorderSize(get_1(theme,"border.radius."+responsiveBorderRadiusValue));};var getBorderWidthValue=function getBorderWidthValue(borderWidth,theme,breakpoint){var responsiveBorderWidthValue=getResponsiveValue(borderWidth,breakpoint);return isEmpty_1(responsiveBorderWidthValue)?undefined:makeBorderSize(get_1(theme,"border.width."+responsiveBorderWidthValue));};var getAllProps=function getAllProps(props,breakpoint){var _props$paddingTop,_props$paddingBottom,_props$paddingRight,_props$paddingLeft,_props$marginBottom,_props$marginTop,_props$marginRight,_props$marginLeft;var hasBorder=props.borderBottom||props.borderTop||props.borderLeft||props.borderRight||props.borderBottomColor||props.borderTopColor||props.borderLeftColor||props.borderRightColor||props.borderBottomWidth||props.borderTopWidth||props.borderLeftWidth||props.borderRightWidth;return {display:getResponsiveValue(props.display,breakpoint),overflow:getResponsiveValue(props.overflow,breakpoint),overflowX:getResponsiveValue(props.overflowX,breakpoint),overflowY:getResponsiveValue(props.overflowY,breakpoint),textAlign:getResponsiveValue(props.textAlign,breakpoint),flex:getResponsiveValue(props.flex,breakpoint),flexWrap:getResponsiveValue(props.flexWrap,breakpoint),flexDirection:getResponsiveValue(props.flexDirection,breakpoint),flexGrow:getResponsiveValue(props.flexGrow,breakpoint),flexShrink:getResponsiveValue(props.flexShrink,breakpoint),flexBasis:getResponsiveValue(props.flexBasis,breakpoint),alignItems:getResponsiveValue(props.alignItems,breakpoint),alignContent:getResponsiveValue(props.alignContent,breakpoint),alignSelf:getResponsiveValue(props.alignSelf,breakpoint),justifyItems:getResponsiveValue(props.justifyItems,breakpoint),justifyContent:getResponsiveValue(props.justifyContent,breakpoint),justifySelf:getResponsiveValue(props.justifySelf,breakpoint),order:getResponsiveValue(props.order,breakpoint),position:getResponsiveValue(props.position,breakpoint),zIndex:getResponsiveValue(props.zIndex,breakpoint),grid:getResponsiveValue(props.grid,breakpoint),gridColumn:getResponsiveValue(props.gridColumn,breakpoint),gridRow:getResponsiveValue(props.gridRow,breakpoint),gridRowStart:getResponsiveValue(props.gridRowStart,breakpoint),gridRowEnd:getResponsiveValue(props.gridRowEnd,breakpoint),gridArea:getResponsiveValue(props.gridArea,breakpoint),gridAutoFlow:getResponsiveValue(props.gridAutoFlow,breakpoint),gridAutoRows:getResponsiveValue(props.gridAutoRows,breakpoint),gridAutoColumns:getResponsiveValue(props.gridAutoColumns,breakpoint),gridTemplate:getResponsiveValue(props.gridTemplate,breakpoint),gridTemplateAreas:getResponsiveValue(props.gridTemplateAreas,breakpoint),gridTemplateColumns:getResponsiveValue(props.gridTemplateColumns,breakpoint),gridTemplateRows:getResponsiveValue(props.gridTemplateRows,breakpoint),padding:getSpacingValue(props.padding,props.theme,breakpoint),paddingTop:getSpacingValue((_props$paddingTop=props.paddingTop)!=null?_props$paddingTop:props.paddingY,props.theme,breakpoint),paddingBottom:getSpacingValue((_props$paddingBottom=props.paddingBottom)!=null?_props$paddingBottom:props.paddingY,props.theme,breakpoint),paddingRight:getSpacingValue((_props$paddingRight=props.paddingRight)!=null?_props$paddingRight:props.paddingX,props.theme,breakpoint),paddingLeft:getSpacingValue((_props$paddingLeft=props.paddingLeft)!=null?_props$paddingLeft:props.paddingX,props.theme,breakpoint),margin:getSpacingValue(props.margin,props.theme,breakpoint),marginBottom:getSpacingValue((_props$marginBottom=props.marginBottom)!=null?_props$marginBottom:props.marginY,props.theme,breakpoint),marginTop:getSpacingValue((_props$marginTop=props.marginTop)!=null?_props$marginTop:props.marginY,props.theme,breakpoint),marginRight:getSpacingValue((_props$marginRight=props.marginRight)!=null?_props$marginRight:props.marginX,props.theme,breakpoint),marginLeft:getSpacingValue((_props$marginLeft=props.marginLeft)!=null?_props$marginLeft:props.marginX,props.theme,breakpoint),height:getSpacingValue(props.height,props.theme,breakpoint),minHeight:getSpacingValue(props.minHeight,props.theme,breakpoint),maxHeight:getSpacingValue(props.maxHeight,props.theme,breakpoint),width:getSpacingValue(props.width,props.theme,breakpoint),minWidth:getSpacingValue(props.minWidth,props.theme,breakpoint),maxWidth:getSpacingValue(props.maxWidth,props.theme,breakpoint),gap:getSpacingValue(props.gap,props.theme,breakpoint),rowGap:getSpacingValue(props.rowGap,props.theme,breakpoint),columnGap:getSpacingValue(props.columnGap,props.theme,breakpoint),top:getSpacingValue(props.top,props.theme,breakpoint),right:getSpacingValue(props.right,props.theme,breakpoint),bottom:getSpacingValue(props.bottom,props.theme,breakpoint),left:getSpacingValue(props.left,props.theme,breakpoint),backgroundColor:getColorValue(props.backgroundColor,props.theme,breakpoint),backgroundImage:getResponsiveValue(props.backgroundImage,breakpoint),backgroundSize:getResponsiveValue(props.backgroundSize,breakpoint),backgroundPosition:getResponsiveValue(props.backgroundPosition,breakpoint),backgroundOrigin:getResponsiveValue(props.backgroundOrigin,breakpoint),backgroundRepeat:getResponsiveValue(props.backgroundRepeat,breakpoint),borderRadius:getBorderRadiusValue(props.borderRadius,props.theme,breakpoint),lineHeight:getSpacingValue(props.lineHeight,props.theme,breakpoint),border:getResponsiveValue(props.border,breakpoint),borderTop:getResponsiveValue(props.borderTop,breakpoint),borderRight:getResponsiveValue(props.borderRight,breakpoint),borderBottom:getResponsiveValue(props.borderBottom,breakpoint),borderLeft:getResponsiveValue(props.borderLeft,breakpoint),borderWidth:getBorderWidthValue(props.borderWidth,props.theme,breakpoint),borderColor:getColorValue(props.borderColor,props.theme,breakpoint),borderTopWidth:getBorderWidthValue(props.borderTopWidth,props.theme,breakpoint),borderTopColor:getColorValue(props.borderTopColor,props.theme,breakpoint),borderRightWidth:getBorderWidthValue(props.borderRightWidth,props.theme,breakpoint),borderRightColor:getColorValue(props.borderRightColor,props.theme,breakpoint),borderBottomWidth:getBorderWidthValue(props.borderBottomWidth,props.theme,breakpoint),borderBottomColor:getColorValue(props.borderBottomColor,props.theme,breakpoint),borderLeftWidth:getBorderWidthValue(props.borderLeftWidth,props.theme,breakpoint),borderLeftColor:getColorValue(props.borderLeftColor,props.theme,breakpoint),borderTopLeftRadius:getBorderRadiusValue(props.borderTopLeftRadius,props.theme,breakpoint),borderTopRightRadius:getBorderRadiusValue(props.borderTopRightRadius,props.theme,breakpoint),borderBottomRightRadius:getBorderRadiusValue(props.borderBottomRightRadius,props.theme,breakpoint),borderBottomLeftRadius:getBorderRadiusValue(props.borderBottomLeftRadius,props.theme,breakpoint),borderStyle:hasBorder?'solid':undefined,touchAction:getResponsiveValue(props.touchAction,breakpoint),userSelect:getResponsiveValue(props.userSelect,breakpoint),pointerEvents:getResponsiveValue(props.pointerEvents),opacity:getResponsiveValue(props.opacity,breakpoint)};};var shouldAddBreakpoint=function shouldAddBreakpoint(cssProps){var firstDefinedValue=Object.values(cssProps).find(function(cssValue){return cssValue!==undefined&&cssValue!==null;});return firstDefinedValue!==undefined;};var getAllMediaQueries=function getAllMediaQueries(props){if(isReactNative$4()){return {};}breakpoints.base;var breakpointsWithoutBase=_objectWithoutProperties(breakpoints,_excluded$4U);return Object.fromEntries(Object.entries(breakpointsWithoutBase).map(function(_ref){var _ref2=_slicedToArray(_ref,2),breakpointKey=_ref2[0],breakpointValue=_ref2[1];var cssPropsForCurrentBreakpoint=getAllProps(props,breakpointKey);if(!shouldAddBreakpoint(cssPropsForCurrentBreakpoint)){return [];}var mediaQuery="@media "+getMediaQuery({min:breakpointValue});return [mediaQuery,cssPropsForCurrentBreakpoint];}));};var getBaseBoxStyles=function getBaseBoxStyles(props){return _extends({},getAllProps(props),getAllMediaQueries(props));};
|
|
1965
1971
|
|
|
1966
|
-
var MetaConstants={Accordion:'accordion',AccordionButton:'accordion-button',AccordionItem:'accordion-item',ActionList:'action-list',
|
|
1972
|
+
var MetaConstants={Accordion:'accordion',AccordionButton:'accordion-button',AccordionItem:'accordion-item',ActionList:'action-list',ActionListItem:'action-list-item',ActionListSection:'action-list-section',Alert:'alert',Amount:'amount',Badge:'badge',Box:'box',BaseBox:'base-box',BaseText:'base-text',Button:'button',Checkbox:'checkbox',CheckboxGroup:'checkbox-group',CheckboxLabel:'checkbox-label',Code:'code',Component:'blade-component',Counter:'counter',Divider:'divider',DropdownOverlay:'dropdown-overlay',DropdownFooter:'dropdown-footer',DropdownHeader:'dropdown-header',Icon:'icon',IconButton:'icon-button',Indicator:'indicator',Link:'link',List:'list',ListItem:'list-item',OTPInput:'otp-input',PasswordInput:'password-input',TextArea:'textarea',TextInput:'textinput',ProgressBar:'progress-bar',Radio:'radio',RadioGroup:'radio-group',RadioLabel:'radio-label',SkipNav:'skipnav',Spinner:'spinner',SelectInput:'select-input',Tooltip:'tooltip',TooltipInteractiveWrapper:'tooltip-interactive-wrapper',BottomSheet:'bottom-sheet',BottomSheetBody:'bottom-sheet-body',BottomSheetHeader:'bottom-sheet-header',BottomSheetFooter:'bottom-sheet-footer',BottomSheetGrabHandle:'bottomsheet-grab-handle',Card:'card',CardBody:'card-body',CardHeader:'card-header',CardFooter:'card-footer',Collapsible:'collapsible',CollapsibleBody:'collapsible-body',CollapsibleButton:'collapsible-button',CollapsibleLink:'collapsible-link',Modal:'modal',ModalBody:'modal-body',ModalHeader:'modal-header',ModalFooter:'modal-footer',ModalBackdrop:'modal-backdrop',ModalScrollOverlay:'modal-scroll-overlay',VisuallyHidden:'visually-hidden',FormLabel:'form-label',Switch:'switch',SwitchLabel:'switch-label',StyledBaseInput:'styled-base-input'};
|
|
1967
1973
|
|
|
1968
1974
|
var metaAttribute=function metaAttribute(_ref){var testID=_ref.testID,name=_ref.name;return _extends({},name?_defineProperty({},"data-"+MetaConstants.Component,name):{},testID?{testID:testID}:{});};
|
|
1969
1975
|
|
|
1970
1976
|
var isSupportedOnReactNativeElement=function isSupportedOnReactNativeElement(prop){return !prop.startsWith('padding')&&!prop.startsWith('margin')&&prop!=='flex';};var BaseBox=styled(View).attrs(function(props){return _extends({},metaAttribute({name:props['data-blade-component']||MetaConstants.BaseBox}));}).withConfig({shouldForwardProp:function shouldForwardProp(prop,defaultValidator){return isSupportedOnReactNativeElement(prop)&&defaultValidator(prop);}})(function(props){var cssObject=getBaseBoxStyles(props);return cssObject;});
|
|
1971
1977
|
|
|
1972
|
-
var ThemeContext=createContext({theme:null,colorScheme:'light',platform:'onDesktop',setColorScheme:function setColorScheme(){return null;}});var useTheme=function useTheme(){var themeContext=useContext(ThemeContext);if(!themeContext.theme){throw new Error("[@razorpay/blade:BladeProvider]: BladeProvider is missing theme");}if(themeContext===undefined){throw new Error("[@razorpay/blade:BladeProvider]: useTheme must be used within BladeProvider");}return themeContext;};
|
|
1973
|
-
|
|
1974
|
-
var useBladeProvider=function useBladeProvider(_ref){var themeTokens=_ref.themeTokens,initialColorScheme=_ref.initialColorScheme;if(!themeTokens){throw new Error("[BladeProvider]: Expected valid themeTokens of type ThemeTokens to be passed but found "+typeof themeTokens);}if(initialColorScheme&&!colorSchemeNamesInput.includes(initialColorScheme)){throw new Error("[BladeProvider]: Expected color scheme to be one of ["+colorSchemeNamesInput.toString()+"] but received "+initialColorScheme);}var _useColorScheme=useColorScheme(initialColorScheme),colorScheme=_useColorScheme.colorScheme,setColorScheme=_useColorScheme.setColorScheme;var _useBreakpoint=useBreakpoint({breakpoints:themeTokens.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var onColorMode="on"+toTitleCase(colorScheme);var onDeviceType="on"+toTitleCase(matchedDeviceType);var theme=_extends({},themeTokens,{colors:themeTokens.colors[onColorMode],elevation:themeTokens.elevation[onColorMode],typography:themeTokens.typography[onDeviceType]});var themeContextValue={theme:theme,colorScheme:colorScheme,setColorScheme:setColorScheme,platform:onDeviceType};return {themeContextValue:themeContextValue,theme:theme};};
|
|
1975
|
-
|
|
1976
|
-
var BottomSheetStackContext=React__default.createContext({stack:[],addBottomSheetToStack:function addBottomSheetToStack(){},removeBottomSheetFromStack:function removeBottomSheetFromStack(){},getTopOfTheStack:function getTopOfTheStack(){return null;},getCurrentStackIndexById:function getCurrentStackIndexById(){return -1;}});var BottomSheetStackProvider=function BottomSheetStackProvider(_ref){var children=_ref.children;var _React$useState=React__default.useState([]),_React$useState2=_slicedToArray(_React$useState,2),stack=_React$useState2[0],setStack=_React$useState2[1];var getTopOfTheStack=React__default.useCallback(function(){return stack[0]||null;},[stack]);var addBottomSheetToStack=React__default.useCallback(function(id){setStack(function(prev){return [id].concat(_toConsumableArray(prev));});},[]);var removeBottomSheetFromStack=React__default.useCallback(function(id){setStack(function(prev){var newStack=_toConsumableArray(prev);var popped=newStack.shift();if(popped===id)return newStack;return newStack;});},[]);var getCurrentStackIndexById=React__default.useCallback(function(id){return stack.findIndex(function(stackId){return stackId===id;});},[stack]);var value=React__default.useMemo(function(){return {stack:stack,addBottomSheetToStack:addBottomSheetToStack,removeBottomSheetFromStack:removeBottomSheetFromStack,getTopOfTheStack:getTopOfTheStack,getCurrentStackIndexById:getCurrentStackIndexById};},[addBottomSheetToStack,getCurrentStackIndexById,getTopOfTheStack,removeBottomSheetFromStack,stack]);return jsx(BottomSheetStackContext.Provider,{value:value,children:children});};var useBottomSheetStack=function useBottomSheetStack(){var context=React__default.useContext(BottomSheetStackContext);return context;};
|
|
1977
|
-
|
|
1978
|
-
var gestureHandlerStyle={flex:1};var BladeProvider=function BladeProvider(_ref){var themeTokens=_ref.themeTokens,initialColorScheme=_ref.colorScheme,children=_ref.children;var _useBladeProvider=useBladeProvider({initialColorScheme:initialColorScheme,themeTokens:themeTokens}),theme=_useBladeProvider.theme,themeContextValue=_useBladeProvider.themeContextValue;return jsx(GestureHandlerRootView,{style:gestureHandlerStyle,children:jsx(PortalProvider,{children:jsx(ThemeContext.Provider,{value:themeContextValue,children:jsxs(ThemeProvider,{theme:theme,children:[jsx(BottomSheetStackProvider,{children:children}),jsx(PortalHost,{name:"BladeBottomSheetPortal"})]})})})});};
|
|
1979
|
-
|
|
1980
|
-
var _excluded$4U=["children"];var BaseStyledActionList=styled(BaseBox)(function(props){return _extends({},getBaseActionListStyles(props));});var StyledActionList=function StyledActionList(_ref){var children=_ref.children,props=_objectWithoutProperties(_ref,_excluded$4U);var _useTheme=useTheme(),theme=_useTheme.theme;return jsx(BaseStyledActionList,_extends({},props,{style:props.isInBottomSheet?undefined:castNativeType(theme.elevation.midRaised),children:children}));};
|
|
1981
|
-
|
|
1982
|
-
var getBaseListBoxWrapperStyles=function getBaseListBoxWrapperStyles(props){return {maxHeight:props.isInBottomSheet?undefined:makeSize(size[300]),padding:props.isInBottomSheet?undefined:makeSize(props.theme.spacing[3])};};
|
|
1983
|
-
|
|
1984
|
-
var StyledListBoxWrapper=styled(SectionList)(function(props){return _extends({},getBaseListBoxWrapperStyles({theme:props.theme,isInBottomSheet:props.isInBottomSheet}),{padding:makeSize(props.theme.spacing[3]),marginBottom:makeSize(props.marginBottom)});});
|
|
1985
|
-
|
|
1986
|
-
var getBaseActionListItemStyles=function getBaseActionListItemStyles(props){return {borderWidth:makeSize(props.theme.spacing[2]),borderStyle:'solid',borderColor:'transparent',textAlign:isReactNative$4()?undefined:'left',backgroundColor:'transparent',padding:makeSize(props.isMobile?props.theme.spacing[3]:props.theme.spacing[2]),borderRadius:makeSize(props.theme.border.radius.medium),textDecoration:'none',cursor:'pointer',width:'100%'};};
|
|
1987
|
-
|
|
1988
|
-
var StyledActionListItem=styled(TouchableOpacity)(function(props){return _extends({},getBaseActionListItemStyles(props),{backgroundColor:props.isSelected&&props.selectionType==='single'?props.theme.colors.brand.primary[300]:undefined});});
|
|
1989
|
-
|
|
1990
1978
|
var validBoxAsValues=['div','section','footer','header','main','aside','nav','span','label'];
|
|
1991
1979
|
|
|
1992
1980
|
var assignWithoutSideEffects=function assignWithoutSideEffects(component,sourceObj){return _extends(component,sourceObj);};
|
|
@@ -2051,6 +2039,14 @@ var getCheckboxIconWrapperStyles=function getCheckboxIconWrapperStyles(_ref){var
|
|
|
2051
2039
|
|
|
2052
2040
|
var CheckboxIconWrapper=styled.View(function(props){return getCheckboxIconWrapperStyles(props);});
|
|
2053
2041
|
|
|
2042
|
+
var ThemeContext=createContext({theme:null,colorScheme:'light',platform:'onDesktop',setColorScheme:function setColorScheme(){return null;}});var useTheme=function useTheme(){var themeContext=useContext(ThemeContext);if(!themeContext.theme){throw new Error("[@razorpay/blade:BladeProvider]: BladeProvider is missing theme");}if(themeContext===undefined){throw new Error("[@razorpay/blade:BladeProvider]: useTheme must be used within BladeProvider");}return themeContext;};
|
|
2043
|
+
|
|
2044
|
+
var useBladeProvider=function useBladeProvider(_ref){var themeTokens=_ref.themeTokens,initialColorScheme=_ref.initialColorScheme;if(!themeTokens){throw new Error("[BladeProvider]: Expected valid themeTokens of type ThemeTokens to be passed but found "+typeof themeTokens);}if(initialColorScheme&&!colorSchemeNamesInput.includes(initialColorScheme)){throw new Error("[BladeProvider]: Expected color scheme to be one of ["+colorSchemeNamesInput.toString()+"] but received "+initialColorScheme);}var _useColorScheme=useColorScheme(initialColorScheme),colorScheme=_useColorScheme.colorScheme,setColorScheme=_useColorScheme.setColorScheme;var _useBreakpoint=useBreakpoint({breakpoints:themeTokens.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var onColorMode="on"+toTitleCase(colorScheme);var onDeviceType="on"+toTitleCase(matchedDeviceType);var theme=_extends({},themeTokens,{colors:themeTokens.colors[onColorMode],elevation:themeTokens.elevation[onColorMode],typography:themeTokens.typography[onDeviceType]});var themeContextValue={theme:theme,colorScheme:colorScheme,setColorScheme:setColorScheme,platform:onDeviceType};return {themeContextValue:themeContextValue,theme:theme};};
|
|
2045
|
+
|
|
2046
|
+
var BottomSheetStackContext=React__default.createContext({stack:[],addBottomSheetToStack:function addBottomSheetToStack(){},removeBottomSheetFromStack:function removeBottomSheetFromStack(){},getTopOfTheStack:function getTopOfTheStack(){return null;},getCurrentStackIndexById:function getCurrentStackIndexById(){return -1;}});var BottomSheetStackProvider=function BottomSheetStackProvider(_ref){var children=_ref.children;var _React$useState=React__default.useState([]),_React$useState2=_slicedToArray(_React$useState,2),stack=_React$useState2[0],setStack=_React$useState2[1];var getTopOfTheStack=React__default.useCallback(function(){return stack[0]||null;},[stack]);var addBottomSheetToStack=React__default.useCallback(function(id){setStack(function(prev){return [id].concat(_toConsumableArray(prev));});},[]);var removeBottomSheetFromStack=React__default.useCallback(function(id){setStack(function(prev){var newStack=_toConsumableArray(prev);var popped=newStack.shift();if(popped===id)return newStack;return newStack;});},[]);var getCurrentStackIndexById=React__default.useCallback(function(id){return stack.findIndex(function(stackId){return stackId===id;});},[stack]);var value=React__default.useMemo(function(){return {stack:stack,addBottomSheetToStack:addBottomSheetToStack,removeBottomSheetFromStack:removeBottomSheetFromStack,getTopOfTheStack:getTopOfTheStack,getCurrentStackIndexById:getCurrentStackIndexById};},[addBottomSheetToStack,getCurrentStackIndexById,getTopOfTheStack,removeBottomSheetFromStack,stack]);return jsx(BottomSheetStackContext.Provider,{value:value,children:children});};var useBottomSheetStack=function useBottomSheetStack(){var context=React__default.useContext(BottomSheetStackContext);return context;};
|
|
2047
|
+
|
|
2048
|
+
var gestureHandlerStyle={flex:1};var BladeProvider=function BladeProvider(_ref){var themeTokens=_ref.themeTokens,initialColorScheme=_ref.colorScheme,children=_ref.children;var _useBladeProvider=useBladeProvider({initialColorScheme:initialColorScheme,themeTokens:themeTokens}),theme=_useBladeProvider.theme,themeContextValue=_useBladeProvider.themeContextValue;return jsx(GestureHandlerRootView,{style:gestureHandlerStyle,children:jsx(PortalProvider,{children:jsx(ThemeContext.Provider,{value:themeContextValue,children:jsxs(ThemeProvider,{theme:theme,children:[jsx(BottomSheetStackProvider,{children:children}),jsx(PortalHost,{name:"BladeBottomSheetPortal"})]})})})});};
|
|
2049
|
+
|
|
2054
2050
|
var StyledFade$1=styled(Animated.View)(function(_ref){var styles=_ref.styles;return _extends({},styles);});var Fade$1=function Fade(_ref2){var children=_ref2.children,show=_ref2.show,styles=_ref2.styles;var _useTheme=useTheme(),theme=_useTheme.theme;var fadeInEasing=theme.motion.easing.entrance.effective;var fadeOutEasing=theme.motion.easing.exit.effective;var fadeIn=new Keyframe({from:{transform:[{scale:0.6}],opacity:0,easing:fadeInEasing},to:{transform:[{scale:1}],opacity:1,easing:fadeInEasing}}).duration(theme.motion.duration.quick);var fadeOut=new Keyframe({from:{transform:[{scale:1}],opacity:1,easing:fadeOutEasing},to:{transform:[{scale:0.6}],opacity:0,easing:fadeOutEasing}}).duration(theme.motion.duration.quick);return show?jsx(StyledFade$1,{styles:styles,entering:fadeIn,exiting:fadeOut,children:children}):null;};
|
|
2055
2051
|
|
|
2056
2052
|
var ClipPath=function ClipPath(_ref){var children=_ref.children,id=_ref.id;return jsx(ClipPath$1,_extends({id:id},metaAttribute({name:'svg-clippath'}),{children:children}));};
|
|
@@ -2653,11 +2649,7 @@ var ActionListItemContext=React__default.createContext({});var ActionListSection
|
|
|
2653
2649
|
|
|
2654
2650
|
var _ActionListBox=React__default.forwardRef(function(_ref,ref){var sectionData=_ref.sectionData,actionListItemWrapperRole=_ref.actionListItemWrapperRole,isMultiSelectable=_ref.isMultiSelectable,isInBottomSheet=_ref.isInBottomSheet;var _useBottomSheetContex=useBottomSheetContext(),footerHeight=_useBottomSheetContex.footerHeight,setContentHeight=_useBottomSheetContex.setContentHeight;var renderActionListItem=React__default.useCallback(function(_ref2){var item=_ref2.item;return jsx(ActionListItem,_extends({},item));},[]);var renderActionListSectionHeader=React__default.useCallback(function(_ref3){var title=_ref3.section.title;if(!title)return null;return jsx(ActionListSection,{title:title,_hideDivider:true,children:undefined});},[]);var renderActionListSectionDivider=React__default.useCallback(function(_ref4){var _ref4$section=_ref4.section,title=_ref4$section.title,hideDivider=_ref4$section.hideDivider;if(!title)return null;if(hideDivider)return null;return jsx(ActionListSectionDivider,{});},[]);return jsx(StyledListBoxWrapper,_extends({as:isInBottomSheet?BottomSheetSectionList:SectionList,isInBottomSheet:Boolean(isInBottomSheet),marginBottom:footerHeight,sections:sectionData,windowSize:5,keyExtractor:function keyExtractor(item){return item.value;},stickySectionHeadersEnabled:false,renderSectionHeader:renderActionListSectionHeader,renderSectionFooter:renderActionListSectionDivider,renderItem:renderActionListItem,ref:ref,onContentSizeChange:function onContentSizeChange(_width,height){setContentHeight(height);}},makeAccessible({role:actionListItemWrapperRole,multiSelectable:actionListItemWrapperRole==='listbox'?isMultiSelectable:undefined})));});var ActionListBox=assignWithoutSideEffects(_ActionListBox,{displayName:'ActionListBox'});
|
|
2655
2651
|
|
|
2656
|
-
var ActionListContext=React__default.createContext({surfaceLevel:2});var useActionListContext=function useActionListContext(){var context=React__default.useContext(ActionListContext);if(!context){throw new Error('[Blade ActionList]: useActionListContext has to be called inside ActionListContext.Provider');}return context;};var _ActionList=function _ActionList(_ref){var children=_ref.children,_ref$surfaceLevel=_ref.surfaceLevel,surfaceLevel=_ref$surfaceLevel===void 0?2:_ref$surfaceLevel,testID=_ref.testID;var _useDropdown=useDropdown(),setOptions=_useDropdown.setOptions,actionListItemRef=_useDropdown.actionListItemRef,selectionType=_useDropdown.selectionType,dropdownBaseId=_useDropdown.dropdownBaseId,dropdownTriggerer=_useDropdown.dropdownTriggerer,hasFooterAction=_useDropdown.hasFooterAction;var _useBottomSheetContex=useBottomSheetContext(),isInBottomSheet=_useBottomSheetContex.isInBottomSheet;var _React$useMemo=React__default.useMemo(function(){return getActionListProperties(children);},[children]),sectionData=_React$useMemo.sectionData,childrenWithId=_React$useMemo.childrenWithId,actionListOptions=_React$useMemo.actionListOptions
|
|
2657
|
-
|
|
2658
|
-
var StyledActionListHeader=styled(BaseBox)(function(props){return {display:'flex',flexDirection:'row',alignItems:'center',padding:makeSize(props.theme.spacing[3])+" "+makeSize(props.theme.spacing[5]),backgroundColor:props.theme.colors.brand.gray.a50.lowContrast};});var _ActionListHeader=function _ActionListHeader(props){React__default.useEffect(function(){React__default.Children.map(props.leading,function(child){if(!isValidAllowedChildren(child,componentIds.ActionListHeaderIcon)){throw new Error("[ActionListHeader]: Only "+componentIds.ActionListHeaderIcon+" is allowed in leading prop");}});},[props.leading]);return jsxs(StyledActionListHeader,_extends({},metaAttribute({name:MetaConstants.ActionListHeader,testID:props.testID}),{children:[jsx(BaseBox,{children:props.leading}),jsx(BaseBox,{paddingLeft:"spacing.3",paddingRight:"spacing.3",children:jsx(Text,{variant:"caption",color:"surface.text.subdued.lowContrast",children:props.title})})]}));};var ActionListHeader=assignWithoutSideEffects(_ActionListHeader,{componentId:componentIds.ActionListHeader});var _ActionListHeaderIcon=function _ActionListHeaderIcon(_ref){var icon=_ref.icon;var Icon=icon;return jsx(Icon,{color:"surface.text.muted.lowContrast",size:"small"});};var ActionListHeaderIcon=assignWithoutSideEffects(_ActionListHeaderIcon,{componentId:componentIds.ActionListHeaderIcon});
|
|
2659
|
-
|
|
2660
|
-
var StyledActionListFooter=styled(BaseBox)(function(props){return {display:'flex',flexDirection:'row',alignItems:'center',padding:makeSize(props.theme.spacing[3])+" "+makeSize(props.theme.spacing[5]),backgroundColor:props.theme.colors.brand.gray.a50.lowContrast};});var _ActionListFooter=function _ActionListFooter(props){var footerRef=React__default.useRef(null);var _useDropdown=useDropdown(),setShouldIgnoreBlur=_useDropdown.setShouldIgnoreBlur,setHasFooterAction=_useDropdown.setHasFooterAction,onTriggerKeydown=_useDropdown.onTriggerKeydown,activeIndex=_useDropdown.activeIndex,close=_useDropdown.close,selectionType=_useDropdown.selectionType;var bottomSheetAndDropdownGlue=useBottomSheetAndDropdownGlue();React__default.useEffect(function(){React__default.Children.map(props.leading,function(child){if(!isValidAllowedChildren(child,componentIds.ActionListFooterIcon)){throw new Error("[ActionListFooter]: Only "+componentIds.ActionListFooterIcon+" is allowed in leading prop");}});},[props.leading]);React__default.useEffect(function(){var _footerRef$current;if(!isReactNative$4()&&(_footerRef$current=footerRef.current)!=null&&_footerRef$current.querySelector('button, a')){setHasFooterAction(true);}},[setHasFooterAction,props.trailing]);var isOnlyActionButton=!props.title&&!props.leading&&props.trailing;return jsxs(StyledActionListFooter,_extends({ref:footerRef,onMouseDown:function onMouseDown(){if(selectionType==='multiple'){setShouldIgnoreBlur(true);}},onKeyDown:function onKeyDown(e){var nativeEvent=e.nativeEvent;var shouldIgnoreDropdownKeydown=(nativeEvent.key===' '||nativeEvent.key==='Enter')&&activeIndex<0;if(shouldIgnoreDropdownKeydown){if(selectionType==='single'&&!(bottomSheetAndDropdownGlue!=null&&bottomSheetAndDropdownGlue.dropdownHasBottomSheet)){close();}return;}onTriggerKeydown==null?void 0:onTriggerKeydown({event:e.nativeEvent});},onBlur:function onBlur(e){var nextItem=e.relatedTarget;var nextItemRole=nextItem==null?void 0:nextItem.getAttribute('role');if(nextItemRole!=='combobox'&&nextItemRole!=='option'&&!(bottomSheetAndDropdownGlue!=null&&bottomSheetAndDropdownGlue.dropdownHasBottomSheet)){close();}}},makeAccessible({role:getActionListFooterRole(),label:props.title}),metaAttribute({name:MetaConstants.ActionListFooter,testID:props.testID}),{children:[props.leading?jsx(BaseBox,{children:props.leading}):null,props.title?jsx(BaseBox,{flex:1,paddingLeft:"spacing.3",paddingRight:"spacing.3",children:jsx(Text,{variant:"caption",color:"surface.text.subdued.lowContrast",children:props.title})}):null,props.trailing?jsx(BaseBox,{display:"flex",alignItems:"center",marginLeft:isOnlyActionButton?undefined:'auto',width:isOnlyActionButton?'100%':undefined,children:props.trailing}):null]}));};var ActionListFooter=assignWithoutSideEffects(_ActionListFooter,{componentId:componentIds.ActionListFooter});var _ActionListFooterIcon=function _ActionListFooterIcon(_ref){var icon=_ref.icon;var Icon=icon;return jsx(Icon,{color:"surface.text.muted.lowContrast",size:"small"});};var ActionListFooterIcon=assignWithoutSideEffects(_ActionListFooterIcon,{componentId:componentIds.ActionListFooterIcon});
|
|
2652
|
+
var ActionListContext=React__default.createContext({surfaceLevel:2});var useActionListContext=function useActionListContext(){var context=React__default.useContext(ActionListContext);if(!context){throw new Error('[Blade ActionList]: useActionListContext has to be called inside ActionListContext.Provider');}return context;};var _ActionList=function _ActionList(_ref){var children=_ref.children,_ref$surfaceLevel=_ref.surfaceLevel,surfaceLevel=_ref$surfaceLevel===void 0?2:_ref$surfaceLevel,testID=_ref.testID;var _useDropdown=useDropdown(),setOptions=_useDropdown.setOptions,actionListItemRef=_useDropdown.actionListItemRef,selectionType=_useDropdown.selectionType,dropdownBaseId=_useDropdown.dropdownBaseId,dropdownTriggerer=_useDropdown.dropdownTriggerer,hasFooterAction=_useDropdown.hasFooterAction;var _useBottomSheetContex=useBottomSheetContext(),isInBottomSheet=_useBottomSheetContex.isInBottomSheet;var _React$useMemo=React__default.useMemo(function(){return getActionListProperties(children);},[children]),sectionData=_React$useMemo.sectionData,childrenWithId=_React$useMemo.childrenWithId,actionListOptions=_React$useMemo.actionListOptions;React__default.useEffect(function(){setOptions(actionListOptions);},[actionListOptions]);var actionListContainerRole=getActionListContainerRole(hasFooterAction,dropdownTriggerer);var actionListItemWrapperRole=getActionListItemWrapperRole(hasFooterAction,dropdownTriggerer);var isMultiSelectable=selectionType==='multiple';var actionListContextValue=React__default.useMemo(function(){return {surfaceLevel:surfaceLevel};},[surfaceLevel]);return jsx(ActionListContext.Provider,{value:actionListContextValue,children:isInBottomSheet?jsx(ActionListBox,{isInBottomSheet:isInBottomSheet,actionListItemWrapperRole:actionListItemWrapperRole,childrenWithId:childrenWithId,sectionData:sectionData,isMultiSelectable:isMultiSelectable,ref:actionListItemRef}):jsx(BaseBox,_extends({id:dropdownBaseId+"-actionlist"},makeAccessible({role:actionListContainerRole,multiSelectable:actionListContainerRole==='listbox'?isMultiSelectable:undefined,labelledBy:dropdownBaseId+"-label"}),metaAttribute({name:MetaConstants.ActionList,testID:testID}),{children:jsx(ActionListBox,{isInBottomSheet:isInBottomSheet,actionListItemWrapperRole:actionListItemWrapperRole,childrenWithId:childrenWithId,sectionData:sectionData,isMultiSelectable:isMultiSelectable,ref:actionListItemRef})}))});};var ActionList=assignWithoutSideEffects(React__default.memo(_ActionList),{displayName:componentIds.ActionList,componentId:componentIds.ActionList});
|
|
2661
2653
|
|
|
2662
2654
|
var _ActionListItemAsset=function _ActionListItemAsset(props){var source=typeof props.src==='string'?{uri:props.src}:props.src;return jsx(Image,{source:source,style:{width:size[16],height:size[12]},accessibilityIgnoresInvertColors:true,alt:props.alt});};var ActionListItemAsset=assignWithoutSideEffects(_ActionListItemAsset,{componentId:componentIds.ActionListItemAsset});
|
|
2663
2655
|
|
|
@@ -2705,7 +2697,7 @@ var StyledBadge=styled(BaseBox)(function(props){return _extends({},getStyledBadg
|
|
|
2705
2697
|
|
|
2706
2698
|
var verticalPadding$1={small:'spacing.0',medium:'spacing.1',large:'spacing.2'};var horizontalPadding$1={small:'spacing.3',medium:'spacing.3',large:'spacing.4'};var iconPadding={small:'spacing.1',medium:'spacing.2',large:'spacing.2'};var iconSize={small:'xsmall',medium:'small',large:'small'};
|
|
2707
2699
|
|
|
2708
|
-
var _excluded$r=["children","contrast","fontWeight","icon","size","variant","testID"];var isFeedbackVariant=function isFeedbackVariant(variant){var feedbackVariants=['information','negative','neutral','notice','positive'];return feedbackVariants.includes(variant);};var getColorProps$1=function getColorProps(_ref){var variant=_ref.variant,contrast=_ref.contrast;var props={iconColor:'feedback.icon.neutral.lowContrast',textColor:'feedback.text.neutral.lowContrast',backgroundColor:'feedback.background.neutral.lowContrast'};if(isFeedbackVariant(variant)){props.iconColor="feedback.icon."+variant+"."+contrast+"Contrast";props.textColor="feedback.text."+variant+"."+contrast+"Contrast";props.backgroundColor="feedback.background."+variant+"."+contrast+"Contrast";}else {props.iconColor="badge.icon."+variant+"."+contrast+"Contrast";props.textColor="badge.text."+variant+"."+contrast+"Contrast";props.backgroundColor="badge.background."+variant+"."+contrast+"Contrast";}return props;};var _Badge=function _Badge(_ref2){var children=_ref2.children,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,_ref2$fontWeight=_ref2.fontWeight,fontWeight=_ref2$fontWeight===void 0?'regular':_ref2$fontWeight,Icon=_ref2.icon,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'neutral':_ref2$variant,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded$r);var childrenString=getStringFromReactText(children);if(!(childrenString!=null&&childrenString.trim())){throw new Error('[Blade: Badge]: Text as children is required for Badge.');}var _getColorProps=getColorProps$1({variant:variant,contrast:contrast}),backgroundColor=_getColorProps.backgroundColor,iconColor=_getColorProps.iconColor,textColor=_getColorProps.textColor;var badgeTextSizes={small:{variant:'body',size:'xsmall'},medium:{variant:'body',size:'small'},large:{variant:'body',size:'small'}};return jsx(StyledBadge,_extends({backgroundColor:backgroundColor,size:size,textAlign:'left'},metaAttribute({name:MetaConstants.Badge,testID:testID}),getStyledProps(styledProps),{children:jsxs(BaseBox,{paddingRight:horizontalPadding$1[size],paddingLeft:horizontalPadding$1[size],paddingTop:verticalPadding$1[size],paddingBottom:verticalPadding$1[size],display:isReactNative$4()?'flex':'inline-flex',flexDirection:"row",justifyContent:"center",alignItems:"center",overflow:"hidden",children:[Icon?jsx(BaseBox,{paddingRight:Boolean(Icon)?iconPadding[size]:'spacing.0',display:"flex",children:jsx(Icon,{color:iconColor,size:iconSize[size]})}):null,jsx(Text,_extends({},badgeTextSizes[size],{type:"normal",weight:fontWeight,truncateAfterLines:1,color:textColor,children:children}))]})}));};var Badge=assignWithoutSideEffects(_Badge,{displayName:'Badge',componentId:'Badge'});
|
|
2700
|
+
var _excluded$r=["children","contrast","fontWeight","icon","size","variant","testID"];var isFeedbackVariant$1=function isFeedbackVariant(variant){var feedbackVariants=['information','negative','neutral','notice','positive'];return feedbackVariants.includes(variant);};var getColorProps$1=function getColorProps(_ref){var variant=_ref.variant,contrast=_ref.contrast;var props={iconColor:'feedback.icon.neutral.lowContrast',textColor:'feedback.text.neutral.lowContrast',backgroundColor:'feedback.background.neutral.lowContrast'};if(isFeedbackVariant$1(variant)){props.iconColor="feedback.icon."+variant+"."+contrast+"Contrast";props.textColor="feedback.text."+variant+"."+contrast+"Contrast";props.backgroundColor="feedback.background."+variant+"."+contrast+"Contrast";}else {props.iconColor="badge.icon."+variant+"."+contrast+"Contrast";props.textColor="badge.text."+variant+"."+contrast+"Contrast";props.backgroundColor="badge.background."+variant+"."+contrast+"Contrast";}return props;};var _Badge=function _Badge(_ref2){var children=_ref2.children,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,_ref2$fontWeight=_ref2.fontWeight,fontWeight=_ref2$fontWeight===void 0?'regular':_ref2$fontWeight,Icon=_ref2.icon,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'neutral':_ref2$variant,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded$r);var childrenString=getStringFromReactText(children);if(!(childrenString!=null&&childrenString.trim())){throw new Error('[Blade: Badge]: Text as children is required for Badge.');}var _getColorProps=getColorProps$1({variant:variant,contrast:contrast}),backgroundColor=_getColorProps.backgroundColor,iconColor=_getColorProps.iconColor,textColor=_getColorProps.textColor;var badgeTextSizes={small:{variant:'body',size:'xsmall'},medium:{variant:'body',size:'small'},large:{variant:'body',size:'small'}};return jsx(StyledBadge,_extends({backgroundColor:backgroundColor,size:size,textAlign:'left'},metaAttribute({name:MetaConstants.Badge,testID:testID}),getStyledProps(styledProps),{children:jsxs(BaseBox,{paddingRight:horizontalPadding$1[size],paddingLeft:horizontalPadding$1[size],paddingTop:verticalPadding$1[size],paddingBottom:verticalPadding$1[size],display:isReactNative$4()?'flex':'inline-flex',flexDirection:"row",justifyContent:"center",alignItems:"center",overflow:"hidden",children:[Icon?jsx(BaseBox,{paddingRight:Boolean(Icon)?iconPadding[size]:'spacing.0',display:"flex",children:jsx(Icon,{color:iconColor,size:iconSize[size]})}):null,jsx(Text,_extends({},badgeTextSizes[size],{type:"normal",weight:fontWeight,truncateAfterLines:1,color:textColor,children:children}))]})}));};var Badge=assignWithoutSideEffects(_Badge,{displayName:'Badge',componentId:'Badge'});
|
|
2709
2701
|
|
|
2710
2702
|
var _excluded$q=["children","surfaceLevel","elevation"];var CardSurfaceStyled=styled(BaseBox)(function(_ref){var surfaceLevel=_ref.surfaceLevel,elevation=_ref.elevation,theme=_ref.theme;var backgroundColor=theme.colors.surface.background["level"+surfaceLevel].lowContrast;return {width:'100%',display:'flex',flexDirection:'column',borderWidth:elevation==='none'?""+theme.border.width.thin:undefined,borderStyle:elevation==='none'?'solid':undefined,borderColor:elevation==='none'?""+theme.colors.surface.border.normal.lowContrast:undefined,backgroundColor:backgroundColor};});var CardSurface=function CardSurface(_ref2){var children=_ref2.children,surfaceLevel=_ref2.surfaceLevel,elevation=_ref2.elevation,props=_objectWithoutProperties(_ref2,_excluded$q);var _useTheme=useTheme(),theme=_useTheme.theme;return jsx(CardSurfaceStyled,_extends({},props,{surfaceLevel:surfaceLevel,elevation:elevation,style:castNativeType(theme.elevation[elevation]),children:children}));};
|
|
2711
2703
|
|
|
@@ -2723,7 +2715,7 @@ var getStyledCounterStyles=function getStyledCounterStyles(_ref){var theme=_ref.
|
|
|
2723
2715
|
|
|
2724
2716
|
var StyledCounter=styled(BaseBox)(function(props){return _extends({},getStyledCounterStyles(props),{alignSelf:'center'});});
|
|
2725
2717
|
|
|
2726
|
-
var _excluded$m=["value","max","intent","contrast","size","testID"];var getColorProps=function getColorProps(_ref){var _ref$
|
|
2718
|
+
var _excluded$m=["value","max","intent","variant","contrast","size","testID"];var isFeedbackVariant=function isFeedbackVariant(variant){var feedbackVariants=['information','negative','neutral','notice','positive'];return feedbackVariants.includes(variant);};var getColorProps=function getColorProps(_ref){var _ref$variant=_ref.variant,variant=_ref$variant===void 0?'neutral':_ref$variant,_ref$contrast=_ref.contrast,contrast=_ref$contrast===void 0?'low':_ref$contrast;var props={textColor:'feedback.text.neutral.lowContrast',backgroundColor:'feedback.background.neutral.lowContrast'};if(isFeedbackVariant(variant)){props.textColor="feedback.text."+variant+"."+contrast+"Contrast";props.backgroundColor="feedback.background."+variant+"."+contrast+"Contrast";}else {props.textColor="badge.text."+variant+"."+contrast+"Contrast";props.backgroundColor="badge.background."+variant+"."+contrast+"Contrast";}return props;};var Counter=function Counter(_ref2){var value=_ref2.value,max=_ref2.max,intent=_ref2.intent,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'neutral':_ref2$variant,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded$m);var content=""+value;if(max&&value>max){content=max+"+";}var _useTheme=useTheme(),platform=_useTheme.platform;var _getColorProps=getColorProps({variant:intent!=null?intent:variant,contrast:contrast}),backgroundColor=_getColorProps.backgroundColor,textColor=_getColorProps.textColor;if(intent){console.warn('[Blade: Counter] The prop `intent` is deprecated and will be removed in a future release. Please use `variant` instead.');}var counterTextSizes={small:{variant:'body',size:'xsmall'},medium:{variant:'body',size:'small'},large:{variant:'body',size:'medium'}};return jsx(StyledCounter,_extends({backgroundColor:backgroundColor,size:size,platform:platform},getStyledProps(styledProps),{children:jsx(BaseBox,_extends({paddingRight:horizontalPadding[size],paddingLeft:horizontalPadding[size],paddingTop:verticalPadding[size],paddingBottom:verticalPadding[size],display:isReactNative$4()?'flex':'inline-flex',flexDirection:"row",justifyContent:"center",alignItems:"center",overflow:"hidden"},metaAttribute({name:MetaConstants.Counter,testID:testID}),{children:jsx(Text,_extends({},counterTextSizes[size],{textAlign:"center",type:"normal",weight:"regular",truncateAfterLines:1,color:textColor,children:content}))}))}));};
|
|
2727
2719
|
|
|
2728
2720
|
var _CardHeaderIcon=function _CardHeaderIcon(_ref){var Icon=_ref.icon;useVerifyInsideCard('CardHeaderIcon');return jsx(Icon,{color:"surface.text.normal.lowContrast",size:"xlarge"});};var CardHeaderIcon=assignWithoutSideEffects(_CardHeaderIcon,{componentId:ComponentIds$2.CardHeaderIcon});var _CardHeaderCounter=function _CardHeaderCounter(props){useVerifyInsideCard('CardHeaderCounter');return jsx(Counter,_extends({},props));};var CardHeaderCounter=assignWithoutSideEffects(_CardHeaderCounter,{componentId:ComponentIds$2.CardHeaderCounter});var _CardHeaderBadge=function _CardHeaderBadge(props){useVerifyInsideCard('CardHeaderBadge');return jsx(Badge,_extends({},props));};var CardHeaderBadge=assignWithoutSideEffects(_CardHeaderBadge,{componentId:ComponentIds$2.CardHeaderBadge});var _CardHeaderText=function _CardHeaderText(props){useVerifyInsideCard('CardHeaderText');return jsx(Text,_extends({textAlign:"left"},props));};var CardHeaderText=assignWithoutSideEffects(_CardHeaderText,{componentId:ComponentIds$2.CardHeaderText});var _CardHeaderLink=function _CardHeaderLink(props){useVerifyInsideCard('CardHeaderLink');return jsx(Link,_extends({},props));};var CardHeaderLink=assignWithoutSideEffects(_CardHeaderLink,{componentId:ComponentIds$2.CardHeaderLink});var _CardHeaderIconButton=function _CardHeaderIconButton(props){useVerifyInsideCard('CardHeaderIconButton');return jsx(BaseBox,{width:makeSpace(minHeight.xsmall),children:jsx(Button,_extends({},props,{variant:"tertiary",size:"xsmall",iconPosition:"left",isFullWidth:true}))});};var CardHeaderIconButton=assignWithoutSideEffects(_CardHeaderIconButton,{componentId:ComponentIds$2.CardHeaderIconButton});var _CardHeader=function _CardHeader(_ref2){var children=_ref2.children,testID=_ref2.testID;useVerifyInsideCard('CardHeader');useVerifyAllowedComponents(children,'CardHeader',[ComponentIds$2.CardHeaderLeading,ComponentIds$2.CardHeaderTrailing]);return jsxs(BaseBox,_extends({marginBottom:"spacing.7"},metaAttribute({name:MetaConstants.CardHeader,testID:testID}),{children:[jsx(BaseBox,{marginBottom:"spacing.7",display:"flex",flexDirection:"row",justifyContent:"space-between",children:children}),jsx(Divider,{})]}));};var CardHeader=assignWithoutSideEffects(_CardHeader,{componentId:ComponentIds$2.CardHeader});var _CardHeaderLeading=function _CardHeaderLeading(_ref3){var title=_ref3.title,subtitle=_ref3.subtitle,prefix=_ref3.prefix,suffix=_ref3.suffix;useVerifyInsideCard('CardHeaderLeading');if(prefix&&!isValidAllowedChildren(prefix,ComponentIds$2.CardHeaderIcon)){throw new Error("[Blade CardHeaderLeading]: Only `"+ComponentIds$2.CardHeaderIcon+"` component is accepted in prefix");}if(suffix&&!isValidAllowedChildren(suffix,ComponentIds$2.CardHeaderCounter)){throw new Error("[Blade CardHeaderLeading]: Only `"+ComponentIds$2.CardHeaderCounter+"` component is accepted in prefix");}return jsxs(BaseBox,{flex:1,display:"flex",flexDirection:"row",children:[jsx(BaseBox,{marginRight:"spacing.3",alignSelf:"center",display:"flex",children:prefix}),jsxs(BaseBox,{children:[jsxs(BaseBox,{display:"flex",flexDirection:"row",alignItems:"center",flexWrap:"wrap",children:[jsx(Heading,{size:"small",variant:"regular",type:"normal",children:title}),jsx(BaseBox,{marginLeft:"spacing.3",children:suffix})]}),subtitle&&jsx(Text,{textAlign:"left",variant:"body",size:"small",weight:"regular",children:subtitle})]})]});};var CardHeaderLeading=assignWithoutSideEffects(_CardHeaderLeading,{componentId:ComponentIds$2.CardHeaderLeading});var headerTrailingAllowedComponents=[ComponentIds$2.CardHeaderLink,ComponentIds$2.CardHeaderText,ComponentIds$2.CardHeaderIconButton,ComponentIds$2.CardHeaderBadge];var _CardHeaderTrailing=function _CardHeaderTrailing(_ref4){var visual=_ref4.visual;useVerifyInsideCard('CardHeaderTrailing');if(visual&&!headerTrailingAllowedComponents.includes(getComponentId(visual))){throw new Error("[Blade CardHeaderTrailing]: Only one of `"+headerTrailingAllowedComponents.join(', ')+"` component is accepted in visual");}return jsx(BaseBox,{alignSelf:"center",children:visual});};var CardHeaderTrailing=assignWithoutSideEffects(_CardHeaderTrailing,{componentId:ComponentIds$2.CardHeaderTrailing});
|
|
2729
2721
|
|
|
@@ -2733,12 +2725,20 @@ var ComponentIds$1={BottomSheet:'BottomSheet',BottomSheetHeader:'BottomSheetHead
|
|
|
2733
2725
|
|
|
2734
2726
|
var _excluded$l=["children","selectionType","onDismiss"];var validDropdownChildren=[componentIds$1.triggers.SelectInput,componentIds$1.triggers.DropdownButton,componentIds$1.triggers.DropdownLink,componentIds$1.DropdownOverlay,ComponentIds$1.BottomSheet];var _Dropdown=function _Dropdown(_ref){var children=_ref.children,_ref$selectionType=_ref.selectionType,selectionType=_ref$selectionType===void 0?'single':_ref$selectionType,onDismiss=_ref.onDismiss,styledProps=_objectWithoutProperties(_ref,_excluded$l);var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isOpen=_React$useState2[0],setIsOpen=_React$useState2[1];var _React$useState3=React__default.useState([]),_React$useState4=_slicedToArray(_React$useState3,2),options=_React$useState4[0],setOptions=_React$useState4[1];var _React$useState5=React__default.useState([]),_React$useState6=_slicedToArray(_React$useState5,2),selectedIndices=_React$useState6[0],setSelectedIndices=_React$useState6[1];var _React$useState7=React__default.useState([]),_React$useState8=_slicedToArray(_React$useState7,2),controlledValueIndices=_React$useState8[0],setControlledValueIndices=_React$useState8[1];var _React$useState9=React__default.useState(-1),_React$useState10=_slicedToArray(_React$useState9,2),activeIndex=_React$useState10[0],setActiveIndex=_React$useState10[1];var _React$useState11=React__default.useState(false),_React$useState12=_slicedToArray(_React$useState11,2),shouldIgnoreBlur=_React$useState12[0],setShouldIgnoreBlur=_React$useState12[1];var _React$useState13=React__default.useState(false),_React$useState14=_slicedToArray(_React$useState13,2),shouldIgnoreBlurAnimation=_React$useState14[0],setShouldIgnoreBlurAnimation=_React$useState14[1];var triggererRef=React__default.useRef(null);var actionListItemRef=React__default.useRef(null);var _React$useState15=React__default.useState(false),_React$useState16=_slicedToArray(_React$useState15,2),hasFooterAction=_React$useState16[0],setHasFooterAction=_React$useState16[1];var _React$useState17=React__default.useState(false),_React$useState18=_slicedToArray(_React$useState17,2),hasLabelOnLeft=_React$useState18[0],setHasLabelOnLeft=_React$useState18[1];var _React$useState19=React__default.useState(false),_React$useState20=_slicedToArray(_React$useState19,2),isKeydownPressed=_React$useState20[0],setIsKeydownPressed=_React$useState20[1];var _React$useState21=React__default.useState(0),_React$useState22=_slicedToArray(_React$useState21,2),changeCallbackTriggerer=_React$useState22[0],setChangeCallbackTriggerer=_React$useState22[1];var _React$useState23=React__default.useState(false),_React$useState24=_slicedToArray(_React$useState23,2),isControlled=_React$useState24[0],setIsControlled=_React$useState24[1];var _React$useState25=React__default.useState(false),_React$useState26=_slicedToArray(_React$useState25,2),dropdownHasBottomSheet=_React$useState26[0],setDropdownHasBottomSheet=_React$useState26[1];var dropdownBaseId=useId('dropdown');var dropdownTriggerer=React__default.useRef();var isFirstRenderRef=React__default.useRef(true);React__default.useEffect(function(){if(isFirstRenderRef.current){isFirstRenderRef.current=false;return;}if(!isOpen&&onDismiss){onDismiss();}},[isOpen]);var close=React__default.useCallback(function(){setIsOpen(false);onDismiss==null?void 0:onDismiss();},[onDismiss]);React__default.Children.map(children,function(child){if(React__default.isValidElement(child)){var _getComponentId;if(!validDropdownChildren.includes((_getComponentId=getComponentId(child))!=null?_getComponentId:'')){throw new Error("[Dropdown]: Dropdown can only have one of following elements as children - \n\n "+validDropdownChildren.join(', ')+" \n\n Check out: https://blade.razorpay.com/?path=/story/components-dropdown");}if(isValidAllowedChildren(child,componentIds$1.triggers.SelectInput)){dropdownTriggerer.current='SelectInput';}if(isValidAllowedChildren(child,componentIds$1.triggers.DropdownButton)){dropdownTriggerer.current='DropdownButton';}}});var contextValue=React__default.useMemo(function(){return {isOpen:isOpen,setIsOpen:setIsOpen,close:close,selectedIndices:selectedIndices,setSelectedIndices:setSelectedIndices,controlledValueIndices:controlledValueIndices,setControlledValueIndices:setControlledValueIndices,options:options,setOptions:setOptions,activeIndex:activeIndex,setActiveIndex:setActiveIndex,shouldIgnoreBlur:shouldIgnoreBlur,setShouldIgnoreBlur:setShouldIgnoreBlur,shouldIgnoreBlurAnimation:shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation:setShouldIgnoreBlurAnimation,isKeydownPressed:isKeydownPressed,setIsKeydownPressed:setIsKeydownPressed,dropdownBaseId:dropdownBaseId,triggererRef:triggererRef,actionListItemRef:actionListItemRef,selectionType:selectionType,hasFooterAction:hasFooterAction,setHasFooterAction:setHasFooterAction,hasLabelOnLeft:hasLabelOnLeft,setHasLabelOnLeft:setHasLabelOnLeft,dropdownTriggerer:dropdownTriggerer.current,changeCallbackTriggerer:changeCallbackTriggerer,setChangeCallbackTriggerer:setChangeCallbackTriggerer,isControlled:isControlled,setIsControlled:setIsControlled};},[isOpen,selectedIndices,controlledValueIndices,options,activeIndex,shouldIgnoreBlur,shouldIgnoreBlurAnimation,selectionType,hasFooterAction,hasLabelOnLeft,isKeydownPressed,changeCallbackTriggerer,isControlled]);var BottomSheetAndDropdownGlueContextValue=React__default.useMemo(function(){return {isOpen:isOpen,dropdownHasBottomSheet:dropdownHasBottomSheet,setDropdownHasBottomSheet:setDropdownHasBottomSheet,onBottomSheetDismiss:close};},[dropdownHasBottomSheet,isOpen,close]);return jsx(BottomSheetAndDropdownGlueContext.Provider,{value:BottomSheetAndDropdownGlueContextValue,children:jsx(DropdownContext.Provider,{value:contextValue,children:jsx(BaseBox,_extends({position:"relative",textAlign:'left'},getStyledProps(styledProps),{children:children}))})});};var Dropdown=assignWithoutSideEffects(_Dropdown,{componentId:componentIds$1.Dropdown});
|
|
2735
2727
|
|
|
2736
|
-
var StyledDropdownOverlay=styled(BaseBox)(function(props){
|
|
2728
|
+
var StyledDropdownOverlay=styled(BaseBox)(function(props){var theme=props.theme,isInBottomSheet=props.isInBottomSheet;return {backgroundColor:theme.colors.surface.background.level2.lowContrast,borderWidth:isInBottomSheet?undefined:theme.border.width.thin,borderColor:theme.colors.surface.border.normal.lowContrast,borderStyle:isInBottomSheet?undefined:'solid',borderRadius:makeSize(theme.border.radius.medium),boxShadow:isInBottomSheet||isReactNative$4()?undefined:castWebType(theme.elevation.midRaised)};});
|
|
2729
|
+
|
|
2730
|
+
var AnimatedDropdownOverlay=styled(StyledDropdownOverlay)(function(props){return {transform:"translateY("+makeSize(props.theme.spacing[3])+")"};});var StyledCloseableArea=styled(Pressable)(function(props){return {position:'static',height:'100%',width:'100%',display:props.display};});var _DropdownOverlay=function _DropdownOverlay(_ref){var children=_ref.children,testID=_ref.testID;var _useDropdown=useDropdown(),isOpen=_useDropdown.isOpen,close=_useDropdown.close;var bottomSheetAndDropdownGlue=useBottomSheetAndDropdownGlue();return jsx(BaseBox,{position:"relative",children:jsx(StyledCloseableArea,{display:isOpen?'flex':'none',onPress:function onPress(){close();},testID:"closeable-area",children:jsx(AnimatedDropdownOverlay,_extends({isInBottomSheet:bottomSheetAndDropdownGlue==null?void 0:bottomSheetAndDropdownGlue.dropdownHasBottomSheet,display:isOpen?'flex':'none',position:"absolute",width:"100%",testID:"dropdown-overlay"},metaAttribute({name:MetaConstants.DropdownOverlay,testID:testID}),{children:children}))})});};var DropdownOverlay=assignWithoutSideEffects(_DropdownOverlay,{componentId:componentIds$1.DropdownOverlay});
|
|
2737
2731
|
|
|
2738
2732
|
var _excluded$k=["children","icon","iconPosition","isDisabled","isFullWidth","isLoading","onClick","onBlur","onKeyDown","size","type","variant","accessibilityLabel","testID"];var _DropdownButton=function _DropdownButton(_ref){var children=_ref.children,icon=_ref.icon,_ref$iconPosition=_ref.iconPosition,iconPosition=_ref$iconPosition===void 0?'left':_ref$iconPosition,_ref$isDisabled=_ref.isDisabled,isDisabled=_ref$isDisabled===void 0?false:_ref$isDisabled,_ref$isFullWidth=_ref.isFullWidth,isFullWidth=_ref$isFullWidth===void 0?false:_ref$isFullWidth,_ref$isLoading=_ref.isLoading,isLoading=_ref$isLoading===void 0?false:_ref$isLoading,_onClick=_ref.onClick,_onBlur=_ref.onBlur,_onKeyDown=_ref.onKeyDown,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,_ref$type=_ref.type,type=_ref$type===void 0?'button':_ref$type,_ref$variant=_ref.variant,variant=_ref$variant===void 0?'primary':_ref$variant,accessibilityLabel=_ref.accessibilityLabel,testID=_ref.testID,styledProps=_objectWithoutProperties(_ref,_excluded$k);var _useDropdown=useDropdown(),onTriggerClick=_useDropdown.onTriggerClick,onTriggerBlur=_useDropdown.onTriggerBlur,onTriggerKeydown=_useDropdown.onTriggerKeydown,dropdownBaseId=_useDropdown.dropdownBaseId,isOpen=_useDropdown.isOpen,activeIndex=_useDropdown.activeIndex,hasFooterAction=_useDropdown.hasFooterAction,triggererRef=_useDropdown.triggererRef;return jsx(BaseButton,_extends({},styledProps,icon?{icon:icon,children:children}:{children:children},{iconPosition:iconPosition,isDisabled:isDisabled,isFullWidth:isFullWidth,isLoading:isLoading,size:size,type:type,variant:variant,accessibilityLabel:accessibilityLabel,testID:testID,ref:triggererRef},makeAccessible({hasPopup:getActionListContainerRole(hasFooterAction,'DropdownButton'),expanded:isOpen,controls:dropdownBaseId+"-actionlist",role:'combobox',activeDescendant:activeIndex>=0?dropdownBaseId+"-"+activeIndex:undefined}),{onClick:function onClick(e){onTriggerClick();_onClick==null?void 0:_onClick(e);},onBlur:function onBlur(e){onTriggerBlur==null?void 0:onTriggerBlur({name:undefined,value:undefined});_onBlur==null?void 0:_onBlur(e);},onKeyDown:function onKeyDown(e){onTriggerKeydown==null?void 0:onTriggerKeydown({event:e});_onKeyDown==null?void 0:_onKeyDown(e);}}));};var DropdownButton=assignWithoutSideEffects(_DropdownButton,{componentId:componentIds$1.triggers.DropdownButton});
|
|
2739
2733
|
|
|
2740
2734
|
var _excluded$j=["children","icon","iconPosition","onClick","onBlur","onKeyDown","isDisabled","href","target","rel","accessibilityLabel","size","testID","hitSlop","htmlTitle"];var _DropdownLink=function _DropdownLink(_ref){var children=_ref.children,icon=_ref.icon,_ref$iconPosition=_ref.iconPosition,iconPosition=_ref$iconPosition===void 0?'left':_ref$iconPosition,_onClick=_ref.onClick,_onBlur=_ref.onBlur,_onKeyDown=_ref.onKeyDown,isDisabled=_ref.isDisabled;_ref.href;_ref.target;_ref.rel;var accessibilityLabel=_ref.accessibilityLabel,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,testID=_ref.testID,hitSlop=_ref.hitSlop,htmlTitle=_ref.htmlTitle,styledProps=_objectWithoutProperties(_ref,_excluded$j);var _useDropdown=useDropdown(),onTriggerClick=_useDropdown.onTriggerClick,onTriggerBlur=_useDropdown.onTriggerBlur,onTriggerKeydown=_useDropdown.onTriggerKeydown,dropdownBaseId=_useDropdown.dropdownBaseId,isOpen=_useDropdown.isOpen,activeIndex=_useDropdown.activeIndex,hasFooterAction=_useDropdown.hasFooterAction,triggererRef=_useDropdown.triggererRef;return jsx(BaseLink,_extends({variant:"button"},icon?{icon:icon,children:children}:{children:children},{iconPosition:iconPosition,accessibilityLabel:accessibilityLabel,size:size,testID:testID,hitSlop:hitSlop,htmlTitle:htmlTitle,isDisabled:isDisabled},styledProps,{ref:triggererRef},makeAccessible({hasPopup:getActionListContainerRole(hasFooterAction,'DropdownButton'),expanded:isOpen,controls:dropdownBaseId+"-actionlist",role:'combobox',activeDescendant:activeIndex>=0?dropdownBaseId+"-"+activeIndex:undefined}),{onClick:function onClick(e){onTriggerClick();_onClick==null?void 0:_onClick(e);},onBlur:function onBlur(e){onTriggerBlur==null?void 0:onTriggerBlur({name:undefined,value:undefined});_onBlur==null?void 0:_onBlur(e);},onKeyDown:function onKeyDown(e){onTriggerKeydown==null?void 0:onTriggerKeydown({event:e});_onKeyDown==null?void 0:_onKeyDown(e);}}));};var DropdownLink=assignWithoutSideEffects(_DropdownLink,{componentId:componentIds$1.triggers.DropdownLink});
|
|
2741
2735
|
|
|
2736
|
+
var _BaseFooter=function _BaseFooter(_ref){var children=_ref.children,_ref$showDivider=_ref.showDivider,showDivider=_ref$showDivider===void 0?true:_ref$showDivider,metaComponentName=_ref.metaComponentName,testID=_ref.testID;return jsxs(Fragment,{children:[showDivider&&jsx(Divider,{}),jsx(BaseBox,_extends({},metaAttribute({name:metaComponentName,testID:testID}),{padding:{base:'spacing.5',m:'spacing.6'},children:children}))]});};var BaseFooter=assignWithoutSideEffects(_BaseFooter,{componentId:'BaseFooter'});
|
|
2737
|
+
|
|
2738
|
+
var centerBoxProps={display:'flex',alignItems:'center',justifyContent:'center',height:'28px'};var propRestrictionMap={Button:{size:'xsmall',variant:'tertiary'},Badge:{size:'medium'},Link:{size:'medium'},Text:{size:'medium',variant:'body'},Amount:{size:'body-medium'}};var useTrailingRestriction=function useTrailingRestriction(trailing){var _React$useState=React__default.useState(null),_React$useState2=_slicedToArray(_React$useState,2),validatedTrailingComponent=_React$useState2[0],setValidatedTrailingComponent=_React$useState2[1];React__default.useEffect(function(){if(React__default.isValidElement(trailing)){var trailingComponentType=getComponentId(trailing);var restrictedProps=propRestrictionMap[trailingComponentType];var allowedComponents=Object.keys(propRestrictionMap);if(!restrictedProps){throw new Error("[Blade Header]: Only one of `"+allowedComponents.join(', ')+"` component is accepted as trailing");}var restrictedPropKeys=Object.keys(propRestrictionMap[trailingComponentType]);for(var _i=0,_restrictedPropKeys=restrictedPropKeys;_i<_restrictedPropKeys.length;_i++){var _trailing$props;var prop=_restrictedPropKeys[_i];if(trailing!=null&&(_trailing$props=trailing.props)!=null&&_trailing$props.hasOwnProperty(prop)){console.warn("[Blade Header]: Do not pass \""+prop+"\" to \""+trailingComponentType+"\" while inside Header trailing, because we override it.");}}setValidatedTrailingComponent(React__default.cloneElement(trailing,restrictedProps));}},[trailing]);return validatedTrailingComponent;};var _BaseHeader=function _BaseHeader(_ref){var title=_ref.title,subtitle=_ref.subtitle,leading=_ref.leading,titleSuffix=_ref.titleSuffix,trailing=_ref.trailing,_ref$showDivider=_ref.showDivider,showDivider=_ref$showDivider===void 0?true:_ref$showDivider,_ref$showBackButton=_ref.showBackButton,showBackButton=_ref$showBackButton===void 0?false:_ref$showBackButton,_ref$showCloseButton=_ref.showCloseButton,showCloseButton=_ref$showCloseButton===void 0?true:_ref$showCloseButton,onBackButtonClick=_ref.onBackButtonClick,onCloseButtonClick=_ref.onCloseButtonClick,closeButtonRef=_ref.closeButtonRef,testID=_ref.testID,onClickCapture=_ref.onClickCapture,onKeyDown=_ref.onKeyDown,onKeyUp=_ref.onKeyUp,onLostPointerCapture=_ref.onLostPointerCapture,onPointerCancel=_ref.onPointerCancel,onPointerDown=_ref.onPointerDown,onPointerMove=_ref.onPointerMove,onPointerUp=_ref.onPointerUp,metaComponentName=_ref.metaComponentName;var validatedTrailingComponent=useTrailingRestriction(trailing);var shouldWrapTitle=titleSuffix&&trailing&&showBackButton&&showCloseButton;var webOnlyEventHandlers=isReactNative$4()?{}:{onClickCapture:onClickCapture,onKeyDown:onKeyDown,onKeyUp:onKeyUp,onLostPointerCapture:onLostPointerCapture,onPointerCancel:onPointerCancel,onPointerDown:onPointerDown,onPointerMove:onPointerMove,onPointerUp:onPointerUp};return jsxs(BaseBox,_extends({},metaAttribute({name:metaComponentName,testID:testID}),{children:[jsx(BaseBox,_extends({marginY:{base:'spacing.5',m:'spacing.6'},paddingX:{base:'spacing.5',m:'spacing.6'},touchAction:"none"},webOnlyEventHandlers,{children:jsxs(BaseBox,{display:"flex",flexDirection:"row",userSelect:"none",children:[showBackButton?jsx(BaseBox,{overflow:"visible",marginRight:"spacing.5",children:jsx(Box,_extends({},centerBoxProps,{children:jsx(IconButton,{size:"large",icon:ChevronLeftIcon,onClick:function onClick(){return onBackButtonClick==null?void 0:onBackButtonClick();},accessibilityLabel:"Back"})}))}):null,jsxs(BaseBox,{paddingRight:"spacing.5",marginRight:"auto",flex:"auto",display:"flex",flexDirection:"row",alignItems:"flex-start",children:[leading?jsx(BaseBox,_extends({width:"spacing.8",height:"spacing.8",marginRight:"spacing.3"},centerBoxProps,{children:leading})):null,jsxs(BaseBox,{flex:"auto",children:[jsxs(BaseBox,{maxWidth:isReactNative$4()&&shouldWrapTitle?'100px':undefined,flexShrink:0,display:"flex",flexDirection:"row",children:[title?jsx(Heading,{size:"small",variant:"regular",type:"normal",children:title}):null,titleSuffix&&jsx(BaseBox,{marginLeft:"spacing.3",children:jsx(Box,_extends({},centerBoxProps,{children:titleSuffix}))})]}),subtitle?jsx(Text,{variant:"body",size:"small",weight:"regular",type:"muted",children:subtitle}):null]})]}),validatedTrailingComponent?jsx(BaseBox,{marginRight:"spacing.5",children:jsx(Box,_extends({},centerBoxProps,{children:validatedTrailingComponent}))}):null,showCloseButton?jsx(Box,_extends({},centerBoxProps,{children:jsx(IconButton,{ref:closeButtonRef,size:"large",icon:CloseIcon,accessibilityLabel:"Close",onClick:function onClick(){return onCloseButtonClick==null?void 0:onCloseButtonClick();}})})):null]})})),showDivider?jsx(Divider,{}):null]}));};var BaseHeader=assignWithoutSideEffects(_BaseHeader,{componentId:'BaseHeader'});
|
|
2739
|
+
|
|
2740
|
+
var _DropdownHeader=function _DropdownHeader(_ref){var title=_ref.title,subtitle=_ref.subtitle,leading=_ref.leading,titleSuffix=_ref.titleSuffix,trailing=_ref.trailing,testID=_ref.testID;return jsx(BaseBox,_extends({overflow:'auto',flexShrink:0},isReactNative$4()?{}:{onMouseDown:function onMouseDown(e){e.preventDefault();}},{children:jsx(BaseHeader,{title:title,subtitle:subtitle,leading:leading,trailing:trailing,titleSuffix:titleSuffix,metaComponentName:MetaConstants.DropdownHeader,testID:testID,showBackButton:false,showCloseButton:false})}));};var DropdownHeader=assignWithoutSideEffects(_DropdownHeader,{componentId:'DropdownHeader'});var _DropdownFooter=function _DropdownFooter(_ref2){var children=_ref2.children,testID=_ref2.testID;var _useDropdown=useDropdown(),setHasFooterAction=_useDropdown.setHasFooterAction,setShouldIgnoreBlur=_useDropdown.setShouldIgnoreBlur,activeIndex=_useDropdown.activeIndex,onTriggerKeydown=_useDropdown.onTriggerKeydown,close=_useDropdown.close;var bottomSheetAndDropdownGlue=useBottomSheetAndDropdownGlue();var footerRef=React__default.useRef(null);var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isClickedInsideFooter=_React$useState2[0],setIsClickedInsideFooter=_React$useState2[1];React__default.useEffect(function(){setHasFooterAction(true);},[]);return jsx(BaseBox,_extends({ref:footerRef},isReactNative$4()?{}:{onMouseDown:function onMouseDown(){setShouldIgnoreBlur(true);setIsClickedInsideFooter(true);},onMouseUp:function onMouseUp(){setIsClickedInsideFooter(false);},onKeyDown:function onKeyDown(e){var nativeEvent=e.nativeEvent;var shouldIgnoreDropdownKeydown=(nativeEvent.key===' '||nativeEvent.key==='Enter')&&activeIndex<0;if(!shouldIgnoreDropdownKeydown){onTriggerKeydown==null?void 0:onTriggerKeydown({event:e.nativeEvent});}},onBlur:function onBlur(){if(!isClickedInsideFooter&&!(bottomSheetAndDropdownGlue!=null&&bottomSheetAndDropdownGlue.dropdownHasBottomSheet)){close();}}},makeAccessible({role:'group'}),{children:jsx(BaseFooter,{metaComponentName:MetaConstants.DropdownFooter,testID:testID,children:children})}));};var DropdownFooter=assignWithoutSideEffects(_DropdownFooter,{componentId:'DropdownFooter'});
|
|
2741
|
+
|
|
2742
2742
|
var getVisualContainerStyles=function getVisualContainerStyles(){return {display:'flex',flexDirection:'row',alignItems:'center'};};var getPrefixStyles=function getPrefixStyles(_ref){var hasLeadingIcon=_ref.hasLeadingIcon,hasPrefix=_ref.hasPrefix;if(hasPrefix&&hasLeadingIcon){return {paddingLeft:'spacing.2'};}if(hasPrefix&&!hasLeadingIcon){return {paddingLeft:'spacing.4'};}return {paddingLeft:'spacing.0'};};var getInteractionElementStyles=function getInteractionElementStyles(_ref2){var hasTrailingIcon=_ref2.hasTrailingIcon,hasInteractionElement=_ref2.hasInteractionElement,hasSuffix=_ref2.hasSuffix;if(hasInteractionElement&&(hasSuffix||hasTrailingIcon)){return {paddingRight:'spacing.2'};}if(hasInteractionElement&&!hasSuffix&&!hasTrailingIcon){return {paddingRight:'spacing.4'};}return {paddingRight:'spacing.0'};};var getSuffixStyles=function getSuffixStyles(_ref3){var hasTrailingIcon=_ref3.hasTrailingIcon,hasSuffix=_ref3.hasSuffix;if(hasSuffix&&hasTrailingIcon){return {paddingRight:'spacing.2'};}if(hasSuffix&&!hasTrailingIcon){return {paddingRight:'spacing.4'};}return {paddingRight:'spacing.0'};};var getInputVisualsToBeRendered=function getInputVisualsToBeRendered(_ref4){var leadingIcon=_ref4.leadingIcon,prefix=_ref4.prefix,interactionElement=_ref4.interactionElement,suffix=_ref4.suffix,trailingIcon=_ref4.trailingIcon;return {hasLeadingIcon:Boolean(leadingIcon),hasPrefix:Boolean(prefix),hasInteractionElement:Boolean(interactionElement),hasSuffix:Boolean(suffix),hasTrailingIcon:Boolean(trailingIcon)};};var BaseInputVisuals=function BaseInputVisuals(_ref5){var LeadingIcon=_ref5.leadingIcon,prefix=_ref5.prefix,interactionElement=_ref5.interactionElement,suffix=_ref5.suffix,TrailingIcon=_ref5.trailingIcon,isDisabled=_ref5.isDisabled;var _getInputVisualsToBeR=getInputVisualsToBeRendered({leadingIcon:LeadingIcon,prefix:prefix,interactionElement:interactionElement,suffix:suffix,trailingIcon:TrailingIcon}),hasLeadingIcon=_getInputVisualsToBeR.hasLeadingIcon,hasPrefix=_getInputVisualsToBeR.hasPrefix,hasInteractionElement=_getInputVisualsToBeR.hasInteractionElement,hasSuffix=_getInputVisualsToBeR.hasSuffix,hasTrailingIcon=_getInputVisualsToBeR.hasTrailingIcon;var hasLeadingVisuals=hasLeadingIcon||hasPrefix;var hasTrailingVisuals=hasInteractionElement||hasSuffix||hasTrailingIcon;if(hasLeadingVisuals){return jsxs(BaseBox,_extends({},getVisualContainerStyles(),{children:[LeadingIcon?jsx(BaseBox,{paddingLeft:"spacing.4",display:"flex",children:jsx(LeadingIcon,{size:"medium",color:isDisabled?'surface.text.placeholder.lowContrast':'surface.text.subtle.lowContrast'})}):null,hasPrefix?jsx(BaseBox,_extends({},getPrefixStyles({hasLeadingIcon:hasLeadingIcon,hasPrefix:hasPrefix}),{children:jsx(Text,{size:"medium",variant:"body",weight:"regular",contrast:"low",type:isDisabled?'placeholder':'subtle',children:prefix})})):null]}));}if(hasTrailingVisuals){return jsxs(BaseBox,_extends({},getVisualContainerStyles(),{children:[hasInteractionElement?jsx(BaseBox,_extends({},getInteractionElementStyles({hasTrailingIcon:hasTrailingIcon,hasInteractionElement:hasInteractionElement,hasSuffix:hasSuffix}),{display:"flex",children:interactionElement})):null,hasSuffix?jsx(BaseBox,_extends({},getSuffixStyles({hasTrailingIcon:hasTrailingIcon,hasSuffix:hasSuffix}),{children:jsx(Text,{size:"medium",variant:"body",weight:"regular",contrast:"low",type:isDisabled?'placeholder':'subtle',children:suffix})})):null,TrailingIcon?jsx(BaseBox,{paddingRight:"spacing.4",display:"flex",children:jsx(TrailingIcon,{size:"medium",color:isDisabled?'surface.text.placeholder.lowContrast':'surface.text.subtle.lowContrast'})}):null]}));}return null;};
|
|
2743
2743
|
|
|
2744
2744
|
var getTextStyles=function getTextStyles(_ref){var variant=_ref.variant,type=_ref.type,weight=_ref.weight,size=_ref.size,contrast=_ref.contrast,theme=_ref.theme;return getBaseTextStyles(_extends({},getTextProps({variant:variant,type:type,weight:weight,size:size,contrast:contrast}),{theme:theme}));};
|
|
@@ -3058,12 +3058,10 @@ var _Switch=function _Switch(_ref,ref){var defaultChecked=_ref.defaultChecked,is
|
|
|
3058
3058
|
|
|
3059
3059
|
var affixFontSizes={'body-small':75,'body-small-bold':75,'body-medium':75,'body-medium-bold':75,'heading-small':75,'heading-small-bold':75,'heading-large':100,'heading-large-bold':100,'title-small':300,'title-medium':400};var amountFontSizes={'body-small':75,'body-small-bold':75,'body-medium':100,'body-medium-bold':100,'heading-small':200,'heading-small-bold':200,'heading-large':400,'heading-large-bold':400,'title-small':600,'title-medium':700};var amountLineHeights={'body-small':50,'body-small-bold':50,'body-medium':100,'body-medium-bold':100,'heading-small':300,'heading-small-bold':300,'heading-large':400,'heading-large-bold':400,'title-small':500,'title-medium':600};var currencyPrefixMapping={INR:{'currency-symbol':'₹','currency-code':'INR'},MYR:{'currency-symbol':'RM','currency-code':'MYR'}};var currencyLocaleMapping={INR:'en-IN',MYR:'en-MY'};var currencyAbbreviationsMapping={INR:[{value:1e7,symbol:'Cr'},{value:1e5,symbol:'L'},{value:1e3,symbol:'k'}],MYR:[{value:1e9,symbol:'B'},{value:1e6,symbol:'M'},{value:1e3,symbol:'K'}]};
|
|
3060
3060
|
|
|
3061
|
-
var _excluded$3=["value","suffix","size","isAffixSubtle","intent","prefix","testID","currency"];var getTextColorProps=function getTextColorProps(_ref){var intent=_ref.intent;var props={amountValueColor:'surface.text.normal.lowContrast',affixColor:'surface.text.muted.lowContrast'};if(!intent)return props;props.amountValueColor="feedback.text."+intent+".lowContrast";props.affixColor="feedback.text."+intent+".lowContrast";return props;};var AmountValue=function AmountValue(_ref2){var value=_ref2.value,size=_ref2.size,amountValueColor=_ref2.amountValueColor,isAffixSubtle=_ref2.isAffixSubtle,suffix=_ref2.suffix,affixColor=_ref2.affixColor;var affixFontWeight=isAffixSubtle?'regular':'bold';var isReactNative=getPlatformType()==='react-native';var affixFontSize=isAffixSubtle?affixFontSizes[size]:amountFontSizes[size];var valueForWeight=size.includes('bold')||size.startsWith('title')?'bold':'regular';if(suffix==='decimals'&&isAffixSubtle){var integer=value.split('.')[0];var decimal=value.split('.')[1];var AmountWrapper=getPlatformType()==='react-native'?BaseText:React__default.Fragment;return jsxs(AmountWrapper,{children:[jsxs(BaseText,{fontSize:amountFontSizes[size],fontWeight:valueForWeight,lineHeight:amountLineHeights[size],color:amountValueColor,as:isReactNative?undefined:'span',children:[integer,"."]}),jsx(BaseText,{marginLeft:"spacing.1",fontWeight:affixFontWeight,fontSize:affixFontSize,color:affixColor,as:isReactNative?undefined:'span',children:decimal||'00'})]});}return jsx(BaseText,{fontSize:amountFontSizes[size],fontWeight:valueForWeight,color:amountValueColor,lineHeight:amountLineHeights[size],children:value});};var getFlooredFixed=function getFlooredFixed(value,decimalPlaces){var factor=Math.pow(10,decimalPlaces);var roundedValue=Math.floor(value*factor)/factor;return Number(roundedValue.toFixed(decimalPlaces));};var addCommas=function addCommas(amountValue,currency){var decimalPlaces=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var locale=currencyLocaleMapping[currency];return amountValue.toLocaleString(locale,{minimumFractionDigits:decimalPlaces});};var getHumanizedAmount=function getHumanizedAmount(amountValue,currency){var abbreviations=currencyAbbreviationsMapping[currency];var abbreviation=abbreviations.find(function(abbr){return amountValue>=abbr.value;});if(abbreviation){amountValue=amountValue/abbreviation.value;var formattedAmountValue=getFlooredFixed(amountValue,2);return addCommas(formattedAmountValue,currency)+abbreviation.symbol;}else {return amountValue.toString();}};var formatAmountWithSuffix=function formatAmountWithSuffix(_ref3){var suffix=_ref3.suffix,value=_ref3.value,currency=_ref3.currency;switch(suffix){case'decimals':{var decimalNumber=getFlooredFixed(value,2);return addCommas(decimalNumber,currency,2);}case'humanize':{return getHumanizedAmount(value,currency);}case'none':{return addCommas(getFlooredFixed(value,0),currency);}default:return addCommas(getFlooredFixed(value,0),currency);}};var getCurrencyWeight=function getCurrencyWeight(isAffixSubtle,size){if(isAffixSubtle||size.startsWith('bold'))return 'bold';return 'regular';};var
|
|
3061
|
+
var _excluded$3=["value","suffix","size","isAffixSubtle","intent","prefix","testID","currency"];var getTextColorProps=function getTextColorProps(_ref){var intent=_ref.intent;var props={amountValueColor:'surface.text.normal.lowContrast',affixColor:'surface.text.muted.lowContrast'};if(!intent)return props;props.amountValueColor="feedback.text."+intent+".lowContrast";props.affixColor="feedback.text."+intent+".lowContrast";return props;};var AmountValue=function AmountValue(_ref2){var value=_ref2.value,size=_ref2.size,amountValueColor=_ref2.amountValueColor,isAffixSubtle=_ref2.isAffixSubtle,suffix=_ref2.suffix,affixColor=_ref2.affixColor;var affixFontWeight=isAffixSubtle?'regular':'bold';var isReactNative=getPlatformType()==='react-native';var affixFontSize=isAffixSubtle?affixFontSizes[size]:amountFontSizes[size];var valueForWeight=size.includes('bold')||size.startsWith('title')?'bold':'regular';if(suffix==='decimals'&&isAffixSubtle){var integer=value.split('.')[0];var decimal=value.split('.')[1];var AmountWrapper=getPlatformType()==='react-native'?BaseText:React__default.Fragment;return jsxs(AmountWrapper,{children:[jsxs(BaseText,{fontSize:amountFontSizes[size],fontWeight:valueForWeight,lineHeight:amountLineHeights[size],color:amountValueColor,as:isReactNative?undefined:'span',children:[integer,"."]}),jsx(BaseText,{marginLeft:"spacing.1",fontWeight:affixFontWeight,fontSize:affixFontSize,color:affixColor,as:isReactNative?undefined:'span',children:decimal||'00'})]});}return jsx(BaseText,{fontSize:amountFontSizes[size],fontWeight:valueForWeight,color:amountValueColor,lineHeight:amountLineHeights[size],children:value});};var getFlooredFixed=function getFlooredFixed(value,decimalPlaces){var factor=Math.pow(10,decimalPlaces);var roundedValue=Math.floor(value*factor)/factor;return Number(roundedValue.toFixed(decimalPlaces));};var addCommas=function addCommas(amountValue,currency){var decimalPlaces=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var locale=currencyLocaleMapping[currency];return amountValue.toLocaleString(locale,{minimumFractionDigits:decimalPlaces});};var getHumanizedAmount=function getHumanizedAmount(amountValue,currency){var abbreviations=currencyAbbreviationsMapping[currency];var abbreviation=abbreviations.find(function(abbr){return amountValue>=abbr.value;});if(abbreviation){amountValue=amountValue/abbreviation.value;var formattedAmountValue=getFlooredFixed(amountValue,2);return addCommas(formattedAmountValue,currency)+abbreviation.symbol;}else {return amountValue.toString();}};var formatAmountWithSuffix=function formatAmountWithSuffix(_ref3){var suffix=_ref3.suffix,value=_ref3.value,currency=_ref3.currency;switch(suffix){case'decimals':{var decimalNumber=getFlooredFixed(value,2);return addCommas(decimalNumber,currency,2);}case'humanize':{return getHumanizedAmount(value,currency);}case'none':{return addCommas(getFlooredFixed(value,0),currency);}default:return addCommas(getFlooredFixed(value,0),currency);}};var getCurrencyWeight=function getCurrencyWeight(isAffixSubtle,size){if(isAffixSubtle||size.startsWith('bold'))return 'bold';return 'regular';};var _Amount=function _Amount(_ref4){var value=_ref4.value,_ref4$suffix=_ref4.suffix,suffix=_ref4$suffix===void 0?'decimals':_ref4$suffix,_ref4$size=_ref4.size,size=_ref4$size===void 0?'body-medium':_ref4$size,_ref4$isAffixSubtle=_ref4.isAffixSubtle,isAffixSubtle=_ref4$isAffixSubtle===void 0?true:_ref4$isAffixSubtle,intent=_ref4.intent,_ref4$prefix=_ref4.prefix,prefix=_ref4$prefix===void 0?'currency-symbol':_ref4$prefix,testID=_ref4.testID,_ref4$currency=_ref4.currency,currency=_ref4$currency===void 0?'INR':_ref4$currency,styledProps=_objectWithoutProperties(_ref4,_excluded$3);if(typeof value!=='number'){throw new Error('[Blade: Amount]: `value` prop must be of type `number` for Amount.');}if(intent==='neutral'){throw new Error('[Blade Amount]: `neutral` intent is not supported.');}var currencyPrefix=currencyPrefixMapping[currency][prefix];var renderedValue=formatAmountWithSuffix({suffix:suffix,value:value,currency:currency});var _getTextColorProps=getTextColorProps({intent:intent}),amountValueColor=_getTextColorProps.amountValueColor,affixColor=_getTextColorProps.affixColor;var currencyColor=isAffixSubtle?affixColor:amountValueColor;var currencyFontSize=isAffixSubtle?affixFontSizes[size]:amountFontSizes[size];var currencyWeight=getCurrencyWeight(isAffixSubtle,size);var isReactNative=getPlatformType()==='react-native';return jsxs(BaseBox,_extends({paddingLeft:"spacing.2",paddingRight:"spacing.2",display:isReactNative?castNativeType('flex'):castWebType('inline-flex'),alignItems:"baseline",flexDirection:"row"},metaAttribute({name:MetaConstants.Amount,testID:testID}),getStyledProps(styledProps),{children:[jsx(BaseText,{marginRight:"spacing.1",fontWeight:currencyWeight,fontSize:currencyFontSize,color:currencyColor,as:isReactNative?undefined:'span',children:currencyPrefix}),jsx(AmountValue,{value:renderedValue,amountValueColor:amountValueColor,size:size,isAffixSubtle:isAffixSubtle,suffix:suffix,affixColor:affixColor})]}));};var Amount=assignWithoutSideEffects(_Amount,{displayName:'Amount',componentId:'Amount'});
|
|
3062
3062
|
|
|
3063
3063
|
var BottomSheetEmptyHeader=React__default.forwardRef(function(_ref,ref){var onClickCapture=_ref.onClickCapture,onKeyDown=_ref.onKeyDown,onKeyUp=_ref.onKeyUp,onLostPointerCapture=_ref.onLostPointerCapture,onPointerCancel=_ref.onPointerCancel,onPointerDown=_ref.onPointerDown,onPointerMove=_ref.onPointerMove,onPointerUp=_ref.onPointerUp;var _useBottomSheetContex=useBottomSheetContext(),close=_useBottomSheetContex.close,isHeaderFloating=_useBottomSheetContex.isHeaderFloating;var _useTheme=useTheme(),theme=_useTheme.theme;var webOnlyEventHandlers=isReactNative$4()?{}:{onClickCapture:onClickCapture,onKeyDown:onKeyDown,onKeyUp:onKeyUp,onLostPointerCapture:onLostPointerCapture,onPointerCancel:onPointerCancel,onPointerDown:onPointerDown,onPointerMove:onPointerMove,onPointerUp:onPointerUp};var topOffset=isHeaderFloating?'spacing.5':undefined;if(isReactNative$4()){topOffset='spacing.0';}return jsx(BaseBox,_extends({position:isHeaderFloating?'absolute':'relative',height:makeSize(size[8]),touchAction:"none",top:topOffset,right:"spacing.0"},webOnlyEventHandlers,{children:jsx(BaseBox,{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:isHeaderFloating?'spacing.0':makeSpace(-size[4]),right:"spacing.5",width:makeSize(size[28]),height:makeSize(size[28]),flexShrink:0,backgroundColor:theme.colors.surface.background.level2.lowContrast,borderRadius:"max",zIndex:100,children:jsx(IconButton,{ref:ref,size:"large",icon:CloseIcon,accessibilityLabel:"Close",onClick:close})})}));});
|
|
3064
3064
|
|
|
3065
|
-
var propRestrictionMap={Button:{size:'xsmall',variant:'tertiary'},Badge:{size:'medium'},Link:{size:'medium'},Text:{size:'medium',variant:'body'}};var useTrailingRestriction=function useTrailingRestriction(trailing){var _React$useState=React__default.useState(null),_React$useState2=_slicedToArray(_React$useState,2),validatedTrailingComponent=_React$useState2[0],setValidatedTrailingComponent=_React$useState2[1];React__default.useEffect(function(){if(React__default.isValidElement(trailing)){var trailingComponentType=getComponentId(trailing);var restrictedProps=propRestrictionMap[trailingComponentType];var allowedComponents=Object.keys(propRestrictionMap);if(!restrictedProps){throw new Error("[Blade Header]: Only one of `"+allowedComponents.join(', ')+"` component is accepted as trailing");}var restrictedPropKeys=Object.keys(propRestrictionMap[trailingComponentType]);for(var _i=0,_restrictedPropKeys=restrictedPropKeys;_i<_restrictedPropKeys.length;_i++){var _trailing$props;var prop=_restrictedPropKeys[_i];if(trailing!=null&&(_trailing$props=trailing.props)!=null&&_trailing$props.hasOwnProperty(prop)){console.warn("[Blade Header]: Do not pass \""+prop+"\" to \""+trailingComponentType+"\" while inside Header trailing, because we override it.");}}setValidatedTrailingComponent(React__default.cloneElement(trailing,restrictedProps));}},[trailing]);return validatedTrailingComponent;};var _BaseHeader=function _BaseHeader(_ref){var title=_ref.title,subtitle=_ref.subtitle,leading=_ref.leading,titleSuffix=_ref.titleSuffix,trailing=_ref.trailing,_ref$showDivider=_ref.showDivider,showDivider=_ref$showDivider===void 0?true:_ref$showDivider,_ref$showBackButton=_ref.showBackButton,showBackButton=_ref$showBackButton===void 0?false:_ref$showBackButton,_ref$showCloseButton=_ref.showCloseButton,showCloseButton=_ref$showCloseButton===void 0?true:_ref$showCloseButton,onBackButtonClick=_ref.onBackButtonClick,onCloseButtonClick=_ref.onCloseButtonClick,closeButtonRef=_ref.closeButtonRef,onClickCapture=_ref.onClickCapture,onKeyDown=_ref.onKeyDown,onKeyUp=_ref.onKeyUp,onLostPointerCapture=_ref.onLostPointerCapture,onPointerCancel=_ref.onPointerCancel,onPointerDown=_ref.onPointerDown,onPointerMove=_ref.onPointerMove,onPointerUp=_ref.onPointerUp,metaComponentName=_ref.metaComponentName;var validatedTrailingComponent=useTrailingRestriction(trailing);var webOnlyEventHandlers=isReactNative$4()?{}:{onClickCapture:onClickCapture,onKeyDown:onKeyDown,onKeyUp:onKeyUp,onLostPointerCapture:onLostPointerCapture,onPointerCancel:onPointerCancel,onPointerDown:onPointerDown,onPointerMove:onPointerMove,onPointerUp:onPointerUp};return jsxs(BaseBox,_extends({},metaAttribute({name:metaComponentName}),{children:[jsx(BaseBox,_extends({marginTop:"spacing.4",marginBottom:"spacing.5",paddingLeft:"spacing.5",paddingRight:"spacing.5",touchAction:"none"},webOnlyEventHandlers,{children:jsxs(BaseBox,{display:"flex",flexDirection:"row",alignItems:"center",userSelect:"none",children:[showBackButton?jsx(BaseBox,{overflow:"visible",marginRight:"spacing.5",children:jsx(IconButton,{size:"large",icon:ChevronLeftIcon,onClick:function onClick(){return onBackButtonClick==null?void 0:onBackButtonClick();},accessibilityLabel:"Back"})}):null,jsxs(BaseBox,{paddingRight:"spacing.5",marginRight:"auto",flex:"auto",display:"flex",flexDirection:"row",alignItems:"center",children:[leading?jsx(BaseBox,{width:"spacing.8",height:"spacing.8",flexShrink:0,marginRight:"spacing.3",justifyContent:"center",alignItems:"center",display:"flex",children:leading}):null,jsxs(BaseBox,{children:[jsxs(BaseBox,{flexShrink:0,display:"flex",flexDirection:"row",alignItems:"center",children:[title?jsx(Heading,{size:"small",variant:"regular",type:"normal",children:title}):null,titleSuffix&&jsx(BaseBox,{marginLeft:"spacing.3",children:titleSuffix})]}),subtitle?jsx(Text,{variant:"body",size:"small",weight:"regular",children:subtitle}):null]})]}),validatedTrailingComponent?jsx(BaseBox,{marginRight:"spacing.5",children:validatedTrailingComponent}):null,showCloseButton?jsx(IconButton,{ref:closeButtonRef,size:"large",icon:CloseIcon,accessibilityLabel:"Close",onClick:function onClick(){return onCloseButtonClick==null?void 0:onCloseButtonClick();}}):null]})})),showDivider?jsx(Divider,{}):null]}));};var BaseHeader=assignWithoutSideEffects(_BaseHeader,{componentId:'BaseHeader'});
|
|
3066
|
-
|
|
3067
3065
|
var _BottomSheetHeader=function _BottomSheetHeader(_ref){var title=_ref.title,subtitle=_ref.subtitle,leading=_ref.leading,trailing=_ref.trailing,titleSuffix=_ref.titleSuffix,_ref$showBackButton=_ref.showBackButton,showBackButton=_ref$showBackButton===void 0?false:_ref$showBackButton,onBackButtonClick=_ref.onBackButtonClick;var _useBottomSheetContex=useBottomSheetContext(),close=_useBottomSheetContex.close,setIsHeaderEmpty=_useBottomSheetContex.setIsHeaderEmpty,defaultInitialFocusRef=_useBottomSheetContex.defaultInitialFocusRef;var isHeaderEmpty=!(title||subtitle||leading||trailing||showBackButton);React__default.useEffect(function(){setIsHeaderEmpty(isHeaderEmpty);},[isHeaderEmpty]);return jsx(BaseBox,{overflow:"visible",flexShrink:0,children:isHeaderEmpty?jsx(BottomSheetEmptyHeader,{ref:defaultInitialFocusRef}):jsx(BaseHeader,{title:title,subtitle:subtitle,leading:leading,trailing:trailing,titleSuffix:titleSuffix,closeButtonRef:defaultInitialFocusRef,showBackButton:showBackButton,onBackButtonClick:onBackButtonClick,showCloseButton:true,onCloseButtonClick:close})});};var BottomSheetHeader=assignWithoutSideEffects(_BottomSheetHeader,{componentId:ComponentIds$1.BottomSheetHeader});
|
|
3068
3066
|
|
|
3069
3067
|
var getHandlePartStyles=function getHandlePartStyles(_ref){var theme=_ref.theme;return {margin:'auto',content:"''",width:makeSize(size[56]),height:makeSize(size[4]),backgroundColor:theme.colors.brand.gray.a100.lowContrast,borderRadius:makeSpace(theme.spacing[5])};};var getBottomSheetGrabHandleStyles=function getBottomSheetGrabHandleStyles(_ref2){var theme=_ref2.theme,isHeaderFloating=_ref2.isHeaderFloating;return _extends({position:isHeaderFloating?'absolute':'relative',flexShrink:0,paddingTop:makeSpace(theme.spacing[4]),marginBottom:makeSpace(theme.spacing[2]),touchAction:'none',width:'100%',display:'flex',flexDirection:'column',alignItems:'center',justifyContent:'center',zIndex:100},isReactNative$4()?undefined:{':after':getHandlePartStyles({theme:theme})});};
|
|
@@ -3072,8 +3070,6 @@ var StyledGrabHandle=styled(BaseBox)(function(_ref){var theme=_ref.theme;return
|
|
|
3072
3070
|
|
|
3073
3071
|
var _BottomSheetBody=function _BottomSheetBody(_ref){var children=_ref.children,_ref$padding=_ref.padding,padding=_ref$padding===void 0?'spacing.5':_ref$padding;var _useBottomSheetContex=useBottomSheetContext(),footerHeight=_useBottomSheetContex.footerHeight,setContentHeight=_useBottomSheetContex.setContentHeight,setHasBodyPadding=_useBottomSheetContex.setHasBodyPadding,isHeaderFloating=_useBottomSheetContex.isHeaderFloating;var _React$useState=React__default.useState(undefined),_React$useState2=_slicedToArray(_React$useState,2),bottomSheetHasActionList=_React$useState2[0],setBottomSheetHasActionList=_React$useState2[1];React__default.useEffect(function(){setBottomSheetHasActionList(false);React__default.Children.forEach(children,function(child){if(isValidAllowedChildren(child,componentIds.ActionList)){setBottomSheetHasActionList(true);}});},[children]);React__default.useEffect(function(){if(padding==='spacing.0'){setHasBodyPadding(false);}},[padding]);if(bottomSheetHasActionList===undefined)return jsx(Fragment,{});return jsx(Fragment,{children:bottomSheetHasActionList?children:jsx(BottomSheetScrollView,{onContentSizeChange:function onContentSizeChange(_width,height){setContentHeight(height);},style:{marginBottom:footerHeight,borderRadius:isHeaderFloating?size[16]:0},children:jsx(BaseBox,{flexShrink:1,flexGrow:1,overflow:"hidden",children:jsx(BaseBox,{paddingLeft:bottomSheetHasActionList?'spacing.3':padding,paddingRight:bottomSheetHasActionList?'spacing.3':padding,paddingTop:bottomSheetHasActionList?'spacing.3':padding,paddingBottom:bottomSheetHasActionList?'spacing.3':padding,overflow:"hidden",children:children})})})});};var BottomSheetBody=assignWithoutSideEffects(_BottomSheetBody,{componentId:ComponentIds$1.BottomSheetBody});
|
|
3074
3072
|
|
|
3075
|
-
var _BaseFooter=function _BaseFooter(_ref){var children=_ref.children,_ref$showDivider=_ref.showDivider,showDivider=_ref$showDivider===void 0?true:_ref$showDivider,metaComponentName=_ref.metaComponentName;return jsxs(Fragment,{children:[showDivider&&jsx(Divider,{}),jsx(BaseBox,_extends({},metaAttribute({name:metaComponentName}),{paddingLeft:"spacing.6",paddingRight:"spacing.6",paddingTop:"spacing.5",paddingBottom:"spacing.5",children:children}))]});};var BaseFooter=assignWithoutSideEffects(_BaseFooter,{componentId:'BaseFooter'});
|
|
3076
|
-
|
|
3077
3073
|
var _BottomSheetFooter=function _BottomSheetFooter(_ref){var children=_ref.children;var _useTheme=useTheme(),theme=_useTheme.theme;return jsx(BaseBox,{width:"100%",flexShrink:0,marginTop:"auto",backgroundColor:theme.colors.surface.background.level2.lowContrast,touchAction:"none",zIndex:2,children:jsx(BaseFooter,{children:children})});};var BottomSheetFooter=assignWithoutSideEffects(_BottomSheetFooter,{componentId:ComponentIds$1.BottomSheetFooter});
|
|
3078
3074
|
|
|
3079
3075
|
var BottomSheetBackdrop=function BottomSheetBackdrop(props){var _useTheme=useTheme(),theme=_useTheme.theme;return jsx(BottomSheetBackdrop$1,_extends({},props,{appearsOnIndex:0,disappearsOnIndex:-1,pressBehavior:"close",opacity:1,style:[props.style,{backgroundColor:theme.colors.overlay.background,zIndex:props.zIndex}]}));};
|
|
@@ -3130,5 +3126,5 @@ var Tooltip=function Tooltip(_ref){var content=_ref.content,children=_ref.childr
|
|
|
3130
3126
|
|
|
3131
3127
|
var StyledPressable=styled(Pressable)(function(){return {alignSelf:'flex-start'};});var TooltipInteractiveWrapper=React__default.forwardRef(function(props,ref){useTooltipContext();return jsx(StyledPressable,_extends({ref:ref,collapsable:false,testID:"tooltip-interactive-wrapper"},props,{children:props.children}));});
|
|
3132
3128
|
|
|
3133
|
-
export { Accordion, AccordionItem, ActionList,
|
|
3129
|
+
export { Accordion, AccordionItem, ActionList, ActionListItem, ActionListItemAsset, ActionListItemIcon, ActionListItemText, ActionListSection, ActionListSectionDivider, ActivityIcon, AirplayIcon, Alert, AlertCircleIcon, AlertTriangleIcon as AlertOctagonIcon, AlertOnlyIcon, AlertTriangleIcon$1 as AlertTriangleIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignRightIcon, Amount, AnchorIcon, AnnouncementIcon, ApertureIcon, AppStoreIcon, ArrowDownIcon, ArrowDownLeftIcon, ArrowDownRightIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowUpLeftIcon, ArrowUpRightIcon, AtSignIcon, Attachment as AttachmentIcon, AwardIcon, Badge, BankIcon, BarChartAltIcon, BarChartIcon, BatteryChargingIcon, BatteryIcon, BellIcon, BellOffIcon, BillIcon, BladeProvider, BluetoothIcon, BoldIcon, BookIcon, BookmarkIcon, BottomSheet, BottomSheetBody, BottomSheetFooter, BottomSheetHeader, Box, BoxIcon, BriefcaseIcon, BulkPayoutsIcon, Button, CalendarIcon, CameraIcon, CameraOffIcon, Card, CardBody, CardFooter, CardFooterLeading, CardFooterTrailing, CardHeader, CardHeaderBadge, CardHeaderCounter, CardHeaderIcon, CardHeaderIconButton, CardHeaderLeading, CardHeaderLink, CardHeaderText, CardHeaderTrailing, CastIcon, CheckCircleIcon, CheckIcon, CheckSquareIcon, Checkbox, CheckboxGroup, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsDownIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsUpIcon, ChromeIcon, CircleIcon, ClipboardIcon, ClockIcon, CloseIcon, CloudDrizzleIcon, CloudIcon, CloudLightningIcon, CloudOffIcon, CloudRainIcon, CloudSnowIcon, Code, CodepenIcon, CoinsIcon, Collapsible, CollapsibleBody, CollapsibleButton, CollapsibleLink, CommandIcon, CompassIcon, ComponentIds$2 as ComponentIds, CopyIcon, CornerDownLeftIcon, CornerDownRightIcon, CornerLeftDownIcon, CornerLeftUpIcon, CornerRightDownIcon, CornerRightUpIcon, CornerUpLeftIcon, CornerUpRightIcon, Counter, CpuIcon, CreditCardIcon, CropIcon, CrosshairIcon, CustomersIcon, CutIcon, DashboardIcon, DeleteIcon, DiscIcon, Divider, DollarIcon, DollarsIcon, DownloadCloudIcon, DownloadIcon, Dropdown, DropdownButton, DropdownFooter, DropdownHeader, DropdownLink, DropdownOverlay, DropletIcon, EditComposeIcon, EditIcon, EditInlineIcon, ExportIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FacebookIcon, FastForwardIcon, FeatherIcon, FileIcon, FileMinusIcon, FilePlusIcon, FileTextIcon, FilmIcon, FilterIcon, FlagIcon, FolderIcon, FullScreenEnterIcon, FullScreenExitIcon, GithubIcon, GitlabIcon, GlobeIcon, GridIcon, HashIcon, Heading, HeadphonesIcon, HeartIcon, HelpCircleIcon, HistoryIcon, HomeIcon, IconButton, ImageIcon, InboxIcon, Indicator, InfoIcon, InstagramIcon, InvoicesIcon, ItalicIcon, LayersIcon, LayoutIcon, LifeBuoyIcon, Link, LinkIcon, List, ListIcon, ListItem, ListItemCode, ListItemLink, LoaderIcon, LockIcon, LogInIcon, LogOutIcon, MailIcon, MailOpenIcon, MapIcon, MapPinIcon, MaximizeIcon, MenuDotsIcon, MenuIcon, MessageCircleIcon, MessageSquareIcon, MicIcon, MicOffIcon, MinimizeIcon, MinusCircleIcon, MinusIcon, MinusSquareIcon, Modal, ModalBody, ModalFooter, ModalHeader, MonitorIcon, MoonIcon, MoreHorizontalIcon, MoreVerticalIcon, MoveIcon, MusicIcon, MyAccountIcon, NavigationIcon, OTPInput, OctagonIcon, OffersIcon, PackageIcon, PaperclipIcon, PasswordInput, PauseCircleIcon, PauseIcon, PaymentButtonsIcon, PaymentLinksIcon, PaymentPagesIcon, PercentIcon, PhoneCallIcon, PhoneForwardedIcon, PhoneIcon, PhoneIncomingIcon, PhoneMissedIcon, PhoneOffIcon, PhoneOutgoingIcon, PieChartIcon, PlayCircleIcon, PlayIcon, PlusCircleIcon, PlusIcon, PlusSquareIcon, PocketIcon, PowerIcon, PrinterIcon, ProgressBar, QRCodeIcon, Radio, RadioGroup, RadioIcon$1 as RadioIcon, RazorpayIcon, RazorpayXIcon, RefreshIcon, RepeatIcon, ReportsIcon, RewindIcon, RotateClockWiseIcon, RotateCounterClockWiseIcon, RoutesIcon, RupeeIcon, RupeesIcon, SaveIcon, ScissorsIcon, SearchIcon, SelectInput, SendIcon, ServerIcon, SettingsIcon, SettlementsIcon, ShareIcon, ShieldIcon, ShoppingCartIcon, ShuffleIcon, SidebarIcon, SkipBackIcon, SkipForwardIcon, SkipNavContent, SkipNavLink, SlackIcon, SlashIcon, SlidersIcon, SmartCollectIcon, SmartphoneIcon, SpeakerIcon, Spinner, SquareIcon, StampIcon, StarIcon, StopCircleIcon, SubscriptionsIcon, SunIcon, SunriseIcon, SunsetIcon, Switch, TabletIcon, TagIcon, TargetIcon, Text, TextArea, TextInput, ThermometerIcon, ThumbsDownIcon, ThumbsUpIcon, Title, ToggleLeftIcon, ToggleRightIcon, Tooltip, TooltipInteractiveWrapper, TransactionsIcon, TrashIcon, TrendingDownIcon, TrendingUpIcon, TriangleIcon, TvIcon, TwitterIcon, TypeIcon, UmbrellaIcon, UnderlineIcon, UnlockIcon, UploadCloudIcon, UploadIcon, UserCheckIcon, UserIcon, UserMinusIcon, UserPlusIcon, UserXIcon, UsersIcon, VideoIcon, VideoOffIcon, VisuallyHidden, VoicemailIcon, VolumeHighIcon, VolumeIcon, VolumeLowIcon, VolumeMuteIcon, WatchIcon, WifiIcon, WifiOffIcon, WindIcon, XCircleIcon, XSquareIcon, ZapIcon, ZoomInIcon, ZoomOutIcon, announce, clearAnnouncer, destroyAnnouncer, getTextProps, screenReaderStyles, useActionListContext, useTheme };
|
|
3134
3130
|
//# sourceMappingURL=index.native.js.map
|