@carbon/ibm-products 2.43.2-canary.243 → 2.43.2-canary.244

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.
@@ -12,7 +12,7 @@ import React__default, { forwardRef, useState, useEffect, useRef } from 'react';
12
12
  import PropTypes from '../../node_modules/prop-types/index.js';
13
13
  import cx from 'classnames';
14
14
  import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
15
- import { pkg } from '../../settings.js';
15
+ import { pkg, carbon } from '../../settings.js';
16
16
  import { usePortalTarget } from '../../global/js/hooks/usePortalTarget.js';
17
17
  import uuidv4 from '../../global/js/utils/uuidv4.js';
18
18
 
@@ -58,6 +58,7 @@ var ExportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
58
58
  _ref$validExtensions = _ref.validExtensions,
59
59
  validExtensions = _ref$validExtensions === void 0 ? defaults.validExtensions : _ref$validExtensions,
60
60
  rest = _objectWithoutProperties(_ref, _excluded);
61
+ var blockClass = "".concat(pkg.prefix, "--export-modal");
61
62
  var _useState = useState(''),
62
63
  _useState2 = _slicedToArray(_useState, 2),
63
64
  name = _useState2[0],
@@ -80,6 +81,12 @@ var ExportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
80
81
  setExtension(preformattedExtensions === null || preformattedExtensions === void 0 || (_preformattedExtensio2 = preformattedExtensions[0]) === null || _preformattedExtensio2 === void 0 ? void 0 : _preformattedExtensio2.extension);
81
82
  }
82
83
  }, [filename, preformattedExtensions, open]);
84
+ useEffect(function () {
85
+ if (successful) {
86
+ var button = document.querySelector(".".concat(blockClass, " .").concat(carbon.prefix, "--modal-close-button button"));
87
+ button === null || button === void 0 || button.focus();
88
+ }
89
+ }, [successful, blockClass]);
83
90
  var onNameChangeHandler = function onNameChangeHandler(evt) {
84
91
  setName(evt.target.value);
85
92
  };
@@ -106,7 +113,6 @@ var ExportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
106
113
  }
107
114
  return false;
108
115
  };
109
- var blockClass = "".concat(pkg.prefix, "--export-modal");
110
116
  var internalId = useRef(uuidv4());
111
117
  var primaryButtonDisabled = loading || !name || hasInvalidExtension();
112
118
  var submitted = loading || error || successful;
@@ -67,6 +67,7 @@ exports.ExportModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
67
67
  _ref$validExtensions = _ref.validExtensions,
68
68
  validExtensions = _ref$validExtensions === void 0 ? defaults.validExtensions : _ref$validExtensions,
69
69
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
70
+ var blockClass = "".concat(settings.pkg.prefix, "--export-modal");
70
71
  var _useState = React.useState(''),
71
72
  _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
72
73
  name = _useState2[0],
@@ -89,6 +90,12 @@ exports.ExportModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
89
90
  setExtension(preformattedExtensions === null || preformattedExtensions === void 0 || (_preformattedExtensio2 = preformattedExtensions[0]) === null || _preformattedExtensio2 === void 0 ? void 0 : _preformattedExtensio2.extension);
90
91
  }
91
92
  }, [filename, preformattedExtensions, open]);
93
+ React.useEffect(function () {
94
+ if (successful) {
95
+ var button = document.querySelector(".".concat(blockClass, " .").concat(settings.carbon.prefix, "--modal-close-button button"));
96
+ button === null || button === void 0 || button.focus();
97
+ }
98
+ }, [successful, blockClass]);
92
99
  var onNameChangeHandler = function onNameChangeHandler(evt) {
93
100
  setName(evt.target.value);
94
101
  };
@@ -115,7 +122,6 @@ exports.ExportModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
115
122
  }
116
123
  return false;
117
124
  };
118
- var blockClass = "".concat(settings.pkg.prefix, "--export-modal");
119
125
  var internalId = React.useRef(uuidv4["default"]());
120
126
  var primaryButtonDisabled = loading || !name || hasInvalidExtension();
121
127
  var submitted = loading || error || successful;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/ibm-products",
3
3
  "description": "Carbon for IBM Products",
4
- "version": "2.43.2-canary.243+dd7564d02",
4
+ "version": "2.43.2-canary.244+ef4bfa87d",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -120,5 +120,5 @@
120
120
  "react": "^16.8.6 || ^17.0.1 || ^18.2.0",
121
121
  "react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
122
122
  },
123
- "gitHead": "dd7564d02dcad68052555eb5b2bf543b4a901992"
123
+ "gitHead": "ef4bfa87d454eba9ce8b4cb83a464e95d66a189e"
124
124
  }