@transferwise/components 46.20.0 → 46.20.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.
package/build/index.js CHANGED
@@ -437,21 +437,6 @@ function getDirectionFromLocale(locale) {
437
437
  return adjustedLocale != null && RTL_LANGUAGES.includes(new Intl.Locale(adjustedLocale).language) ? exports.Direction.RTL : exports.Direction.LTR;
438
438
  }
439
439
 
440
- /**
441
- * generateRandomId() function
442
- *
443
- * This function generates a random string of characters that can be used as
444
- * an ID.
445
- *
446
- * @returns {string} A random string of characters.
447
- * @example
448
- * const id = generateRandomId();
449
- * // id will be a random string of characters, such as "id-4711".
450
- */
451
- const generateRandomId = () => {
452
- return `id-${Math.random().toString(36).slice(7)}`;
453
- };
454
-
455
440
  const DEFAULT_TYPE$1 = exports.Typography.TITLE_GROUP;
456
441
  const titleTypeMapping = {
457
442
  [exports.Typography.TITLE_SCREEN]: 'h1',
@@ -9668,7 +9653,8 @@ const PromoCard = /*#__PURE__*/React.forwardRef(({
9668
9653
  setChecked(!checked); // Update local state for checkbox
9669
9654
  }
9670
9655
  };
9671
- const componentId = `${id || generateRandomId()}`;
9656
+ const fallbackId = reactId.useId();
9657
+ const componentId = id || fallbackId;
9672
9658
  // Set the icon to `'arrow'` if `href` is truthy and `type` is falsy, or
9673
9659
  // `'download'` if `download` is truthy. If neither condition is true, set
9674
9660
  // `icon` to `undefined`.