@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
|
@@ -2115,8 +2115,14 @@ declare type ActionListSectionProps = {
|
|
|
2115
2115
|
* @private
|
|
2116
2116
|
*/
|
|
2117
2117
|
_hideDivider?: boolean;
|
|
2118
|
+
/**
|
|
2119
|
+
* Internally used to hide / show section in AutoComplete
|
|
2120
|
+
*
|
|
2121
|
+
* @private
|
|
2122
|
+
*/
|
|
2123
|
+
_sectionChildValues?: string[];
|
|
2118
2124
|
} & TestID;
|
|
2119
|
-
declare const ActionListSection: ({ title, children, testID, _hideDivider, }: ActionListSectionProps) => React__default.ReactElement;
|
|
2125
|
+
declare const ActionListSection: ({ title, children, testID, _hideDivider, _sectionChildValues, }: ActionListSectionProps) => React__default.ReactElement;
|
|
2120
2126
|
declare const ActionListItemIcon: ({ icon }: {
|
|
2121
2127
|
icon: IconComponent;
|
|
2122
2128
|
}) => React__default.ReactElement;
|
|
@@ -590,17 +590,20 @@ var getActionListProperties = function getActionListProperties(children) {
|
|
|
590
590
|
if ( /*#__PURE__*/React__default.isValidElement(child)) {
|
|
591
591
|
if (isValidAllowedChildren(child, componentIds.ActionListSection)) {
|
|
592
592
|
var shouldHideDivider = index === lastActionListSectionIndex && !isActionListItemPresentAfterSection;
|
|
593
|
+
var sectionChildValues = [];
|
|
593
594
|
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
594
595
|
// @ts-expect-error: TS doesn't understand the child's props
|
|
595
596
|
children: React__default.Children.map(child.props.children, function (childInSection) {
|
|
596
597
|
currentSection = child.props.title;
|
|
598
|
+
sectionChildValues.push(childInSection.props.value);
|
|
597
599
|
if (isValidAllowedChildren(childInSection, componentIds.ActionListItem)) {
|
|
598
600
|
return getActionListItemWithId(childInSection, shouldHideDivider);
|
|
599
601
|
}
|
|
600
602
|
return childInSection;
|
|
601
603
|
}),
|
|
602
604
|
// On web, we handle it with descendant styling in css so no need of JS there
|
|
603
|
-
_hideDivider: isReactNative$4() ? shouldHideDivider : undefined
|
|
605
|
+
_hideDivider: isReactNative$4() ? shouldHideDivider : undefined,
|
|
606
|
+
_sectionChildValues: sectionChildValues
|
|
604
607
|
});
|
|
605
608
|
}
|
|
606
609
|
if (isValidAllowedChildren(child, componentIds.ActionListItem)) {
|
|
@@ -15846,9 +15849,26 @@ var _ActionListSection = function _ActionListSection(_ref) {
|
|
|
15846
15849
|
var title = _ref.title,
|
|
15847
15850
|
children = _ref.children,
|
|
15848
15851
|
testID = _ref.testID,
|
|
15849
|
-
_hideDivider = _ref._hideDivider
|
|
15852
|
+
_hideDivider = _ref._hideDivider,
|
|
15853
|
+
_sectionChildValues = _ref._sectionChildValues;
|
|
15850
15854
|
var _useActionListContext = useActionListContext(),
|
|
15851
15855
|
surfaceLevel = _useActionListContext.surfaceLevel;
|
|
15856
|
+
var _useDropdown = useDropdown(),
|
|
15857
|
+
hasAutoCompleteInBottomSheetHeader = _useDropdown.hasAutoCompleteInBottomSheetHeader,
|
|
15858
|
+
dropdownTriggerer = _useDropdown.dropdownTriggerer,
|
|
15859
|
+
filteredValues = _useDropdown.filteredValues;
|
|
15860
|
+
var hasAutoComplete = hasAutoCompleteInBottomSheetHeader || dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;
|
|
15861
|
+
var isSectionVisible = React__default.useMemo(function () {
|
|
15862
|
+
if (hasAutoComplete) {
|
|
15863
|
+
var visibleActionListItemInSection = _sectionChildValues === null || _sectionChildValues === void 0 ? void 0 : _sectionChildValues.find(function (actionItemValue) {
|
|
15864
|
+
return filteredValues.includes(actionItemValue);
|
|
15865
|
+
});
|
|
15866
|
+
return Boolean(visibleActionListItemInSection);
|
|
15867
|
+
}
|
|
15868
|
+
return true;
|
|
15869
|
+
}, [_sectionChildValues, hasAutoComplete, filteredValues]);
|
|
15870
|
+
var showDividerInRN = !(_hideDivider && isReactNative$4());
|
|
15871
|
+
var showDividerInAutoComplete = hasAutoComplete ? isSectionVisible && filteredValues.length > 1 : true;
|
|
15852
15872
|
return /*#__PURE__*/jsxs(BaseBox, _objectSpread$1q(_objectSpread$1q(_objectSpread$1q({}, makeAccessible({
|
|
15853
15873
|
role: getActionListSectionRole(),
|
|
15854
15874
|
label: title
|
|
@@ -15858,7 +15878,7 @@ var _ActionListSection = function _ActionListSection(_ref) {
|
|
|
15858
15878
|
name: MetaConstants.ActionListSection,
|
|
15859
15879
|
testID: testID
|
|
15860
15880
|
})), {}, {
|
|
15861
|
-
children: [/*#__PURE__*/jsx(StyledActionListSectionTitle, _objectSpread$1q(_objectSpread$1q({}, makeAccessible({
|
|
15881
|
+
children: [isSectionVisible ? /*#__PURE__*/jsx(StyledActionListSectionTitle, _objectSpread$1q(_objectSpread$1q({}, makeAccessible({
|
|
15862
15882
|
hidden: true
|
|
15863
15883
|
})), {}, {
|
|
15864
15884
|
children: /*#__PURE__*/jsx(Text, {
|
|
@@ -15867,16 +15887,16 @@ var _ActionListSection = function _ActionListSection(_ref) {
|
|
|
15867
15887
|
weight: "bold",
|
|
15868
15888
|
children: title
|
|
15869
15889
|
})
|
|
15870
|
-
})), /*#__PURE__*/jsx(BaseBox, _objectSpread$1q(_objectSpread$1q({}, makeAccessible({
|
|
15890
|
+
})) : null, /*#__PURE__*/jsx(BaseBox, _objectSpread$1q(_objectSpread$1q({}, makeAccessible({
|
|
15871
15891
|
// On web, we just wrap it in another listbox to announce item count properly for particular group.
|
|
15872
15892
|
// On React Native, we ignore it since `menu` + `group` role will take care of accessibility
|
|
15873
15893
|
role: isReactNative$4() ? undefined : 'listbox'
|
|
15874
15894
|
})), {}, {
|
|
15875
15895
|
children: children
|
|
15876
|
-
})),
|
|
15896
|
+
})), showDividerInAutoComplete && showDividerInRN ? /*#__PURE__*/jsx(Divider, {
|
|
15877
15897
|
marginX: "spacing.3",
|
|
15878
15898
|
marginY: "spacing.1"
|
|
15879
|
-
})]
|
|
15899
|
+
}) : null]
|
|
15880
15900
|
}));
|
|
15881
15901
|
};
|
|
15882
15902
|
var ActionListSection = /*#__PURE__*/assignWithoutSideEffects(_ActionListSection, {
|
|
@@ -16038,17 +16058,17 @@ var ActionListItemBody = /*#__PURE__*/React__default.memo(_ActionListItemBody);
|
|
|
16038
16058
|
* ```
|
|
16039
16059
|
*/
|
|
16040
16060
|
var _ActionListItem = function _ActionListItem(props) {
|
|
16041
|
-
var
|
|
16042
|
-
activeIndex =
|
|
16043
|
-
dropdownBaseId =
|
|
16044
|
-
onOptionClick =
|
|
16045
|
-
selectedIndices =
|
|
16046
|
-
setShouldIgnoreBlurAnimation =
|
|
16047
|
-
selectionType =
|
|
16048
|
-
dropdownTriggerer =
|
|
16049
|
-
isKeydownPressed =
|
|
16050
|
-
filteredValues =
|
|
16051
|
-
hasAutoCompleteInBottomSheetHeader =
|
|
16061
|
+
var _useDropdown2 = useDropdown(),
|
|
16062
|
+
activeIndex = _useDropdown2.activeIndex,
|
|
16063
|
+
dropdownBaseId = _useDropdown2.dropdownBaseId,
|
|
16064
|
+
onOptionClick = _useDropdown2.onOptionClick,
|
|
16065
|
+
selectedIndices = _useDropdown2.selectedIndices,
|
|
16066
|
+
setShouldIgnoreBlurAnimation = _useDropdown2.setShouldIgnoreBlurAnimation,
|
|
16067
|
+
selectionType = _useDropdown2.selectionType,
|
|
16068
|
+
dropdownTriggerer = _useDropdown2.dropdownTriggerer,
|
|
16069
|
+
isKeydownPressed = _useDropdown2.isKeydownPressed,
|
|
16070
|
+
filteredValues = _useDropdown2.filteredValues,
|
|
16071
|
+
hasAutoCompleteInBottomSheetHeader = _useDropdown2.hasAutoCompleteInBottomSheetHeader;
|
|
16052
16072
|
var _useTheme = useTheme(),
|
|
16053
16073
|
platform = _useTheme.platform;
|
|
16054
16074
|
var isMobile = platform === 'onMobile';
|