@carbon/ibm-products 2.43.2-canary.321 → 2.43.2-canary.323
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/es/components/APIKeyModal/APIKeyDownloader.d.ts +3 -1
- package/es/components/APIKeyModal/APIKeyDownloader.js +9 -2
- package/es/components/APIKeyModal/APIKeyModal.js +9 -2
- package/es/components/APIKeyModal/APIKeyModal.types.d.ts +4 -0
- package/lib/components/APIKeyModal/APIKeyDownloader.d.ts +3 -1
- package/lib/components/APIKeyModal/APIKeyDownloader.js +9 -2
- package/lib/components/APIKeyModal/APIKeyModal.js +9 -2
- package/lib/components/APIKeyModal/APIKeyModal.types.d.ts +4 -0
- package/package.json +2 -2
@@ -1,15 +1,17 @@
|
|
1
|
-
export function APIKeyDownloader({ apiKey, body, fileName, fileType, linkText, }: {
|
1
|
+
export function APIKeyDownloader({ apiKey, body, fileName, fileType, linkText, downloadLinkLabel, }: {
|
2
2
|
apiKey: any;
|
3
3
|
body: any;
|
4
4
|
fileName: any;
|
5
5
|
fileType: any;
|
6
6
|
linkText: any;
|
7
|
+
downloadLinkLabel: any;
|
7
8
|
}): React.JSX.Element;
|
8
9
|
export namespace APIKeyDownloader {
|
9
10
|
export { componentName as displayName };
|
10
11
|
export namespace propTypes {
|
11
12
|
let apiKey: PropTypes.Validator<string>;
|
12
13
|
let body: PropTypes.Validator<string>;
|
14
|
+
let downloadLinkLabel: PropTypes.Requireable<string>;
|
13
15
|
let fileName: PropTypes.Validator<string>;
|
14
16
|
let fileType: PropTypes.Validator<string>;
|
15
17
|
let linkText: PropTypes.Validator<string>;
|
@@ -16,7 +16,8 @@ var APIKeyDownloader = function APIKeyDownloader(_ref) {
|
|
16
16
|
body = _ref.body,
|
17
17
|
fileName = _ref.fileName,
|
18
18
|
fileType = _ref.fileType,
|
19
|
-
linkText = _ref.linkText
|
19
|
+
linkText = _ref.linkText,
|
20
|
+
downloadLinkLabel = _ref.downloadLinkLabel;
|
20
21
|
var _useState = useState({}),
|
21
22
|
_useState2 = _slicedToArray(_useState, 2),
|
22
23
|
linkProps = _useState2[0],
|
@@ -61,7 +62,9 @@ var APIKeyDownloader = function APIKeyDownloader(_ref) {
|
|
61
62
|
}, /*#__PURE__*/React__default.createElement("p", {
|
62
63
|
className: "".concat(pkg.prefix, "--apikey-modal__messaging-text")
|
63
64
|
}, body, ' ', /*#__PURE__*/React__default.createElement("a", _extends({}, linkProps, {
|
64
|
-
className: "".concat(pkg.prefix, "--apikey-modal__download-link")
|
65
|
+
className: "".concat(pkg.prefix, "--apikey-modal__download-link"),
|
66
|
+
"aria-label": downloadLinkLabel !== null && downloadLinkLabel !== void 0 ? downloadLinkLabel : linkText,
|
67
|
+
role: "button"
|
65
68
|
}), linkText)));
|
66
69
|
};
|
67
70
|
APIKeyDownloader.displayName = componentName;
|
@@ -74,6 +77,10 @@ APIKeyDownloader.propTypes = {
|
|
74
77
|
* body content for the downloader
|
75
78
|
*/
|
76
79
|
body: PropTypes.string.isRequired,
|
80
|
+
/**
|
81
|
+
* aria-label for the download link
|
82
|
+
*/
|
83
|
+
downloadLinkLabel: PropTypes.string,
|
77
84
|
/**
|
78
85
|
* designates the name of downloadable json file with the key. if not specified will default to 'apikey'
|
79
86
|
*/
|
@@ -19,7 +19,7 @@ import { isRequiredIf } from '../../global/js/utils/props-helper.js';
|
|
19
19
|
import uuidv4 from '../../global/js/utils/uuidv4.js';
|
20
20
|
|
21
21
|
var _ErrorFilled, _InformationFilled;
|
22
|
-
var _excluded = ["apiKey", "apiKeyLabel", "apiKeyName", "body", "className", "closeButtonText", "copyButtonText", "copyErrorText", "copyIconDescription", "customSteps", "downloadBodyText", "downloadFileName", "downloadFileType", "downloadLinkText", "editButtonText", "editSuccess", "editSuccessTitle", "editing", "error", "errorText", "generateButtonText", "generateSuccessBody", "generateSuccessTitle", "generateTitle", "hasAPIKeyVisibilityToggle", "hasDownloadLink", "hideAPIKeyLabel", "loading", "loadingText", "modalLabel", "nameHelperText", "nameLabel", "namePlaceholder", "nameRequired", "nextStepButtonText", "onClose", "onCopy", "onRequestEdit", "onRequestGenerate", "open", "portalTarget", "previousStepButtonText", "showAPIKeyLabel"];
|
22
|
+
var _excluded = ["apiKey", "apiKeyLabel", "apiKeyName", "body", "className", "closeButtonText", "copyButtonText", "copyErrorText", "copyIconDescription", "customSteps", "downloadBodyText", "downloadFileName", "downloadFileType", "downloadLinkText", "downloadLinkLabel", "editButtonText", "editSuccess", "editSuccessTitle", "editing", "error", "errorText", "generateButtonText", "generateSuccessBody", "generateSuccessTitle", "generateTitle", "hasAPIKeyVisibilityToggle", "hasDownloadLink", "hideAPIKeyLabel", "loading", "loadingText", "modalLabel", "nameHelperText", "nameLabel", "namePlaceholder", "nameRequired", "nextStepButtonText", "onClose", "onCopy", "onRequestEdit", "onRequestGenerate", "open", "portalTarget", "previousStepButtonText", "showAPIKeyLabel"];
|
23
23
|
var componentName = 'APIKeyModal';
|
24
24
|
|
25
25
|
// Default values for props
|
@@ -45,6 +45,8 @@ var APIKeyModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
45
45
|
downloadFileName = _ref.downloadFileName,
|
46
46
|
downloadFileType = _ref.downloadFileType,
|
47
47
|
downloadLinkText = _ref.downloadLinkText,
|
48
|
+
_ref$downloadLinkLabe = _ref.downloadLinkLabel,
|
49
|
+
downloadLinkLabel = _ref$downloadLinkLabe === void 0 ? downloadLinkText : _ref$downloadLinkLabe,
|
48
50
|
editButtonText = _ref.editButtonText,
|
49
51
|
editSuccess = _ref.editSuccess,
|
50
52
|
editSuccessTitle = _ref.editSuccessTitle,
|
@@ -289,7 +291,8 @@ var APIKeyModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
289
291
|
body: downloadBodyText,
|
290
292
|
fileName: downloadFileName,
|
291
293
|
linkText: downloadLinkText,
|
292
|
-
fileType: downloadFileType
|
294
|
+
fileType: downloadFileType,
|
295
|
+
downloadLinkLabel: downloadLinkLabel
|
293
296
|
}) : /*#__PURE__*/React__default.createElement("div", {
|
294
297
|
className: "".concat(blockClass, "__messaging-text")
|
295
298
|
}, generateSuccessBody)))), /*#__PURE__*/React__default.createElement(ModalFooter, {
|
@@ -393,6 +396,10 @@ APIKeyModal.propTypes = {
|
|
393
396
|
* designates the file type for the downloadable key
|
394
397
|
*/
|
395
398
|
downloadFileType: downloadRequiredProps(PropTypes.oneOf(['txt', 'json'])),
|
399
|
+
/**
|
400
|
+
* aria-label for the download link
|
401
|
+
*/
|
402
|
+
downloadLinkLabel: downloadRequiredProps(PropTypes.string),
|
396
403
|
/**
|
397
404
|
* anchor text for the download link
|
398
405
|
*/
|
@@ -207,6 +207,10 @@ type HasDownloadLinkProps = {
|
|
207
207
|
* anchor text for the download link
|
208
208
|
*/
|
209
209
|
downloadLinkText: string;
|
210
|
+
/**
|
211
|
+
* Aria-label for the download link
|
212
|
+
*/
|
213
|
+
downloadLinkLabel?: string;
|
210
214
|
};
|
211
215
|
export type APIKeyModalProps = APIKeyModalCommonProps & CustomStepConditionalProps & EditingConditionalProps & HasDownloadLinkProps;
|
212
216
|
export {};
|
@@ -1,15 +1,17 @@
|
|
1
|
-
export function APIKeyDownloader({ apiKey, body, fileName, fileType, linkText, }: {
|
1
|
+
export function APIKeyDownloader({ apiKey, body, fileName, fileType, linkText, downloadLinkLabel, }: {
|
2
2
|
apiKey: any;
|
3
3
|
body: any;
|
4
4
|
fileName: any;
|
5
5
|
fileType: any;
|
6
6
|
linkText: any;
|
7
|
+
downloadLinkLabel: any;
|
7
8
|
}): React.JSX.Element;
|
8
9
|
export namespace APIKeyDownloader {
|
9
10
|
export { componentName as displayName };
|
10
11
|
export namespace propTypes {
|
11
12
|
let apiKey: PropTypes.Validator<string>;
|
12
13
|
let body: PropTypes.Validator<string>;
|
14
|
+
let downloadLinkLabel: PropTypes.Requireable<string>;
|
13
15
|
let fileName: PropTypes.Validator<string>;
|
14
16
|
let fileType: PropTypes.Validator<string>;
|
15
17
|
let linkText: PropTypes.Validator<string>;
|
@@ -18,7 +18,8 @@ var APIKeyDownloader = function APIKeyDownloader(_ref) {
|
|
18
18
|
body = _ref.body,
|
19
19
|
fileName = _ref.fileName,
|
20
20
|
fileType = _ref.fileType,
|
21
|
-
linkText = _ref.linkText
|
21
|
+
linkText = _ref.linkText,
|
22
|
+
downloadLinkLabel = _ref.downloadLinkLabel;
|
22
23
|
var _useState = React.useState({}),
|
23
24
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
24
25
|
linkProps = _useState2[0],
|
@@ -63,7 +64,9 @@ var APIKeyDownloader = function APIKeyDownloader(_ref) {
|
|
63
64
|
}, /*#__PURE__*/React.createElement("p", {
|
64
65
|
className: "".concat(settings.pkg.prefix, "--apikey-modal__messaging-text")
|
65
66
|
}, body, ' ', /*#__PURE__*/React.createElement("a", _rollupPluginBabelHelpers.extends({}, linkProps, {
|
66
|
-
className: "".concat(settings.pkg.prefix, "--apikey-modal__download-link")
|
67
|
+
className: "".concat(settings.pkg.prefix, "--apikey-modal__download-link"),
|
68
|
+
"aria-label": downloadLinkLabel !== null && downloadLinkLabel !== void 0 ? downloadLinkLabel : linkText,
|
69
|
+
role: "button"
|
67
70
|
}), linkText)));
|
68
71
|
};
|
69
72
|
APIKeyDownloader.displayName = componentName;
|
@@ -76,6 +79,10 @@ APIKeyDownloader.propTypes = {
|
|
76
79
|
* body content for the downloader
|
77
80
|
*/
|
78
81
|
body: index.default.string.isRequired,
|
82
|
+
/**
|
83
|
+
* aria-label for the download link
|
84
|
+
*/
|
85
|
+
downloadLinkLabel: index.default.string,
|
79
86
|
/**
|
80
87
|
* designates the name of downloadable json file with the key. if not specified will default to 'apikey'
|
81
88
|
*/
|
@@ -21,7 +21,7 @@ var propsHelper = require('../../global/js/utils/props-helper.js');
|
|
21
21
|
var uuidv4 = require('../../global/js/utils/uuidv4.js');
|
22
22
|
|
23
23
|
var _ErrorFilled, _InformationFilled;
|
24
|
-
var _excluded = ["apiKey", "apiKeyLabel", "apiKeyName", "body", "className", "closeButtonText", "copyButtonText", "copyErrorText", "copyIconDescription", "customSteps", "downloadBodyText", "downloadFileName", "downloadFileType", "downloadLinkText", "editButtonText", "editSuccess", "editSuccessTitle", "editing", "error", "errorText", "generateButtonText", "generateSuccessBody", "generateSuccessTitle", "generateTitle", "hasAPIKeyVisibilityToggle", "hasDownloadLink", "hideAPIKeyLabel", "loading", "loadingText", "modalLabel", "nameHelperText", "nameLabel", "namePlaceholder", "nameRequired", "nextStepButtonText", "onClose", "onCopy", "onRequestEdit", "onRequestGenerate", "open", "portalTarget", "previousStepButtonText", "showAPIKeyLabel"];
|
24
|
+
var _excluded = ["apiKey", "apiKeyLabel", "apiKeyName", "body", "className", "closeButtonText", "copyButtonText", "copyErrorText", "copyIconDescription", "customSteps", "downloadBodyText", "downloadFileName", "downloadFileType", "downloadLinkText", "downloadLinkLabel", "editButtonText", "editSuccess", "editSuccessTitle", "editing", "error", "errorText", "generateButtonText", "generateSuccessBody", "generateSuccessTitle", "generateTitle", "hasAPIKeyVisibilityToggle", "hasDownloadLink", "hideAPIKeyLabel", "loading", "loadingText", "modalLabel", "nameHelperText", "nameLabel", "namePlaceholder", "nameRequired", "nextStepButtonText", "onClose", "onCopy", "onRequestEdit", "onRequestGenerate", "open", "portalTarget", "previousStepButtonText", "showAPIKeyLabel"];
|
25
25
|
var componentName = 'APIKeyModal';
|
26
26
|
|
27
27
|
// Default values for props
|
@@ -47,6 +47,8 @@ exports.APIKeyModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
47
47
|
downloadFileName = _ref.downloadFileName,
|
48
48
|
downloadFileType = _ref.downloadFileType,
|
49
49
|
downloadLinkText = _ref.downloadLinkText,
|
50
|
+
_ref$downloadLinkLabe = _ref.downloadLinkLabel,
|
51
|
+
downloadLinkLabel = _ref$downloadLinkLabe === void 0 ? downloadLinkText : _ref$downloadLinkLabe,
|
50
52
|
editButtonText = _ref.editButtonText,
|
51
53
|
editSuccess = _ref.editSuccess,
|
52
54
|
editSuccessTitle = _ref.editSuccessTitle,
|
@@ -291,7 +293,8 @@ exports.APIKeyModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
291
293
|
body: downloadBodyText,
|
292
294
|
fileName: downloadFileName,
|
293
295
|
linkText: downloadLinkText,
|
294
|
-
fileType: downloadFileType
|
296
|
+
fileType: downloadFileType,
|
297
|
+
downloadLinkLabel: downloadLinkLabel
|
295
298
|
}) : /*#__PURE__*/React.createElement("div", {
|
296
299
|
className: "".concat(blockClass, "__messaging-text")
|
297
300
|
}, generateSuccessBody)))), /*#__PURE__*/React.createElement(react.ModalFooter, {
|
@@ -395,6 +398,10 @@ exports.APIKeyModal.propTypes = {
|
|
395
398
|
* designates the file type for the downloadable key
|
396
399
|
*/
|
397
400
|
downloadFileType: downloadRequiredProps(index.default.oneOf(['txt', 'json'])),
|
401
|
+
/**
|
402
|
+
* aria-label for the download link
|
403
|
+
*/
|
404
|
+
downloadLinkLabel: downloadRequiredProps(index.default.string),
|
398
405
|
/**
|
399
406
|
* anchor text for the download link
|
400
407
|
*/
|
@@ -207,6 +207,10 @@ type HasDownloadLinkProps = {
|
|
207
207
|
* anchor text for the download link
|
208
208
|
*/
|
209
209
|
downloadLinkText: string;
|
210
|
+
/**
|
211
|
+
* Aria-label for the download link
|
212
|
+
*/
|
213
|
+
downloadLinkLabel?: string;
|
210
214
|
};
|
211
215
|
export type APIKeyModalProps = APIKeyModalCommonProps & CustomStepConditionalProps & EditingConditionalProps & HasDownloadLinkProps;
|
212
216
|
export {};
|
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.
|
4
|
+
"version": "2.43.2-canary.323+68cb17576",
|
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": "
|
123
|
+
"gitHead": "68cb17576b7647759e68bd29d543c40c2e205e87"
|
124
124
|
}
|