@carbon/ibm-products 2.1.3 → 2.2.0
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/css/index-full-carbon.css +246 -777
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +3 -3
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +11 -210
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +2 -2
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +48 -412
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +3 -3
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +121 -344
- package/css/index.css.map +1 -1
- package/css/index.min.css +3 -3
- package/css/index.min.css.map +1 -1
- package/es/components/AboutModal/AboutModal.js +4 -2
- package/es/components/ActionBar/ActionBar.js +6 -2
- package/es/components/AddSelect/AddSelectFormControl.js +6 -6
- package/es/components/AddSelect/AddSelectRow.js +5 -15
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +6 -5
- package/es/components/ButtonMenu/ButtonMenu.js +4 -4
- package/es/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +9 -3
- package/es/components/Cascade/Cascade.js +1 -11
- package/es/components/CreateFullPage/CreateFullPage.js +0 -13
- package/es/components/CreateModal/CreateModal.js +0 -7
- package/es/components/CreateSidePanel/CreateSidePanel.js +1 -1
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +3 -3
- package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -1
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -3
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +2 -3
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +47 -39
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +24 -20
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/index.js +1 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +15 -44
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +21 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +10 -12
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +2 -2
- package/es/components/Datagrid/useActionsColumn.js +7 -10
- package/es/components/Datagrid/useCustomizeColumns.js +7 -9
- package/es/components/Datagrid/useExpandedRow.js +7 -11
- package/es/components/Datagrid/useFiltering.js +8 -12
- package/es/components/Datagrid/useInlineEdit.js +0 -3
- package/es/components/Datagrid/useNestedRows.js +6 -10
- package/es/components/Datagrid/useStickyColumn.js +3 -10
- package/es/components/Datagrid/utils/DatagridActions.js +14 -6
- package/es/components/EditFullPage/EditFullPage.js +1 -2
- package/es/components/EditSidePanel/EditSidePanel.js +1 -1
- package/es/components/EditTearsheet/EditTearsheet.js +0 -4
- package/es/components/EditTearsheetNarrow/EditTearsheetNarrow.js +1 -1
- package/es/components/EditUpdateCards/EditUpdateCards.js +2 -3
- package/es/components/EmptyStates/EmptyState.js +0 -4
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +0 -4
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +0 -4
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +0 -4
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +0 -4
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +0 -4
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +0 -4
- package/es/components/ExportModal/ExportModal.js +0 -4
- package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +0 -6
- package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +0 -6
- package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +0 -6
- package/es/components/ImportModal/ImportModal.js +6 -13
- package/es/components/MultiAddSelect/MultiAddSelect.js +0 -4
- package/es/components/NotificationsPanel/preview-components/UnreadNotificationBell.js +17 -2
- package/es/components/PageHeader/PageHeader.js +6 -2
- package/es/components/PageHeader/PageHeaderUtils.js +2 -2
- package/es/components/RemoveModal/RemoveModal.js +0 -6
- package/es/components/SidePanel/SidePanel.js +3 -1
- package/es/components/SingleAddSelect/SingleAddSelect.js +0 -4
- package/es/components/StatusIcon/StatusIcon.js +0 -10
- package/es/components/TagSet/TagSet.js +7 -4
- package/es/components/Tearsheet/TearsheetShell.js +6 -11
- package/es/components/UserProfileImage/UserProfileImage.js +3 -14
- package/es/components/WebTerminal/WebTerminal.js +0 -4
- package/es/global/js/hooks/useCreateComponentStepChange.js +15 -16
- package/es/global/js/hooks/useResizeObserver.js +28 -14
- package/es/global/js/package-settings.js +1 -14
- package/es/global/js/utils/story-helper.js +6 -108
- package/lib/components/AboutModal/AboutModal.js +4 -2
- package/lib/components/ActionBar/ActionBar.js +6 -2
- package/lib/components/AddSelect/AddSelectFormControl.js +6 -6
- package/lib/components/AddSelect/AddSelectRow.js +5 -15
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +6 -5
- package/lib/components/ButtonMenu/ButtonMenu.js +4 -4
- package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +9 -3
- package/lib/components/Cascade/Cascade.js +1 -11
- package/lib/components/CreateFullPage/CreateFullPage.js +0 -13
- package/lib/components/CreateModal/CreateModal.js +0 -7
- package/lib/components/CreateSidePanel/CreateSidePanel.js +1 -1
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +3 -3
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -1
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -3
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +2 -3
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +45 -37
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +24 -20
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/index.js +7 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +13 -42
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +30 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +10 -12
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +2 -2
- package/lib/components/Datagrid/useActionsColumn.js +7 -12
- package/lib/components/Datagrid/useCustomizeColumns.js +8 -10
- package/lib/components/Datagrid/useExpandedRow.js +6 -9
- package/lib/components/Datagrid/useFiltering.js +7 -10
- package/lib/components/Datagrid/useInlineEdit.js +0 -3
- package/lib/components/Datagrid/useNestedRows.js +6 -9
- package/lib/components/Datagrid/useStickyColumn.js +3 -10
- package/lib/components/Datagrid/utils/DatagridActions.js +13 -5
- package/lib/components/EditFullPage/EditFullPage.js +1 -2
- package/lib/components/EditSidePanel/EditSidePanel.js +1 -1
- package/lib/components/EditTearsheet/EditTearsheet.js +0 -4
- package/lib/components/EditTearsheetNarrow/EditTearsheetNarrow.js +1 -1
- package/lib/components/EditUpdateCards/EditUpdateCards.js +2 -3
- package/lib/components/EmptyStates/EmptyState.js +0 -4
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +0 -4
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +0 -4
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +0 -4
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +0 -4
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +0 -4
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +0 -4
- package/lib/components/ExportModal/ExportModal.js +0 -4
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +0 -6
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +0 -6
- package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +0 -6
- package/lib/components/ImportModal/ImportModal.js +6 -13
- package/lib/components/MultiAddSelect/MultiAddSelect.js +0 -4
- package/lib/components/NotificationsPanel/preview-components/UnreadNotificationBell.js +17 -2
- package/lib/components/PageHeader/PageHeader.js +6 -2
- package/lib/components/PageHeader/PageHeaderUtils.js +2 -2
- package/lib/components/RemoveModal/RemoveModal.js +0 -6
- package/lib/components/SidePanel/SidePanel.js +3 -1
- package/lib/components/SingleAddSelect/SingleAddSelect.js +0 -4
- package/lib/components/StatusIcon/StatusIcon.js +0 -10
- package/lib/components/TagSet/TagSet.js +7 -4
- package/lib/components/Tearsheet/TearsheetShell.js +6 -11
- package/lib/components/UserProfileImage/UserProfileImage.js +3 -14
- package/lib/components/WebTerminal/WebTerminal.js +0 -4
- package/lib/global/js/hooks/useCreateComponentStepChange.js +15 -16
- package/lib/global/js/hooks/useResizeObserver.js +27 -13
- package/lib/global/js/package-settings.js +1 -14
- package/lib/global/js/utils/story-helper.js +7 -115
- package/package.json +4 -4
- package/scss/components/AddSelect/_add-select.scss +0 -4
- package/scss/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss +1 -0
- package/scss/components/ButtonMenu/_button-menu.scss +1 -32
- package/scss/components/Cascade/_storybook-styles.scss +2 -3
- package/scss/components/DataSpreadsheet/_storybook-styles.scss +0 -6
- package/scss/components/Datagrid/_datagrid.scss +2 -4
- package/scss/components/Datagrid/_storybook-styles.scss +2 -16
- package/scss/components/Datagrid/styles/_datagrid.scss +13 -26
- package/scss/components/Datagrid/styles/addons/_FilterFlyout.scss +0 -7
- package/scss/components/Datagrid/styles/addons/_FilterPanel.scss +0 -4
- package/scss/components/HTTPErrors/_storybook-styles.scss +6 -0
- package/scss/components/NotificationsPanel/_notifications-panel.scss +1 -1
- package/scss/components/NotificationsPanel/_storybook-styles.scss +2 -10
- package/scss/components/PageHeader/_page-header.scss +1 -0
- package/scss/components/PageHeader/_storybook-styles.scss +14 -24
- package/scss/components/SidePanel/_side-panel.scss +2 -0
- package/scss/components/Tearsheet/_tearsheet.scss +6 -7
- package/scss/components/WebTerminal/_storybook-styles.scss +1 -11
- package/scss/global/styles/_display-box.scss +0 -1
- package/es/components/APIKeyModal/APIKeyModal.docs-page.js +0 -26
- package/es/components/AboutModal/AboutModal.docs-page.js +0 -21
- package/es/components/Cascade/Cascade.docs-page.js +0 -22
- package/es/components/CreateFullPage/CreateFullPage.docs-page.js +0 -39
- package/es/components/CreateModal/CreateModal.docs-page.js +0 -24
- package/es/components/CreateSidePanel/CreateSidePanel.docs-page.js +0 -18
- package/es/components/CreateTearsheet/CreateTearsheet.docs-page.js +0 -29
- package/es/components/EditFullPage/EditFullPage.docs-page.js +0 -39
- package/es/components/EditTearsheet/EditTearsheet.docs-page.js +0 -25
- package/es/components/ExampleComponent/ExampleComponent.docs-page.js +0 -22
- package/es/components/ImportModal/ImportModal.docs-page.js +0 -18
- package/es/components/MultiAddSelect/MultiAddSelect.docs-page.js +0 -17
- package/es/components/RemoveModal/RemoveModal.docs-page.js +0 -18
- package/es/components/SingleAddSelect/SingleAddSelect.docs-page.js +0 -15
- package/es/components/StatusIcon/StatusIcon.docs-page.js +0 -17
- package/es/components/Toolbar/Toolbar.docs-page.js +0 -14
- package/es/components/UserProfileImage/UserProfileImage.docs-page.js +0 -17
- package/es/components/WebTerminal/WebTerminal.docs-page.js +0 -52
- package/es/global/js/utils/StoryDocsPage.js +0 -218
- package/lib/components/APIKeyModal/APIKeyModal.docs-page.js +0 -37
- package/lib/components/AboutModal/AboutModal.docs-page.js +0 -32
- package/lib/components/Cascade/Cascade.docs-page.js +0 -33
- package/lib/components/CreateFullPage/CreateFullPage.docs-page.js +0 -50
- package/lib/components/CreateModal/CreateModal.docs-page.js +0 -35
- package/lib/components/CreateSidePanel/CreateSidePanel.docs-page.js +0 -29
- package/lib/components/CreateTearsheet/CreateTearsheet.docs-page.js +0 -40
- package/lib/components/EditFullPage/EditFullPage.docs-page.js +0 -50
- package/lib/components/EditTearsheet/EditTearsheet.docs-page.js +0 -36
- package/lib/components/ExampleComponent/ExampleComponent.docs-page.js +0 -33
- package/lib/components/ImportModal/ImportModal.docs-page.js +0 -26
- package/lib/components/MultiAddSelect/MultiAddSelect.docs-page.js +0 -25
- package/lib/components/RemoveModal/RemoveModal.docs-page.js +0 -26
- package/lib/components/SingleAddSelect/SingleAddSelect.docs-page.js +0 -23
- package/lib/components/StatusIcon/StatusIcon.docs-page.js +0 -28
- package/lib/components/Toolbar/Toolbar.docs-page.js +0 -25
- package/lib/components/UserProfileImage/UserProfileImage.docs-page.js +0 -28
- package/lib/components/WebTerminal/WebTerminal.docs-page.js +0 -63
- package/lib/global/js/utils/StoryDocsPage.js +0 -225
|
@@ -16,16 +16,6 @@ import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
|
|
16
16
|
import { pkg } from '../../settings';
|
|
17
17
|
var blockClass = "".concat(pkg.prefix, "--status-icon");
|
|
18
18
|
var componentName = 'StatusIcon';
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
The `StatusIcon` component follows the Carbon guidelines for status icons with
|
|
22
|
-
some added specifications around illustration usage. For additional usage
|
|
23
|
-
guidelines and documentation please refer to the links above.
|
|
24
|
-
|
|
25
|
-
_Status icons_ are an important method of communicating severity level
|
|
26
|
-
information to users. The shapes and colors, communicate severity that enable
|
|
27
|
-
users to quickly assess and identify status and respond accordingly.
|
|
28
|
-
*/
|
|
29
19
|
export var StatusIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
30
20
|
var _icons$kind;
|
|
31
21
|
var kind = _ref.kind,
|
|
@@ -156,8 +156,7 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
156
156
|
if (sizingTags.length > 0) {
|
|
157
157
|
var spaceAvailable = tagSetRef.current.offsetWidth;
|
|
158
158
|
for (var i in sizingTags) {
|
|
159
|
-
var
|
|
160
|
-
var tagWidth = ((_sizingTags$i = sizingTags[i]) === null || _sizingTags$i === void 0 ? void 0 : _sizingTags$i.offsetWidth) || 0;
|
|
159
|
+
var tagWidth = sizingTags[i].offsetWidth;
|
|
161
160
|
if (spaceAvailable >= tagWidth) {
|
|
162
161
|
spaceAvailable -= tagWidth;
|
|
163
162
|
willFit += 1;
|
|
@@ -199,8 +198,12 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
199
198
|
var handleModalClose = function handleModalClose() {
|
|
200
199
|
setShowAllModalOpen(false);
|
|
201
200
|
};
|
|
202
|
-
useResizeObserver(sizingContainerRef,
|
|
203
|
-
|
|
201
|
+
useResizeObserver(sizingContainerRef, {
|
|
202
|
+
callback: handleSizerTagsResize
|
|
203
|
+
});
|
|
204
|
+
useResizeObserver(tagSetRef, {
|
|
205
|
+
callback: handleResize
|
|
206
|
+
});
|
|
204
207
|
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
|
205
208
|
className: cx([blockClass, className]),
|
|
206
209
|
ref: tagSetRef
|
|
@@ -55,13 +55,7 @@ export var tearsheetHasCloseIcon = function tearsheetHasCloseIcon(actions, hasCl
|
|
|
55
55
|
return hasCloseIcon !== null && hasCloseIcon !== void 0 ? hasCloseIcon : tearsheetIsPassive(actions);
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
* TearSheetShell is used internally by TearSheet and TearSheetNarrow
|
|
60
|
-
*
|
|
61
|
-
* The component is not public.
|
|
62
|
-
*
|
|
63
|
-
* See the canvas tab for the component API details.
|
|
64
|
-
* */
|
|
58
|
+
// TearSheetShell is used internally by TearSheet and TearSheetNarrow
|
|
65
59
|
export var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
66
60
|
var actions = _ref.actions,
|
|
67
61
|
children = _ref.children,
|
|
@@ -222,8 +216,7 @@ export var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
222
216
|
closeModal: onClose,
|
|
223
217
|
iconDescription: closeIconDescription
|
|
224
218
|
}, /*#__PURE__*/React.createElement(Wrap, {
|
|
225
|
-
className: "".concat(bc, "__header-content")
|
|
226
|
-
element: wide ? Layer : undefined
|
|
219
|
+
className: "".concat(bc, "__header-content")
|
|
227
220
|
}, /*#__PURE__*/React.createElement(Wrap, {
|
|
228
221
|
className: "".concat(bc, "__header-fields")
|
|
229
222
|
}, /*#__PURE__*/React.createElement(Wrap, {
|
|
@@ -248,10 +241,12 @@ export var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
248
241
|
className: "".concat(bc, "__right")
|
|
249
242
|
}, /*#__PURE__*/React.createElement(Wrap, {
|
|
250
243
|
className: "".concat(bc, "__main"),
|
|
251
|
-
alwaysRender: includeActions
|
|
244
|
+
alwaysRender: includeActions,
|
|
245
|
+
element: wide ? Layer : undefined
|
|
252
246
|
}, /*#__PURE__*/React.createElement(Wrap, {
|
|
253
247
|
className: "".concat(bc, "__content"),
|
|
254
|
-
alwaysRender: influencer && influencerPosition === 'right'
|
|
248
|
+
alwaysRender: influencer && influencerPosition === 'right',
|
|
249
|
+
element: wide ? Layer : undefined
|
|
255
250
|
}, children), /*#__PURE__*/React.createElement(Wrap, {
|
|
256
251
|
className: cx((_cx6 = {}, _defineProperty(_cx6, "".concat(bc, "__influencer"), true), _defineProperty(_cx6, "".concat(bc, "__influencer--wide"), influencerWidth === 'wide'), _cx6)),
|
|
257
252
|
neverRender: influencerPosition !== 'right'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["backgroundColor", "className", "kind", "icon", "initials", "image", "imageDescription", "size", "theme", "tooltipText"
|
|
3
|
+
var _excluded = ["backgroundColor", "className", "kind", "icon", "initials", "image", "imageDescription", "size", "theme", "tooltipText"];
|
|
4
4
|
/**
|
|
5
5
|
* Copyright IBM Corp. 2021, 2021
|
|
6
6
|
*
|
|
@@ -28,12 +28,8 @@ var componentName = 'UserProfileImage';
|
|
|
28
28
|
|
|
29
29
|
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
|
30
30
|
|
|
31
|
-
// Default values for props
|
|
32
|
-
var defaults = {
|
|
33
|
-
tooltipAlignment: 'bottom'
|
|
34
|
-
};
|
|
35
31
|
/**
|
|
36
|
-
*
|
|
32
|
+
* This is a user profile image component which displays an image, or initials or icon for a user.
|
|
37
33
|
*/
|
|
38
34
|
export var UserProfileImage = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
39
35
|
var backgroundColor = _ref.backgroundColor,
|
|
@@ -46,8 +42,6 @@ export var UserProfileImage = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
46
42
|
size = _ref.size,
|
|
47
43
|
theme = _ref.theme,
|
|
48
44
|
tooltipText = _ref.tooltipText,
|
|
49
|
-
_ref$tooltipAlignment = _ref.tooltipAlignment,
|
|
50
|
-
tooltipAlignment = _ref$tooltipAlignment === void 0 ? defaults.tooltipAlignment : _ref$tooltipAlignment,
|
|
51
45
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
52
46
|
var icons = {
|
|
53
47
|
user: {
|
|
@@ -127,8 +121,7 @@ export var UserProfileImage = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
127
121
|
return FillItem && (tooltipText ? /*#__PURE__*/React.createElement(IconButton, {
|
|
128
122
|
label: tooltipText,
|
|
129
123
|
className: "".concat(blockClass, "__tooltip"),
|
|
130
|
-
kind: "ghost"
|
|
131
|
-
align: tooltipAlignment
|
|
124
|
+
kind: "ghost"
|
|
132
125
|
}, renderUserProfileImage()) : renderUserProfileImage());
|
|
133
126
|
});
|
|
134
127
|
|
|
@@ -176,10 +169,6 @@ UserProfileImage.propTypes = {
|
|
|
176
169
|
* Set theme in which the component will be rendered
|
|
177
170
|
*/
|
|
178
171
|
theme: PropTypes.oneOf(['light', 'dark']).isRequired,
|
|
179
|
-
/**
|
|
180
|
-
* Specify how the trigger should align with the tooltip
|
|
181
|
-
*/
|
|
182
|
-
tooltipAlignment: PropTypes.oneOf(['top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right', 'left', 'right']),
|
|
183
172
|
/**
|
|
184
173
|
* Pass in the display name to have it shown on hover
|
|
185
174
|
*/
|
|
@@ -39,10 +39,6 @@ var defaults = {
|
|
|
39
39
|
documentationLinksIconDescription: 'Show documentation links',
|
|
40
40
|
isInitiallyOpen: false
|
|
41
41
|
};
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* The `WebTerminal` is prompted by the user and is persistent until dismissed. The purpose of a web terminal is to provide users with the ability to type commands manually instead of using the GUI.
|
|
45
|
-
*/
|
|
46
42
|
export var WebTerminal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
47
43
|
var _ref3;
|
|
48
44
|
var _ref$actions = _ref.actions,
|
|
@@ -30,20 +30,6 @@ export var useCreateComponentStepChange = function useCreateComponentStepChange(
|
|
|
30
30
|
componentBlockClass = _ref.componentBlockClass,
|
|
31
31
|
setCreateComponentActions = _ref.setCreateComponentActions,
|
|
32
32
|
setModalIsOpen = _ref.setModalIsOpen;
|
|
33
|
-
var continueToNextStep = useCallback(function () {
|
|
34
|
-
setIsSubmitting(false);
|
|
35
|
-
setCurrentStep(function (prev) {
|
|
36
|
-
// Find next included step to render
|
|
37
|
-
// There will always be a next step otherwise we will
|
|
38
|
-
// have reach the onSubmit
|
|
39
|
-
do {
|
|
40
|
-
var _stepData;
|
|
41
|
-
prev++;
|
|
42
|
-
} while (!((_stepData = stepData[prev - 1]) !== null && _stepData !== void 0 && _stepData.shouldIncludeStep));
|
|
43
|
-
return prev;
|
|
44
|
-
});
|
|
45
|
-
}, [setCurrentStep, setIsSubmitting, stepData]);
|
|
46
|
-
|
|
47
33
|
// useEffect to handle multi step logic
|
|
48
34
|
useEffect(function () {
|
|
49
35
|
var onUnmount = function onUnmount() {
|
|
@@ -171,9 +157,9 @@ export var useCreateComponentStepChange = function useCreateComponentStepChange(
|
|
|
171
157
|
// There will always be a previous step otherwise we will
|
|
172
158
|
// have disabled the back button since we have reached the first visible step
|
|
173
159
|
do {
|
|
174
|
-
var
|
|
160
|
+
var _stepData;
|
|
175
161
|
prev--;
|
|
176
|
-
} while (!((
|
|
162
|
+
} while (!((_stepData = stepData[prev - 1]) !== null && _stepData !== void 0 && _stepData.shouldIncludeStep));
|
|
177
163
|
return prev;
|
|
178
164
|
});
|
|
179
165
|
},
|
|
@@ -201,4 +187,17 @@ export var useCreateComponentStepChange = function useCreateComponentStepChange(
|
|
|
201
187
|
setCreateComponentActions(buttons);
|
|
202
188
|
}
|
|
203
189
|
}, [firstIncludedStep, lastIncludedStep, stepData, onNext, isSubmitDisabled, backButtonText, cancelButtonText, currentStep, onClose, nextButtonText, submitButtonText, onRequestSubmit, isSubmitting, shouldViewAll, componentBlockClass, componentName, continueToNextStep, setCurrentStep, setCreateComponentActions, setIsSubmitting, setShouldViewAll, setModalIsOpen]);
|
|
190
|
+
var continueToNextStep = useCallback(function () {
|
|
191
|
+
setIsSubmitting(false);
|
|
192
|
+
setCurrentStep(function (prev) {
|
|
193
|
+
// Find next included step to render
|
|
194
|
+
// There will always be a next step otherwise we will
|
|
195
|
+
// have reach the onSubmit
|
|
196
|
+
do {
|
|
197
|
+
var _stepData2;
|
|
198
|
+
prev++;
|
|
199
|
+
} while (!((_stepData2 = stepData[prev - 1]) !== null && _stepData2 !== void 0 && _stepData2.shouldIncludeStep));
|
|
200
|
+
return prev;
|
|
201
|
+
});
|
|
202
|
+
}, [setCurrentStep, setIsSubmitting, stepData]);
|
|
204
203
|
};
|
|
@@ -5,8 +5,14 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
5
5
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
import { useRef, useState, useLayoutEffect
|
|
9
|
-
export var useResizeObserver = function useResizeObserver(ref
|
|
8
|
+
import { useRef, useState, useLayoutEffect } from 'react';
|
|
9
|
+
export var useResizeObserver = function useResizeObserver(ref) {
|
|
10
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
11
|
+
callback: null,
|
|
12
|
+
throttleInterval: 0
|
|
13
|
+
};
|
|
14
|
+
var callback = options.callback,
|
|
15
|
+
throttleInterval = options.throttleInterval;
|
|
10
16
|
var _useState = useState(0),
|
|
11
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
12
18
|
width = _useState2[0],
|
|
@@ -15,14 +21,8 @@ export var useResizeObserver = function useResizeObserver(ref, callback) {
|
|
|
15
21
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
16
22
|
height = _useState4[0],
|
|
17
23
|
setHeight = _useState4[1];
|
|
24
|
+
var throttleTimeout = useRef(null);
|
|
18
25
|
var entriesToHandle = useRef(null);
|
|
19
|
-
var cb = useRef(callback);
|
|
20
|
-
useEffect(function () {
|
|
21
|
-
// ref for callback removes it as dependency fro useLayoutEffect
|
|
22
|
-
// This significantly reduces repeated calls if a function is redefined on every
|
|
23
|
-
// render
|
|
24
|
-
cb.current = callback;
|
|
25
|
-
}, [callback]);
|
|
26
26
|
useLayoutEffect(function () {
|
|
27
27
|
if (!(ref !== null && ref !== void 0 && ref.current)) {
|
|
28
28
|
return;
|
|
@@ -34,15 +34,29 @@ export var useResizeObserver = function useResizeObserver(ref, callback) {
|
|
|
34
34
|
var entry = entriesToHandle.current[0];
|
|
35
35
|
setWidth(entry.contentRect.width);
|
|
36
36
|
setHeight(entry.contentRect.height);
|
|
37
|
-
|
|
37
|
+
throttleTimeout.current = null;
|
|
38
|
+
callback && callback(entry.contentRect);
|
|
38
39
|
};
|
|
39
40
|
var observer = new ResizeObserver(function (entries) {
|
|
40
41
|
// always update entriesToHandle
|
|
41
42
|
entriesToHandle.current = entries;
|
|
42
|
-
|
|
43
|
-
//
|
|
43
|
+
if (throttleInterval) {
|
|
44
|
+
// if a throttleInterval check for running timeout
|
|
45
|
+
if (throttleTimeout.current === null) {
|
|
46
|
+
// no live timeout set entries to handle and move on
|
|
47
|
+
|
|
48
|
+
// set up throttle
|
|
49
|
+
throttleTimeout.current = setTimeout(function () {
|
|
50
|
+
// do callbacks
|
|
51
|
+
doCallbacks();
|
|
52
|
+
// reset throttle
|
|
53
|
+
throttleTimeout.current = null;
|
|
54
|
+
}, throttleInterval);
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
// no throttle do callbacks every time
|
|
44
58
|
doCallbacks();
|
|
45
|
-
}
|
|
59
|
+
}
|
|
46
60
|
});
|
|
47
61
|
|
|
48
62
|
// observe all refs passed
|
|
@@ -52,7 +66,7 @@ export var useResizeObserver = function useResizeObserver(ref, callback) {
|
|
|
52
66
|
observer = null;
|
|
53
67
|
};
|
|
54
68
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
|
-
}, [ref]);
|
|
69
|
+
}, [ref, options]);
|
|
56
70
|
return {
|
|
57
71
|
width: width,
|
|
58
72
|
height: height
|
|
@@ -76,15 +76,7 @@ var defaults = {
|
|
|
76
76
|
'a-new-feature': false,
|
|
77
77
|
'default-portal-target-body': true,
|
|
78
78
|
'Datagrid.useInfiniteScroll': false,
|
|
79
|
-
'Datagrid.useInlineEdit': false
|
|
80
|
-
'Datagrid.useEditableCell': false,
|
|
81
|
-
'Datagrid.useExpandedRow': false,
|
|
82
|
-
'Datagrid.useNestedRows': false,
|
|
83
|
-
'Datagrid.useActionsColumn': false,
|
|
84
|
-
'Datagrid.useFiltering': false,
|
|
85
|
-
'Datagrid.useCustomizeColumns': false,
|
|
86
|
-
'ExampleComponent.secondaryIcon': false,
|
|
87
|
-
'ExampleComponent.useExample': false
|
|
79
|
+
'Datagrid.useInlineEdit': false
|
|
88
80
|
}
|
|
89
81
|
};
|
|
90
82
|
var warningMessageComponent = function warningMessageComponent(property) {
|
|
@@ -131,11 +123,6 @@ var component = new Proxy(_objectSpread({}, defaults.component), {
|
|
|
131
123
|
});
|
|
132
124
|
var feature = new Proxy(_objectSpread({}, defaults.feature), {
|
|
133
125
|
set: function set(target, property, value) {
|
|
134
|
-
// If we receive a feature flag that doesn't exist in our defaults we should not log
|
|
135
|
-
// a warning message and instead just return
|
|
136
|
-
if (!Object.getOwnPropertyDescriptor(defaults.feature, property)) {
|
|
137
|
-
return true;
|
|
138
|
-
}
|
|
139
126
|
if (target[property] !== true && !silent && value) {
|
|
140
127
|
// not already true, not silent, and now true
|
|
141
128
|
console.warn(warningMessageFeature(property));
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _toArray from "@babel/runtime/helpers/toArray";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
1
|
//
|
|
4
2
|
// Copyright IBM Corp. 2021, 2021
|
|
5
3
|
//
|
|
@@ -12,7 +10,6 @@ import PropTypes from 'prop-types';
|
|
|
12
10
|
import { sanitize } from '@storybook/csf';
|
|
13
11
|
import pkg from '../package-settings';
|
|
14
12
|
import { getPathForComponent } from '../../../../../core/story-structure';
|
|
15
|
-
import { paramCase } from 'change-case';
|
|
16
13
|
|
|
17
14
|
/**
|
|
18
15
|
* A helper function to return the structured story title for a component.
|
|
@@ -67,14 +64,12 @@ export var prepareStory = function prepareStory(template, options) {
|
|
|
67
64
|
* The link URL is based on the example directory name and the standard codesandbox URL for package examples.
|
|
68
65
|
*/
|
|
69
66
|
var packagePath = 'github/carbon-design-system/ibm-products/tree/main/examples/carbon-for-ibm-products';
|
|
70
|
-
export var codeSandboxHref = function codeSandboxHref(exampleDirectory) {
|
|
71
|
-
return "https://codesandbox.io/p/sandbox/".concat(packagePath, "/").concat(exampleDirectory, "?file=%2Fsrc%2FExample%2FExample.jsx");
|
|
72
|
-
};
|
|
73
67
|
export var CodesandboxLink = function CodesandboxLink(_ref) {
|
|
74
68
|
var exampleDirectory = _ref.exampleDirectory;
|
|
75
|
-
|
|
69
|
+
// const stackblitz = `https://stackblitz.com/${packagePath}/${dir}?file=src%2FExample%2FExample.jsx`;
|
|
70
|
+
var codesandbox = "https://codesandbox.io/p/sandbox/".concat(packagePath, "/").concat(exampleDirectory, "?file=%2Fsrc%2FExample%2FExample.jsx");
|
|
76
71
|
return /*#__PURE__*/React.createElement("a", {
|
|
77
|
-
href:
|
|
72
|
+
href: codesandbox
|
|
78
73
|
}, /*#__PURE__*/React.createElement("img", {
|
|
79
74
|
alt: "Edit on CodeSandbox",
|
|
80
75
|
src: "https://codesandbox.io/static/img/play-codesandbox.svg"
|
|
@@ -86,14 +81,11 @@ CodesandboxLink.propTypes = {
|
|
|
86
81
|
*/
|
|
87
82
|
exampleDirectory: PropTypes.string
|
|
88
83
|
};
|
|
89
|
-
export var stackblitzHref = function stackblitzHref(exampleDirectory) {
|
|
90
|
-
return "https://stackblitz.com/".concat(packagePath, "/").concat(exampleDirectory, "?file=src%2FExample%2FExample.jsx");
|
|
91
|
-
};
|
|
92
84
|
export var StackblitzLink = function StackblitzLink(_ref2) {
|
|
93
85
|
var exampleDirectory = _ref2.exampleDirectory;
|
|
94
|
-
var
|
|
86
|
+
var stackblitz = "https://stackblitz.com/".concat(packagePath, "/").concat(exampleDirectory, "?file=src%2FExample%2FExample.jsx");
|
|
95
87
|
return /*#__PURE__*/React.createElement("a", {
|
|
96
|
-
href:
|
|
88
|
+
href: stackblitz
|
|
97
89
|
}, /*#__PURE__*/React.createElement("img", {
|
|
98
90
|
alt: "Edit on Stackblitz",
|
|
99
91
|
src: "https://c.staticblitz.com/assets/favicon_sb-861fe1b85c0dc928750c62de15fed96fc75e57ee366bd937bad17a3938917b3f.svg"
|
|
@@ -105,106 +97,12 @@ StackblitzLink.propTypes = {
|
|
|
105
97
|
*/
|
|
106
98
|
exampleDirectory: PropTypes.string
|
|
107
99
|
};
|
|
108
|
-
export var palUsageHref = function palUsageHref(csfFile) {
|
|
109
|
-
var _csfFile$meta;
|
|
110
|
-
var title = csfFile === null || csfFile === void 0 ? void 0 : (_csfFile$meta = csfFile.meta) === null || _csfFile$meta === void 0 ? void 0 : _csfFile$meta.title;
|
|
111
|
-
var _title$split = title.split('/'),
|
|
112
|
-
_title$split2 = _slicedToArray(_title$split, 3),
|
|
113
|
-
_pkg = _title$split2[0],
|
|
114
|
-
kind = _title$split2[1],
|
|
115
|
-
section = _title$split2[2];
|
|
116
|
-
if (/components|patterns/i.test(kind) && name) {
|
|
117
|
-
return "https://pages.github.ibm.com/cdai-design/pal/".concat(kind, "s/").concat(paramCase(section), "/usage");
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
export var storyDocsPageTitle = function storyDocsPageTitle(csfFile) {
|
|
121
|
-
var _csfFile$meta2;
|
|
122
|
-
var title = csfFile === null || csfFile === void 0 ? void 0 : (_csfFile$meta2 = csfFile.meta) === null || _csfFile$meta2 === void 0 ? void 0 : _csfFile$meta2.title;
|
|
123
|
-
var _title$split3 = title.split('/'),
|
|
124
|
-
_title$split4 = _toArray(_title$split3),
|
|
125
|
-
_pkg = _title$split4[0],
|
|
126
|
-
kind = _title$split4[1],
|
|
127
|
-
a = _title$split4[2],
|
|
128
|
-
b = _title$split4[3],
|
|
129
|
-
rest = _title$split4.slice(4);
|
|
130
|
-
var component;
|
|
131
|
-
if (/components|patterns/i.test(kind)) {
|
|
132
|
-
// components and patterns have an additional level
|
|
133
|
-
component = b;
|
|
134
|
-
} else {
|
|
135
|
-
component = a;
|
|
136
|
-
}
|
|
137
|
-
var name = component.split('#')[0]; // canary always written as Example#canary};
|
|
138
|
-
|
|
139
|
-
if (name) {
|
|
140
|
-
if (rest.length > 0) {
|
|
141
|
-
return "".concat(name, " (").concat(rest.join(' '), ")");
|
|
142
|
-
} else {
|
|
143
|
-
return name;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
console.error('Error: unable to parse title from metadata.');
|
|
147
|
-
return title;
|
|
148
|
-
};
|
|
149
|
-
export var storyDocsPageInfo = function storyDocsPageInfo(csfFile) {
|
|
150
|
-
var _csfFile$meta3;
|
|
151
|
-
var title = csfFile === null || csfFile === void 0 ? void 0 : (_csfFile$meta3 = csfFile.meta) === null || _csfFile$meta3 === void 0 ? void 0 : _csfFile$meta3.title;
|
|
152
|
-
var _title$split5 = title.split('/'),
|
|
153
|
-
_title$split6 = _toArray(_title$split5),
|
|
154
|
-
pkg = _title$split6[0],
|
|
155
|
-
kind = _title$split6[1],
|
|
156
|
-
a = _title$split6[2],
|
|
157
|
-
b = _title$split6[3],
|
|
158
|
-
rest = _title$split6.slice(4);
|
|
159
|
-
var result = {
|
|
160
|
-
package: pkg,
|
|
161
|
-
kind: kind,
|
|
162
|
-
expectCodedExample: false
|
|
163
|
-
};
|
|
164
|
-
var component;
|
|
165
|
-
if (/components|patterns/i.test(kind)) {
|
|
166
|
-
result.expectCodedExample = true;
|
|
167
|
-
// components and patterns have an additional level
|
|
168
|
-
component = b;
|
|
169
|
-
result.section = a;
|
|
170
|
-
result.guidelinesHref = "https://pages.github.ibm.com/cdai-design/pal/".concat(kind, "s/").concat(paramCase(result.section), "/usage");
|
|
171
|
-
} else {
|
|
172
|
-
component = a;
|
|
173
|
-
}
|
|
174
|
-
var nameSplit = component.split('#'); // canary always written as Example#canary};
|
|
175
|
-
var name = nameSplit[0];
|
|
176
|
-
if (nameSplit.length > 1 && nameSplit[1] === 'canary') {
|
|
177
|
-
result.canary = true;
|
|
178
|
-
}
|
|
179
|
-
if (name) {
|
|
180
|
-
if (rest.length > 0) {
|
|
181
|
-
result.component = result.title = "".concat(name, " (").concat(rest.join(' '), ")");
|
|
182
|
-
} else {
|
|
183
|
-
result.component = name;
|
|
184
|
-
result.title = name;
|
|
185
|
-
}
|
|
186
|
-
} else {
|
|
187
|
-
console.error('Error: unable to parse title from metadata.');
|
|
188
|
-
result.title = title;
|
|
189
|
-
}
|
|
190
|
-
if (result.guidelinesHref) {
|
|
191
|
-
result.guidelinesLinkLabel = "".concat(result.title, " usage guidelines");
|
|
192
|
-
}
|
|
193
|
-
return result;
|
|
194
|
-
};
|
|
195
|
-
export var storyDocsGuidelines = function storyDocsGuidelines(csfFile) {
|
|
196
|
-
var storyInfo = storyDocsPageInfo(csfFile);
|
|
197
|
-
return {
|
|
198
|
-
href: storyInfo.guidelinesHref,
|
|
199
|
-
label: storyInfo.guidelinesLinkLabel
|
|
200
|
-
};
|
|
201
|
-
};
|
|
202
100
|
|
|
203
101
|
/**
|
|
204
102
|
* A helper function that finds the designated theme on the Storybook canvas.
|
|
205
103
|
* @returns "dark" or "light"
|
|
206
104
|
*/
|
|
207
105
|
export var getSelectedCarbonTheme = function getSelectedCarbonTheme() {
|
|
208
|
-
var themeId = document.querySelector('
|
|
106
|
+
var themeId = document.querySelector('html').getAttribute('storybook-carbon-theme');
|
|
209
107
|
return themeId === 'g90' || themeId === 'g100' ? 'dark' : 'light';
|
|
210
108
|
};
|
|
@@ -39,7 +39,7 @@ var componentName = 'AboutModal';
|
|
|
39
39
|
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* The
|
|
42
|
+
* The AboutModal component provides a way to communicate product information
|
|
43
43
|
* to users. It is triggered by a user’s action, appears on top of the main
|
|
44
44
|
* page content, and is persistent until dismissed. The purpose of this modal
|
|
45
45
|
* should be immediately apparent to the user, with a clear and obvious path
|
|
@@ -81,7 +81,9 @@ var AboutModal = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
81
81
|
}, [bodyRef]);
|
|
82
82
|
|
|
83
83
|
// Detect resize of the ModalBody to recalculate whether scrolling is enabled
|
|
84
|
-
(0, _useResizeObserver.useResizeObserver)(bodyRef,
|
|
84
|
+
(0, _useResizeObserver.useResizeObserver)(bodyRef, {
|
|
85
|
+
callback: handleResize
|
|
86
|
+
});
|
|
85
87
|
return /*#__PURE__*/_react.default.createElement(_react2.ComposedModal, (0, _extends2.default)({}, rest, {
|
|
86
88
|
className: (0, _classnames.default)(blockClass,
|
|
87
89
|
// Apply the block class to the main HTML element
|
|
@@ -192,8 +192,12 @@ var ActionBar = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
192
192
|
};
|
|
193
193
|
|
|
194
194
|
// // resize of the items
|
|
195
|
-
(0, _useResizeObserver.useResizeObserver)(sizingRef,
|
|
196
|
-
|
|
195
|
+
(0, _useResizeObserver.useResizeObserver)(sizingRef, {
|
|
196
|
+
callback: handleResize
|
|
197
|
+
});
|
|
198
|
+
(0, _useResizeObserver.useResizeObserver)(localRef, {
|
|
199
|
+
callback: handleResize
|
|
200
|
+
});
|
|
197
201
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
|
|
198
202
|
className: (0, _classnames.default)([blockClass, className]),
|
|
199
203
|
ref: localRef
|
|
@@ -14,15 +14,16 @@ var _UserProfileImage = require("../UserProfileImage");
|
|
|
14
14
|
var componentName = 'AddSelectFormControl';
|
|
15
15
|
var blockClass = "".concat(_settings.pkg.prefix, "--add-select__selections");
|
|
16
16
|
var AddSelectFormControl = function AddSelectFormControl(_ref) {
|
|
17
|
+
var _controlProps;
|
|
17
18
|
var item = _ref.item,
|
|
18
19
|
onClick = _ref.onClick,
|
|
19
20
|
selected = _ref.selected,
|
|
20
21
|
type = _ref.type;
|
|
21
|
-
var controlProps = (
|
|
22
|
+
var controlProps = (_controlProps = {
|
|
22
23
|
onClick: onClick,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, "aria-
|
|
24
|
+
id: item.id,
|
|
25
|
+
className: "".concat(blockClass, "-form-control-wrapper")
|
|
26
|
+
}, (0, _defineProperty2.default)(_controlProps, "aria-label", item.title), (0, _defineProperty2.default)(_controlProps, "size", 20), _controlProps);
|
|
26
27
|
var getCheckbox = function getCheckbox() {
|
|
27
28
|
if (selected) {
|
|
28
29
|
return /*#__PURE__*/_react.default.createElement(_icons.CheckboxCheckedFilled, controlProps);
|
|
@@ -74,8 +75,7 @@ var AddSelectFormControl = function AddSelectFormControl(_ref) {
|
|
|
74
75
|
}, getItemIcon(item)), /*#__PURE__*/_react.default.createElement("div", {
|
|
75
76
|
className: "".concat(blockClass, "-form-control-label-text")
|
|
76
77
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
77
|
-
className: "".concat(blockClass, "-cell-title")
|
|
78
|
-
id: "control-label-".concat(item.id)
|
|
78
|
+
className: "".concat(blockClass, "-cell-title")
|
|
79
79
|
}, item.title), item.subtitle && /*#__PURE__*/_react.default.createElement("span", {
|
|
80
80
|
className: "".concat(blockClass, "-cell-subtitle")
|
|
81
81
|
}, item.subtitle))));
|
|
@@ -47,7 +47,6 @@ var AddSelectRow = function AddSelectRow(_ref) {
|
|
|
47
47
|
setMultiSelection = _ref.setMultiSelection,
|
|
48
48
|
setParentSelected = _ref.setParentSelected,
|
|
49
49
|
setSingleSelection = _ref.setSingleSelection,
|
|
50
|
-
setSize = _ref.setSize,
|
|
51
50
|
singleSelection = _ref.singleSelection;
|
|
52
51
|
var ref = (0, _react.useRef)(null);
|
|
53
52
|
(0, _react.useEffect)(function () {
|
|
@@ -130,20 +129,14 @@ var AddSelectRow = function AddSelectRow(_ref) {
|
|
|
130
129
|
var hasModifiers = (modifiers === null || modifiers === void 0 ? void 0 : (_modifiers$options = modifiers.options) === null || _modifiers$options === void 0 ? void 0 : _modifiers$options.length) > 0;
|
|
131
130
|
var tabIndex = getTabIndex();
|
|
132
131
|
var selected = isSelected();
|
|
133
|
-
var expanded = parentSelected === item.id;
|
|
134
132
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
135
|
-
className: (0, _classnames.default)("".concat(blockClass, "-row"), (_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "-row--selected"), isSelected()), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "-row-meta--selected"), isInMetaPanel(item.id)), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "-row--active"),
|
|
133
|
+
className: (0, _classnames.default)("".concat(blockClass, "-row"), (_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "-row--selected"), isSelected(item.id)), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "-row-meta--selected"), isInMetaPanel(item.id)), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "-row--active"), parentSelected === item.id), _cx)),
|
|
136
134
|
onKeyDown: onSelectKeyDown,
|
|
137
135
|
tabIndex: tabIndex,
|
|
138
136
|
ref: ref,
|
|
139
|
-
role: "row"
|
|
140
|
-
"aria-selected": selected,
|
|
141
|
-
"aria-posinset": index,
|
|
142
|
-
"aria-setsize": setSize,
|
|
143
|
-
"aria-expanded": expanded
|
|
137
|
+
role: "row"
|
|
144
138
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
145
|
-
className: "".concat(blockClass, "-cell")
|
|
146
|
-
role: "gridcell"
|
|
139
|
+
className: "".concat(blockClass, "-cell")
|
|
147
140
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
148
141
|
className: "".concat(blockClass, "-cell-wrapper")
|
|
149
142
|
}, multi ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_AddSelectFormControl.AddSelectFormControl, {
|
|
@@ -156,7 +149,7 @@ var AddSelectRow = function AddSelectRow(_ref) {
|
|
|
156
149
|
type: "inline",
|
|
157
150
|
items: modifiers.options,
|
|
158
151
|
label: modifiers.label,
|
|
159
|
-
disabled: !isSelected(),
|
|
152
|
+
disabled: !isSelected(item.id),
|
|
160
153
|
className: "".concat(blockClass, "-dropdown"),
|
|
161
154
|
initialSelectedItem: item[modifiers.id],
|
|
162
155
|
onChange: function onChange(_ref3) {
|
|
@@ -181,9 +174,7 @@ var AddSelectRow = function AddSelectRow(_ref) {
|
|
|
181
174
|
hasIconOnly: true,
|
|
182
175
|
onClick: onNavigateItem,
|
|
183
176
|
kind: "ghost",
|
|
184
|
-
size: "sm"
|
|
185
|
-
tabIndex: -1,
|
|
186
|
-
"aria-hidden": true
|
|
177
|
+
size: "sm"
|
|
187
178
|
}), item.meta && /*#__PURE__*/_react.default.createElement(_react2.Button, {
|
|
188
179
|
className: "".concat(blockClass, "-view-meta"),
|
|
189
180
|
renderIcon: function renderIcon(props) {
|
|
@@ -221,7 +212,6 @@ AddSelectRow.propTypes = {
|
|
|
221
212
|
setMultiSelection: _propTypes.default.func,
|
|
222
213
|
setParentSelected: _propTypes.default.func,
|
|
223
214
|
setSingleSelection: _propTypes.default.func,
|
|
224
|
-
setSize: _propTypes.default.number,
|
|
225
215
|
singleSelection: _propTypes.default.string
|
|
226
216
|
};
|
|
227
217
|
AddSelectRow.displayName = componentName;
|
|
@@ -167,9 +167,6 @@ var BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
|
|
|
167
167
|
setDisplayedBreadcrumbItems(newDisplayedBreadcrumbItems);
|
|
168
168
|
}, [breadcrumbs, displayCount]);
|
|
169
169
|
var checkFullyVisibleBreadcrumbItems = function checkFullyVisibleBreadcrumbItems() {
|
|
170
|
-
if (!breadcrumbItemWithOverflow.current) {
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
170
|
var displayItemIndex = function displayItemIndex(itemCount, index) {
|
|
174
171
|
// In this data set the overflow measuring item is [0]
|
|
175
172
|
// so the first displayItem in the list is [1]
|
|
@@ -260,9 +257,13 @@ var BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
|
|
|
260
257
|
}
|
|
261
258
|
|
|
262
259
|
// container resize
|
|
263
|
-
(0, _useResizeObserver.useResizeObserver)(sizingContainerRef,
|
|
260
|
+
(0, _useResizeObserver.useResizeObserver)(sizingContainerRef, {
|
|
261
|
+
callback: handleResize
|
|
262
|
+
});
|
|
264
263
|
// item resize
|
|
265
|
-
(0, _useResizeObserver.useResizeObserver)(breadcrumbItemWithOverflow,
|
|
264
|
+
(0, _useResizeObserver.useResizeObserver)(breadcrumbItemWithOverflow, {
|
|
265
|
+
callback: handleResize
|
|
266
|
+
});
|
|
266
267
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
267
268
|
className: (0, _classnames.default)(blockClass, className, (0, _defineProperty2.default)({}, "".concat(blockClass, "__with-items"), displayedBreadcrumbItems.length > 1)),
|
|
268
269
|
ref: breadcrumbItemWithOverflow
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.ButtonMenu = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
10
|
var _react = _interopRequireDefault(require("react"));
|
|
12
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -59,14 +58,15 @@ var ButtonMenu = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
59
58
|
return /*#__PURE__*/_react.default.createElement(_react2.OverflowMenu, (0, _extends2.default)({}, rest, {
|
|
60
59
|
className: (0, _classnames.default)(blockClass,
|
|
61
60
|
// Apply the block class to the main HTML element
|
|
62
|
-
className
|
|
63
|
-
|
|
61
|
+
className // Apply any supplied class names to the main HTML element.
|
|
62
|
+
),
|
|
63
|
+
|
|
64
64
|
"aria-label": menuAriaLabel,
|
|
65
65
|
menuOptionsClass: (0, _classnames.default)("".concat(blockClass, "__options"), menuOptionsClass),
|
|
66
66
|
size: size,
|
|
67
67
|
renderIcon: function renderIcon() {
|
|
68
68
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
69
|
-
className: (0, _classnames.default)("".concat(blockClass, "__trigger"))
|
|
69
|
+
className: (0, _classnames.default)(["".concat(blockClass, "__trigger"), "".concat(carbonPrefix, "--btn"), "".concat(carbonPrefix, "--btn--").concat(kind), "".concat(carbonPrefix, "--btn--").concat(size)])
|
|
70
70
|
}, label, Icon && /*#__PURE__*/_react.default.createElement(Icon, {
|
|
71
71
|
"aria-hidden": "true",
|
|
72
72
|
"aria-label": iconDescription,
|