@carbon/ibm-products 2.54.0-canary.9 → 2.54.0-rc.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/es/components/APIKeyModal/APIKeyDownloader.js +1 -1
- package/es/components/APIKeyModal/APIKeyModal.js +6 -39
- package/es/components/APIKeyModal/APIKeyModal.types.d.ts +0 -5
- package/es/components/AddSelect/AddSelect.d.ts +2 -2
- package/es/components/AddSelect/AddSelect.js +0 -1
- package/es/components/AddSelect/AddSelectBody.d.ts +2 -2
- package/es/components/AddSelect/AddSelectBody.js +0 -1
- package/es/components/Card/Card.js +9 -13
- package/es/components/Tearsheet/Tearsheet.d.ts +1 -1
- package/es/components/Tearsheet/TearsheetNarrow.d.ts +1 -1
- package/es/components/Tearsheet/TearsheetShell.d.ts +1 -1
- package/es/components/TooltipTrigger/TooltipTrigger.d.ts +1 -1
- package/es/components/TooltipTrigger/TooltipTrigger.js +2 -3
- package/es/components/UserAvatar/UserAvatar.js +3 -1
- package/lib/components/APIKeyModal/APIKeyDownloader.js +1 -1
- package/lib/components/APIKeyModal/APIKeyModal.js +5 -38
- package/lib/components/APIKeyModal/APIKeyModal.types.d.ts +0 -5
- package/lib/components/AddSelect/AddSelect.d.ts +2 -2
- package/lib/components/AddSelect/AddSelect.js +0 -1
- package/lib/components/AddSelect/AddSelectBody.d.ts +2 -2
- package/lib/components/AddSelect/AddSelectBody.js +0 -1
- package/lib/components/Card/Card.js +8 -12
- package/lib/components/Tearsheet/Tearsheet.d.ts +1 -1
- package/lib/components/Tearsheet/TearsheetNarrow.d.ts +1 -1
- package/lib/components/Tearsheet/TearsheetShell.d.ts +1 -1
- package/lib/components/TooltipTrigger/TooltipTrigger.d.ts +1 -1
- package/lib/components/TooltipTrigger/TooltipTrigger.js +2 -3
- package/lib/components/UserAvatar/UserAvatar.js +3 -1
- package/package.json +5 -5
@@ -65,7 +65,7 @@ var APIKeyDownloader = function APIKeyDownloader(_ref) {
|
|
65
65
|
className: "".concat(pkg.prefix, "--apikey-modal__download-link"),
|
66
66
|
"aria-label": downloadLinkLabel !== null && downloadLinkLabel !== void 0 ? downloadLinkLabel : linkText,
|
67
67
|
role: "button"
|
68
|
-
}),
|
68
|
+
}), linkText)));
|
69
69
|
};
|
70
70
|
APIKeyDownloader.displayName = componentName;
|
71
71
|
APIKeyDownloader.propTypes = {
|
@@ -9,7 +9,7 @@ import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _
|
|
9
9
|
import React__default, { forwardRef, useState, useRef, useEffect } from 'react';
|
10
10
|
import PropTypes from '../../_virtual/index.js';
|
11
11
|
import cx from 'classnames';
|
12
|
-
import {
|
12
|
+
import { ComposedModal, ModalHeader, ModalBody, PasswordInput, TextInput, Form, InlineLoading, ModalFooter, Button } from '@carbon/react';
|
13
13
|
import { ErrorFilled, InformationFilled, Copy } from '@carbon/react/icons';
|
14
14
|
import { APIKeyDownloader } from './APIKeyDownloader.js';
|
15
15
|
import { pkg } from '../../settings.js';
|
@@ -17,10 +17,9 @@ import { usePortalTarget } from '../../global/js/hooks/usePortalTarget.js';
|
|
17
17
|
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
18
18
|
import { isRequiredIf } from '../../global/js/utils/props-helper.js';
|
19
19
|
import uuidv4 from '../../global/js/utils/uuidv4.js';
|
20
|
-
import { useFocus, getSpecificElement } from '../../global/js/hooks/useFocus.js';
|
21
20
|
|
22
21
|
var _ErrorFilled, _InformationFilled;
|
23
|
-
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", "
|
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"];
|
24
23
|
var componentName = 'APIKeyModal';
|
25
24
|
|
26
25
|
// Default values for props
|
@@ -76,7 +75,6 @@ var APIKeyModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
76
75
|
open = _ref.open,
|
77
76
|
portalTargetIn = _ref.portalTarget,
|
78
77
|
previousStepButtonText = _ref.previousStepButtonText,
|
79
|
-
selectorPrimaryFocus = _ref.selectorPrimaryFocus,
|
80
78
|
showAPIKeyLabel = _ref.showAPIKeyLabel,
|
81
79
|
rest = _objectWithoutProperties(_ref, _excluded);
|
82
80
|
var _useState = useState(null),
|
@@ -113,34 +111,11 @@ var APIKeyModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
113
111
|
ref: copyRef
|
114
112
|
};
|
115
113
|
var blockClass = "".concat(pkg.prefix, "--apikey-modal");
|
116
|
-
var localRef = useRef(undefined);
|
117
|
-
var modalRef = ref || localRef;
|
118
|
-
var _useFocus = useFocus(modalRef, selectorPrimaryFocus),
|
119
|
-
firstElement = _useFocus.firstElement,
|
120
|
-
keyDownListener = _useFocus.keyDownListener;
|
121
114
|
useEffect(function () {
|
122
115
|
if (copyRef.current && open && apiKeyLoaded) {
|
123
116
|
copyRef.current.focus();
|
124
117
|
}
|
125
118
|
}, [open, apiKeyLoaded]);
|
126
|
-
useEffect(function () {
|
127
|
-
if (open) {
|
128
|
-
// Focusing the first element or selectorPrimaryFocus element
|
129
|
-
if (selectorPrimaryFocus && getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus)) {
|
130
|
-
var _window;
|
131
|
-
var specifiedEl = getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus);
|
132
|
-
if (specifiedEl && ((_window = window) === null || _window === void 0 || (_window = _window.getComputedStyle(specifiedEl)) === null || _window === void 0 ? void 0 : _window.display) !== 'none') {
|
133
|
-
setTimeout(function () {
|
134
|
-
return specifiedEl.focus();
|
135
|
-
}, 0);
|
136
|
-
return;
|
137
|
-
}
|
138
|
-
}
|
139
|
-
setTimeout(function () {
|
140
|
-
firstElement === null || firstElement === void 0 || firstElement.focus();
|
141
|
-
}, 0);
|
142
|
-
}
|
143
|
-
}, [firstElement, modalRef, open, selectorPrimaryFocus]);
|
144
119
|
var isPrimaryButtonDisabled = function isPrimaryButtonDisabled() {
|
145
120
|
if (loading) {
|
146
121
|
return true;
|
@@ -255,13 +230,10 @@ var APIKeyModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
255
230
|
onCloseHandler();
|
256
231
|
}
|
257
232
|
};
|
258
|
-
return renderPortalUse( /*#__PURE__*/React__default.createElement(
|
259
|
-
|
260
|
-
|
261
|
-
open: open
|
233
|
+
return renderPortalUse( /*#__PURE__*/React__default.createElement(ComposedModal, _extends({}, rest, _objectSpread2({
|
234
|
+
open: open,
|
235
|
+
ref: ref
|
262
236
|
}, getDevtoolsProps(componentName)), {
|
263
|
-
ref: modalRef,
|
264
|
-
onKeyDown: keyDownListener,
|
265
237
|
className: cx(className, blockClass),
|
266
238
|
onClose: onCloseHandler,
|
267
239
|
size: "sm",
|
@@ -334,7 +306,7 @@ var APIKeyModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
334
306
|
kind: "primary",
|
335
307
|
onClick: submitHandler,
|
336
308
|
disabled: isPrimaryButtonDisabled()
|
337
|
-
}), getPrimaryButtonText()))))
|
309
|
+
}), getPrimaryButtonText()))));
|
338
310
|
});
|
339
311
|
var customStepsRequiredProps = function customStepsRequiredProps(type) {
|
340
312
|
return isRequiredIf(type, function (_ref3) {
|
@@ -547,11 +519,6 @@ APIKeyModal.propTypes = {
|
|
547
519
|
* text that displays in the secondary button when using custom steps to indicate to the user that there is a previous step
|
548
520
|
*/
|
549
521
|
previousStepButtonText: customStepsRequiredProps(PropTypes.string),
|
550
|
-
/**
|
551
|
-
* Specify a CSS selector that matches the DOM element that should be
|
552
|
-
* focused when the Modal opens.
|
553
|
-
*/
|
554
|
-
selectorPrimaryFocus: PropTypes.string,
|
555
522
|
/**
|
556
523
|
* label text that's displayed when hovering over visibility toggler to show key
|
557
524
|
*/
|
@@ -145,11 +145,6 @@ interface APIKeyModalCommonProps {
|
|
145
145
|
* The DOM node the tearsheet should be rendered within. Defaults to document.body.
|
146
146
|
*/
|
147
147
|
portalTarget?: ReactNode;
|
148
|
-
/**
|
149
|
-
* Specify a CSS selector that matches the DOM element that should be
|
150
|
-
* focused when the Modal opens.
|
151
|
-
*/
|
152
|
-
selectorPrimaryFocus?: string;
|
153
148
|
/**
|
154
149
|
* label text that's displayed when hovering over visibility toggler to show key
|
155
150
|
*/
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { ReactNode } from 'react';
|
2
2
|
import { Filter, Item, Theme } from './types';
|
3
3
|
export interface AddSelectProps {
|
4
4
|
className?: string;
|
@@ -36,7 +36,7 @@ export interface AddSelectProps {
|
|
36
36
|
/**
|
37
37
|
* portal target for the all tags modal
|
38
38
|
*/
|
39
|
-
portalTarget?:
|
39
|
+
portalTarget?: ReactNode;
|
40
40
|
searchResultsTitle?: string;
|
41
41
|
sortByLabel?: string;
|
42
42
|
title: string;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { ReactNode } from 'react';
|
2
2
|
import { Item, Theme } from './types';
|
3
3
|
export interface AddSelectBodyProps {
|
4
4
|
className?: string;
|
@@ -35,7 +35,7 @@ export interface AddSelectBodyProps {
|
|
35
35
|
onSubmit?: (selection: any) => void;
|
36
36
|
onSubmitButtonText?: string;
|
37
37
|
open?: boolean;
|
38
|
-
portalTarget?:
|
38
|
+
portalTarget?: ReactNode;
|
39
39
|
searchResultsTitle?: string;
|
40
40
|
sortByLabel?: string;
|
41
41
|
title?: string;
|
@@ -361,7 +361,6 @@ AddSelectBody.propTypes = {
|
|
361
361
|
onSubmit: PropTypes.func,
|
362
362
|
onSubmitButtonText: PropTypes.string,
|
363
363
|
open: PropTypes.bool,
|
364
|
-
/**@ts-ignore */
|
365
364
|
portalTarget: PropTypes.node,
|
366
365
|
searchResultsTitle: PropTypes.string,
|
367
366
|
sortByLabel: PropTypes.string,
|
@@ -8,7 +8,7 @@
|
|
8
8
|
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends, objectSpread2 as _objectSpread2, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default, { forwardRef } from 'react';
|
10
10
|
import cx from 'classnames';
|
11
|
-
import { Layer,
|
11
|
+
import { Layer, OverflowMenu, OverflowMenuItem, Button, IconButton } from '@carbon/react';
|
12
12
|
import { Incomplete, CheckmarkOutline } from '@carbon/react/icons';
|
13
13
|
import PropTypes from '../../_virtual/index.js';
|
14
14
|
import { CardHeader } from './CardHeader.js';
|
@@ -17,7 +17,7 @@ import { pkg } from '../../settings.js';
|
|
17
17
|
|
18
18
|
var _Incomplete, _CheckmarkOutline;
|
19
19
|
var _excluded = ["actionIcons", "actionsPlacement", "aiLabel", "metadata", "children", "className", "clickZone", "description", "disabled", "footerActionIcon", "getStarted", "label", "media", "mediaPosition", "onClick", "onKeyDown", "onPrimaryButtonClick", "overflowActions", "overflowAriaLabel", "onSecondaryButtonClick", "pictogram", "primaryButtonDisabled", "primaryButtonHref", "primaryButtonIcon", "primaryButtonKind", "primaryButtonPlacement", "primaryButtonText", "productive", "secondaryButtonDisabled", "secondaryButtonHref", "secondaryButtonIcon", "secondaryButtonKind", "secondaryButtonPlacement", "secondaryButtonText", "slug", "status", "sequence", "title", "titleSize", "iconDescription"],
|
20
|
-
_excluded2 = ["id"
|
20
|
+
_excluded2 = ["id"],
|
21
21
|
_excluded3 = ["id", "icon", "onClick", "iconDescription", "href"];
|
22
22
|
var componentName = 'Card';
|
23
23
|
var Card = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
@@ -95,27 +95,23 @@ var Card = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
95
95
|
// actions can either be an overflow menu or series of icons
|
96
96
|
var getActions = function getActions() {
|
97
97
|
if (overflowActions.length > 0) {
|
98
|
-
var pos = actionsPlacement === 'top' ? 'bottom
|
98
|
+
var pos = actionsPlacement === 'top' ? 'bottom' : 'top';
|
99
99
|
var size = actionsPlacement === 'top' ? 'sm' : 'md';
|
100
100
|
return /*#__PURE__*/React__default.createElement(Layer, {
|
101
101
|
level: 2
|
102
|
-
}, /*#__PURE__*/React__default.createElement(unstable_FeatureFlags, {
|
103
|
-
enableV12Overflowmenu: true
|
104
102
|
}, /*#__PURE__*/React__default.createElement(OverflowMenu, {
|
105
|
-
autoAlign: true,
|
106
|
-
menuAlignment: pos,
|
107
103
|
size: size,
|
104
|
+
direction: pos,
|
105
|
+
flipped: true,
|
108
106
|
"aria-label": overflowAriaLabel,
|
109
|
-
|
107
|
+
iconDescription: iconDescription
|
110
108
|
}, overflowActions.map(function (_ref2) {
|
111
109
|
var id = _ref2.id,
|
112
|
-
itemText = _ref2.itemText,
|
113
110
|
rest = _objectWithoutProperties(_ref2, _excluded2);
|
114
|
-
return /*#__PURE__*/React__default.createElement(
|
115
|
-
key: id
|
116
|
-
label: itemText
|
111
|
+
return /*#__PURE__*/React__default.createElement(OverflowMenuItem, _extends({
|
112
|
+
key: id
|
117
113
|
}, rest));
|
118
|
-
})))
|
114
|
+
})));
|
119
115
|
}
|
120
116
|
var icons = getIcons().map(function (_ref3) {
|
121
117
|
var id = _ref3.id,
|
@@ -107,7 +107,7 @@ export interface TearsheetProps extends PropsWithChildren {
|
|
107
107
|
/**
|
108
108
|
* The DOM element that the tearsheet should be rendered within. Defaults to document.body.
|
109
109
|
*/
|
110
|
-
portalTarget?:
|
110
|
+
portalTarget?: ReactNode;
|
111
111
|
/**
|
112
112
|
* Specify a CSS selector that matches the DOM element that should be
|
113
113
|
* focused when the Modal opens.
|
@@ -63,7 +63,7 @@ interface TearsheetNarrowBaseProps extends PropsWithChildren {
|
|
63
63
|
/**
|
64
64
|
* The DOM element that the tearsheet should be rendered within. Defaults to document.body.
|
65
65
|
*/
|
66
|
-
portalTarget?:
|
66
|
+
portalTarget?: ReactNode;
|
67
67
|
/**
|
68
68
|
* Specify a CSS selector that matches the DOM element that should be
|
69
69
|
* focused when the Modal opens.
|
@@ -84,7 +84,7 @@ interface TearsheetShellProps extends PropsWithChildren {
|
|
84
84
|
/**
|
85
85
|
* The DOM element that the tearsheet should be rendered within. Defaults to document.body.
|
86
86
|
*/
|
87
|
-
portalTarget?:
|
87
|
+
portalTarget?: ReactNode;
|
88
88
|
/**
|
89
89
|
* Specify a CSS selector that matches the DOM element that should be
|
90
90
|
* focused when the Modal opens.
|
@@ -15,4 +15,4 @@ export interface TooltipTriggerProps extends PropsWithChildren {
|
|
15
15
|
* This is an tooltip trigger as Carbon Tooltip requires an active element to work but provides
|
16
16
|
* no blanked button.
|
17
17
|
*/
|
18
|
-
export declare let TooltipTrigger: React.ForwardRefExoticComponent<TooltipTriggerProps & React.RefAttributes<
|
18
|
+
export declare let TooltipTrigger: React.ForwardRefExoticComponent<TooltipTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -23,13 +23,12 @@ var componentName = 'TooltipTrigger';
|
|
23
23
|
* This is an tooltip trigger as Carbon Tooltip requires an active element to work but provides
|
24
24
|
* no blanked button.
|
25
25
|
*/
|
26
|
-
var TooltipTrigger = /*#__PURE__*/React__default.forwardRef(function (_ref
|
26
|
+
var TooltipTrigger = /*#__PURE__*/React__default.forwardRef(function (_ref) {
|
27
27
|
var children = _ref.children,
|
28
28
|
className = _ref.className,
|
29
29
|
rest = _objectWithoutProperties(_ref, _excluded);
|
30
30
|
return /*#__PURE__*/React__default.createElement("button", _extends({
|
31
|
-
type: "button"
|
32
|
-
ref: ref
|
31
|
+
type: "button"
|
33
32
|
}, rest, {
|
34
33
|
className: cx(blockClass,
|
35
34
|
// Apply the block class to the main HTML element
|
@@ -96,7 +96,9 @@ var UserAvatar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
96
96
|
// switched classes dependant on props or state
|
97
97
|
// example: [`${blockClass}__here-if-small`]: size === 'sm',
|
98
98
|
}),
|
99
|
-
ref: ref
|
99
|
+
ref: ref,
|
100
|
+
role: "img",
|
101
|
+
"aria-hidden": "true"
|
100
102
|
}, getDevtoolsProps(componentName)), getItem());
|
101
103
|
};
|
102
104
|
if (tooltipText) {
|
@@ -67,7 +67,7 @@ var APIKeyDownloader = function APIKeyDownloader(_ref) {
|
|
67
67
|
className: "".concat(settings.pkg.prefix, "--apikey-modal__download-link"),
|
68
68
|
"aria-label": downloadLinkLabel !== null && downloadLinkLabel !== void 0 ? downloadLinkLabel : linkText,
|
69
69
|
role: "button"
|
70
|
-
}),
|
70
|
+
}), linkText)));
|
71
71
|
};
|
72
72
|
APIKeyDownloader.displayName = componentName;
|
73
73
|
APIKeyDownloader.propTypes = {
|
@@ -19,10 +19,9 @@ var usePortalTarget = require('../../global/js/hooks/usePortalTarget.js');
|
|
19
19
|
var devtools = require('../../global/js/utils/devtools.js');
|
20
20
|
var propsHelper = require('../../global/js/utils/props-helper.js');
|
21
21
|
var uuidv4 = require('../../global/js/utils/uuidv4.js');
|
22
|
-
var useFocus = require('../../global/js/hooks/useFocus.js');
|
23
22
|
|
24
23
|
var _ErrorFilled, _InformationFilled;
|
25
|
-
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", "
|
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"];
|
26
25
|
var componentName = 'APIKeyModal';
|
27
26
|
|
28
27
|
// Default values for props
|
@@ -78,7 +77,6 @@ exports.APIKeyModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
78
77
|
open = _ref.open,
|
79
78
|
portalTargetIn = _ref.portalTarget,
|
80
79
|
previousStepButtonText = _ref.previousStepButtonText,
|
81
|
-
selectorPrimaryFocus = _ref.selectorPrimaryFocus,
|
82
80
|
showAPIKeyLabel = _ref.showAPIKeyLabel,
|
83
81
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
84
82
|
var _useState = React.useState(null),
|
@@ -115,34 +113,11 @@ exports.APIKeyModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
115
113
|
ref: copyRef
|
116
114
|
};
|
117
115
|
var blockClass = "".concat(settings.pkg.prefix, "--apikey-modal");
|
118
|
-
var localRef = React.useRef(undefined);
|
119
|
-
var modalRef = ref || localRef;
|
120
|
-
var _useFocus = useFocus.useFocus(modalRef, selectorPrimaryFocus),
|
121
|
-
firstElement = _useFocus.firstElement,
|
122
|
-
keyDownListener = _useFocus.keyDownListener;
|
123
116
|
React.useEffect(function () {
|
124
117
|
if (copyRef.current && open && apiKeyLoaded) {
|
125
118
|
copyRef.current.focus();
|
126
119
|
}
|
127
120
|
}, [open, apiKeyLoaded]);
|
128
|
-
React.useEffect(function () {
|
129
|
-
if (open) {
|
130
|
-
// Focusing the first element or selectorPrimaryFocus element
|
131
|
-
if (selectorPrimaryFocus && useFocus.getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus)) {
|
132
|
-
var _window;
|
133
|
-
var specifiedEl = useFocus.getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus);
|
134
|
-
if (specifiedEl && ((_window = window) === null || _window === void 0 || (_window = _window.getComputedStyle(specifiedEl)) === null || _window === void 0 ? void 0 : _window.display) !== 'none') {
|
135
|
-
setTimeout(function () {
|
136
|
-
return specifiedEl.focus();
|
137
|
-
}, 0);
|
138
|
-
return;
|
139
|
-
}
|
140
|
-
}
|
141
|
-
setTimeout(function () {
|
142
|
-
firstElement === null || firstElement === void 0 || firstElement.focus();
|
143
|
-
}, 0);
|
144
|
-
}
|
145
|
-
}, [firstElement, modalRef, open, selectorPrimaryFocus]);
|
146
121
|
var isPrimaryButtonDisabled = function isPrimaryButtonDisabled() {
|
147
122
|
if (loading) {
|
148
123
|
return true;
|
@@ -257,13 +232,10 @@ exports.APIKeyModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
257
232
|
onCloseHandler();
|
258
233
|
}
|
259
234
|
};
|
260
|
-
return renderPortalUse( /*#__PURE__*/React.createElement(react.
|
261
|
-
|
262
|
-
|
263
|
-
open: open
|
235
|
+
return renderPortalUse( /*#__PURE__*/React.createElement(react.ComposedModal, _rollupPluginBabelHelpers.extends({}, rest, _rollupPluginBabelHelpers.objectSpread2({
|
236
|
+
open: open,
|
237
|
+
ref: ref
|
264
238
|
}, devtools.getDevtoolsProps(componentName)), {
|
265
|
-
ref: modalRef,
|
266
|
-
onKeyDown: keyDownListener,
|
267
239
|
className: cx(className, blockClass),
|
268
240
|
onClose: onCloseHandler,
|
269
241
|
size: "sm",
|
@@ -336,7 +308,7 @@ exports.APIKeyModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
336
308
|
kind: "primary",
|
337
309
|
onClick: submitHandler,
|
338
310
|
disabled: isPrimaryButtonDisabled()
|
339
|
-
}), getPrimaryButtonText()))))
|
311
|
+
}), getPrimaryButtonText()))));
|
340
312
|
});
|
341
313
|
var customStepsRequiredProps = function customStepsRequiredProps(type) {
|
342
314
|
return propsHelper.isRequiredIf(type, function (_ref3) {
|
@@ -549,11 +521,6 @@ exports.APIKeyModal.propTypes = {
|
|
549
521
|
* text that displays in the secondary button when using custom steps to indicate to the user that there is a previous step
|
550
522
|
*/
|
551
523
|
previousStepButtonText: customStepsRequiredProps(index.default.string),
|
552
|
-
/**
|
553
|
-
* Specify a CSS selector that matches the DOM element that should be
|
554
|
-
* focused when the Modal opens.
|
555
|
-
*/
|
556
|
-
selectorPrimaryFocus: index.default.string,
|
557
524
|
/**
|
558
525
|
* label text that's displayed when hovering over visibility toggler to show key
|
559
526
|
*/
|
@@ -145,11 +145,6 @@ interface APIKeyModalCommonProps {
|
|
145
145
|
* The DOM node the tearsheet should be rendered within. Defaults to document.body.
|
146
146
|
*/
|
147
147
|
portalTarget?: ReactNode;
|
148
|
-
/**
|
149
|
-
* Specify a CSS selector that matches the DOM element that should be
|
150
|
-
* focused when the Modal opens.
|
151
|
-
*/
|
152
|
-
selectorPrimaryFocus?: string;
|
153
148
|
/**
|
154
149
|
* label text that's displayed when hovering over visibility toggler to show key
|
155
150
|
*/
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { ReactNode } from 'react';
|
2
2
|
import { Filter, Item, Theme } from './types';
|
3
3
|
export interface AddSelectProps {
|
4
4
|
className?: string;
|
@@ -36,7 +36,7 @@ export interface AddSelectProps {
|
|
36
36
|
/**
|
37
37
|
* portal target for the all tags modal
|
38
38
|
*/
|
39
|
-
portalTarget?:
|
39
|
+
portalTarget?: ReactNode;
|
40
40
|
searchResultsTitle?: string;
|
41
41
|
sortByLabel?: string;
|
42
42
|
title: string;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { ReactNode } from 'react';
|
2
2
|
import { Item, Theme } from './types';
|
3
3
|
export interface AddSelectBodyProps {
|
4
4
|
className?: string;
|
@@ -35,7 +35,7 @@ export interface AddSelectBodyProps {
|
|
35
35
|
onSubmit?: (selection: any) => void;
|
36
36
|
onSubmitButtonText?: string;
|
37
37
|
open?: boolean;
|
38
|
-
portalTarget?:
|
38
|
+
portalTarget?: ReactNode;
|
39
39
|
searchResultsTitle?: string;
|
40
40
|
sortByLabel?: string;
|
41
41
|
title?: string;
|
@@ -363,7 +363,6 @@ AddSelectBody.propTypes = {
|
|
363
363
|
onSubmit: index.default.func,
|
364
364
|
onSubmitButtonText: index.default.string,
|
365
365
|
open: index.default.bool,
|
366
|
-
/**@ts-ignore */
|
367
366
|
portalTarget: index.default.node,
|
368
367
|
searchResultsTitle: index.default.string,
|
369
368
|
sortByLabel: index.default.string,
|
@@ -19,7 +19,7 @@ var settings = require('../../settings.js');
|
|
19
19
|
|
20
20
|
var _Incomplete, _CheckmarkOutline;
|
21
21
|
var _excluded = ["actionIcons", "actionsPlacement", "aiLabel", "metadata", "children", "className", "clickZone", "description", "disabled", "footerActionIcon", "getStarted", "label", "media", "mediaPosition", "onClick", "onKeyDown", "onPrimaryButtonClick", "overflowActions", "overflowAriaLabel", "onSecondaryButtonClick", "pictogram", "primaryButtonDisabled", "primaryButtonHref", "primaryButtonIcon", "primaryButtonKind", "primaryButtonPlacement", "primaryButtonText", "productive", "secondaryButtonDisabled", "secondaryButtonHref", "secondaryButtonIcon", "secondaryButtonKind", "secondaryButtonPlacement", "secondaryButtonText", "slug", "status", "sequence", "title", "titleSize", "iconDescription"],
|
22
|
-
_excluded2 = ["id"
|
22
|
+
_excluded2 = ["id"],
|
23
23
|
_excluded3 = ["id", "icon", "onClick", "iconDescription", "href"];
|
24
24
|
var componentName = 'Card';
|
25
25
|
var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
@@ -97,27 +97,23 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
97
97
|
// actions can either be an overflow menu or series of icons
|
98
98
|
var getActions = function getActions() {
|
99
99
|
if (overflowActions.length > 0) {
|
100
|
-
var pos = actionsPlacement === 'top' ? 'bottom
|
100
|
+
var pos = actionsPlacement === 'top' ? 'bottom' : 'top';
|
101
101
|
var size = actionsPlacement === 'top' ? 'sm' : 'md';
|
102
102
|
return /*#__PURE__*/React.createElement(react.Layer, {
|
103
103
|
level: 2
|
104
|
-
}, /*#__PURE__*/React.createElement(react.unstable_FeatureFlags, {
|
105
|
-
enableV12Overflowmenu: true
|
106
104
|
}, /*#__PURE__*/React.createElement(react.OverflowMenu, {
|
107
|
-
autoAlign: true,
|
108
|
-
menuAlignment: pos,
|
109
105
|
size: size,
|
106
|
+
direction: pos,
|
107
|
+
flipped: true,
|
110
108
|
"aria-label": overflowAriaLabel,
|
111
|
-
|
109
|
+
iconDescription: iconDescription
|
112
110
|
}, overflowActions.map(function (_ref2) {
|
113
111
|
var id = _ref2.id,
|
114
|
-
itemText = _ref2.itemText,
|
115
112
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2, _excluded2);
|
116
|
-
return /*#__PURE__*/React.createElement(react.
|
117
|
-
key: id
|
118
|
-
label: itemText
|
113
|
+
return /*#__PURE__*/React.createElement(react.OverflowMenuItem, _rollupPluginBabelHelpers.extends({
|
114
|
+
key: id
|
119
115
|
}, rest));
|
120
|
-
})))
|
116
|
+
})));
|
121
117
|
}
|
122
118
|
var icons = getIcons().map(function (_ref3) {
|
123
119
|
var id = _ref3.id,
|
@@ -107,7 +107,7 @@ export interface TearsheetProps extends PropsWithChildren {
|
|
107
107
|
/**
|
108
108
|
* The DOM element that the tearsheet should be rendered within. Defaults to document.body.
|
109
109
|
*/
|
110
|
-
portalTarget?:
|
110
|
+
portalTarget?: ReactNode;
|
111
111
|
/**
|
112
112
|
* Specify a CSS selector that matches the DOM element that should be
|
113
113
|
* focused when the Modal opens.
|
@@ -63,7 +63,7 @@ interface TearsheetNarrowBaseProps extends PropsWithChildren {
|
|
63
63
|
/**
|
64
64
|
* The DOM element that the tearsheet should be rendered within. Defaults to document.body.
|
65
65
|
*/
|
66
|
-
portalTarget?:
|
66
|
+
portalTarget?: ReactNode;
|
67
67
|
/**
|
68
68
|
* Specify a CSS selector that matches the DOM element that should be
|
69
69
|
* focused when the Modal opens.
|
@@ -84,7 +84,7 @@ interface TearsheetShellProps extends PropsWithChildren {
|
|
84
84
|
/**
|
85
85
|
* The DOM element that the tearsheet should be rendered within. Defaults to document.body.
|
86
86
|
*/
|
87
|
-
portalTarget?:
|
87
|
+
portalTarget?: ReactNode;
|
88
88
|
/**
|
89
89
|
* Specify a CSS selector that matches the DOM element that should be
|
90
90
|
* focused when the Modal opens.
|
@@ -15,4 +15,4 @@ export interface TooltipTriggerProps extends PropsWithChildren {
|
|
15
15
|
* This is an tooltip trigger as Carbon Tooltip requires an active element to work but provides
|
16
16
|
* no blanked button.
|
17
17
|
*/
|
18
|
-
export declare let TooltipTrigger: React.ForwardRefExoticComponent<TooltipTriggerProps & React.RefAttributes<
|
18
|
+
export declare let TooltipTrigger: React.ForwardRefExoticComponent<TooltipTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -25,13 +25,12 @@ var componentName = 'TooltipTrigger';
|
|
25
25
|
* This is an tooltip trigger as Carbon Tooltip requires an active element to work but provides
|
26
26
|
* no blanked button.
|
27
27
|
*/
|
28
|
-
exports.TooltipTrigger = /*#__PURE__*/React.forwardRef(function (_ref
|
28
|
+
exports.TooltipTrigger = /*#__PURE__*/React.forwardRef(function (_ref) {
|
29
29
|
var children = _ref.children,
|
30
30
|
className = _ref.className,
|
31
31
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
32
32
|
return /*#__PURE__*/React.createElement("button", _rollupPluginBabelHelpers.extends({
|
33
|
-
type: "button"
|
34
|
-
ref: ref
|
33
|
+
type: "button"
|
35
34
|
}, rest, {
|
36
35
|
className: cx(blockClass,
|
37
36
|
// Apply the block class to the main HTML element
|
@@ -98,7 +98,9 @@ exports.UserAvatar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
98
98
|
// switched classes dependant on props or state
|
99
99
|
// example: [`${blockClass}__here-if-small`]: size === 'sm',
|
100
100
|
}),
|
101
|
-
ref: ref
|
101
|
+
ref: ref,
|
102
|
+
role: "img",
|
103
|
+
"aria-hidden": "true"
|
102
104
|
}, devtools.getDevtoolsProps(componentName)), getItem());
|
103
105
|
};
|
104
106
|
if (tooltipText) {
|
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.54.0-
|
4
|
+
"version": "2.54.0-rc.1",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -81,7 +81,7 @@
|
|
81
81
|
"fs-extra": "^11.2.0",
|
82
82
|
"glob": "^10.3.10",
|
83
83
|
"jest": "^29.7.0",
|
84
|
-
"jest-config-ibm-cloud-cognitive": "^1.13.0-rc.
|
84
|
+
"jest-config-ibm-cloud-cognitive": "^1.13.0-rc.1",
|
85
85
|
"jest-environment-jsdom": "^29.7.0",
|
86
86
|
"namor": "^1.1.2",
|
87
87
|
"npm-check-updates": "^16.14.12",
|
@@ -89,14 +89,14 @@
|
|
89
89
|
"rimraf": "^5.0.5",
|
90
90
|
"rollup": "^3.29.5",
|
91
91
|
"rollup-plugin-strip-banner": "^3.0.0",
|
92
|
-
"sass": "^1.
|
92
|
+
"sass": "^1.77.2",
|
93
93
|
"typescript-config-carbon": "^0.3.0",
|
94
94
|
"yargs": "^17.7.2"
|
95
95
|
},
|
96
96
|
"dependencies": {
|
97
97
|
"@babel/runtime": "^7.23.9",
|
98
98
|
"@carbon/feature-flags": "^0.24.0",
|
99
|
-
"@carbon/ibm-products-styles": "^2.50.0-rc.
|
99
|
+
"@carbon/ibm-products-styles": "^2.50.0-rc.1",
|
100
100
|
"@carbon/telemetry": "^0.1.0",
|
101
101
|
"@dnd-kit/core": "^6.0.8",
|
102
102
|
"@dnd-kit/modifiers": "^7.0.0",
|
@@ -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": "9bdef903b3824229bdaf67f77ee4a7f37e2d8cb1"
|
124
124
|
}
|