@razorpay/blade 10.12.1 → 10.13.1

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.
@@ -2992,7 +2992,7 @@ function _objectSpread$6g(target) { for (var i = 1; i < arguments.length; i++) {
2992
2992
  /**
2993
2993
  * Reusable hook to be used in BladeProvider.native & BladeProvider.web file
2994
2994
  *
2995
- * This hook proccesses incoming themeTokens & initialColorScheme
2995
+ * This hook processes incoming themeTokens & initialColorScheme
2996
2996
  * And validates & returns the theme values
2997
2997
  */
2998
2998
  var useBladeProvider = function useBladeProvider(_ref) {
@@ -14375,7 +14375,7 @@ var CheckedIcon$1 = function CheckedIcon(_ref) {
14375
14375
  clipRule: "evenodd",
14376
14376
  d: "M6.90237 1.76413C7.03254 1.89431 7.03254 2.10536 6.90237 2.23554L3.2357 5.90221C3.10553 6.03238 2.89447 6.03238 2.7643 5.90221L1.09763 4.23554C0.967456 4.10536 0.967456 3.89431 1.09763 3.76414C1.22781 3.63396 1.43886 3.63396 1.56904 3.76414L3 5.1951L6.43096 1.76413C6.56114 1.63396 6.77219 1.63396 6.90237 1.76413Z",
14377
14377
  fill: color,
14378
- stroke: "white",
14378
+ stroke: color,
14379
14379
  strokeWidth: "0.5",
14380
14380
  strokeLinecap: "round",
14381
14381
  strokeLinejoin: "round"
@@ -14397,7 +14397,7 @@ var IndeterminateIcon = function IndeterminateIcon(_ref2) {
14397
14397
  clipRule: "evenodd",
14398
14398
  d: "M1.3335 3.99984C1.3335 3.81574 1.48273 3.6665 1.66683 3.6665H6.3335C6.51759 3.6665 6.66683 3.81574 6.66683 3.99984C6.66683 4.18393 6.51759 4.33317 6.3335 4.33317H1.66683C1.48273 4.33317 1.3335 4.18393 1.3335 3.99984Z",
14399
14399
  fill: color,
14400
- stroke: "white",
14400
+ stroke: color,
14401
14401
  strokeWidth: "0.5",
14402
14402
  strokeLinecap: "round",
14403
14403
  strokeLinejoin: "round"
@@ -19400,14 +19400,14 @@ var chipColorTokens = {
19400
19400
  text: {
19401
19401
  unchecked: 'surface.text.subtle.lowContrast',
19402
19402
  disabled: 'surface.text.placeholder.lowContrast',
19403
- none: 'brand.primary.500',
19403
+ none: 'action.text.secondary.default',
19404
19404
  positive: 'feedback.text.positive.lowContrast',
19405
19405
  negative: 'feedback.text.negative.lowContrast'
19406
19406
  },
19407
19407
  icon: {
19408
19408
  unchecked: 'surface.text.subtle.lowContrast',
19409
19409
  disabled: 'surface.text.placeholder.lowContrast',
19410
- none: 'brand.primary.500',
19410
+ none: 'action.icon.secondary.default',
19411
19411
  positive: 'feedback.icon.positive.lowContrast',
19412
19412
  negative: 'feedback.icon.negative.lowContrast'
19413
19413
  },
@@ -23275,6 +23275,12 @@ var useControlledDropdownInput = function useControlledDropdownInput(props) {
23275
23275
  setIsControlled(true);
23276
23276
  }
23277
23277
  selectValues(props.value);
23278
+
23279
+ // in single select AutoComplete, we have to set inputValue of autocomplete according to the new selection.
23280
+ if (selectionType === 'single' && !Array.isArray(props.value) && !props.isSelectInput) {
23281
+ var _props$syncInputValue;
23282
+ (_props$syncInputValue = props.syncInputValueWithSelection) === null || _props$syncInputValue === void 0 ? void 0 : _props$syncInputValue.call(props, props.value);
23283
+ }
23278
23284
  }
23279
23285
  // eslint-disable-next-line react-hooks/exhaustive-deps
23280
23286
  }, [props.value, options]);
@@ -23336,7 +23342,9 @@ var _BaseDropdownInputTrigger = function _BaseDropdownInputTrigger(props, ref) {
23336
23342
  onChange: props.onChange,
23337
23343
  name: props.name,
23338
23344
  value: props.value,
23339
- defaultValue: props.defaultValue
23345
+ defaultValue: props.defaultValue,
23346
+ syncInputValueWithSelection: props.syncInputValueWithSelection,
23347
+ isSelectInput: props.isSelectInput
23340
23348
  });
23341
23349
  var getValue = function getValue() {
23342
23350
  var prefix = '';
@@ -23629,7 +23637,7 @@ var useAutoComplete = function useAutoComplete(_ref) {
23629
23637
  // eslint-disable-next-line no-lonely-if
23630
23638
  if (value && options && options.length > 0) {
23631
23639
  var filteredOptions = getOptionValues().filter(function (optionValue) {
23632
- return optionValue.toLowerCase().startsWith(value.toLowerCase());
23640
+ return optionValue.toLowerCase().includes(value.toLowerCase());
23633
23641
  });
23634
23642
  setGlobalFilteredValues(filteredOptions);
23635
23643
  } else {
@@ -23739,6 +23747,17 @@ var _AutoComplete = function _AutoComplete(props, ref) {
23739
23747
  onChange: onSelectionChange,
23740
23748
  isSelectInput: false,
23741
23749
  inputValue: inputValue,
23750
+ syncInputValueWithSelection: function syncInputValueWithSelection(value) {
23751
+ var _selectedOption$title;
23752
+ if (!value) {
23753
+ setInputValue('');
23754
+ return;
23755
+ }
23756
+ var selectedOption = options.find(function (option) {
23757
+ return option.value === value;
23758
+ });
23759
+ setInputValue((_selectedOption$title = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.title) !== null && _selectedOption$title !== void 0 ? _selectedOption$title : '');
23760
+ },
23742
23761
  onTriggerKeydown: onTriggerKeydown,
23743
23762
  onInputValueChange: onInputValueChange,
23744
23763
  onTriggerClick: function onTriggerClick(triggerEvent) {