@razorpay/blade 8.1.0 → 8.2.3
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 +61 -41
- package/build/components/index.native.d.ts +61 -41
- package/build/components/index.native.js +33 -35
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +226 -233
- package/build/components/index.web.js.map +1 -1
- package/build/css/bankingThemeDarkDesktop.css +5 -26
- package/build/css/bankingThemeDarkMobile.css +5 -26
- package/build/css/bankingThemeLightDesktop.css +5 -26
- package/build/css/bankingThemeLightMobile.css +5 -26
- package/build/css/paymentThemeDarkDesktop.css +5 -26
- package/build/css/paymentThemeDarkMobile.css +5 -26
- package/build/css/paymentThemeLightDesktop.css +5 -26
- package/build/css/paymentThemeLightMobile.css +5 -26
- package/build/tokens/index.d.ts +180 -150
- package/build/tokens/index.native.d.ts +180 -150
- package/build/tokens/index.native.js +12 -10
- package/build/tokens/index.native.js.map +1 -1
- package/build/tokens/index.web.js +382 -409
- package/build/tokens/index.web.js.map +1 -1
- package/build/utils/index.native.js +0 -6
- package/build/utils/index.native.js.map +1 -1
- package/build/utils/index.web.js +16 -98
- package/build/utils/index.web.js.map +1 -1
- package/package.json +5 -5
- package/CHANGELOG.md +0 -1648
|
@@ -5,13 +5,13 @@ import _defineProperty$1 from '@babel/runtime/helpers/defineProperty';
|
|
|
5
5
|
import { Appearance, Platform, View, SectionList, TouchableOpacity, Image, Pressable, AccessibilityInfo, Linking, Dimensions, Keyboard, findNodeHandle } from 'react-native';
|
|
6
6
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
7
7
|
import Animated, { Easing, Keyframe, useSharedValue, useAnimatedStyle, withTiming, withRepeat, cancelAnimation, interpolate, withSequence, withDelay } from 'react-native-reanimated';
|
|
8
|
-
import styled, { ThemeProvider } from 'styled-components/native';
|
|
9
8
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
10
|
-
import
|
|
11
|
-
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
12
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
|
+
import styled, { ThemeProvider } from 'styled-components/native';
|
|
13
10
|
import { PortalProvider, PortalHost, Portal } from '@gorhom/portal';
|
|
14
11
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
12
|
+
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
13
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
|
+
import GorhomBottomSheet, { BottomSheetSectionList, BottomSheetScrollView, BottomSheetBackdrop as BottomSheetBackdrop$1, BottomSheetFooter as BottomSheetFooter$1 } from '@gorhom/bottom-sheet';
|
|
15
15
|
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';
|
|
16
16
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
17
17
|
|
|
@@ -3211,14 +3211,6 @@ var toTitleCase=function toTitleCase(inputString){return inputString.toLowerCase
|
|
|
3211
3211
|
|
|
3212
3212
|
var deviceType={desktop:'desktop',mobile:'mobile'};var useBreakpoint=function useBreakpoint(_ref){var _window;var breakpoints=_ref.breakpoints;var supportsMatchMedia=typeof document!=='undefined'&&typeof window!=='undefined'&&typeof((_window=window)==null?void 0:_window.matchMedia)==='function';var breakpointsTokenAndQueryCollection=useMemo(function(){return supportsMatchMedia?Object.entries(breakpoints).map(function(_ref2,index,breakpointsArray){var _breakpointsArray;var _ref3=_slicedToArray(_ref2,2),token=_ref3[0],screenSize=_ref3[1];var min=screenSize;var maxValue=(_breakpointsArray=breakpointsArray[index+1])==null?void 0:_breakpointsArray[1];var mediaQuery=getMediaQuery({min:min,max:maxValue?maxValue-1:undefined});return {token:token,screenSize:screenSize,mediaQuery:mediaQuery};}):[];},[breakpoints,supportsMatchMedia]);var getMatchedDeviceType=useCallback(function(matchedBreakpoint){var matchedDeviceType=deviceType.mobile;var platform=getPlatformType();if(platform==='react-native'){matchedDeviceType=deviceType.mobile;}else if(platform==='browser'){if(matchedBreakpoint&&['base','xs','s'].includes(matchedBreakpoint)){matchedDeviceType=deviceType.mobile;}else {matchedDeviceType=deviceType.desktop;}}else if(platform==='node'){matchedDeviceType=deviceType.desktop;}return matchedDeviceType;},[]);var getMatchedBreakpoint=useCallback(function(event){var _breakpointsTokenAndQ,_breakpointsTokenAndQ2;var matchedBreakpoint=(_breakpointsTokenAndQ=(_breakpointsTokenAndQ2=breakpointsTokenAndQueryCollection.find(function(_ref4){var _ref4$mediaQuery=_ref4.mediaQuery,mediaQuery=_ref4$mediaQuery===void 0?'':_ref4$mediaQuery;if((event==null?void 0:event.media)===mediaQuery){return true;}if(window.matchMedia(mediaQuery).matches){return true;}return false;}))==null?void 0:_breakpointsTokenAndQ2.token)!=null?_breakpointsTokenAndQ:undefined;return matchedBreakpoint;},[breakpointsTokenAndQueryCollection]);var _useState=useState(function(){var matchedBreakpoint=getMatchedBreakpoint();var matchedDeviceType=getMatchedDeviceType(matchedBreakpoint);return {matchedBreakpoint:matchedBreakpoint,matchedDeviceType:matchedDeviceType};}),_useState2=_slicedToArray(_useState,2),breakpointAndDevice=_useState2[0],setBreakpointAndDevice=_useState2[1];useEffect(function(){if(!supportsMatchMedia){return undefined;}var handleMediaQueryChange=function handleMediaQueryChange(event){setBreakpointAndDevice(function(){var matchedBreakpoint=getMatchedBreakpoint(event);var matchedDeviceType=getMatchedDeviceType(matchedBreakpoint);return {matchedBreakpoint:matchedBreakpoint,matchedDeviceType:matchedDeviceType};});};var mediaQueryInstances=breakpointsTokenAndQueryCollection.map(function(_ref5){var _ref5$mediaQuery=_ref5.mediaQuery,mediaQuery=_ref5$mediaQuery===void 0?'':_ref5$mediaQuery;var mediaQueryInstance=window.matchMedia(mediaQuery);if(mediaQueryInstance.addEventListener){mediaQueryInstance.addEventListener('change',handleMediaQueryChange);}else {mediaQueryInstance.addListener(handleMediaQueryChange);}return mediaQueryInstance;});return function(){mediaQueryInstances.forEach(function(mediaQueryInstance){if(mediaQueryInstance.removeEventListener){mediaQueryInstance.removeEventListener('change',handleMediaQueryChange);}else {mediaQueryInstance.removeListener(handleMediaQueryChange);}});};},[breakpointsTokenAndQueryCollection,getMatchedBreakpoint,getMatchedDeviceType,supportsMatchMedia]);return breakpointAndDevice;};
|
|
3213
3213
|
|
|
3214
|
-
var breakpoints={base:0,xs:320,s:480,m:768,l:1024,xl:1200};
|
|
3215
|
-
|
|
3216
|
-
var fontFamily={text:'Lato',code:Platform.OS==='ios'?'Courier':'monospace'};
|
|
3217
|
-
|
|
3218
|
-
var fontWeight={regular:400,bold:700};({onDesktop:{fonts:{family:_extends({},fontFamily),size:{10:9,25:10,50:11,75:12,100:14,200:16,300:18,400:20,500:22,600:24,700:28,800:32,900:36,1000:40},weight:_extends({},fontWeight)},lineHeights:{0:0,25:14,50:16,75:18,100:20,200:24,300:24,400:28,500:32,600:40,700:40,800:48}},onMobile:{fonts:{family:_extends({},fontFamily),size:{10:9,25:10,50:11,75:12,100:14,200:16,300:16,400:18,500:20,600:20,700:24,800:28,900:32,1000:32},weight:_extends({},fontWeight)},lineHeights:{0:0,25:14,50:16,75:18,100:20,200:20,300:24,400:24,500:28,600:32,700:40,800:40}}});
|
|
3219
|
-
|
|
3220
|
-
({standard:{attentive:makeBezier(0.5,0,0.3,1.5),effective:makeBezier(0.3,0,0.2,1),revealing:makeBezier(0.5,0,0,1),wary:makeBezier(1,0.5,0,0.5)},entrance:{attentive:makeBezier(0.5,0,0.3,1.5),effective:makeBezier(0,0,0.2,1),revealing:makeBezier(0,0,0,1)},exit:{attentive:makeBezier(0.7,0,0.5,1),effective:makeBezier(0.17,0,1,1),revealing:makeBezier(0.5,0,1,1)}});
|
|
3221
|
-
|
|
3222
3214
|
var colorSchemeNamesInput=['light','dark','system'];
|
|
3223
3215
|
|
|
3224
3216
|
var useColorScheme=function useColorScheme(){var initialColorScheme=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'light';var _useState=useState(function(){return getColorScheme(initialColorScheme);}),_useState2=_slicedToArray(_useState,2),colorSchemeState=_useState2[0],setColorSchemeState=_useState2[1];var setColorScheme=useCallback(function setThemeMode(colorScheme){if(!colorSchemeNamesInput.includes(colorScheme)){throw new Error("[useColorScheme]: Expected color scheme to be one of ["+colorSchemeNamesInput.toString()+"] but received "+colorScheme);}setColorSchemeState(getColorScheme(colorScheme));},[]);return {colorScheme:colorSchemeState,setColorScheme:setColorScheme};};
|
|
@@ -3227,8 +3219,6 @@ function usePrevious(value){var ref=useRef();useEffect(function(){ref.current=va
|
|
|
3227
3219
|
|
|
3228
3220
|
var isReactNative$4=function isReactNative(){return getPlatformType()==='react-native';};
|
|
3229
3221
|
|
|
3230
|
-
var getOS=function getOS(){return Platform.OS;};var isAndroid$1=function isAndroid(){return getOS()==='android';};
|
|
3231
|
-
|
|
3232
3222
|
var castWebType=function castWebType(value){return value;};var castNativeType=function castNativeType(value){return value;};
|
|
3233
3223
|
|
|
3234
3224
|
var assignWithoutSideEffects=function assignWithoutSideEffects(component,sourceObj){return _extends(component,sourceObj);};
|
|
@@ -3239,16 +3229,32 @@ var componentIds$1={ActionList:'ActionList',ActionListHeader:'ActionListHeader',
|
|
|
3239
3229
|
|
|
3240
3230
|
var getActionListSectionPosition=function getActionListSectionPosition(children){var childComponentIdArray=React__default.Children.toArray(children).map(function(child){return getComponentId(child);});var lastActionListSectionIndex=childComponentIdArray.lastIndexOf(componentIds$1.ActionListSection);var isActionListItemPresentAfterSection=childComponentIdArray.slice(lastActionListSectionIndex).includes(componentIds$1.ActionListItem);return {isActionListItemPresentAfterSection:isActionListItemPresentAfterSection,lastActionListSectionIndex:lastActionListSectionIndex};};var actionListAllowedChildren=[componentIds$1.ActionListFooter,componentIds$1.ActionListHeader,componentIds$1.ActionListItem,componentIds$1.ActionListSection];var getActionListProperties=function getActionListProperties(children){var sectionData=[];var currentSection=null;var actionListOptions=[];var actionListHeaderChild=null;var actionListFooterChild=null;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$1.ActionListHeader)){actionListHeaderChild=child;return null;}if(isValidAllowedChildren(child,componentIds$1.ActionListFooter)){actionListFooterChild=child;return null;}if(isValidAllowedChildren(child,componentIds$1.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$1.ActionListItem)){return getActionListItemWithId(childInSection,shouldHideDivider);}return childInSection;}),_hideDivider:isReactNative$4()?shouldHideDivider:undefined});}if(isValidAllowedChildren(child,componentIds$1.ActionListItem)){return getActionListItemWithId(child,true);}throw new Error("[ActionList]: Only "+actionListAllowedChildren.join(', ')+" supported inside ActionList");}return child;});return {sectionData:sectionData,childrenWithId:childrenWithId,actionListFooterChild:actionListFooterChild,actionListHeaderChild:actionListHeaderChild,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$1.ActionListItemIcon)&&!isValidAllowedChildren(child,componentIds$1.ActionListItemText)){throw new Error("[ActionListItem]: Only "+componentIds$1.ActionListItemIcon+" and "+componentIds$1.ActionListItemText+" are allowed in trailing prop");}});React__default.Children.map(leading,function(child){if(!isValidAllowedChildren(child,componentIds$1.ActionListItemIcon)&&!isValidAllowedChildren(child,componentIds$1.ActionListItemText)&&!isValidAllowedChildren(child,componentIds$1.ActionListItemAsset)){throw new Error("[ActionListItem]: Only "+componentIds$1.ActionListItemIcon+", "+componentIds$1.ActionListItemAsset+", and "+componentIds$1.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';};
|
|
3241
3231
|
|
|
3242
|
-
var getBaseActionListStyles=function getBaseActionListStyles(props){var theme=props.theme,_props$surfaceLevel=props.surfaceLevel,surfaceLevel=_props$surfaceLevel===void 0?2:_props$surfaceLevel,isInBottomSheet=props.isInBottomSheet;var
|
|
3232
|
+
var getBaseActionListStyles=function getBaseActionListStyles(props){var theme=props.theme,_props$surfaceLevel=props.surfaceLevel,surfaceLevel=_props$surfaceLevel===void 0?2:_props$surfaceLevel,isInBottomSheet=props.isInBottomSheet;var backgroundColor=theme.colors.surface.background["level"+surfaceLevel].lowContrast;return {backgroundColor:backgroundColor,borderWidth:isInBottomSheet?undefined:theme.border.width.thin,borderColor:theme.colors.surface.border.normal.lowContrast,borderRadius:makeSize(theme.border.radius.medium),boxShadow:isInBottomSheet||isReactNative$4()?undefined:castWebType(theme.elevation.midRaised)};};
|
|
3243
3233
|
|
|
3244
|
-
var
|
|
3234
|
+
var breakpoints={base:0,xs:320,s:480,m:768,l:1024,xl:1200};
|
|
3245
3235
|
|
|
3246
|
-
var
|
|
3236
|
+
var fontFamily={text:'Lato',code:Platform.OS==='ios'?'Courier':'monospace'};
|
|
3237
|
+
|
|
3238
|
+
var fontWeight={regular:400,bold:700};({onDesktop:{fonts:{family:_extends({},fontFamily),size:{10:9,25:10,50:11,75:12,100:14,200:16,300:18,400:20,500:22,600:24,700:28,800:32,900:36,1000:40},weight:_extends({},fontWeight)},lineHeights:{0:0,25:14,50:16,75:18,100:20,200:24,300:24,400:28,500:32,600:40,700:40,800:48}},onMobile:{fonts:{family:_extends({},fontFamily),size:{10:9,25:10,50:11,75:12,100:14,200:16,300:16,400:18,500:20,600:20,700:24,800:28,900:32,1000:32},weight:_extends({},fontWeight)},lineHeights:{0:0,25:14,50:16,75:18,100:20,200:20,300:24,400:24,500:28,600:32,700:40,800:40}}});
|
|
3247
3239
|
|
|
3248
|
-
|
|
3240
|
+
({standard:{attentive:makeBezier(0.5,0,0.3,1.5),effective:makeBezier(0.3,0,0.2,1),revealing:makeBezier(0.5,0,0,1),wary:makeBezier(1,0.5,0,0.5)},entrance:{attentive:makeBezier(0.5,0,0.3,1.5),effective:makeBezier(0,0,0.2,1),revealing:makeBezier(0,0,0,1)},exit:{attentive:makeBezier(0.7,0,0.5,1),effective:makeBezier(0.17,0,1,1),revealing:makeBezier(0.5,0,1,1)}});
|
|
3249
3241
|
|
|
3250
3242
|
var size={0:0,1:1,2:2,3:3,4:4,5:5,6:6,8:8,10:10,12:12,16:16,18:18,20:20,24:24,28:28,32:32,36:36,40:40,48:48,56:56,100:100,120:120,300:300,584:584};
|
|
3251
3243
|
|
|
3244
|
+
var _excluded$4R=["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),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),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),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$4R);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));};
|
|
3245
|
+
|
|
3246
|
+
var isSupportedOnReactNativeElement=function isSupportedOnReactNativeElement(prop){return !prop.startsWith('padding')&&!prop.startsWith('margin')&&prop!=='flex';};var BaseBox=styled(View).withConfig({shouldForwardProp:function shouldForwardProp(prop,defaultValidator){return isSupportedOnReactNativeElement(prop)&&defaultValidator(prop);}})(function(props){var cssObject=getBaseBoxStyles(props);return cssObject;});
|
|
3247
|
+
|
|
3248
|
+
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;};
|
|
3249
|
+
|
|
3250
|
+
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};};
|
|
3251
|
+
|
|
3252
|
+
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;};
|
|
3253
|
+
|
|
3254
|
+
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"})]})})})});};
|
|
3255
|
+
|
|
3256
|
+
var _excluded$4Q=["children"];var BaseStyledActionList=styled(BaseBox)(function(props){return _extends({},getBaseActionListStyles(props));});var StyledActionList=function StyledActionList(_ref){var children=_ref.children,props=_objectWithoutProperties(_ref,_excluded$4Q);var _useTheme=useTheme(),theme=_useTheme.theme;return jsx(BaseStyledActionList,_extends({},props,{style:props.isInBottomSheet?undefined:castNativeType(theme.elevation.midRaised),children:children}));};
|
|
3257
|
+
|
|
3252
3258
|
var getBaseListBoxWrapperStyles=function getBaseListBoxWrapperStyles(props){return {maxHeight:props.isInBottomSheet?undefined:makeSize(size[300]),padding:props.isInBottomSheet?undefined:makeSize(props.theme.spacing[3])};};
|
|
3253
3259
|
|
|
3254
3260
|
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)});});
|
|
@@ -3313,14 +3319,6 @@ var getCheckboxIconWrapperStyles=function getCheckboxIconWrapperStyles(_ref){var
|
|
|
3313
3319
|
|
|
3314
3320
|
var CheckboxIconWrapper=styled.View(function(props){return getCheckboxIconWrapperStyles(props);});
|
|
3315
3321
|
|
|
3316
|
-
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;};
|
|
3317
|
-
|
|
3318
|
-
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],shadows:_extends({},themeTokens.shadows,{color:themeTokens.shadows.color[onColorMode]}),typography:themeTokens.typography[onDeviceType]});var themeContextValue={theme:theme,colorScheme:colorScheme,setColorScheme:setColorScheme,platform:onDeviceType};return {themeContextValue:themeContextValue,theme:theme};};
|
|
3319
|
-
|
|
3320
|
-
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;};
|
|
3321
|
-
|
|
3322
|
-
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"})]})})})});};
|
|
3323
|
-
|
|
3324
3322
|
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;};
|
|
3325
3323
|
|
|
3326
3324
|
var ClipPath=function ClipPath(_ref){var children=_ref.children,id=_ref.id;return jsx(ClipPath$1,{id:id,children:children});};
|
|
@@ -3923,7 +3921,7 @@ var ActionListItemContext=React__default.createContext({});var StyledSectionDivi
|
|
|
3923
3921
|
|
|
3924
3922
|
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'});
|
|
3925
3923
|
|
|
3926
|
-
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
|
|
3924
|
+
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,actionListHeaderChild=_React$useMemo.actionListHeaderChild,actionListFooterChild=_React$useMemo.actionListFooterChild;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}):jsxs(StyledActionList,_extends({isInBottomSheet:isInBottomSheet,surfaceLevel:surfaceLevel,id:dropdownBaseId+"-actionlist"},makeAccessible({role:actionListContainerRole,multiSelectable:actionListContainerRole==='listbox'?isMultiSelectable:undefined,labelledBy:dropdownBaseId+"-label"}),metaAttribute({name:MetaConstants.ActionList,testID:testID}),{children:[actionListHeaderChild,jsx(ActionListBox,{isInBottomSheet:isInBottomSheet,actionListItemWrapperRole:actionListItemWrapperRole,childrenWithId:childrenWithId,sectionData:sectionData,isMultiSelectable:isMultiSelectable,ref:actionListItemRef}),actionListFooterChild]}))});};var ActionList=assignWithoutSideEffects(React__default.memo(_ActionList),{displayName:componentIds$1.ActionList});
|
|
3927
3925
|
|
|
3928
3926
|
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$1.ActionListHeaderIcon)){throw new Error("[ActionListHeader]: Only "+componentIds$1.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$1.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$1.ActionListHeaderIcon});
|
|
3929
3927
|
|
|
@@ -3983,11 +3981,11 @@ var validBoxAsValues=['div','section','footer','header','main','aside','nav','sp
|
|
|
3983
3981
|
|
|
3984
3982
|
var validateBackgroundString=function validateBackgroundString(stringBackgroundColorValue){if(!stringBackgroundColorValue.startsWith('surface.background')){throw new Error("[Blade - Box]: Oops! Currently you can only use `surface.background.*` tokens with backgroundColor property but we received `"+stringBackgroundColorValue+"` instead.\n\n Do you have a usecase of using other values? Create an issue on https://github.com/razorpay/blade repo to let us know and we can discuss \u2728");}};var validateBackgroundProp=function validateBackgroundProp(responsiveBackgroundColor){if(responsiveBackgroundColor){if(typeof responsiveBackgroundColor==='string'){validateBackgroundString(responsiveBackgroundColor);return;}Object.values(responsiveBackgroundColor).forEach(function(backgroundColor){validateBackgroundString(backgroundColor);});}};var makeBoxProps=function makeBoxProps(props){return {display:props.display,overflow:props.overflow,overflowX:props.overflowX,overflowY:props.overflowY,height:props.height,minHeight:props.minHeight,maxHeight:props.maxHeight,width:props.width,minWidth:props.minWidth,maxWidth:props.maxWidth,flex:props.flex,flexWrap:props.flexWrap,flexDirection:props.flexDirection,flexGrow:props.flexGrow,flexShrink:props.flexShrink,flexBasis:props.flexBasis,alignItems:props.alignItems,alignContent:props.alignContent,alignSelf:props.alignSelf,justifyItems:props.justifyItems,justifyContent:props.justifyContent,justifySelf:props.justifySelf,placeSelf:props.placeSelf,order:props.order,grid:props.grid,gridColumn:props.gridColumn,gridRow:props.gridRow,gridRowStart:props.gridRowStart,gridRowEnd:props.gridRowEnd,gridColumnStart:props.gridColumnStart,gridColumnEnd:props.gridColumnEnd,gridArea:props.gridArea,gridAutoFlow:props.gridAutoFlow,gridAutoRows:props.gridAutoRows,gridAutoColumns:props.gridAutoColumns,gridTemplate:props.gridTemplate,gridTemplateAreas:props.gridTemplateAreas,gridTemplateColumns:props.gridTemplateColumns,gridTemplateRows:props.gridTemplateRows,padding:props.padding,paddingTop:props.paddingTop,paddingBottom:props.paddingBottom,paddingRight:props.paddingRight,paddingLeft:props.paddingLeft,paddingX:props.paddingX,paddingY:props.paddingY,margin:props.margin,marginBottom:props.marginBottom,marginTop:props.marginTop,marginRight:props.marginRight,marginLeft:props.marginLeft,marginX:props.marginX,marginY:props.marginY,gap:props.gap,rowGap:props.rowGap,columnGap:props.columnGap,position:props.position,zIndex:props.zIndex,top:props.top,right:props.right,bottom:props.bottom,left:props.left,backgroundColor:props.backgroundColor,borderWidth:props.borderWidth,borderColor:props.borderColor,borderTopWidth:props.borderTopWidth,borderTopColor:props.borderTopColor,borderRightWidth:props.borderRightWidth,borderRightColor:props.borderRightColor,borderBottomWidth:props.borderBottomWidth,borderBottomColor:props.borderBottomColor,borderLeftWidth:props.borderLeftWidth,borderLeftColor:props.borderLeftColor,borderRadius:props.borderRadius,borderTopLeftRadius:props.borderTopLeftRadius,borderTopRightRadius:props.borderTopRightRadius,borderBottomRightRadius:props.borderBottomRightRadius,borderBottomLeftRadius:props.borderBottomLeftRadius,children:props.children,as:isReactNative$4()?undefined:props.as};};var Box=function Box(props){React__default.useEffect(function(){validateBackgroundProp(props.backgroundColor);},[props.backgroundColor]);React__default.useEffect(function(){if(props.as){if(isReactNative$4()){throw new Error('[Blade - Box]: `as` prop is not supported on React Native');}if(!validBoxAsValues.includes(props.as)){throw new Error("[Blade - Box]: Invalid `as` prop value - "+props.as+". Only "+validBoxAsValues.join(', ')+" are valid values");}}},[props.as]);return jsx(BaseBox,_extends({},metaAttribute({name:MetaConstants.Box,testID:props.testID}),makeBoxProps(props)));};
|
|
3985
3983
|
|
|
3986
|
-
var _excluded$l=["children","surfaceLevel"
|
|
3984
|
+
var _excluded$l=["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$l);var _useTheme=useTheme(),theme=_useTheme.theme;return jsx(CardSurfaceStyled,_extends({},props,{surfaceLevel:surfaceLevel,elevation:elevation,style:castNativeType(theme.elevation[elevation]),children:children}));};
|
|
3987
3985
|
|
|
3988
3986
|
var CardContext=React__default.createContext(null);var useVerifyInsideCard=function useVerifyInsideCard(componentName){var context=React__default.useContext(CardContext);if(!context){throw new Error("[Blade Card]: "+componentName+" cannot be used outside of Card component");}return true;};var useVerifyAllowedComponents=function useVerifyAllowedComponents(children,componentName,allowedComponents){React__default.Children.forEach(children,function(child){var isValidChild=child&&allowedComponents.includes(getComponentId(child));if(!isValidChild){throw new Error("[Blade Card]: Only one of `"+allowedComponents.join(', ')+"` component is accepted as "+componentName+" children");}});};var CardProvider=function CardProvider(_ref){var children=_ref.children;return jsx(CardContext.Provider,{value:true,children:children});};
|
|
3989
3987
|
|
|
3990
|
-
var _excluded$k=["children","surfaceLevel","testID"];var ComponentIds$2={CardHeader:'CardHeader',CardHeaderTrailing:'CardHeaderTrailing',CardHeaderLeading:'CardHeaderLeading',CardFooter:'CardFooter',CardFooterTrailing:'CardFooterTrailing',CardFooterLeading:'CardFooterLeading',CardBody:'CardBody',CardHeaderIcon:'CardHeaderIcon',CardHeaderCounter:'CardHeaderCounter',CardHeaderBadge:'CardHeaderBadge',CardHeaderText:'CardHeaderText',CardHeaderLink:'CardHeaderLink',CardHeaderIconButton:'CardHeaderIconButton'};var Card=function Card(_ref){var children=_ref.children,_ref$surfaceLevel=_ref.surfaceLevel,surfaceLevel=_ref$surfaceLevel===void 0?
|
|
3988
|
+
var _excluded$k=["children","surfaceLevel","elevation","testID","padding"];var ComponentIds$2={CardHeader:'CardHeader',CardHeaderTrailing:'CardHeaderTrailing',CardHeaderLeading:'CardHeaderLeading',CardFooter:'CardFooter',CardFooterTrailing:'CardFooterTrailing',CardFooterLeading:'CardFooterLeading',CardBody:'CardBody',CardHeaderIcon:'CardHeaderIcon',CardHeaderCounter:'CardHeaderCounter',CardHeaderBadge:'CardHeaderBadge',CardHeaderText:'CardHeaderText',CardHeaderLink:'CardHeaderLink',CardHeaderIconButton:'CardHeaderIconButton'};var Card=function Card(_ref){var children=_ref.children,_ref$surfaceLevel=_ref.surfaceLevel,surfaceLevel=_ref$surfaceLevel===void 0?2:_ref$surfaceLevel,_ref$elevation=_ref.elevation,elevation=_ref$elevation===void 0?'lowRaised':_ref$elevation,testID=_ref.testID,_ref$padding=_ref.padding,padding=_ref$padding===void 0?'spacing.7':_ref$padding,styledProps=_objectWithoutProperties(_ref,_excluded$k);useVerifyAllowedComponents(children,'Card',[ComponentIds$2.CardHeader,ComponentIds$2.CardBody,ComponentIds$2.CardFooter]);return jsx(CardProvider,{children:jsx(CardSurface,_extends({},metaAttribute({name:MetaConstants.Card,testID:testID}),{padding:padding,borderRadius:"medium",surfaceLevel:surfaceLevel,elevation:elevation},getStyledProps(styledProps),{children:children}))});};var _CardBody=function _CardBody(_ref2){var children=_ref2.children,testID=_ref2.testID;useVerifyInsideCard('CardBody');return jsx(BaseBox,_extends({},metaAttribute({name:MetaConstants.CardBody,testID:testID}),{children:children}));};var CardBody=assignWithoutSideEffects(_CardBody,{componentId:ComponentIds$2.CardBody});
|
|
3991
3989
|
|
|
3992
3990
|
var _excluded$j=["children","icon","iconPosition","isDisabled","onClick","variant","href","target","rel","accessibilityLabel","size","testID","hitSlop","htmlTitle"];var _Link=function _Link(_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,onClick=_ref.onClick,_ref$variant=_ref.variant,variant=_ref$variant===void 0?'anchor':_ref$variant,href=_ref.href,target=_ref.target,rel=_ref.rel,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);return jsx(BaseLink,_extends({},icon?{icon:icon,children:children}:{children:children},variant==='anchor'?{variant:variant,href:href,target:target,rel:rel}:{variant:variant,isDisabled:isDisabled},{iconPosition:iconPosition,onClick:onClick,accessibilityLabel:accessibilityLabel,size:size,testID:testID,hitSlop:hitSlop,htmlTitle:htmlTitle},styledProps));};var Link=assignWithoutSideEffects(_Link,{displayName:'Link',componentId:'Link'});
|
|
3993
3991
|
|
|
@@ -4065,7 +4063,7 @@ var ListItemElement=View;
|
|
|
4065
4063
|
|
|
4066
4064
|
var romanize=function romanize(number){var romanKeys={m:1000,cm:900,d:500,cd:400,c:100,xc:90,l:50,xl:40,x:10,ix:9,v:5,iv:4,i:1};var result='';Object.keys(romanKeys).forEach(function(key){result+=key.repeat(Math.floor(number/romanKeys[key]));number%=romanKeys[key];});return result;};var alphabetize=function alphabetize(number){var indexedNumber=--number;var alphabets='abcdefghijklmnopqrstuvwxyz';var firstAlphabets=indexedNumber>=26?alphabetize(Math.floor(indexedNumber/26)-1):'';var lastAlphabet=alphabets[indexedNumber%26];return ""+firstAlphabets+lastAlphabet;};var getOrderedListItemBullet=function getOrderedListItemBullet(_ref){var itemNumber=_ref.itemNumber,level=_ref.level;if(isNaN(itemNumber))return '';switch(level){case 1:return ""+itemNumber;case 2:return ""+alphabetize(itemNumber);case 3:return ""+romanize(itemNumber);default:return ""+itemNumber;}};
|
|
4067
4065
|
|
|
4068
|
-
var StyledListItem=styled(ListItemElement)(function(_ref){var level=_ref.level,theme=_ref.theme,variant=_ref.variant,hasIcon=_ref.hasIcon;return {marginLeft:level?get_1(theme,listItemMarginLeft[""+variant+(variant==='unordered'&&hasIcon?'WithIcon':'')][level]):0};});var ListItemContentChildren=function ListItemContentChildren(_ref2){var children=_ref2.children,size=_ref2.size;return getPlatformType()==='react-native'?jsx(BaseBox,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:children.map(function(child){if(typeof child==='string'){return jsx(Text,{variant:"body",size:size,children:child});}return child;})}):jsx(Text,{variant:"body",size:size,children:children});};var _ListItem=function _ListItem(_ref3){var children=_ref3.children,Icon=_ref3.icon,_itemNumber=_ref3._itemNumber,testID=_ref3.testID;var _useListContext=useListContext(),level=_useListContext.level,size=_useListContext.size,ListContextIcon=_useListContext.icon,variant=_useListContext.variant;var _useTheme=useTheme(),theme=_useTheme.theme,platform=_useTheme.platform;var ItemIcon=Icon!=null?Icon:ListContextIcon;if(level&&level>3){throw new Error('[Blade List]: List Nesting is allowed only upto 3 levels.');}var childrenArray=React__default.Children.toArray(children);var validChildItem=childrenArray.filter(function(child){if(getComponentId(child)==='List')return null;if(typeof child==='string'||isValidAllowedChildren(child,'ListItemLink')||isValidAllowedChildren(child,'ListItemCode')){return child;}else {throw new Error('[Blade List]: You can only pass a List, ListItemLink, ListItemCode or a string as a child to ListItem.');}});var childList=childrenArray.filter(function(child){return getComponentId(child)==='List'?child:null;});var hasIcon=Boolean(ItemIcon);return jsxs(StyledListItem,_extends({level:level,variant:variant,hasIcon:hasIcon},metaAttribute({name:MetaConstants.ListItem,testID:testID}),{children:[jsxs(BaseBox,{display:"flex",flexDirection:"row",alignItems:"center",marginBottom:listItemMarginBottom,children:[variant==='unordered'?jsx(BaseBox,{marginRight:listItemBulletMarginRight[variant],marginTop:listItemBulletMarginTop[""+variant+(hasIcon?'WithIcon':'')][platform][size],display:"flex",alignSelf:"flex-start",children:ItemIcon?jsx(ItemIcon,{size:size,color:"surface.text.subdued.lowContrast"}):jsx(UnorderedItemIcon,{level:level})}):jsx(BaseBox,{width:listItemOrderedBulletBoxSize[variant][platform][size],height:listItemOrderedBulletBoxSize[variant][platform][size],marginRight:listItemBulletMarginRight[variant],marginTop:listItemBulletMarginTop[variant][platform][size],display:"flex",flexShrink:0,justifyContent:"center",alignSelf:"flex-start",alignItems:"center",borderRadius:variant==='ordered-filled'?'max':undefined,backgroundColor:variant==='ordered-filled'?get_1(theme,'colors.brand.gray.a100.lowContrast'):undefined,children:jsx(Text,{variant:"body",type:"subtle",size:variant==='ordered'?size:'xsmall',children:""+getOrderedListItemBullet({itemNumber:_itemNumber!=null?_itemNumber:1,level:level!=null?level:1})+(variant==='ordered'?'.':'')})}),jsx(ListItemContentChildren,{size:size,children:validChildItem})]}),childList]}));};var ListItem=assignWithoutSideEffects(_ListItem,{componentId:'ListItem'});
|
|
4066
|
+
var StyledListItem=styled(ListItemElement)(function(_ref){var level=_ref.level,theme=_ref.theme,variant=_ref.variant,hasIcon=_ref.hasIcon;return {marginLeft:level?get_1(theme,listItemMarginLeft[""+variant+(variant==='unordered'&&hasIcon?'WithIcon':'')][level]):0};});var ListItemContentChildren=function ListItemContentChildren(_ref2){var children=_ref2.children,size=_ref2.size;return getPlatformType()==='react-native'?jsx(BaseBox,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:children.map(function(child,index){if(typeof child==='string'){return jsx(Text,{variant:"body",size:size,children:child},index);}return child;})}):jsx(Text,{variant:"body",size:size,children:children});};var _ListItem=function _ListItem(_ref3){var children=_ref3.children,Icon=_ref3.icon,_itemNumber=_ref3._itemNumber,testID=_ref3.testID;var _useListContext=useListContext(),level=_useListContext.level,size=_useListContext.size,ListContextIcon=_useListContext.icon,variant=_useListContext.variant;var _useTheme=useTheme(),theme=_useTheme.theme,platform=_useTheme.platform;var ItemIcon=Icon!=null?Icon:ListContextIcon;if(level&&level>3){throw new Error('[Blade List]: List Nesting is allowed only upto 3 levels.');}var childrenArray=React__default.Children.toArray(children);var validChildItem=childrenArray.filter(function(child){if(getComponentId(child)==='List')return null;if(typeof child==='string'||isValidAllowedChildren(child,'ListItemLink')||isValidAllowedChildren(child,'ListItemCode')){return child;}else {throw new Error('[Blade List]: You can only pass a List, ListItemLink, ListItemCode or a string as a child to ListItem.');}});var childList=childrenArray.filter(function(child){return getComponentId(child)==='List'?child:null;});var hasIcon=Boolean(ItemIcon);return jsxs(StyledListItem,_extends({level:level,variant:variant,hasIcon:hasIcon},metaAttribute({name:MetaConstants.ListItem,testID:testID}),{children:[jsxs(BaseBox,{display:"flex",flexDirection:"row",alignItems:"center",marginBottom:listItemMarginBottom,children:[variant==='unordered'?jsx(BaseBox,{marginRight:listItemBulletMarginRight[variant],marginTop:listItemBulletMarginTop[""+variant+(hasIcon?'WithIcon':'')][platform][size],display:"flex",alignSelf:"flex-start",children:ItemIcon?jsx(ItemIcon,{size:size,color:"surface.text.subdued.lowContrast"}):jsx(UnorderedItemIcon,{level:level})}):jsx(BaseBox,{width:listItemOrderedBulletBoxSize[variant][platform][size],height:listItemOrderedBulletBoxSize[variant][platform][size],marginRight:listItemBulletMarginRight[variant],marginTop:listItemBulletMarginTop[variant][platform][size],display:"flex",flexShrink:0,justifyContent:"center",alignSelf:"flex-start",alignItems:"center",borderRadius:variant==='ordered-filled'?'max':undefined,backgroundColor:variant==='ordered-filled'?get_1(theme,'colors.brand.gray.a100.lowContrast'):undefined,children:jsx(Text,{variant:"body",type:"subtle",size:variant==='ordered'?size:'xsmall',children:""+getOrderedListItemBullet({itemNumber:_itemNumber!=null?_itemNumber:1,level:level!=null?level:1})+(variant==='ordered'?'.':'')})}),jsx(ListItemContentChildren,{size:size,children:validChildItem})]}),childList]}));};var ListItem=assignWithoutSideEffects(_ListItem,{componentId:'ListItem'});
|
|
4069
4067
|
|
|
4070
4068
|
var _ListItemLink=function _ListItemLink(_ref){var accessibilityLabel=_ref.accessibilityLabel,children=_ref.children,href=_ref.href,icon=_ref.icon,iconPosition=_ref.iconPosition,onClick=_ref.onClick,rel=_ref.rel,target=_ref.target,testID=_ref.testID;var _useListContext=useListContext(),size=_useListContext.size;return jsx(Link,_extends({size:size,variant:"anchor"},icon?{icon:icon,children:children}:{children:children},{href:href,target:target,rel:rel,iconPosition:iconPosition,onClick:onClick,accessibilityLabel:accessibilityLabel,testID:testID}));};var ListItemLink=assignWithoutSideEffects(_ListItemLink,{componentId:'ListItemLink'});
|
|
4071
4069
|
|
|
@@ -4273,10 +4271,6 @@ var affixFontSizes={'body-small':75,'body-small-bold':75,'body-medium':75,'body-
|
|
|
4273
4271
|
|
|
4274
4272
|
var _excluded=["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,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 locale=currencyLocaleMapping[currency];return amountValue.toLocaleString(locale);};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);}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);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:"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})]}));};
|
|
4275
4273
|
|
|
4276
|
-
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;return _extends({flexShrink:0,paddingTop:makeSpace(theme.spacing[4]),marginBottom:makeSpace(theme.spacing[2]),touchAction:'none',width:'100%',display:'flex',flexDirection:'column',alignItems:'center',justifyContent:'center'},isReactNative$4()?undefined:{':after':getHandlePartStyles({theme:theme})});};
|
|
4277
|
-
|
|
4278
|
-
var StyledGrabHandle=styled(BaseBox)(function(_ref){var theme=_ref.theme;return getBottomSheetGrabHandleStyles({theme:theme});});var StyledHandlePart=styled(BaseBox)(function(_ref2){var theme=_ref2.theme;return getHandlePartStyles({theme:theme});});var BottomSheetGrabHandle=function BottomSheetGrabHandle(){return jsx(StyledGrabHandle,{children:jsx(StyledHandlePart,{})});};
|
|
4279
|
-
|
|
4280
4274
|
var propRestrictionMap={Button:{size:'xsmall',variant:'tertiary'},Badge:{size:'medium'},Link:{size:'medium'},Text:{size:'medium',variant:'body'}};var useBottomSheetHeaderTrailingRestriction=function useBottomSheetHeaderTrailingRestriction(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 BottomSheetHeader]: 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 BottomSheetHeader]: Do not pass \""+prop+"\" to \""+trailingComponentType+"\" while inside BottomSheetHeader trailing, because we override it.");}}setValidatedTrailingComponent(React__default.cloneElement(trailing,restrictedProps));}},[trailing]);return validatedTrailingComponent;};
|
|
4281
4275
|
|
|
4282
4276
|
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;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};return jsx(BaseBox,_extends({position:"relative",height:makeSize(size[8]),touchAction:"none"},webOnlyEventHandlers,{children:jsx(BaseBox,{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top: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",children:jsx(IconButton,{ref:ref,size:"large",icon:CloseIcon,accessibilityLabel:"Close",onClick:close})})}));});
|
|
@@ -4287,6 +4281,10 @@ var _BaseHeader=function _BaseHeader(_ref){var title=_ref.title,subtitle=_ref.su
|
|
|
4287
4281
|
|
|
4288
4282
|
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,defaultInitialFocusRef=_useBottomSheetContex.defaultInitialFocusRef;var validatedTrailingComponent=useBottomSheetHeaderTrailingRestriction(trailing);var isHeaderEmpty=!(title||subtitle||leading||trailing||showBackButton);return jsx(BaseBox,{backgroundColor:"white",overflow:"visible",flexShrink:0,children:isHeaderEmpty?jsx(BottomSheetEmptyHeader,{ref:defaultInitialFocusRef}):jsx(BaseHeader,{title:title,subtitle:subtitle,leading:leading,trailing:validatedTrailingComponent,titleSuffix:titleSuffix,closeButtonRef:defaultInitialFocusRef,showBackButton:showBackButton,onBackButtonClick:onBackButtonClick,showCloseButton:true,onCloseButtonClick:close})});};var BottomSheetHeader=assignWithoutSideEffects(_BottomSheetHeader,{componentId:ComponentIds$1.BottomSheetHeader});
|
|
4289
4283
|
|
|
4284
|
+
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;return _extends({flexShrink:0,paddingTop:makeSpace(theme.spacing[4]),marginBottom:makeSpace(theme.spacing[2]),touchAction:'none',width:'100%',display:'flex',flexDirection:'column',alignItems:'center',justifyContent:'center'},isReactNative$4()?undefined:{':after':getHandlePartStyles({theme:theme})});};
|
|
4285
|
+
|
|
4286
|
+
var StyledGrabHandle=styled(BaseBox)(function(_ref){var theme=_ref.theme;return getBottomSheetGrabHandleStyles({theme:theme});});var StyledHandlePart=styled(BaseBox)(function(_ref2){var theme=_ref2.theme;return getHandlePartStyles({theme:theme});});var BottomSheetGrabHandle=function BottomSheetGrabHandle(){return jsx(StyledGrabHandle,{children:jsx(StyledHandlePart,{})});};
|
|
4287
|
+
|
|
4290
4288
|
var _BottomSheetBody=function _BottomSheetBody(_ref){var children=_ref.children;var _useBottomSheetContex=useBottomSheetContext(),footerHeight=_useBottomSheetContex.footerHeight,setContentHeight=_useBottomSheetContex.setContentHeight;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$1.ActionList)){setBottomSheetHasActionList(true);}});},[children]);if(bottomSheetHasActionList===undefined)return jsx(Fragment,{});return jsx(Fragment,{children:bottomSheetHasActionList?children:jsx(BottomSheetScrollView,{onContentSizeChange:function onContentSizeChange(_width,height){setContentHeight(height);},style:{marginBottom:footerHeight},children:jsx(BaseBox,{flexShrink:1,flexGrow:1,overflow:"hidden",children:jsx(BaseBox,{paddingLeft:bottomSheetHasActionList?'spacing.3':'spacing.5',paddingRight:bottomSheetHasActionList?'spacing.3':'spacing.5',paddingTop:bottomSheetHasActionList?'spacing.3':'spacing.5',paddingBottom:bottomSheetHasActionList?'spacing.3':'spacing.5',overflow:"hidden",children:children})})})});};var BottomSheetBody=assignWithoutSideEffects(_BottomSheetBody,{componentId:ComponentIds$1.BottomSheetBody});
|
|
4291
4289
|
|
|
4292
4290
|
var _BaseFooter=function _BaseFooter(_ref){var children=_ref.children,_ref$showDivider=_ref.showDivider,showDivider=_ref$showDivider===void 0?true:_ref$showDivider;return jsxs(Fragment,{children:[showDivider&&jsx(Divider,{}),jsx(BaseBox,{paddingLeft:"spacing.6",paddingRight:"spacing.6",paddingTop:"spacing.5",paddingBottom:"spacing.5",children:children})]});};var BaseFooter=assignWithoutSideEffects(_BaseFooter,{componentId:'BaseFooter'});
|
|
@@ -4295,7 +4293,7 @@ var _BottomSheetFooter=function _BottomSheetFooter(_ref){var children=_ref.child
|
|
|
4295
4293
|
|
|
4296
4294
|
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}]}));};
|
|
4297
4295
|
|
|
4298
|
-
var BottomSheetSurface=styled(BaseBox)(function(_ref){var theme=_ref.theme;return {borderTopLeftRadius:makeSpace(theme.spacing[5]),borderTopRightRadius:makeSpace(theme.spacing[5]),backgroundColor:theme.colors.surface.background.level2.lowContrast,justifyContent:'center',alignItems:'center',position:'relative'};});var focusOnElement=function focusOnElement(element){var reactTag=findNodeHandle(element);if(reactTag){AccessibilityInfo.setAccessibilityFocus(reactTag);}};var _BottomSheet=function _BottomSheet(_ref2){var _bottomSheetAndDropdo;var children=_ref2.children,_ref2$snapPoints=_ref2.snapPoints,snapPoints=_ref2$snapPoints===void 0?[0.35,0.5,0.85]:_ref2$snapPoints,isOpen=_ref2.isOpen,onDismiss=_ref2.onDismiss,initialFocusRef=_ref2.initialFocusRef;var bottomSheetAndDropdownGlue=useBottomSheetAndDropdownGlue();var defaultInitialFocusRef=React__default.useRef(null);var sheetRef=React__default.useRef(null);var header=React__default.useRef();var footer=React__default.useRef();var body=React__default.useRef();var _isOpen=(_bottomSheetAndDropdo=bottomSheetAndDropdownGlue==null?void 0:bottomSheetAndDropdownGlue.isOpen)!=null?_bottomSheetAndDropdo:isOpen;var _React$useState=React__default.useState(0),_React$useState2=_slicedToArray(_React$useState,2),headerHeight=_React$useState2[0],setHeaderHeight=_React$useState2[1];var _React$useState3=React__default.useState(0),_React$useState4=_slicedToArray(_React$useState3,2),footerHeight=_React$useState4[0],setFooterHeight=_React$useState4[1];var _React$useState5=React__default.useState(0),_React$useState6=_slicedToArray(_React$useState5,2),contentHeight=_React$useState6[0],setContentHeight=_React$useState6[1];var initialSnapPoint=React__default.useRef(0);var totalHeight=React__default.useMemo(function(){return headerHeight+footerHeight+contentHeight;},[contentHeight,footerHeight,headerHeight]);var id=useId();var _useBottomSheetStack=useBottomSheetStack(),addBottomSheetToStack=_useBottomSheetStack.addBottomSheetToStack,removeBottomSheetFromStack=_useBottomSheetStack.removeBottomSheetFromStack,getCurrentStackIndexById=_useBottomSheetStack.getCurrentStackIndexById,getTopOfTheStack=_useBottomSheetStack.getTopOfTheStack;var currentStackIndex=getCurrentStackIndexById(id);var zIndex=100-currentStackIndex;useIsomorphicLayoutEffect(function(){var height=Dimensions.get('window').height;var middleSnapPoint=snapPoints[1]*height;if(totalHeight>middleSnapPoint){initialSnapPoint.current=1;}},[snapPoints,totalHeight]);var _snapPoints=React__default.useMemo(function(){return snapPoints.map(function(point){return point*100+"%";});},[snapPoints]);var close=React__default.useCallback(function(){onDismiss==null?void 0:onDismiss();bottomSheetAndDropdownGlue==null?void 0:bottomSheetAndDropdownGlue.onBottomSheetDismiss();},[bottomSheetAndDropdownGlue,onDismiss]);var handleOnOpen=React__default.useCallback(function(){var _sheetRef$current;(_sheetRef$current=sheetRef.current)==null?void 0:_sheetRef$current.snapToIndex(initialSnapPoint.current);},[]);var handleOnClose=React__default.useCallback(function(){var _sheetRef$current2;(_sheetRef$current2=sheetRef.current)==null?void 0:_sheetRef$current2.close();Keyboard.dismiss();},[sheetRef]);React__default.useEffect(function(){if(_isOpen){handleOnOpen();if(!initialFocusRef){focusOnElement(defaultInitialFocusRef.current);}else {focusOnElement(initialFocusRef.current);}}else {handleOnClose();}},[_isOpen,handleOnClose,handleOnOpen,initialFocusRef]);React__default.useEffect(function(){if(!bottomSheetAndDropdownGlue)return;bottomSheetAndDropdownGlue.setDropdownHasBottomSheet(true);},[bottomSheetAndDropdownGlue]);React__default.useEffect(function(){React__default.Children.forEach(children,function(child){if(getComponentId(child)===ComponentIds$1.BottomSheetHeader){header.current=child;}if(getComponentId(child)===ComponentIds$1.BottomSheetFooter){footer.current=child;}if(getComponentId(child)===ComponentIds$1.BottomSheetBody){body.current=child;}});},[children]);var renderFooter=React__default.useCallback(function(props){return jsx(BottomSheetFooter$1,_extends({},props,{children:jsx(View,{onLayout:function onLayout(event){setFooterHeight(event.nativeEvent.layout.height);},children:footer.current})}));},[]);var renderBackdrop=React__default.useCallback(function(props){return jsx(BottomSheetBackdrop,_extends({},props,{zIndex:zIndex}));},[zIndex]);var renderHandle=React__default.useCallback(function(){return jsxs(BaseBox,{onLayout:function onLayout(_ref3){var nativeEvent=_ref3.nativeEvent;setHeaderHeight(nativeEvent.layout.height);},children:[jsx(BaseBox,{zIndex:zIndex,children:jsx(BottomSheetGrabHandle,{})}),header.current]});},[zIndex]);var contextValue=React__default.useMemo(function(){return {isInBottomSheet:true,isOpen:Boolean(_isOpen),close:handleOnClose,positionY:0,headerHeight:headerHeight,contentHeight:contentHeight,footerHeight:footerHeight,setContentHeight:setContentHeight,setFooterHeight:setFooterHeight,setHeaderHeight:setHeaderHeight,scrollRef:function scrollRef(){},bind:{},defaultInitialFocusRef:defaultInitialFocusRef};},[_isOpen,contentHeight,footerHeight,handleOnClose,headerHeight]);var dropdownProps=useDropdown();React__default.useEffect(function(){if(_isOpen){addBottomSheetToStack(id);}else {removeBottomSheetFromStack(id);}},[addBottomSheetToStack,_isOpen,id,removeBottomSheetFromStack]);React__default.useEffect(function(){var showSubscription=Keyboard.addListener('keyboardDidShow',function(){if(id&&id===getTopOfTheStack()){var _sheetRef$current3;(_sheetRef$current3=sheetRef.current)==null?void 0:_sheetRef$current3.expand();}});return function(){showSubscription.remove();};},[getTopOfTheStack,id]);return jsx(Portal,{hostName:"BladeBottomSheetPortal",children:jsx(DropdownContext.Provider,{value:dropdownProps,children:jsx(BottomSheetContext.Provider,{value:contextValue,children:jsx(GorhomBottomSheet,{enablePanDownToClose:true,enableOverDrag:true,enableContentPanningGesture:true,ref:sheetRef,index:-1,containerStyle:{zIndex:zIndex},animateOnMount:false,handleComponent:renderHandle,backgroundComponent:BottomSheetSurface,footerComponent:renderFooter,backdropComponent:renderBackdrop,onClose:close,snapPoints:_snapPoints,children:body.current})})})});};var BottomSheet=assignWithoutSideEffects(_BottomSheet,{componentId:ComponentIds$1.BottomSheet});
|
|
4296
|
+
var BottomSheetSurface=styled(BaseBox)(function(_ref){var theme=_ref.theme;return {borderTopLeftRadius:makeSpace(theme.spacing[5]),borderTopRightRadius:makeSpace(theme.spacing[5]),backgroundColor:theme.colors.surface.background.level2.lowContrast,justifyContent:'center',alignItems:'center',position:'relative'};});var focusOnElement=function focusOnElement(element){var reactTag=findNodeHandle(element);if(reactTag){AccessibilityInfo.setAccessibilityFocus(reactTag);}};var _BottomSheet=function _BottomSheet(_ref2){var _bottomSheetAndDropdo;var children=_ref2.children,_ref2$snapPoints=_ref2.snapPoints,snapPoints=_ref2$snapPoints===void 0?[0.35,0.5,0.85]:_ref2$snapPoints,isOpen=_ref2.isOpen,onDismiss=_ref2.onDismiss,initialFocusRef=_ref2.initialFocusRef;var bottomSheetAndDropdownGlue=useBottomSheetAndDropdownGlue();var defaultInitialFocusRef=React__default.useRef(null);var sheetRef=React__default.useRef(null);var header=React__default.useRef();var footer=React__default.useRef();var body=React__default.useRef();var _isOpen=(_bottomSheetAndDropdo=bottomSheetAndDropdownGlue==null?void 0:bottomSheetAndDropdownGlue.isOpen)!=null?_bottomSheetAndDropdo:isOpen;var _React$useState=React__default.useState(0),_React$useState2=_slicedToArray(_React$useState,2),headerHeight=_React$useState2[0],setHeaderHeight=_React$useState2[1];var _React$useState3=React__default.useState(0),_React$useState4=_slicedToArray(_React$useState3,2),footerHeight=_React$useState4[0],setFooterHeight=_React$useState4[1];var _React$useState5=React__default.useState(0),_React$useState6=_slicedToArray(_React$useState5,2),contentHeight=_React$useState6[0],setContentHeight=_React$useState6[1];var initialSnapPoint=React__default.useRef(0);var totalHeight=React__default.useMemo(function(){return headerHeight+footerHeight+contentHeight;},[contentHeight,footerHeight,headerHeight]);var id=useId();var _useBottomSheetStack=useBottomSheetStack(),addBottomSheetToStack=_useBottomSheetStack.addBottomSheetToStack,removeBottomSheetFromStack=_useBottomSheetStack.removeBottomSheetFromStack,getCurrentStackIndexById=_useBottomSheetStack.getCurrentStackIndexById,getTopOfTheStack=_useBottomSheetStack.getTopOfTheStack;var currentStackIndex=getCurrentStackIndexById(id);var zIndex=100-currentStackIndex;useIsomorphicLayoutEffect(function(){var height=Dimensions.get('window').height;var middleSnapPoint=snapPoints[1]*height;if(totalHeight>middleSnapPoint){initialSnapPoint.current=1;}},[snapPoints,totalHeight]);var _snapPoints=React__default.useMemo(function(){return snapPoints.map(function(point){return point*100+"%";});},[snapPoints]);var close=React__default.useCallback(function(){onDismiss==null?void 0:onDismiss();bottomSheetAndDropdownGlue==null?void 0:bottomSheetAndDropdownGlue.onBottomSheetDismiss();},[bottomSheetAndDropdownGlue,onDismiss]);var handleOnOpen=React__default.useCallback(function(){var _sheetRef$current;(_sheetRef$current=sheetRef.current)==null?void 0:_sheetRef$current.snapToIndex(initialSnapPoint.current);},[]);var handleOnClose=React__default.useCallback(function(){var _sheetRef$current2;(_sheetRef$current2=sheetRef.current)==null?void 0:_sheetRef$current2.close();Keyboard.dismiss();},[sheetRef]);React__default.useEffect(function(){if(_isOpen){handleOnOpen();if(!initialFocusRef){focusOnElement(defaultInitialFocusRef.current);}else {focusOnElement(initialFocusRef.current);}}else {handleOnClose();}},[_isOpen,handleOnClose,handleOnOpen,initialFocusRef]);React__default.useEffect(function(){if(!bottomSheetAndDropdownGlue)return;bottomSheetAndDropdownGlue.setDropdownHasBottomSheet(true);},[bottomSheetAndDropdownGlue]);React__default.useEffect(function(){React__default.Children.forEach(children,function(child){if(getComponentId(child)===ComponentIds$1.BottomSheetHeader){header.current=child;}if(getComponentId(child)===ComponentIds$1.BottomSheetFooter){footer.current=child;}if(getComponentId(child)===ComponentIds$1.BottomSheetBody){body.current=child;}});},[children]);var renderFooter=React__default.useCallback(function(props){return jsx(BottomSheetFooter$1,_extends({},props,{children:jsx(View,{onLayout:function onLayout(event){setFooterHeight(event.nativeEvent.layout.height);},children:footer.current})}));},[]);var renderBackdrop=React__default.useCallback(function(props){return jsx(BottomSheetBackdrop,_extends({},props,{zIndex:zIndex}));},[zIndex]);var renderHandle=React__default.useCallback(function(){return jsxs(BaseBox,{onLayout:function onLayout(_ref3){var nativeEvent=_ref3.nativeEvent;setHeaderHeight(nativeEvent.layout.height);},children:[jsx(BaseBox,{zIndex:zIndex,children:jsx(BottomSheetGrabHandle,{})}),header.current]});},[zIndex]);var contextValue=React__default.useMemo(function(){return {isInBottomSheet:true,isOpen:Boolean(_isOpen),close:handleOnClose,positionY:0,headerHeight:headerHeight,contentHeight:contentHeight,footerHeight:footerHeight,setContentHeight:setContentHeight,setFooterHeight:setFooterHeight,setHeaderHeight:setHeaderHeight,scrollRef:function scrollRef(){},bind:{},defaultInitialFocusRef:defaultInitialFocusRef};},[_isOpen,contentHeight,footerHeight,handleOnClose,headerHeight]);var dropdownProps=useDropdown();React__default.useEffect(function(){if(_isOpen){addBottomSheetToStack(id);}else {removeBottomSheetFromStack(id);}},[addBottomSheetToStack,_isOpen,id,removeBottomSheetFromStack]);React__default.useEffect(function(){var showSubscription=Keyboard.addListener('keyboardDidShow',function(){if(id&&id===getTopOfTheStack()){var _sheetRef$current3;(_sheetRef$current3=sheetRef.current)==null?void 0:_sheetRef$current3.expand();}});return function(){showSubscription.remove();};},[getTopOfTheStack,id]);return jsx(Portal,{hostName:"BladeBottomSheetPortal",children:jsx(DropdownContext.Provider,{value:dropdownProps,children:jsx(BottomSheetContext.Provider,{value:contextValue,children:jsx(GorhomBottomSheet,{style:{shadowColor:'hsla(217,56%,17%,0.64)',shadowOffset:{width:0,height:-18},shadowOpacity:0.2,shadowRadius:12},enablePanDownToClose:true,enableOverDrag:true,enableContentPanningGesture:true,ref:sheetRef,index:-1,containerStyle:{zIndex:zIndex},animateOnMount:false,handleComponent:renderHandle,backgroundComponent:BottomSheetSurface,footerComponent:renderFooter,backdropComponent:renderBackdrop,onClose:close,snapPoints:_snapPoints,children:body.current})})})});};var BottomSheet=assignWithoutSideEffects(_BottomSheet,{componentId:ComponentIds$1.BottomSheet});
|
|
4299
4297
|
|
|
4300
4298
|
export { ActionList, ActionListFooter, ActionListFooterIcon, ActionListHeader, ActionListHeaderIcon, 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, 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, DollarIcon, DollarsIcon, DownloadCloudIcon, DownloadIcon, Dropdown, DropdownButton, 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, 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, TabletIcon, TagIcon, TargetIcon, Text, TextArea, TextInput, ThermometerIcon, ThumbsDownIcon, ThumbsUpIcon, Title, ToggleLeftIcon, ToggleRightIcon, 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 };
|
|
4301
4299
|
//# sourceMappingURL=index.native.js.map
|