@razorpay/blade 10.14.2 → 10.14.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 +37 -17
- package/build/components/index.development.web.js.map +1 -1
- package/build/components/index.native.d.ts +7 -1
- package/build/components/index.native.js +2 -2
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.production.web.js +37 -17
- 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 +1 -1
|
@@ -537,17 +537,20 @@ var getActionListProperties = function getActionListProperties(children) {
|
|
|
537
537
|
if ( /*#__PURE__*/React__default.isValidElement(child)) {
|
|
538
538
|
if (isValidAllowedChildren(child, componentIds.ActionListSection)) {
|
|
539
539
|
var shouldHideDivider = index === lastActionListSectionIndex && !isActionListItemPresentAfterSection;
|
|
540
|
+
var sectionChildValues = [];
|
|
540
541
|
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
541
542
|
// @ts-expect-error: TS doesn't understand the child's props
|
|
542
543
|
children: React__default.Children.map(child.props.children, function (childInSection) {
|
|
543
544
|
currentSection = child.props.title;
|
|
545
|
+
sectionChildValues.push(childInSection.props.value);
|
|
544
546
|
if (isValidAllowedChildren(childInSection, componentIds.ActionListItem)) {
|
|
545
547
|
return getActionListItemWithId(childInSection, shouldHideDivider);
|
|
546
548
|
}
|
|
547
549
|
return childInSection;
|
|
548
550
|
}),
|
|
549
551
|
// On web, we handle it with descendant styling in css so no need of JS there
|
|
550
|
-
_hideDivider: isReactNative$4() ? shouldHideDivider : undefined
|
|
552
|
+
_hideDivider: isReactNative$4() ? shouldHideDivider : undefined,
|
|
553
|
+
_sectionChildValues: sectionChildValues
|
|
551
554
|
});
|
|
552
555
|
}
|
|
553
556
|
if (isValidAllowedChildren(child, componentIds.ActionListItem)) {
|
|
@@ -15608,9 +15611,26 @@ var _ActionListSection = function _ActionListSection(_ref) {
|
|
|
15608
15611
|
var title = _ref.title,
|
|
15609
15612
|
children = _ref.children,
|
|
15610
15613
|
testID = _ref.testID,
|
|
15611
|
-
_hideDivider = _ref._hideDivider
|
|
15614
|
+
_hideDivider = _ref._hideDivider,
|
|
15615
|
+
_sectionChildValues = _ref._sectionChildValues;
|
|
15612
15616
|
var _useActionListContext = useActionListContext(),
|
|
15613
15617
|
surfaceLevel = _useActionListContext.surfaceLevel;
|
|
15618
|
+
var _useDropdown = useDropdown(),
|
|
15619
|
+
hasAutoCompleteInBottomSheetHeader = _useDropdown.hasAutoCompleteInBottomSheetHeader,
|
|
15620
|
+
dropdownTriggerer = _useDropdown.dropdownTriggerer,
|
|
15621
|
+
filteredValues = _useDropdown.filteredValues;
|
|
15622
|
+
var hasAutoComplete = hasAutoCompleteInBottomSheetHeader || dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;
|
|
15623
|
+
var isSectionVisible = React__default.useMemo(function () {
|
|
15624
|
+
if (hasAutoComplete) {
|
|
15625
|
+
var visibleActionListItemInSection = _sectionChildValues === null || _sectionChildValues === void 0 ? void 0 : _sectionChildValues.find(function (actionItemValue) {
|
|
15626
|
+
return filteredValues.includes(actionItemValue);
|
|
15627
|
+
});
|
|
15628
|
+
return Boolean(visibleActionListItemInSection);
|
|
15629
|
+
}
|
|
15630
|
+
return true;
|
|
15631
|
+
}, [_sectionChildValues, hasAutoComplete, filteredValues]);
|
|
15632
|
+
var showDividerInRN = !(_hideDivider && isReactNative$4());
|
|
15633
|
+
var showDividerInAutoComplete = hasAutoComplete ? isSectionVisible && filteredValues.length > 1 : true;
|
|
15614
15634
|
return /*#__PURE__*/jsxs(BaseBox, _objectSpread$1q(_objectSpread$1q(_objectSpread$1q({}, makeAccessible({
|
|
15615
15635
|
role: getActionListSectionRole(),
|
|
15616
15636
|
label: title
|
|
@@ -15620,7 +15640,7 @@ var _ActionListSection = function _ActionListSection(_ref) {
|
|
|
15620
15640
|
name: MetaConstants.ActionListSection,
|
|
15621
15641
|
testID: testID
|
|
15622
15642
|
})), {}, {
|
|
15623
|
-
children: [/*#__PURE__*/jsx(StyledActionListSectionTitle, _objectSpread$1q(_objectSpread$1q({}, makeAccessible({
|
|
15643
|
+
children: [isSectionVisible ? /*#__PURE__*/jsx(StyledActionListSectionTitle, _objectSpread$1q(_objectSpread$1q({}, makeAccessible({
|
|
15624
15644
|
hidden: true
|
|
15625
15645
|
})), {}, {
|
|
15626
15646
|
children: /*#__PURE__*/jsx(Text, {
|
|
@@ -15629,16 +15649,16 @@ var _ActionListSection = function _ActionListSection(_ref) {
|
|
|
15629
15649
|
weight: "bold",
|
|
15630
15650
|
children: title
|
|
15631
15651
|
})
|
|
15632
|
-
})), /*#__PURE__*/jsx(BaseBox, _objectSpread$1q(_objectSpread$1q({}, makeAccessible({
|
|
15652
|
+
})) : null, /*#__PURE__*/jsx(BaseBox, _objectSpread$1q(_objectSpread$1q({}, makeAccessible({
|
|
15633
15653
|
// On web, we just wrap it in another listbox to announce item count properly for particular group.
|
|
15634
15654
|
// On React Native, we ignore it since `menu` + `group` role will take care of accessibility
|
|
15635
15655
|
role: isReactNative$4() ? undefined : 'listbox'
|
|
15636
15656
|
})), {}, {
|
|
15637
15657
|
children: children
|
|
15638
|
-
})),
|
|
15658
|
+
})), showDividerInAutoComplete && showDividerInRN ? /*#__PURE__*/jsx(Divider, {
|
|
15639
15659
|
marginX: "spacing.3",
|
|
15640
15660
|
marginY: "spacing.1"
|
|
15641
|
-
})]
|
|
15661
|
+
}) : null]
|
|
15642
15662
|
}));
|
|
15643
15663
|
};
|
|
15644
15664
|
var ActionListSection = /*#__PURE__*/assignWithoutSideEffects(_ActionListSection, {
|
|
@@ -15800,17 +15820,17 @@ var ActionListItemBody = /*#__PURE__*/React__default.memo(_ActionListItemBody);
|
|
|
15800
15820
|
* ```
|
|
15801
15821
|
*/
|
|
15802
15822
|
var _ActionListItem = function _ActionListItem(props) {
|
|
15803
|
-
var
|
|
15804
|
-
activeIndex =
|
|
15805
|
-
dropdownBaseId =
|
|
15806
|
-
onOptionClick =
|
|
15807
|
-
selectedIndices =
|
|
15808
|
-
setShouldIgnoreBlurAnimation =
|
|
15809
|
-
selectionType =
|
|
15810
|
-
dropdownTriggerer =
|
|
15811
|
-
isKeydownPressed =
|
|
15812
|
-
filteredValues =
|
|
15813
|
-
hasAutoCompleteInBottomSheetHeader =
|
|
15823
|
+
var _useDropdown2 = useDropdown(),
|
|
15824
|
+
activeIndex = _useDropdown2.activeIndex,
|
|
15825
|
+
dropdownBaseId = _useDropdown2.dropdownBaseId,
|
|
15826
|
+
onOptionClick = _useDropdown2.onOptionClick,
|
|
15827
|
+
selectedIndices = _useDropdown2.selectedIndices,
|
|
15828
|
+
setShouldIgnoreBlurAnimation = _useDropdown2.setShouldIgnoreBlurAnimation,
|
|
15829
|
+
selectionType = _useDropdown2.selectionType,
|
|
15830
|
+
dropdownTriggerer = _useDropdown2.dropdownTriggerer,
|
|
15831
|
+
isKeydownPressed = _useDropdown2.isKeydownPressed,
|
|
15832
|
+
filteredValues = _useDropdown2.filteredValues,
|
|
15833
|
+
hasAutoCompleteInBottomSheetHeader = _useDropdown2.hasAutoCompleteInBottomSheetHeader;
|
|
15814
15834
|
var _useTheme = useTheme(),
|
|
15815
15835
|
platform = _useTheme.platform;
|
|
15816
15836
|
var isMobile = platform === 'onMobile';
|