@razorpay/blade 10.15.1 → 10.15.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.
@@ -14317,6 +14317,7 @@ var getCheckboxIconWrapperStyles = function getCheckboxIconWrapperStyles(_ref) {
14317
14317
  display: 'flex',
14318
14318
  alignItems: 'center',
14319
14319
  justifyContent: 'center',
14320
+ flexShrink: 0,
14320
14321
  width: makeSpace(checkboxSizes.icon[size].width),
14321
14322
  height: makeSpace(checkboxSizes.icon[size].height),
14322
14323
  borderWidth: makeBorderSize(theme.border.width.thick),
@@ -14914,7 +14915,7 @@ var SelectorLabel = function SelectorLabel(_ref2) {
14914
14915
  var children = _ref2.children,
14915
14916
  componentName = _ref2.componentName,
14916
14917
  testID = _ref2.testID,
14917
- _onMouseDown = _ref2.onMouseDown,
14918
+ onMouseDown = _ref2.onMouseDown,
14918
14919
  onMouseUp = _ref2.onMouseUp,
14919
14920
  onMouseOut = _ref2.onMouseOut,
14920
14921
  onKeyDown = _ref2.onKeyDown,
@@ -14925,10 +14926,7 @@ var SelectorLabel = function SelectorLabel(_ref2) {
14925
14926
  return /*#__PURE__*/jsx(StyledSelectorLabel, _objectSpread$1x(_objectSpread$1x({
14926
14927
  onTouchStart: onTouchStart,
14927
14928
  onTouchEnd: onTouchEnd,
14928
- onMouseDown: function onMouseDown(e) {
14929
- e.preventDefault();
14930
- _onMouseDown === null || _onMouseDown === void 0 ? void 0 : _onMouseDown(e);
14931
- },
14929
+ onMouseDown: onMouseDown,
14932
14930
  onMouseUp: onMouseUp,
14933
14931
  onMouseOut: onMouseOut,
14934
14932
  onKeyDown: onKeyDown,
@@ -15197,7 +15195,6 @@ var _Checkbox = function _Checkbox(_ref, ref) {
15197
15195
  flexDirection: "column",
15198
15196
  children: [/*#__PURE__*/jsxs(BaseBox, {
15199
15197
  display: "flex",
15200
- alignItems: "center",
15201
15198
  flexDirection: "row",
15202
15199
  children: [/*#__PURE__*/jsx(SelectorInput, {
15203
15200
  hoverTokens: checkboxHoverTokens,
@@ -15728,14 +15725,6 @@ var _ActionListItemText = function _ActionListItemText(_ref4) {
15728
15725
  var ActionListItemText = /*#__PURE__*/assignWithoutSideEffects(_ActionListItemText, {
15729
15726
  componentId: componentIds.ActionListItemText
15730
15727
  });
15731
- var ActionListCheckboxWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
15732
- displayName: "ActionListItem__ActionListCheckboxWrapper",
15733
- componentId: "m6qdwa-1"
15734
- })(function (_props) {
15735
- return {
15736
- pointerEvents: 'none'
15737
- };
15738
- });
15739
15728
  var makeActionListItemClickable = function makeActionListItemClickable(clickHandler) {
15740
15729
  if (isReactNative$4()) {
15741
15730
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error
@@ -15772,8 +15761,9 @@ var _ActionListItemBody = function _ActionListItemBody(_ref5) {
15772
15761
  children: selectionType === 'multiple' ?
15773
15762
  /*#__PURE__*/
15774
15763
  // Adding aria-hidden because the listbox item in multiselect in itself explains the behaviour so announcing checkbox is unneccesary and just a nice UI tweak for us
15775
- jsx(ActionListCheckboxWrapper, _objectSpread$1q(_objectSpread$1q({
15776
- hasDescription: Boolean(description)
15764
+ jsx(BaseBox, _objectSpread$1q(_objectSpread$1q({
15765
+ pointerEvents: "none",
15766
+ paddingRight: "spacing.2"
15777
15767
  }, makeAccessible({
15778
15768
  hidden: true
15779
15769
  })), {}, {
@@ -21317,7 +21307,7 @@ var _StyledBaseInput = function _StyledBaseInput(_ref, ref) {
21317
21307
  }, commonProps), props), accessibilityProps), {}, {
21318
21308
  value: props.value,
21319
21309
  children: /*#__PURE__*/jsx(Text, {
21320
- type: props.value ? 'subtle' : 'placeholder',
21310
+ type: props.value && !isDisabled ? 'subtle' : 'placeholder',
21321
21311
  truncateAfterLines: 1,
21322
21312
  textAlign: props.textAlign,
21323
21313
  children: props.value ? props.value : props.placeholder
@@ -21590,7 +21580,8 @@ var BaseInputTagSlot = function BaseInputTagSlot(_ref3) {
21590
21580
  handleOnInputClick = _ref3.handleOnInputClick,
21591
21581
  isDropdownTrigger = _ref3.isDropdownTrigger,
21592
21582
  visibleTagsCountRef = _ref3.visibleTagsCountRef,
21593
- labelPrefix = _ref3.labelPrefix;
21583
+ labelPrefix = _ref3.labelPrefix,
21584
+ isDisabled = _ref3.isDisabled;
21594
21585
  var hasTags = tags && tags.length > 0;
21595
21586
  var slotRef = React__default.useRef(null);
21596
21587
  var visibleTagsCount = useVisibleTagsCount({
@@ -21659,6 +21650,7 @@ var BaseInputTagSlot = function BaseInputTagSlot(_ref3) {
21659
21650
  setShouldIgnoreBlurAnimation === null || setShouldIgnoreBlurAnimation === void 0 ? void 0 : setShouldIgnoreBlurAnimation(false);
21660
21651
  },
21661
21652
  children: [visibleTags, tags && !showAllTags && invisibleTagsCount ? /*#__PURE__*/jsx(Text, {
21653
+ type: isDisabled ? 'placeholder' : 'normal',
21662
21654
  alignSelf: "center",
21663
21655
  marginY: "spacing.2",
21664
21656
  marginRight: "spacing.4",
@@ -22092,6 +22084,7 @@ var BaseInput = /*#__PURE__*/React__default.forwardRef(function (_ref11, ref) {
22092
22084
  }), /*#__PURE__*/jsx(BaseInputTagSlot, {
22093
22085
  renderAs: as,
22094
22086
  tags: tags,
22087
+ isDisabled: isDisabled,
22095
22088
  showAllTags: showAllTagsWithAnimation,
22096
22089
  setFocusOnInput: function setFocusOnInput() {
22097
22090
  if (ref && !isReactNative && 'current' in ref) {
@@ -23032,22 +23025,32 @@ var _OTPInput = function _OTPInput(_ref, incomingRef) {
23032
23025
  };
23033
23026
  var OTPInput = /*#__PURE__*/React__default.forwardRef(_OTPInput);
23034
23027
 
23028
+ var Chevron = function Chevron(props) {
23029
+ var iconColor = "surface.text.".concat(props.isDisabled ? 'placeholder' : 'normal', ".lowContrast");
23030
+ return /*#__PURE__*/jsxs(Fragment, {
23031
+ children: [/*#__PURE__*/jsx(ChevronDownIcon, {
23032
+ display: props.isOpen ? 'none' : 'flex',
23033
+ size: "medium",
23034
+ color: iconColor
23035
+ }), /*#__PURE__*/jsx(ChevronUpIcon, {
23036
+ display: props.isOpen ? 'flex' : 'none',
23037
+ size: "medium",
23038
+ color: iconColor
23039
+ })]
23040
+ });
23041
+ };
23042
+
23035
23043
  var InputChevronIcon = function InputChevronIcon(props) {
23036
- return /*#__PURE__*/jsxs(BaseBox, {
23044
+ return /*#__PURE__*/jsx(BaseBox, {
23037
23045
  display: "flex",
23038
23046
  height: "100%",
23039
23047
  justifyContent: "center",
23040
23048
  alignItems: "center",
23041
23049
  onClick: props.onClick,
23042
- children: [/*#__PURE__*/jsx(ChevronDownIcon, {
23043
- display: props.isOpen ? 'none' : 'flex',
23044
- color: "surface.text.normal.lowContrast",
23045
- size: "medium"
23046
- }), /*#__PURE__*/jsx(ChevronUpIcon, {
23047
- display: props.isOpen ? 'flex' : 'none',
23048
- color: "surface.text.normal.lowContrast",
23049
- size: "medium"
23050
- })]
23050
+ children: /*#__PURE__*/jsx(Chevron, {
23051
+ isOpen: props.isOpen,
23052
+ isDisabled: props.isDisabled
23053
+ })
23051
23054
  });
23052
23055
  };
23053
23056
 
@@ -23197,6 +23200,7 @@ var AnimatedTagContainer = /*#__PURE__*/styled(BaseBox).withConfig({
23197
23200
  var AnimatedTag = function AnimatedTag(_ref) {
23198
23201
  var children = _ref.children,
23199
23202
  currentTagIndex = _ref.currentTagIndex,
23203
+ isDisabled = _ref.isDisabled,
23200
23204
  activeTagIndex = _ref.activeTagIndex,
23201
23205
  onDismiss = _ref.onDismiss;
23202
23206
  var _React$useState = React__default.useState(true),
@@ -23226,6 +23230,7 @@ var AnimatedTag = function AnimatedTag(_ref) {
23226
23230
  },
23227
23231
  marginRight: "spacing.3",
23228
23232
  marginY: "spacing.2",
23233
+ isDisabled: isDisabled,
23229
23234
  children: children
23230
23235
  })
23231
23236
  });
@@ -23234,6 +23239,7 @@ var AnimatedTag = function AnimatedTag(_ref) {
23234
23239
  var getTagsGroup = function getTagsGroup(_ref) {
23235
23240
  var tags = _ref.tags,
23236
23241
  activeTagIndex = _ref.activeTagIndex,
23242
+ isDisabled = _ref.isDisabled,
23237
23243
  onDismiss = _ref.onDismiss;
23238
23244
  return tags.map(function (tagName, tagIndex) {
23239
23245
  return /*#__PURE__*/jsx(AnimatedTag, {
@@ -23241,6 +23247,7 @@ var getTagsGroup = function getTagsGroup(_ref) {
23241
23247
  onDismiss: onDismiss,
23242
23248
  currentTagIndex: tagIndex,
23243
23249
  tagsLength: tags.length,
23250
+ isDisabled: isDisabled,
23244
23251
  children: tagName
23245
23252
  }, tagName);
23246
23253
  });
@@ -23420,9 +23427,11 @@ var _BaseDropdownInputTrigger = function _BaseDropdownInputTrigger(props, ref) {
23420
23427
  }
23421
23428
  return getTagsGroup({
23422
23429
  tags: selectedIndices.map(function (selectedIndex) {
23423
- return options[selectedIndex].title;
23430
+ var _options$selectedInde;
23431
+ return (_options$selectedInde = options[selectedIndex]) === null || _options$selectedInde === void 0 ? void 0 : _options$selectedInde.title;
23424
23432
  }),
23425
23433
  activeTagIndex: activeTagIndex,
23434
+ isDisabled: props.isDisabled,
23426
23435
  onDismiss: function onDismiss(_ref) {
23427
23436
  var tagIndex = _ref.tagIndex;
23428
23437
  if (isTagDismissedRef.current) {
@@ -23488,7 +23497,13 @@ var _BaseDropdownInputTrigger = function _BaseDropdownInputTrigger(props, ref) {
23488
23497
  autoFocus: props.autoFocus // eslint-disable-line jsx-a11y/no-autofocus
23489
23498
  ,
23490
23499
  value: getValue(),
23491
- onClick: props.onTriggerClick,
23500
+ onClick: function onClick(e) {
23501
+ var _props$onTriggerClick;
23502
+ if (props.isDisabled) {
23503
+ return;
23504
+ }
23505
+ (_props$onTriggerClick = props.onTriggerClick) === null || _props$onTriggerClick === void 0 ? void 0 : _props$onTriggerClick.call(props, e);
23506
+ },
23492
23507
  onFocus: props.onFocus,
23493
23508
  onBlur: function onBlur(_ref2) {
23494
23509
  var _props$onBlur;
@@ -23526,6 +23541,7 @@ var _BaseDropdownInputTrigger = function _BaseDropdownInputTrigger(props, ref) {
23526
23541
  onTriggerClick();
23527
23542
  }
23528
23543
  },
23544
+ isDisabled: props.isDisabled,
23529
23545
  isOpen: isOpen
23530
23546
  })
23531
23547
  });
@@ -23727,7 +23743,10 @@ var useAutoComplete = function useAutoComplete(_ref) {
23727
23743
  name: props.name,
23728
23744
  value: displayText
23729
23745
  });
23730
- setInputValue(displayText !== null && displayText !== void 0 ? displayText : '');
23746
+ // Use displayText as inputValue only if its not controlled by user
23747
+ if (typeof props.value === 'undefined') {
23748
+ setInputValue(displayText !== null && displayText !== void 0 ? displayText : '');
23749
+ }
23731
23750
  }
23732
23751
  (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
23733
23752
  name: props.name,