@razorpay/blade 10.16.0 → 10.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/index.d.ts +0 -1
- package/build/components/index.development.web.js +2 -2
- package/build/components/index.development.web.js.map +1 -1
- package/build/components/index.native.d.ts +0 -1
- package/build/components/index.native.js +1 -1
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.production.web.js +2 -2
- package/build/components/index.production.web.js.map +1 -1
- package/build/css/bankingThemeDarkDesktop.css +1 -2
- package/build/css/bankingThemeDarkMobile.css +1 -2
- package/build/css/bankingThemeLightDesktop.css +2 -3
- package/build/css/bankingThemeLightMobile.css +2 -3
- package/build/css/paymentThemeDarkDesktop.css +2 -3
- package/build/css/paymentThemeDarkMobile.css +2 -3
- package/build/css/paymentThemeLightDesktop.css +2 -3
- package/build/css/paymentThemeLightMobile.css +2 -3
- package/build/tokens/index.d.ts +0 -1
- package/build/tokens/index.development.web.js +3 -15
- package/build/tokens/index.development.web.js.map +1 -1
- package/build/tokens/index.native.d.ts +0 -1
- package/build/tokens/index.native.js +2 -2
- package/build/tokens/index.native.js.map +1 -1
- package/build/tokens/index.production.web.js +3 -15
- package/build/tokens/index.production.web.js.map +1 -1
- package/build/utils/index.d.ts +0 -1
- package/build/utils/index.development.web.js.map +1 -1
- package/build/utils/index.native.d.ts +0 -1
- package/build/utils/index.native.js.map +1 -1
- package/package.json +17 -16
|
@@ -436,7 +436,6 @@ declare type Colors = {
|
|
|
436
436
|
overlay: Record<'background', Record<400 | 800, string>>;
|
|
437
437
|
popup: Record<'background', string>;
|
|
438
438
|
};
|
|
439
|
-
overlay: Record<'background', string>;
|
|
440
439
|
action: {
|
|
441
440
|
background: Omit<ActionVariants, 'link'>;
|
|
442
441
|
border: Omit<ActionVariants, 'link'>;
|
|
@@ -3204,7 +3204,7 @@ var _BottomSheetBody=function _BottomSheetBody(_ref){var children=_ref.children,
|
|
|
3204
3204
|
|
|
3205
3205
|
var _BottomSheetFooter=function _BottomSheetFooter(_ref){var children=_ref.children;var _useTheme=useTheme(),theme=_useTheme.theme;return jsx(BaseBox,{width:"100%",flexShrink:0,marginTop:"auto",backgroundColor:theme.colors.surface.background.level2.lowContrast,touchAction:"none",zIndex:2,children:jsx(BaseFooter,{children:children})});};var BottomSheetFooter=assignWithoutSideEffects(_BottomSheetFooter,{componentId:ComponentIds.BottomSheetFooter});
|
|
3206
3206
|
|
|
3207
|
-
var BottomSheetBackdrop=function BottomSheetBackdrop(props){var _useTheme=useTheme(),theme=_useTheme.theme;return jsx(BottomSheetBackdrop$1,Object.assign({},props,{appearsOnIndex:0,disappearsOnIndex:-1,pressBehavior:"close",opacity:1,style:[props.style,{backgroundColor:theme.colors.overlay.background,zIndex:props.zIndex}]}));};
|
|
3207
|
+
var BottomSheetBackdrop=function BottomSheetBackdrop(props){var _useTheme=useTheme(),theme=_useTheme.theme;return jsx(BottomSheetBackdrop$1,Object.assign({},props,{appearsOnIndex:0,disappearsOnIndex:-1,pressBehavior:"close",opacity:1,style:[props.style,{backgroundColor:theme.colors.surface.overlay.background[800],zIndex:props.zIndex}]}));};
|
|
3208
3208
|
|
|
3209
3209
|
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 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=isOpen!=null?isOpen:bottomSheetAndDropdownGlue==null?void 0:bottomSheetAndDropdownGlue.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 _React$useState7=React__default.useState(true),_React$useState8=_slicedToArray(_React$useState7,2),hasBodyPadding=_React$useState8[0],setHasBodyPadding=_React$useState8[1];var _React$useState9=React__default.useState(false),_React$useState10=_slicedToArray(_React$useState9,2),isHeaderEmpty=_React$useState10[0],setIsHeaderEmpty=_React$useState10[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(){if(bottomSheetAndDropdownGlue!=null&&bottomSheetAndDropdownGlue.hasAutoCompleteInBottomSheetHeader){initialSnapPoint.current=2;}else {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.BottomSheetHeader){header.current=child;}if(getComponentId(child)===ComponentIds.BottomSheetFooter){footer.current=child;}if(getComponentId(child)===ComponentIds.BottomSheetBody){body.current=child;}});},[children]);var renderFooter=React__default.useCallback(function(props){return jsx(BottomSheetFooter$1,Object.assign({},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,Object.assign({},props,{zIndex:zIndex}));},[zIndex]);var renderHandle=React__default.useCallback(function(){return jsxs(BaseBox,{position:isHeaderEmpty?'absolute':'relative',top:"spacing.0",left:"spacing.0",right:"spacing.0",onLayout:function onLayout(_ref3){var nativeEvent=_ref3.nativeEvent;setHeaderHeight(nativeEvent.layout.height);},children:[jsx(BaseBox,{zIndex:zIndex,children:jsx(BottomSheetGrabHandle,{})}),header.current]});},[isHeaderEmpty,zIndex]);var isHeaderFloating=!hasBodyPadding&&isHeaderEmpty;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,isHeaderFloating:isHeaderFloating,setHasBodyPadding:setHasBodyPadding,setIsHeaderEmpty:setIsHeaderEmpty};},[_isOpen,contentHeight,footerHeight,handleOnClose,headerHeight,isHeaderFloating]);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:isOpen?{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.BottomSheet});
|
|
3210
3210
|
|