@razorpay/blade 10.2.1 → 10.3.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.
@@ -5,12 +5,11 @@ import _toConsumableArray$1 from '@babel/runtime/helpers/toConsumableArray';
5
5
  import _objectWithoutProperties$1 from '@babel/runtime/helpers/objectWithoutProperties';
6
6
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
7
7
  import styled, { ThemeProvider, css, keyframes } from 'styled-components';
8
- import { FloatingDelayGroup, useFloating, detectOverflow, autoUpdate, FloatingOverlay, FloatingPortal, FloatingFocusManager, shift, flip, offset, arrow, useTransitionStyles, useDelayGroup, useDelayGroupContext, useHover, useFocus, useRole, useInteractions, FloatingArrow } from '@floating-ui/react';
9
- import _typeof from '@babel/runtime/helpers/typeof';
8
+ import { FloatingDelayGroup, useFloating, offset, flip, size as size$1, autoUpdate, useTransitionStyles, FloatingOverlay, FloatingPortal, FloatingFocusManager, shift, arrow, useDelayGroup, useDelayGroupContext, useHover, useFocus, useRole, useInteractions, FloatingArrow } from '@floating-ui/react';
9
+ import '@babel/runtime/helpers/typeof';
10
10
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
11
11
  import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
12
12
  import _createClass from '@babel/runtime/helpers/createClass';
13
- import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
14
13
 
15
14
  /*
16
15
  * This content is licensed according to the W3C Software License at
@@ -688,6 +687,9 @@ var DropdownContext = /*#__PURE__*/React__default.createContext({
688
687
  },
689
688
  triggererRef: {
690
689
  current: null
690
+ },
691
+ triggererWrapperRef: {
692
+ current: null
691
693
  }
692
694
  });
693
695
  var searchTimeout;
@@ -1278,27 +1280,6 @@ var fontWeight = {
1278
1280
  }
1279
1281
  });
1280
1282
 
1281
- /**
1282
- * When any of the values are changed here, do change the jsdoc comments in BaseBox/types/spacingTypes.ts as well
1283
- *
1284
- * {@link ../../components/Box/BaseBox/types/spacingTypes.ts}
1285
- */
1286
-
1287
- var spacing = {
1288
- 0: 0,
1289
- 1: 2,
1290
- 2: 4,
1291
- 3: 8,
1292
- 4: 12,
1293
- 5: 16,
1294
- 6: 20,
1295
- 7: 24,
1296
- 8: 32,
1297
- 9: 40,
1298
- 10: 48,
1299
- 11: 56
1300
- };
1301
-
1302
1283
  /**
1303
1284
  * Size tokens are currently not exposed for users (therefore not available in theme)
1304
1285
  */
@@ -1355,6 +1336,8 @@ var size = {
1355
1336
  160: 160,
1356
1337
  /** 200 px */
1357
1338
  200: 200,
1339
+ /** 240 px */
1340
+ 240: 240,
1358
1341
  /** 300 px */
1359
1342
  300: 300,
1360
1343
  /** 360 px */
@@ -14762,33 +14745,55 @@ var SelectorSupportText = function SelectorSupportText(_ref) {
14762
14745
  });
14763
14746
  };
14764
14747
 
14748
+ /* eslint-disable @typescript-eslint/no-explicit-any */
14749
+ function assignRef(ref, value) {
14750
+ if (ref == null) return;
14751
+ if (typeof ref === 'function') {
14752
+ ref(value);
14753
+ return;
14754
+ }
14755
+ try {
14756
+ ref.current = value;
14757
+ } catch (error) {
14758
+ throwBladeError({
14759
+ moduleName: 'useMergeRefs',
14760
+ message: "Cannot assign value '".concat(value, "' to ref '").concat(ref, "'")
14761
+ });
14762
+ }
14763
+ }
14764
+ function mergeRefs() {
14765
+ for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
14766
+ refs[_key] = arguments[_key];
14767
+ }
14768
+ return function (node) {
14769
+ refs.forEach(function (ref) {
14770
+ assignRef(ref, node);
14771
+ });
14772
+ };
14773
+ }
14774
+
14765
14775
  /**
14766
- * A hook which only exposes the properties of html input element via imparative hook
14776
+ * Merged two or more refs into a single ref callback.
14777
+ *
14778
+ * Usage:
14779
+ * ```ts
14780
+ * const internalRef = React.useRef()
14781
+ * const ref = useMergeRefs(incomingRef, internalRef);
14782
+ * ```
14767
14783
  *
14768
- * It avoids exposing other native properties of HTMLElement
14769
- * like `style` `classList` to avoid unintended usage of refs.
14784
+ *
14785
+ * Taken from ChakraUI:
14786
+ * https://github.com/chakra-ui/chakra-ui/blob/f3c4a492e5636d2745b438d10794fa4e7999b6de/packages/hooks/use-merge-refs/src/index.ts#L31
14770
14787
  */
14771
- var useBladeInnerRef = function useBladeInnerRef(targetRef, handlers) {
14772
- var innerRef = React__default.useRef(null);
14773
- React__default.useImperativeHandle(targetRef, function () {
14774
- var element = innerRef.current;
14775
- return {
14776
- focus: function focus(opts) {
14777
- var _element$focus;
14778
- return handlers !== null && handlers !== void 0 && handlers.onFocus ? handlers.onFocus(opts) : element === null || element === void 0 ? void 0 : (_element$focus = element.focus) === null || _element$focus === void 0 ? void 0 : _element$focus.call(element, opts);
14779
- },
14780
- scrollIntoView: function scrollIntoView(opts) {
14781
- var _element$scrollIntoVi;
14782
- return element === null || element === void 0 ? void 0 : (_element$scrollIntoVi = element.scrollIntoView) === null || _element$scrollIntoVi === void 0 ? void 0 : _element$scrollIntoVi.call(element, opts);
14783
- },
14784
- getBoundingClientRect: function getBoundingClientRect() {
14785
- return element === null || element === void 0 ? void 0 : element.getBoundingClientRect();
14786
- },
14787
- clientHeight: element.clientHeight
14788
- };
14789
- }, [innerRef, handlers]);
14790
- return innerRef;
14791
- };
14788
+ function useMergeRefs() {
14789
+ for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
14790
+ refs[_key2] = arguments[_key2];
14791
+ }
14792
+ // eslint-disable-next-line react-hooks/exhaustive-deps
14793
+ return useMemo(function () {
14794
+ return mergeRefs.apply(void 0, refs);
14795
+ }, refs);
14796
+ }
14792
14797
 
14793
14798
  function ownKeys$1n(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
14794
14799
  function _objectSpread$1m(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1n(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1n(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -14843,7 +14848,10 @@ var _SelectorInput = function _SelectorInput(_ref3, ref) {
14843
14848
  hoverTokens = _ref3.hoverTokens,
14844
14849
  tabIndex = _ref3.tabIndex,
14845
14850
  accessibilityLabel = _ref3.accessibilityLabel;
14846
- var inputRef = useBladeInnerRef(ref);
14851
+ // merging both refs because inputProps.ref needs to have access to indeterminate state
14852
+ // to be able to set the mixed value via setMixed() function
14853
+ // TODO: replace with a generic `mergeRefs()` util if we do this in other places
14854
+ var mergedRef = useMergeRefs(ref, inputProps.ref);
14847
14855
  return /*#__PURE__*/jsx(StyledInput, _objectSpread$1m(_objectSpread$1m(_objectSpread$1m({
14848
14856
  id: id,
14849
14857
  isChecked: isChecked,
@@ -14854,13 +14862,7 @@ var _SelectorInput = function _SelectorInput(_ref3, ref) {
14854
14862
  }, inputProps), makeAccessible({
14855
14863
  label: accessibilityLabel
14856
14864
  })), {}, {
14857
- // merging both refs because inputProps.ref needs to have access to indeterminate state
14858
- // to be able to set the mixed value via setMixed() function
14859
- // TODO: replace with a generic `mergeRefs()` util if we do this in other places
14860
- ref: function ref(value) {
14861
- inputProps.ref.current = value;
14862
- inputRef.current = value;
14863
- }
14865
+ ref: mergedRef
14864
14866
  }));
14865
14867
  };
14866
14868
  var SelectorInput = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.forwardRef(_SelectorInput), {
@@ -18952,6 +18954,11 @@ var _Dropdown = function _Dropdown(_ref) {
18952
18954
  shouldIgnoreBlurAnimation = _React$useState14[0],
18953
18955
  setShouldIgnoreBlurAnimation = _React$useState14[1];
18954
18956
  var triggererRef = React__default.useRef(null);
18957
+ /**
18958
+ * In inputs, actual input is smaller than the visible input wrapper.
18959
+ * You can set this reference in such cases so floating ui calculations happen correctly
18960
+ * */
18961
+ var triggererWrapperRef = React__default.useRef(null);
18955
18962
  var actionListItemRef = React__default.useRef(null);
18956
18963
  var _React$useState15 = React__default.useState(false),
18957
18964
  _React$useState16 = _slicedToArray(_React$useState15, 2),
@@ -19027,6 +19034,7 @@ var _Dropdown = function _Dropdown(_ref) {
19027
19034
  setIsKeydownPressed: setIsKeydownPressed,
19028
19035
  dropdownBaseId: dropdownBaseId,
19029
19036
  triggererRef: triggererRef,
19037
+ triggererWrapperRef: triggererWrapperRef,
19030
19038
  actionListItemRef: actionListItemRef,
19031
19039
  selectionType: selectionType,
19032
19040
  hasFooterAction: hasFooterAction,
@@ -19091,157 +19099,75 @@ var StyledDropdownOverlay = /*#__PURE__*/styled(BaseBox).withConfig({
19091
19099
 
19092
19100
  function ownKeys$W(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19093
19101
  function _objectSpread$V(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$W(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$W(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
19094
- function _regeneratorRuntime() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
19095
- var dropdownFadeIn = /*#__PURE__*/keyframes(["from{transform:translateY(", ");opacity:0;}to{transform:translateY(", ");opacity:1;}"], makeSize(spacing[0]), makeSize(spacing[3]));
19096
- var dropdownFadeOut = /*#__PURE__*/keyframes(["from{transform:translateY(", ");opacity:1;}to{transform:translateY(", ");opacity:0;}"], makeSize(spacing[3]), makeSize(spacing[0]));
19097
- var AnimatedOverlay = /*#__PURE__*/styled(StyledDropdownOverlay).withConfig({
19098
- displayName: "DropdownOverlayweb__AnimatedOverlay",
19099
- componentId: "sc-9pwxtx-0"
19100
- })(function (props) {
19101
- return css(["", " transform:translateY(", ");opacity:0;z-index:99;pointer-events:", ";"], props.transition, makeSize(props.theme.spacing[3]), props.isOpen ? 'all' : 'none');
19102
- });
19103
-
19104
- /**
19105
- * This function calculates the position of dropdown overlay with respect to dropdown trigger element.
19106
- * For non-menus (e.g SelectInput), position is flipped if overflow is on bottom.
19107
- * For menus (e.g. DropdownButton), position is flipped if overflow is on right or bottom.
19108
- * Additional spacing is added to clientHeight to provide spacing above the dropdown trigger.
19109
- */
19110
- var getDropdownOverlayPosition = function getDropdownOverlayPosition(_ref) {
19111
- var position = _ref.overflow,
19112
- isMenu = _ref.isMenu,
19113
- triggererEl = _ref.triggererEl,
19114
- actionListItemEl = _ref.actionListItemEl;
19115
- var zeroSpacing = 'spacing.0';
19116
- var top = position.top,
19117
- bottom = position.bottom,
19118
- right = position.right;
19119
- var newPosition = {
19120
- left: zeroSpacing
19121
- };
19122
-
19123
- /**
19124
- * Calculating thresholds using the height & width of action list element with offset of 16px
19125
- */
19126
- var WIDTH_THRESHOLD = (Number(actionListItemEl === null || actionListItemEl === void 0 ? void 0 : actionListItemEl.clientWidth) + Number(size[16])) * -1;
19127
- var HEIGHT_THRESHOLD = (Number(actionListItemEl === null || actionListItemEl === void 0 ? void 0 : actionListItemEl.clientHeight) + Number(size[16])) * -1;
19128
- if (!isMenu) {
19129
- // In SelectInput, we set position wrt to right so that leftLabel position can be accomodated
19130
- // without additional offset calculation from left
19131
- newPosition.left = undefined;
19132
- newPosition.right = zeroSpacing;
19133
- if (bottom > HEIGHT_THRESHOLD) {
19134
- newPosition.bottom = "".concat(Number(triggererEl === null || triggererEl === void 0 ? void 0 : triggererEl.clientHeight) + Number(size[32]), "px");
19135
- newPosition.top = undefined;
19136
- }
19137
- if (top > HEIGHT_THRESHOLD) {
19138
- newPosition.top = zeroSpacing;
19139
- newPosition.bottom = undefined;
19140
- }
19141
- return newPosition;
19142
- }
19143
- if (right > WIDTH_THRESHOLD) {
19144
- newPosition.right = zeroSpacing;
19145
- newPosition.left = undefined;
19146
- }
19147
- if (bottom > HEIGHT_THRESHOLD) {
19148
- newPosition.bottom = "".concat(Number(triggererEl === null || triggererEl === void 0 ? void 0 : triggererEl.clientHeight) + Number(size[20]), "px");
19149
- newPosition.top = undefined;
19150
- }
19151
- if (top > HEIGHT_THRESHOLD) {
19152
- newPosition.top = zeroSpacing;
19153
- newPosition.bottom = undefined;
19154
- }
19155
- return newPosition;
19156
- };
19157
- var getDropdownOverflowMiddleware = function getDropdownOverflowMiddleware(_ref2) {
19158
- var isMenu = _ref2.isMenu,
19159
- triggererRef = _ref2.triggererRef,
19160
- actionListItemRef = _ref2.actionListItemRef,
19161
- setDropdownPosition = _ref2.setDropdownPosition;
19162
- return {
19163
- name: 'detectOverflowMiddleware',
19164
- fn: function fn(state) {
19165
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
19166
- var overflow, position;
19167
- return _regeneratorRuntime().wrap(function _callee$(_context) {
19168
- while (1) switch (_context.prev = _context.next) {
19169
- case 0:
19170
- _context.next = 2;
19171
- return detectOverflow(state, {
19172
- elementContext: 'reference'
19173
- });
19174
- case 2:
19175
- overflow = _context.sent;
19176
- position = getDropdownOverlayPosition({
19177
- overflow: overflow,
19178
- isMenu: isMenu,
19179
- triggererEl: triggererRef.current,
19180
- actionListItemEl: actionListItemRef.current
19181
- });
19182
- setDropdownPosition(position);
19183
- return _context.abrupt("return", {});
19184
- case 6:
19185
- case "end":
19186
- return _context.stop();
19187
- }
19188
- }, _callee);
19189
- }))();
19190
- }
19191
- };
19192
- };
19102
+ var OVERLAY_OFFSET = size['8'];
19103
+ var OVERLAY_PADDING = size['12']; // doesn't have to be exact. Just rough padding for floating ui to decide to show overlay on top or bottom
19104
+ var OVERLAY_ZINDEX = 1001;
19193
19105
 
19194
19106
  /**
19195
19107
  * Overlay of dropdown
19196
19108
  *
19197
19109
  * Wrap your ActionList within this component
19198
19110
  */
19199
- var _DropdownOverlay = function _DropdownOverlay(_ref3) {
19200
- var children = _ref3.children,
19201
- testID = _ref3.testID;
19111
+ var _DropdownOverlay = function _DropdownOverlay(_ref) {
19112
+ var _triggererWrapperRef$;
19113
+ var children = _ref.children,
19114
+ testID = _ref.testID,
19115
+ _ref$zIndex = _ref.zIndex,
19116
+ zIndex = _ref$zIndex === void 0 ? OVERLAY_ZINDEX : _ref$zIndex;
19202
19117
  var _useDropdown = useDropdown(),
19203
19118
  isOpen = _useDropdown.isOpen,
19204
19119
  triggererRef = _useDropdown.triggererRef,
19205
- hasLabelOnLeft = _useDropdown.hasLabelOnLeft,
19120
+ triggererWrapperRef = _useDropdown.triggererWrapperRef,
19206
19121
  dropdownTriggerer = _useDropdown.dropdownTriggerer,
19207
- setIsOpen = _useDropdown.setIsOpen,
19208
- actionListItemRef = _useDropdown.actionListItemRef;
19122
+ setIsOpen = _useDropdown.setIsOpen;
19209
19123
  var _useTheme = useTheme(),
19210
19124
  theme = _useTheme.theme;
19211
19125
  var bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();
19212
- var _React$useState = React__default.useState(false),
19213
- _React$useState2 = _slicedToArray(_React$useState, 2),
19214
- showFadeOutAnimation = _React$useState2[0],
19215
- setShowFadeOutAnimation = _React$useState2[1];
19216
- var _React$useState3 = React__default.useState('100%'),
19217
- _React$useState4 = _slicedToArray(_React$useState3, 2),
19218
- width = _React$useState4[0],
19219
- setWidth = _React$useState4[1];
19220
- var _React$useState5 = React__default.useState({}),
19221
- _React$useState6 = _slicedToArray(_React$useState5, 2),
19222
- dropdownPosition = _React$useState6[0],
19223
- setDropdownPosition = _React$useState6[1];
19224
19126
  var isMenu = dropdownTriggerer !== 'SelectInput';
19225
19127
  var _useFloating = useFloating({
19226
19128
  open: isOpen,
19227
19129
  onOpenChange: setIsOpen,
19228
- strategy: 'absolute',
19130
+ strategy: 'fixed',
19229
19131
  placement: 'bottom-start',
19230
19132
  elements: {
19231
- reference: triggererRef.current
19133
+ // Input triggers have their ref on internal input element but we want width height of overall visible input hence wrapperRef is needed
19134
+ // We fallback to use `triggererRef` for triggers like button and link where wrapper is not needed
19135
+ // Checkout: https://github.com/razorpay/blade/pull/1559#discussion_r1305438920
19136
+ reference: (_triggererWrapperRef$ = triggererWrapperRef.current) !== null && _triggererWrapperRef$ !== void 0 ? _triggererWrapperRef$ : triggererRef.current
19232
19137
  },
19233
- middleware: [getDropdownOverflowMiddleware({
19234
- isMenu: isMenu,
19235
- triggererRef: triggererRef,
19236
- actionListItemRef: actionListItemRef,
19237
- setDropdownPosition: setDropdownPosition
19138
+ middleware: [offset({
19139
+ mainAxis: OVERLAY_OFFSET
19140
+ }), flip({
19141
+ padding: OVERLAY_OFFSET + OVERLAY_PADDING
19142
+ }), size$1({
19143
+ apply: function apply(_ref2) {
19144
+ var rects = _ref2.rects,
19145
+ elements = _ref2.elements;
19146
+ Object.assign(elements.floating.style, {
19147
+ // in menu, we have flexible width between min and max
19148
+ // in input triggers, we just take width of trigger
19149
+ width: isMenu ? undefined : makeSize(rects.reference.width),
19150
+ minWidth: isMenu ? makeSize(size['240']) : undefined,
19151
+ maxWidth: isMenu ? makeSize(size['400']) : undefined
19152
+ });
19153
+ }
19238
19154
  })],
19239
19155
  whileElementsMounted: autoUpdate
19240
19156
  }),
19241
- refs = _useFloating.refs;
19242
- var fadeIn = /*#__PURE__*/css(["animation:", " ", " ", ";"], dropdownFadeIn, makeMotionTime(theme.motion.duration.quick), String(theme.motion.easing.entrance.revealing));
19243
- var fadeOut = /*#__PURE__*/css(["animation:", " ", " ", ";"], dropdownFadeOut, makeMotionTime(theme.motion.duration.quick), String(theme.motion.easing.entrance.revealing));
19244
- var noAnimation = /*#__PURE__*/css(["animation:none;"]);
19157
+ refs = _useFloating.refs,
19158
+ floatingStyles = _useFloating.floatingStyles,
19159
+ context = _useFloating.context;
19160
+ var _useTransitionStyles = useTransitionStyles(context, {
19161
+ duration: theme.motion.duration.quick,
19162
+ initial: function initial() {
19163
+ return {
19164
+ transform: "translateY(-".concat(makeSize(size['8']), ")"),
19165
+ opacity: 0
19166
+ };
19167
+ }
19168
+ }),
19169
+ isMounted = _useTransitionStyles.isMounted,
19170
+ styles = _useTransitionStyles.styles;
19245
19171
  React__default.useEffect(function () {
19246
19172
  if (isOpen) {
19247
19173
  var _triggererRef$current;
@@ -19250,88 +19176,24 @@ var _DropdownOverlay = function _DropdownOverlay(_ref3) {
19250
19176
  }
19251
19177
  // eslint-disable-next-line react-hooks/exhaustive-deps
19252
19178
  }, [isOpen]);
19253
-
19254
- // We want to set width of overlay as per width of the SelectInput
19255
- React__default.useEffect(function () {
19256
- // We don't set width according to trigger when trigger is Button or other menu trigger
19257
- if (isMenu) {
19258
- return undefined;
19259
- }
19260
- var setOverlayWidth = throttle_1(function () {
19261
- var _triggererRef$current2;
19262
- if ((_triggererRef$current2 = triggererRef.current) !== null && _triggererRef$current2 !== void 0 && _triggererRef$current2.clientWidth && hasLabelOnLeft) {
19263
- var _triggererRef$current3;
19264
- var svgWidth = size[16];
19265
- var interactionElementPadding = theme.spacing[4];
19266
- var offset = svgWidth + interactionElementPadding;
19267
- // SelectInput is -> Button + InteractionElement on right (the chevron icon)
19268
- // So we add the interactionElement offset with Button's width.
19269
- setWidth(makeSize(((_triggererRef$current3 = triggererRef.current) === null || _triggererRef$current3 === void 0 ? void 0 : _triggererRef$current3.clientWidth) + offset));
19270
- } else {
19271
- // We don't have to worry about setting the custom width when label is on top since we can just 100% width of parent div
19272
- setWidth('100%');
19273
- window.removeEventListener('resize', setOverlayWidth);
19274
- }
19275
- }, 1000);
19276
- setOverlayWidth();
19277
- window.addEventListener('resize', setOverlayWidth);
19278
- return function () {
19279
- window.removeEventListener('resize', setOverlayWidth);
19280
- };
19281
- // eslint-disable-next-line react-hooks/exhaustive-deps
19282
- }, [setWidth, triggererRef, hasLabelOnLeft]);
19283
- var onAnimationEnd = React__default.useCallback(function () {
19284
- if (isOpen) {
19285
- setShowFadeOutAnimation(true);
19286
- } else {
19287
- setShowFadeOutAnimation(false);
19288
- }
19289
- }, [isOpen]);
19290
- var styles = React__default.useMemo(function () {
19291
- return {
19292
- opacity: isOpen ? 1 : 0
19293
- };
19294
- }, [isOpen]);
19295
- return (
19296
- /*#__PURE__*/
19297
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
19298
- jsxs(BaseBox, {
19299
- position: "relative",
19300
- ref: refs.setFloating,
19301
- children: [isOpen ? /*#__PURE__*/jsx(BaseBox, {
19302
- position: 'fixed',
19303
- top: "spacing.0",
19304
- left: "spacing.0",
19305
- height: "100%",
19306
- width: "100%",
19307
- onClick: function onClick() {
19308
- return setIsOpen(false);
19309
- }
19310
- }) : null, /*#__PURE__*/jsx(AnimatedOverlay, _objectSpread$V(_objectSpread$V({
19311
- isInBottomSheet: bottomSheetAndDropdownGlue === null || bottomSheetAndDropdownGlue === void 0 ? void 0 : bottomSheetAndDropdownGlue.dropdownHasBottomSheet,
19312
- width: isMenu ? 'max-content' : width
19313
- // In SelectInput, Overlay should always take width of Input
19314
- ,
19315
- minWidth: isMenu ? '240px' : undefined
19316
- // in SelectInput, we don't want to set maxWidth because it takes width according to the trigger
19317
- ,
19318
- maxWidth: isMenu ? '400px' : undefined,
19319
- left: dropdownPosition.left,
19320
- right: dropdownPosition.right,
19321
- bottom: dropdownPosition.bottom,
19322
- style: styles,
19323
- isOpen: isOpen,
19324
- position: "absolute",
19325
- transition: isOpen ? fadeIn : showFadeOutAnimation ? fadeOut : noAnimation,
19326
- onAnimationEnd: onAnimationEnd
19327
- }, metaAttribute({
19328
- name: MetaConstants.DropdownOverlay,
19329
- testID: testID
19330
- })), {}, {
19331
- children: children
19332
- }))]
19333
- })
19334
- );
19179
+ return /*#__PURE__*/jsx(BaseBox
19180
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19181
+ , {
19182
+ ref: refs.setFloating,
19183
+ style: floatingStyles,
19184
+ zIndex: zIndex,
19185
+ display: isMounted ? 'flex' : 'none',
19186
+ children: /*#__PURE__*/jsx(StyledDropdownOverlay, _objectSpread$V(_objectSpread$V({
19187
+ isInBottomSheet: bottomSheetAndDropdownGlue === null || bottomSheetAndDropdownGlue === void 0 ? void 0 : bottomSheetAndDropdownGlue.dropdownHasBottomSheet,
19188
+ style: _objectSpread$V({}, styles),
19189
+ width: "100%"
19190
+ }, metaAttribute({
19191
+ name: MetaConstants.DropdownOverlay,
19192
+ testID: testID
19193
+ })), {}, {
19194
+ children: children
19195
+ }))
19196
+ });
19335
19197
  };
19336
19198
  var DropdownOverlay = /*#__PURE__*/assignWithoutSideEffects(_DropdownOverlay, {
19337
19199
  componentId: componentIds$1.DropdownOverlay
@@ -20303,7 +20165,7 @@ var BaseInputAnimatedBorder = function BaseInputAnimatedBorder(_ref2) {
20303
20165
  });
20304
20166
  };
20305
20167
 
20306
- var _excluded$k = ["children", "validationState", "currentInteraction", "isLabelLeftPositioned", "isTextArea"];
20168
+ var _excluded$k = ["children", "validationState", "currentInteraction", "isLabelLeftPositioned", "isTextArea", "setInputWrapperRef"];
20307
20169
  function ownKeys$M(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
20308
20170
  function _objectSpread$L(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$M(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$M(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
20309
20171
  var StyledBaseInputWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
@@ -20341,8 +20203,12 @@ var BaseInputWrapper = function BaseInputWrapper(_ref) {
20341
20203
  currentInteraction = _ref.currentInteraction;
20342
20204
  _ref.isLabelLeftPositioned;
20343
20205
  var isTextArea = _ref.isTextArea,
20206
+ setInputWrapperRef = _ref.setInputWrapperRef,
20344
20207
  props = _objectWithoutProperties$1(_ref, _excluded$k);
20345
- return /*#__PURE__*/jsxs(StyledBaseInputWrapper, _objectSpread$L(_objectSpread$L({
20208
+ return /*#__PURE__*/jsxs(StyledBaseInputWrapper
20209
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion, @typescript-eslint/no-explicit-any
20210
+ , _objectSpread$L(_objectSpread$L({
20211
+ ref: setInputWrapperRef,
20346
20212
  display: "flex",
20347
20213
  flexDirection: "row",
20348
20214
  width: "100%",
@@ -20358,7 +20224,7 @@ var BaseInputWrapper = function BaseInputWrapper(_ref) {
20358
20224
  }));
20359
20225
  };
20360
20226
 
20361
- var _excluded$j = ["as", "label", "labelPosition", "placeholder", "type", "defaultValue", "name", "value", "onFocus", "onChange", "onInput", "onBlur", "onSubmit", "onClick", "onKeyDown", "isDisabled", "necessityIndicator", "validationState", "errorText", "helpText", "successText", "isRequired", "leadingIcon", "prefix", "interactionElement", "suffix", "trailingIcon", "maxCharacters", "textAlign", "autoFocus", "keyboardReturnKeyType", "keyboardType", "autoCompleteSuggestionType", "trailingHeaderSlot", "trailingFooterSlot", "numberOfLines", "id", "componentName", "accessibilityLabel", "labelId", "activeDescendant", "hideLabelText", "hideFormHint", "hasPopup", "popupId", "isPopupExpanded", "shouldIgnoreBlurAnimation", "autoCapitalize", "testID"];
20227
+ var _excluded$j = ["as", "label", "labelPosition", "placeholder", "type", "defaultValue", "name", "value", "onFocus", "onChange", "onInput", "onBlur", "onSubmit", "onClick", "onKeyDown", "isDisabled", "necessityIndicator", "validationState", "errorText", "helpText", "successText", "isRequired", "leadingIcon", "prefix", "interactionElement", "suffix", "trailingIcon", "maxCharacters", "textAlign", "autoFocus", "keyboardReturnKeyType", "keyboardType", "autoCompleteSuggestionType", "trailingHeaderSlot", "trailingFooterSlot", "numberOfLines", "id", "componentName", "accessibilityLabel", "labelId", "activeDescendant", "hideLabelText", "hideFormHint", "hasPopup", "popupId", "isPopupExpanded", "shouldIgnoreBlurAnimation", "autoCapitalize", "setInputWrapperRef", "testID"];
20362
20228
  function ownKeys$L(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
20363
20229
  function _objectSpread$K(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$L(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$L(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
20364
20230
  var useInput = function useInput(_ref) {
@@ -20584,6 +20450,7 @@ var BaseInput = /*#__PURE__*/React__default.forwardRef(function (_ref11, ref) {
20584
20450
  isPopupExpanded = _ref11.isPopupExpanded,
20585
20451
  shouldIgnoreBlurAnimation = _ref11.shouldIgnoreBlurAnimation,
20586
20452
  autoCapitalize = _ref11.autoCapitalize,
20453
+ setInputWrapperRef = _ref11.setInputWrapperRef,
20587
20454
  testID = _ref11.testID,
20588
20455
  styledProps = _objectWithoutProperties$1(_ref11, _excluded$j);
20589
20456
  var _useTheme = useTheme(),
@@ -20676,6 +20543,7 @@ var BaseInput = /*#__PURE__*/React__default.forwardRef(function (_ref11, ref) {
20676
20543
  validationState: validationState,
20677
20544
  currentInteraction: currentInteraction,
20678
20545
  isLabelLeftPositioned: isLabelLeftPositioned,
20546
+ setInputWrapperRef: setInputWrapperRef,
20679
20547
  children: [/*#__PURE__*/jsx(BaseInputVisuals, {
20680
20548
  leadingIcon: leadingIcon,
20681
20549
  prefix: prefix,
@@ -20901,7 +20769,8 @@ var _TextInput = function _TextInput(_ref2, ref) {
20901
20769
  autoCapitalize = _ref2.autoCapitalize,
20902
20770
  testID = _ref2.testID,
20903
20771
  styledProps = _objectWithoutProperties$1(_ref2, _excluded$h);
20904
- var textInputRef = useBladeInnerRef(ref);
20772
+ var textInputRef = React__default.useRef(null);
20773
+ var mergedRef = useMergeRefs(ref, textInputRef);
20905
20774
  var _useState = useState(false),
20906
20775
  _useState2 = _slicedToArray(_useState, 2),
20907
20776
  shouldShowClearButton = _useState2[0],
@@ -20944,7 +20813,7 @@ var _TextInput = function _TextInput(_ref2, ref) {
20944
20813
  return /*#__PURE__*/jsx(BaseInput, _objectSpread$I(_objectSpread$I({
20945
20814
  id: "textinput",
20946
20815
  componentName: MetaConstants.TextInput,
20947
- ref: textInputRef,
20816
+ ref: mergedRef,
20948
20817
  label: label,
20949
20818
  accessibilityLabel: accessibilityLabel,
20950
20819
  hideLabelText: !Boolean(label),
@@ -21046,7 +20915,6 @@ var _PasswordInput = function _PasswordInput(_ref, ref) {
21046
20915
  autoCompleteSuggestionType = _ref.autoCompleteSuggestionType,
21047
20916
  testID = _ref.testID,
21048
20917
  styledProps = _objectWithoutProperties$1(_ref, _excluded$g);
21049
- var inputRef = useBladeInnerRef(ref);
21050
20918
  var _React$useState = React__default.useState(false),
21051
20919
  _React$useState2 = _slicedToArray(_React$useState, 2),
21052
20920
  isRevealed = _React$useState2[0],
@@ -21081,7 +20949,7 @@ var _PasswordInput = function _PasswordInput(_ref, ref) {
21081
20949
  }) : null;
21082
20950
  };
21083
20951
  return /*#__PURE__*/jsx(BaseInput, _objectSpread$H({
21084
- ref: inputRef,
20952
+ ref: ref,
21085
20953
  componentName: MetaConstants.PasswordInput,
21086
20954
  id: "password-field",
21087
20955
  label: label,
@@ -21157,7 +21025,8 @@ var _TextArea = function _TextArea(_ref, ref) {
21157
21025
  numberOfLines = _ref$numberOfLines === void 0 ? 2 : _ref$numberOfLines,
21158
21026
  testID = _ref.testID,
21159
21027
  styledProps = _objectWithoutProperties$1(_ref, _excluded$f);
21160
- var inputRef = useBladeInnerRef(ref);
21028
+ var inputRef = React__default.useRef(null);
21029
+ var mergedRef = useMergeRefs(ref, inputRef);
21161
21030
  var _React$useState = React__default.useState(false),
21162
21031
  _React$useState2 = _slicedToArray(_React$useState, 2),
21163
21032
  shouldShowClearButton = _React$useState2[0],
@@ -21200,7 +21069,7 @@ var _TextArea = function _TextArea(_ref, ref) {
21200
21069
  id: "textarea",
21201
21070
  componentName: MetaConstants.TextArea,
21202
21071
  autoFocus: autoFocus,
21203
- ref: inputRef,
21072
+ ref: mergedRef,
21204
21073
  label: label,
21205
21074
  accessibilityLabel: accessibilityLabel,
21206
21075
  hideLabelText: !Boolean(label),
@@ -21628,13 +21497,8 @@ var _SelectInput = function _SelectInput(props, ref) {
21628
21497
  isControlled = _useDropdown.isControlled,
21629
21498
  setIsControlled = _useDropdown.setIsControlled,
21630
21499
  selectionType = _useDropdown.selectionType,
21631
- selectedIndices = _useDropdown.selectedIndices;
21632
- var inputRef = useBladeInnerRef(ref, {
21633
- onFocus: function onFocus(opts) {
21634
- var _triggererRef$current;
21635
- (_triggererRef$current = triggererRef.current) === null || _triggererRef$current === void 0 ? void 0 : _triggererRef$current.focus(opts);
21636
- }
21637
- });
21500
+ selectedIndices = _useDropdown.selectedIndices,
21501
+ triggererWrapperRef = _useDropdown.triggererWrapperRef;
21638
21502
  var icon = props.icon;
21639
21503
  props.onChange;
21640
21504
  props.defaultValue;
@@ -21725,7 +21589,11 @@ var _SelectInput = function _SelectInput(props, ref) {
21725
21589
  position: "relative",
21726
21590
  children: [!isReactNative$4() ? /*#__PURE__*/jsx(VisuallyHidden, {
21727
21591
  children: /*#__PURE__*/jsx("input", {
21728
- ref: inputRef,
21592
+ onFocus: function onFocus() {
21593
+ var _triggererRef$current;
21594
+ (_triggererRef$current = triggererRef.current) === null || _triggererRef$current === void 0 ? void 0 : _triggererRef$current.focus();
21595
+ },
21596
+ ref: ref,
21729
21597
  tabIndex: -1,
21730
21598
  required: props.isRequired,
21731
21599
  name: props.name,
@@ -21744,6 +21612,9 @@ var _SelectInput = function _SelectInput(props, ref) {
21744
21612
  hideLabelText: ((_props$label = props.label) === null || _props$label === void 0 ? void 0 : _props$label.length) === 0,
21745
21613
  componentName: MetaConstants.SelectInput,
21746
21614
  ref: !isReactNative$4() ? triggererRef : null,
21615
+ setInputWrapperRef: function setInputWrapperRef(wrapperNode) {
21616
+ triggererWrapperRef.current = wrapperNode;
21617
+ },
21747
21618
  textAlign: "left",
21748
21619
  value: displayValue,
21749
21620
  placeholder: placeholder,