@razorpay/blade 9.5.2 → 9.5.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 +7 -1
- package/build/components/index.development.web.js +61 -76
- package/build/components/index.development.web.js.map +1 -1
- package/build/components/index.native.d.ts +6 -0
- package/build/components/index.native.js +2 -2
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.production.web.js +61 -76
- package/build/components/index.production.web.js.map +1 -1
- package/build/css/bankingThemeDarkDesktop.css +1 -1
- package/build/css/bankingThemeDarkMobile.css +1 -1
- package/build/css/bankingThemeLightDesktop.css +1 -1
- package/build/css/bankingThemeLightMobile.css +1 -1
- package/build/css/paymentThemeDarkDesktop.css +1 -1
- package/build/css/paymentThemeDarkMobile.css +1 -1
- package/build/css/paymentThemeLightDesktop.css +1 -1
- package/build/css/paymentThemeLightMobile.css +1 -1
- package/package.json +13 -12
|
@@ -21355,16 +21355,7 @@ var StyledBaseNativeButton = /*#__PURE__*/styled.button.withConfig({
|
|
|
21355
21355
|
displayName: "StyledBaseInputweb__StyledBaseNativeButton",
|
|
21356
21356
|
componentId: "hsusrk-1"
|
|
21357
21357
|
})(function (props) {
|
|
21358
|
-
return _objectSpread$M(
|
|
21359
|
-
size: 'medium',
|
|
21360
|
-
variant: 'body',
|
|
21361
|
-
type: props.value ? 'subtle' : 'placeholder',
|
|
21362
|
-
weight: 'regular',
|
|
21363
|
-
contrast: 'low',
|
|
21364
|
-
theme: props.theme
|
|
21365
|
-
})), {}, {
|
|
21366
|
-
textAlign: props.textAlign
|
|
21367
|
-
});
|
|
21358
|
+
return _objectSpread$M({}, getWebInputStyles(props));
|
|
21368
21359
|
});
|
|
21369
21360
|
var autoCompleteSuggestionTypeMap = {
|
|
21370
21361
|
none: 'off',
|
|
@@ -21453,7 +21444,12 @@ var _StyledBaseInput = function _StyledBaseInput(_ref, ref) {
|
|
|
21453
21444
|
}
|
|
21454
21445
|
}, commonProps), props), accessibilityProps), {}, {
|
|
21455
21446
|
value: props.value,
|
|
21456
|
-
children:
|
|
21447
|
+
children: /*#__PURE__*/jsx(Text, {
|
|
21448
|
+
type: props.value ? 'subtle' : 'placeholder',
|
|
21449
|
+
truncateAfterLines: 1,
|
|
21450
|
+
textAlign: props.textAlign,
|
|
21451
|
+
children: props.value ? props.value : props.placeholder
|
|
21452
|
+
})
|
|
21457
21453
|
})) : /*#__PURE__*/jsx(StyledBaseNativeInput // @ts-expect-error: TS doesnt understand that this will always be `input`
|
|
21458
21454
|
, _objectSpread$M(_objectSpread$M(_objectSpread$M({
|
|
21459
21455
|
ref: ref,
|
|
@@ -28357,7 +28353,9 @@ var _BottomSheet = function _BottomSheet(_ref2) {
|
|
|
28357
28353
|
children = _ref2.children,
|
|
28358
28354
|
initialFocusRef = _ref2.initialFocusRef,
|
|
28359
28355
|
_ref2$snapPoints = _ref2.snapPoints,
|
|
28360
|
-
snapPoints = _ref2$snapPoints === void 0 ? [0.35, 0.5, 0.85] : _ref2$snapPoints
|
|
28356
|
+
snapPoints = _ref2$snapPoints === void 0 ? [0.35, 0.5, 0.85] : _ref2$snapPoints,
|
|
28357
|
+
_ref2$zIndex = _ref2.zIndex,
|
|
28358
|
+
zIndex = _ref2$zIndex === void 0 ? 100 : _ref2$zIndex;
|
|
28361
28359
|
|
|
28362
28360
|
var _useTheme = useTheme(),
|
|
28363
28361
|
theme = _useTheme.theme;
|
|
@@ -28411,7 +28409,6 @@ var _BottomSheet = function _BottomSheet(_ref2) {
|
|
|
28411
28409
|
var preventScrollingRef = React__default.useRef(true);
|
|
28412
28410
|
var scrollRef = React__default.useRef(null);
|
|
28413
28411
|
var grabHandleRef = React__default.useRef(null);
|
|
28414
|
-
var originalFocusElement = React__default.useRef(null);
|
|
28415
28412
|
var defaultInitialFocusRef = React__default.useRef(null);
|
|
28416
28413
|
var initialSnapPoint = React__default.useRef(snapPoints[1]);
|
|
28417
28414
|
var totalHeight = React__default.useMemo(function () {
|
|
@@ -28428,7 +28425,7 @@ var _BottomSheet = function _BottomSheet(_ref2) {
|
|
|
28428
28425
|
|
|
28429
28426
|
var currentStackIndex = getCurrentStackIndexById(id);
|
|
28430
28427
|
var isOnTopOfStack = getTopOfTheStack() === id;
|
|
28431
|
-
var
|
|
28428
|
+
var bottomSheetZIndex = zIndex - currentStackIndex;
|
|
28432
28429
|
var setPositionY = React__default.useCallback(function (value) {
|
|
28433
28430
|
var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
28434
28431
|
var maxValue = computeMaxContent({
|
|
@@ -28472,42 +28469,13 @@ var _BottomSheet = function _BottomSheet(_ref2) {
|
|
|
28472
28469
|
initialSnapPoint.current = snapPoints[0];
|
|
28473
28470
|
}
|
|
28474
28471
|
}, [dimensions.height, snapPoints, totalHeight]);
|
|
28475
|
-
var returnFocus = React__default.useCallback(function () {
|
|
28476
|
-
if (!originalFocusElement.current) return;
|
|
28477
|
-
originalFocusElement.current.focus(); // After returning focus we will clear the original focus
|
|
28478
|
-
// Because if sheet can be opened up via multiple triggers
|
|
28479
|
-
// We want to ensure the focus returns back to the most recent triggerer
|
|
28480
|
-
|
|
28481
|
-
originalFocusElement.current = null;
|
|
28482
|
-
}, [originalFocusElement]);
|
|
28483
|
-
var focusOnInitialRef = React__default.useCallback(function () {
|
|
28484
|
-
if (!initialFocusRef) {
|
|
28485
|
-
var _defaultInitialFocusR;
|
|
28486
|
-
|
|
28487
|
-
// focus on close button
|
|
28488
|
-
(_defaultInitialFocusR = defaultInitialFocusRef.current) === null || _defaultInitialFocusR === void 0 ? void 0 : _defaultInitialFocusR.focus();
|
|
28489
|
-
} else {
|
|
28490
|
-
var _initialFocusRef$curr;
|
|
28491
|
-
|
|
28492
|
-
// focus on the initialRef passed by the user
|
|
28493
|
-
(_initialFocusRef$curr = initialFocusRef.current) === null || _initialFocusRef$curr === void 0 ? void 0 : _initialFocusRef$curr.focus();
|
|
28494
|
-
}
|
|
28495
|
-
}, [initialFocusRef]);
|
|
28496
28472
|
var handleOnOpen = React__default.useCallback(function () {
|
|
28497
|
-
var _originalFocusElement;
|
|
28498
|
-
|
|
28499
28473
|
setPositionY(dimensions.height * initialSnapPoint.current);
|
|
28500
|
-
scrollLockRef.current.activate();
|
|
28501
|
-
|
|
28502
|
-
// On Subsequent open operations it won't further update the original focus
|
|
28503
|
-
|
|
28504
|
-
originalFocusElement.current = (_originalFocusElement = originalFocusElement.current) !== null && _originalFocusElement !== void 0 ? _originalFocusElement : document.activeElement;
|
|
28505
|
-
focusOnInitialRef();
|
|
28506
|
-
}, [dimensions.height, focusOnInitialRef, scrollLockRef, setPositionY]);
|
|
28474
|
+
scrollLockRef.current.activate();
|
|
28475
|
+
}, [dimensions.height, scrollLockRef, setPositionY]);
|
|
28507
28476
|
var handleOnClose = React__default.useCallback(function () {
|
|
28508
28477
|
setPositionY(0);
|
|
28509
|
-
|
|
28510
|
-
}, [returnFocus, setPositionY]);
|
|
28478
|
+
}, [setPositionY]);
|
|
28511
28479
|
var close = React__default.useCallback(function () {
|
|
28512
28480
|
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
28513
28481
|
bottomSheetAndDropdownGlue === null || bottomSheetAndDropdownGlue === void 0 ? void 0 : bottomSheetAndDropdownGlue.onBottomSheetDismiss();
|
|
@@ -28725,49 +28693,66 @@ var _BottomSheet = function _BottomSheet(_ref2) {
|
|
|
28725
28693
|
|
|
28726
28694
|
_setPositionY(0);
|
|
28727
28695
|
}
|
|
28728
|
-
}, [isMounted, scrollLockRef]); //
|
|
28696
|
+
}, [isMounted, scrollLockRef]); // required by floating ui to handle focus
|
|
28697
|
+
|
|
28698
|
+
var _useFloating = useFloating({
|
|
28699
|
+
open: isMounted
|
|
28700
|
+
}),
|
|
28701
|
+
refs = _useFloating.refs,
|
|
28702
|
+
context = _useFloating.context; // We don't want to destroy the react tree when we are rendering inside Dropdown
|
|
28729
28703
|
// Because if we bail out early then ActionList won't render,
|
|
28730
28704
|
// and Dropdown manages it's state based on the rendered JSX of ActionList
|
|
28731
28705
|
// If we don't render ActionList Dropdown state will reset each time we open/close BottomSheet
|
|
28732
28706
|
|
|
28707
|
+
|
|
28733
28708
|
var isInsideDropdown = Boolean(bottomSheetAndDropdownGlue);
|
|
28734
28709
|
|
|
28735
28710
|
if (!isMounted && !isInsideDropdown) {
|
|
28736
28711
|
return /*#__PURE__*/jsx(Fragment, {});
|
|
28737
28712
|
}
|
|
28738
28713
|
|
|
28739
|
-
return /*#__PURE__*/
|
|
28714
|
+
return /*#__PURE__*/jsx(BottomSheetContext.Provider, {
|
|
28740
28715
|
value: contextValue,
|
|
28741
|
-
children:
|
|
28742
|
-
|
|
28743
|
-
|
|
28744
|
-
|
|
28745
|
-
})), makeAccessible({
|
|
28716
|
+
children: (isMounted || isInsideDropdown) && /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
28717
|
+
returnFocus: true,
|
|
28718
|
+
initialFocus: initialFocusRef !== null && initialFocusRef !== void 0 ? initialFocusRef : defaultInitialFocusRef,
|
|
28719
|
+
context: context,
|
|
28746
28720
|
modal: true,
|
|
28747
|
-
|
|
28748
|
-
|
|
28749
|
-
|
|
28750
|
-
|
|
28751
|
-
|
|
28752
|
-
|
|
28753
|
-
|
|
28754
|
-
|
|
28755
|
-
|
|
28756
|
-
|
|
28757
|
-
|
|
28758
|
-
|
|
28759
|
-
|
|
28760
|
-
|
|
28761
|
-
|
|
28762
|
-
|
|
28763
|
-
|
|
28764
|
-
|
|
28765
|
-
|
|
28766
|
-
|
|
28767
|
-
|
|
28768
|
-
|
|
28721
|
+
children: /*#__PURE__*/jsxs(Fragment, {
|
|
28722
|
+
children: [/*#__PURE__*/jsx(BottomSheetBackdrop, {
|
|
28723
|
+
zIndex: bottomSheetZIndex
|
|
28724
|
+
}), /*#__PURE__*/jsx(BottomSheetSurface, _objectSpread$c(_objectSpread$c(_objectSpread$c({}, metaAttribute({
|
|
28725
|
+
name: MetaConstants.BottomSheet,
|
|
28726
|
+
testID: 'bottomsheet-surface'
|
|
28727
|
+
})), makeAccessible({
|
|
28728
|
+
modal: true,
|
|
28729
|
+
role: 'dialog'
|
|
28730
|
+
})), {}, {
|
|
28731
|
+
windowHeight: dimensions.height,
|
|
28732
|
+
isDragging: isDragging,
|
|
28733
|
+
style: {
|
|
28734
|
+
opacity: isVisible ? 1 : 0,
|
|
28735
|
+
pointerEvents: isVisible ? 'all' : 'none',
|
|
28736
|
+
height: positionY,
|
|
28737
|
+
bottom: 0,
|
|
28738
|
+
top: 'auto',
|
|
28739
|
+
zIndex: bottomSheetZIndex
|
|
28740
|
+
},
|
|
28741
|
+
ref: refs.setFloating,
|
|
28742
|
+
children: /*#__PURE__*/jsxs(BaseBox, {
|
|
28743
|
+
height: "100%",
|
|
28744
|
+
display: "flex",
|
|
28745
|
+
flexDirection: "column",
|
|
28746
|
+
children: [/*#__PURE__*/jsx(BottomSheetGrabHandle, _objectSpread$c(_objectSpread$c({
|
|
28747
|
+
ref: grabHandleRef,
|
|
28748
|
+
isHeaderFloating: isHeaderFloating
|
|
28749
|
+
}, metaAttribute({
|
|
28750
|
+
name: ComponentIds.BottomSheetGrabHandle
|
|
28751
|
+
})), bind())), children]
|
|
28752
|
+
})
|
|
28753
|
+
}))]
|
|
28769
28754
|
})
|
|
28770
|
-
})
|
|
28755
|
+
})
|
|
28771
28756
|
});
|
|
28772
28757
|
};
|
|
28773
28758
|
|