@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
|
@@ -320,8 +320,12 @@ var PageHeader = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
320
320
|
(0, _PageHeaderUtils.utilSetCollapsed)(collapseHeader, metrics.headerOffset, metrics.headerTopValue);
|
|
321
321
|
}
|
|
322
322
|
}, [collapseHeader, metrics.headerOffset, metrics.headerTopValue]);
|
|
323
|
-
(0, _useResizeObserver.useResizeObserver)(sizingContainerRef,
|
|
324
|
-
|
|
323
|
+
(0, _useResizeObserver.useResizeObserver)(sizingContainerRef, {
|
|
324
|
+
callback: handleResizeActionBarColumn
|
|
325
|
+
});
|
|
326
|
+
(0, _useResizeObserver.useResizeObserver)(headerRef, {
|
|
327
|
+
callback: handleResize
|
|
328
|
+
});
|
|
325
329
|
|
|
326
330
|
// Determine what form of title to display in the breadcrumb
|
|
327
331
|
var breadcrumbItemForTitle = (0, _PageHeaderUtils.utilGetBreadcrumbItemForTitle)(_PageHeaderUtils.blockClass, collapseTitle, title);
|
|
@@ -71,11 +71,11 @@ var utilCheckUpdateVerticalSpace = function utilCheckUpdateVerticalSpace(headerR
|
|
|
71
71
|
var scrollableContainer = (0, _scrollableAncestor.scrollableAncestor)(headerRef.current);
|
|
72
72
|
|
|
73
73
|
/* istanbul ignore next */
|
|
74
|
-
var scrollableContainerTop = scrollableContainer ? scrollableContainer.scrollTop - scrollableContainer.
|
|
74
|
+
var scrollableContainerTop = scrollableContainer ? scrollableContainer.scrollTop - scrollableContainer.offsetTop : 0;
|
|
75
75
|
|
|
76
76
|
// The header offset calculation is either going to work out at 0 if we have no gap between scrolling container
|
|
77
77
|
// top and the measuring ref top, or the difference between. It does not change on scroll or resize.
|
|
78
|
-
update.headerOffset =
|
|
78
|
+
update.headerOffset = scrollableContainerTop + offsetTopMeasuringRef.current.getBoundingClientRect().top;
|
|
79
79
|
|
|
80
80
|
/* istanbul ignore next */
|
|
81
81
|
update.breadcrumbRowHeight = breadcrumbRowEl ? breadcrumbRowEl.clientHeight : 0;
|
|
@@ -29,12 +29,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
29
29
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
30
30
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
31
31
|
var componentName = 'RemoveModal';
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
The `RemoveModal` covers what is known as high impact and medium impact deleting.
|
|
35
|
-
Enabling `textConfirmation` enables what would be considered the high impact state of the modal.
|
|
36
|
-
For additional information on differentiating between delete / remove and low / medium / high impact please refer to the usage guidelines.
|
|
37
|
-
*/
|
|
38
32
|
var RemoveModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
39
33
|
var body = _ref.body,
|
|
40
34
|
className = _ref.className,
|
|
@@ -451,7 +451,9 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
451
451
|
}, title));
|
|
452
452
|
};
|
|
453
453
|
var contentRef = ref || sidePanelRef;
|
|
454
|
-
(0, _useResizeObserver.useResizeObserver)(contentRef,
|
|
454
|
+
(0, _useResizeObserver.useResizeObserver)(contentRef, {
|
|
455
|
+
callback: handleResize
|
|
456
|
+
});
|
|
455
457
|
return /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, null, open && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_framerMotion.motion.div, (0, _extends2.default)({}, (0, _devtools.getDevtoolsProps)(componentName), rest, {
|
|
456
458
|
id: "".concat(blockClass, "-outer"),
|
|
457
459
|
className: mainPanelClassNames,
|
|
@@ -23,10 +23,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
23
23
|
//
|
|
24
24
|
|
|
25
25
|
var componentName = 'SingleAddSelect';
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Used to add or select one or more items from larger lists or hierarchies.
|
|
29
|
-
*/
|
|
30
26
|
var SingleAddSelect = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
31
27
|
// remove multi add select specific props
|
|
32
28
|
var validProps = (0, _propsHelper.prepareProps)(props, ['columnInputPlaceholder', 'globalFilters', 'globalFiltersIconDescription', 'globalFiltersPlaceholderText', 'globalFiltersPrimaryButtonText', 'globalFiltersSecondaryButtonText', 'influencerTitle', 'multi', 'noSelectionDescription', 'noSelectionTitle', 'removeIconDescription']);
|
|
@@ -26,16 +26,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
26
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
27
|
var blockClass = "".concat(_settings.pkg.prefix, "--status-icon");
|
|
28
28
|
var componentName = 'StatusIcon';
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
The `StatusIcon` component follows the Carbon guidelines for status icons with
|
|
32
|
-
some added specifications around illustration usage. For additional usage
|
|
33
|
-
guidelines and documentation please refer to the links above.
|
|
34
|
-
|
|
35
|
-
_Status icons_ are an important method of communicating severity level
|
|
36
|
-
information to users. The shapes and colors, communicate severity that enable
|
|
37
|
-
users to quickly assess and identify status and respond accordingly.
|
|
38
|
-
*/
|
|
39
29
|
var StatusIcon = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
40
30
|
var _icons$kind;
|
|
41
31
|
var kind = _ref.kind,
|
|
@@ -164,8 +164,7 @@ var TagSet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
164
164
|
if (sizingTags.length > 0) {
|
|
165
165
|
var spaceAvailable = tagSetRef.current.offsetWidth;
|
|
166
166
|
for (var i in sizingTags) {
|
|
167
|
-
var
|
|
168
|
-
var tagWidth = ((_sizingTags$i = sizingTags[i]) === null || _sizingTags$i === void 0 ? void 0 : _sizingTags$i.offsetWidth) || 0;
|
|
167
|
+
var tagWidth = sizingTags[i].offsetWidth;
|
|
169
168
|
if (spaceAvailable >= tagWidth) {
|
|
170
169
|
spaceAvailable -= tagWidth;
|
|
171
170
|
willFit += 1;
|
|
@@ -207,8 +206,12 @@ var TagSet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
207
206
|
var handleModalClose = function handleModalClose() {
|
|
208
207
|
setShowAllModalOpen(false);
|
|
209
208
|
};
|
|
210
|
-
(0, _useResizeObserver.useResizeObserver)(sizingContainerRef,
|
|
211
|
-
|
|
209
|
+
(0, _useResizeObserver.useResizeObserver)(sizingContainerRef, {
|
|
210
|
+
callback: handleSizerTagsResize
|
|
211
|
+
});
|
|
212
|
+
(0, _useResizeObserver.useResizeObserver)(tagSetRef, {
|
|
213
|
+
callback: handleResize
|
|
214
|
+
});
|
|
212
215
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
|
|
213
216
|
className: (0, _classnames.default)([blockClass, className]),
|
|
214
217
|
ref: tagSetRef
|
|
@@ -63,13 +63,7 @@ var tearsheetHasCloseIcon = function tearsheetHasCloseIcon(actions, hasCloseIcon
|
|
|
63
63
|
return hasCloseIcon !== null && hasCloseIcon !== void 0 ? hasCloseIcon : tearsheetIsPassive(actions);
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
* TearSheetShell is used internally by TearSheet and TearSheetNarrow
|
|
68
|
-
*
|
|
69
|
-
* The component is not public.
|
|
70
|
-
*
|
|
71
|
-
* See the canvas tab for the component API details.
|
|
72
|
-
* */
|
|
66
|
+
// TearSheetShell is used internally by TearSheet and TearSheetNarrow
|
|
73
67
|
exports.tearsheetHasCloseIcon = tearsheetHasCloseIcon;
|
|
74
68
|
var TearsheetShell = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
75
69
|
var actions = _ref.actions,
|
|
@@ -231,8 +225,7 @@ var TearsheetShell = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
|
|
|
231
225
|
closeModal: onClose,
|
|
232
226
|
iconDescription: closeIconDescription
|
|
233
227
|
}, /*#__PURE__*/_react.default.createElement(_Wrap.Wrap, {
|
|
234
|
-
className: "".concat(bc, "__header-content")
|
|
235
|
-
element: wide ? _react2.Layer : undefined
|
|
228
|
+
className: "".concat(bc, "__header-content")
|
|
236
229
|
}, /*#__PURE__*/_react.default.createElement(_Wrap.Wrap, {
|
|
237
230
|
className: "".concat(bc, "__header-fields")
|
|
238
231
|
}, /*#__PURE__*/_react.default.createElement(_Wrap.Wrap, {
|
|
@@ -257,10 +250,12 @@ var TearsheetShell = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
|
|
|
257
250
|
className: "".concat(bc, "__right")
|
|
258
251
|
}, /*#__PURE__*/_react.default.createElement(_Wrap.Wrap, {
|
|
259
252
|
className: "".concat(bc, "__main"),
|
|
260
|
-
alwaysRender: includeActions
|
|
253
|
+
alwaysRender: includeActions,
|
|
254
|
+
element: wide ? _react2.Layer : undefined
|
|
261
255
|
}, /*#__PURE__*/_react.default.createElement(_Wrap.Wrap, {
|
|
262
256
|
className: "".concat(bc, "__content"),
|
|
263
|
-
alwaysRender: influencer && influencerPosition === 'right'
|
|
257
|
+
alwaysRender: influencer && influencerPosition === 'right',
|
|
258
|
+
element: wide ? _react2.Layer : undefined
|
|
264
259
|
}, children), /*#__PURE__*/_react.default.createElement(_Wrap.Wrap, {
|
|
265
260
|
className: (0, _classnames.default)((_cx6 = {}, (0, _defineProperty2.default)(_cx6, "".concat(bc, "__influencer"), true), (0, _defineProperty2.default)(_cx6, "".concat(bc, "__influencer--wide"), influencerWidth === 'wide'), _cx6)),
|
|
266
261
|
neverRender: influencerPosition !== 'right'
|
|
@@ -15,7 +15,7 @@ require("../../global/js/utils/props-helper");
|
|
|
15
15
|
var _settings = require("../../settings");
|
|
16
16
|
var _icons = require("@carbon/react/icons");
|
|
17
17
|
var _react2 = require("@carbon/react");
|
|
18
|
-
var _excluded = ["backgroundColor", "className", "kind", "icon", "initials", "image", "imageDescription", "size", "theme", "tooltipText"
|
|
18
|
+
var _excluded = ["backgroundColor", "className", "kind", "icon", "initials", "image", "imageDescription", "size", "theme", "tooltipText"];
|
|
19
19
|
/**
|
|
20
20
|
* Copyright IBM Corp. 2021, 2021
|
|
21
21
|
*
|
|
@@ -31,12 +31,8 @@ var componentName = 'UserProfileImage';
|
|
|
31
31
|
|
|
32
32
|
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
|
33
33
|
|
|
34
|
-
// Default values for props
|
|
35
|
-
var defaults = {
|
|
36
|
-
tooltipAlignment: 'bottom'
|
|
37
|
-
};
|
|
38
34
|
/**
|
|
39
|
-
*
|
|
35
|
+
* This is a user profile image component which displays an image, or initials or icon for a user.
|
|
40
36
|
*/
|
|
41
37
|
var UserProfileImage = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
42
38
|
var backgroundColor = _ref.backgroundColor,
|
|
@@ -49,8 +45,6 @@ var UserProfileImage = /*#__PURE__*/_react.default.forwardRef(function (_ref, re
|
|
|
49
45
|
size = _ref.size,
|
|
50
46
|
theme = _ref.theme,
|
|
51
47
|
tooltipText = _ref.tooltipText,
|
|
52
|
-
_ref$tooltipAlignment = _ref.tooltipAlignment,
|
|
53
|
-
tooltipAlignment = _ref$tooltipAlignment === void 0 ? defaults.tooltipAlignment : _ref$tooltipAlignment,
|
|
54
48
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
55
49
|
var icons = {
|
|
56
50
|
user: {
|
|
@@ -130,8 +124,7 @@ var UserProfileImage = /*#__PURE__*/_react.default.forwardRef(function (_ref, re
|
|
|
130
124
|
return FillItem && (tooltipText ? /*#__PURE__*/_react.default.createElement(_react2.IconButton, {
|
|
131
125
|
label: tooltipText,
|
|
132
126
|
className: "".concat(blockClass, "__tooltip"),
|
|
133
|
-
kind: "ghost"
|
|
134
|
-
align: tooltipAlignment
|
|
127
|
+
kind: "ghost"
|
|
135
128
|
}, renderUserProfileImage()) : renderUserProfileImage());
|
|
136
129
|
});
|
|
137
130
|
|
|
@@ -180,10 +173,6 @@ UserProfileImage.propTypes = {
|
|
|
180
173
|
* Set theme in which the component will be rendered
|
|
181
174
|
*/
|
|
182
175
|
theme: _propTypes.default.oneOf(['light', 'dark']).isRequired,
|
|
183
|
-
/**
|
|
184
|
-
* Specify how the trigger should align with the tooltip
|
|
185
|
-
*/
|
|
186
|
-
tooltipAlignment: _propTypes.default.oneOf(['top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right', 'left', 'right']),
|
|
187
176
|
/**
|
|
188
177
|
* Pass in the display name to have it shown on hover
|
|
189
178
|
*/
|
|
@@ -45,10 +45,6 @@ var defaults = {
|
|
|
45
45
|
documentationLinksIconDescription: 'Show documentation links',
|
|
46
46
|
isInitiallyOpen: false
|
|
47
47
|
};
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* 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.
|
|
51
|
-
*/
|
|
52
48
|
var WebTerminal = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
53
49
|
var _ref3;
|
|
54
50
|
var _ref$actions = _ref.actions,
|
|
@@ -37,20 +37,6 @@ var useCreateComponentStepChange = function useCreateComponentStepChange(_ref) {
|
|
|
37
37
|
componentBlockClass = _ref.componentBlockClass,
|
|
38
38
|
setCreateComponentActions = _ref.setCreateComponentActions,
|
|
39
39
|
setModalIsOpen = _ref.setModalIsOpen;
|
|
40
|
-
var continueToNextStep = (0, _react.useCallback)(function () {
|
|
41
|
-
setIsSubmitting(false);
|
|
42
|
-
setCurrentStep(function (prev) {
|
|
43
|
-
// Find next included step to render
|
|
44
|
-
// There will always be a next step otherwise we will
|
|
45
|
-
// have reach the onSubmit
|
|
46
|
-
do {
|
|
47
|
-
var _stepData;
|
|
48
|
-
prev++;
|
|
49
|
-
} while (!((_stepData = stepData[prev - 1]) !== null && _stepData !== void 0 && _stepData.shouldIncludeStep));
|
|
50
|
-
return prev;
|
|
51
|
-
});
|
|
52
|
-
}, [setCurrentStep, setIsSubmitting, stepData]);
|
|
53
|
-
|
|
54
40
|
// useEffect to handle multi step logic
|
|
55
41
|
(0, _react.useEffect)(function () {
|
|
56
42
|
var onUnmount = function onUnmount() {
|
|
@@ -178,9 +164,9 @@ var useCreateComponentStepChange = function useCreateComponentStepChange(_ref) {
|
|
|
178
164
|
// There will always be a previous step otherwise we will
|
|
179
165
|
// have disabled the back button since we have reached the first visible step
|
|
180
166
|
do {
|
|
181
|
-
var
|
|
167
|
+
var _stepData;
|
|
182
168
|
prev--;
|
|
183
|
-
} while (!((
|
|
169
|
+
} while (!((_stepData = stepData[prev - 1]) !== null && _stepData !== void 0 && _stepData.shouldIncludeStep));
|
|
184
170
|
return prev;
|
|
185
171
|
});
|
|
186
172
|
},
|
|
@@ -208,5 +194,18 @@ var useCreateComponentStepChange = function useCreateComponentStepChange(_ref) {
|
|
|
208
194
|
setCreateComponentActions(buttons);
|
|
209
195
|
}
|
|
210
196
|
}, [firstIncludedStep, lastIncludedStep, stepData, onNext, isSubmitDisabled, backButtonText, cancelButtonText, currentStep, onClose, nextButtonText, submitButtonText, onRequestSubmit, isSubmitting, shouldViewAll, componentBlockClass, componentName, continueToNextStep, setCurrentStep, setCreateComponentActions, setIsSubmitting, setShouldViewAll, setModalIsOpen]);
|
|
197
|
+
var continueToNextStep = (0, _react.useCallback)(function () {
|
|
198
|
+
setIsSubmitting(false);
|
|
199
|
+
setCurrentStep(function (prev) {
|
|
200
|
+
// Find next included step to render
|
|
201
|
+
// There will always be a next step otherwise we will
|
|
202
|
+
// have reach the onSubmit
|
|
203
|
+
do {
|
|
204
|
+
var _stepData2;
|
|
205
|
+
prev++;
|
|
206
|
+
} while (!((_stepData2 = stepData[prev - 1]) !== null && _stepData2 !== void 0 && _stepData2.shouldIncludeStep));
|
|
207
|
+
return prev;
|
|
208
|
+
});
|
|
209
|
+
}, [setCurrentStep, setIsSubmitting, stepData]);
|
|
211
210
|
};
|
|
212
211
|
exports.useCreateComponentStepChange = useCreateComponentStepChange;
|
|
@@ -14,7 +14,13 @@ var _react = require("react");
|
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
var useResizeObserver = function useResizeObserver(ref
|
|
17
|
+
var useResizeObserver = function useResizeObserver(ref) {
|
|
18
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
19
|
+
callback: null,
|
|
20
|
+
throttleInterval: 0
|
|
21
|
+
};
|
|
22
|
+
var callback = options.callback,
|
|
23
|
+
throttleInterval = options.throttleInterval;
|
|
18
24
|
var _useState = (0, _react.useState)(0),
|
|
19
25
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
20
26
|
width = _useState2[0],
|
|
@@ -23,14 +29,8 @@ var useResizeObserver = function useResizeObserver(ref, callback) {
|
|
|
23
29
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
24
30
|
height = _useState4[0],
|
|
25
31
|
setHeight = _useState4[1];
|
|
32
|
+
var throttleTimeout = (0, _react.useRef)(null);
|
|
26
33
|
var entriesToHandle = (0, _react.useRef)(null);
|
|
27
|
-
var cb = (0, _react.useRef)(callback);
|
|
28
|
-
(0, _react.useEffect)(function () {
|
|
29
|
-
// ref for callback removes it as dependency fro useLayoutEffect
|
|
30
|
-
// This significantly reduces repeated calls if a function is redefined on every
|
|
31
|
-
// render
|
|
32
|
-
cb.current = callback;
|
|
33
|
-
}, [callback]);
|
|
34
34
|
(0, _react.useLayoutEffect)(function () {
|
|
35
35
|
if (!(ref !== null && ref !== void 0 && ref.current)) {
|
|
36
36
|
return;
|
|
@@ -42,15 +42,29 @@ var useResizeObserver = function useResizeObserver(ref, callback) {
|
|
|
42
42
|
var entry = entriesToHandle.current[0];
|
|
43
43
|
setWidth(entry.contentRect.width);
|
|
44
44
|
setHeight(entry.contentRect.height);
|
|
45
|
-
|
|
45
|
+
throttleTimeout.current = null;
|
|
46
|
+
callback && callback(entry.contentRect);
|
|
46
47
|
};
|
|
47
48
|
var observer = new ResizeObserver(function (entries) {
|
|
48
49
|
// always update entriesToHandle
|
|
49
50
|
entriesToHandle.current = entries;
|
|
50
|
-
|
|
51
|
-
//
|
|
51
|
+
if (throttleInterval) {
|
|
52
|
+
// if a throttleInterval check for running timeout
|
|
53
|
+
if (throttleTimeout.current === null) {
|
|
54
|
+
// no live timeout set entries to handle and move on
|
|
55
|
+
|
|
56
|
+
// set up throttle
|
|
57
|
+
throttleTimeout.current = setTimeout(function () {
|
|
58
|
+
// do callbacks
|
|
59
|
+
doCallbacks();
|
|
60
|
+
// reset throttle
|
|
61
|
+
throttleTimeout.current = null;
|
|
62
|
+
}, throttleInterval);
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
// no throttle do callbacks every time
|
|
52
66
|
doCallbacks();
|
|
53
|
-
}
|
|
67
|
+
}
|
|
54
68
|
});
|
|
55
69
|
|
|
56
70
|
// observe all refs passed
|
|
@@ -60,7 +74,7 @@ var useResizeObserver = function useResizeObserver(ref, callback) {
|
|
|
60
74
|
observer = null;
|
|
61
75
|
};
|
|
62
76
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
63
|
-
}, [ref]);
|
|
77
|
+
}, [ref, options]);
|
|
64
78
|
return {
|
|
65
79
|
width: width,
|
|
66
80
|
height: height
|
|
@@ -81,15 +81,7 @@ var defaults = {
|
|
|
81
81
|
'a-new-feature': false,
|
|
82
82
|
'default-portal-target-body': true,
|
|
83
83
|
'Datagrid.useInfiniteScroll': false,
|
|
84
|
-
'Datagrid.useInlineEdit': false
|
|
85
|
-
'Datagrid.useEditableCell': false,
|
|
86
|
-
'Datagrid.useExpandedRow': false,
|
|
87
|
-
'Datagrid.useNestedRows': false,
|
|
88
|
-
'Datagrid.useActionsColumn': false,
|
|
89
|
-
'Datagrid.useFiltering': false,
|
|
90
|
-
'Datagrid.useCustomizeColumns': false,
|
|
91
|
-
'ExampleComponent.secondaryIcon': false,
|
|
92
|
-
'ExampleComponent.useExample': false
|
|
84
|
+
'Datagrid.useInlineEdit': false
|
|
93
85
|
}
|
|
94
86
|
};
|
|
95
87
|
var warningMessageComponent = function warningMessageComponent(property) {
|
|
@@ -136,11 +128,6 @@ var component = new Proxy(_objectSpread({}, defaults.component), {
|
|
|
136
128
|
});
|
|
137
129
|
var feature = new Proxy(_objectSpread({}, defaults.feature), {
|
|
138
130
|
set: function set(target, property, value) {
|
|
139
|
-
// If we receive a feature flag that doesn't exist in our defaults we should not log
|
|
140
|
-
// a warning message and instead just return
|
|
141
|
-
if (!Object.getOwnPropertyDescriptor(defaults.feature, property)) {
|
|
142
|
-
return true;
|
|
143
|
-
}
|
|
144
131
|
if (target[property] !== true && !silent && value) {
|
|
145
132
|
// not already true, not silent, and now true
|
|
146
133
|
console.warn(warningMessageFeature(property));
|
|
@@ -4,15 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
7
|
+
exports.prepareStory = exports.getStoryTitle = exports.getStoryId = exports.getSelectedCarbonTheme = exports.StackblitzLink = exports.CodesandboxLink = void 0;
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
10
|
var _csf = require("@storybook/csf");
|
|
13
11
|
var _packageSettings = _interopRequireDefault(require("../package-settings"));
|
|
14
12
|
var _storyStructure = require("../../../../../core/story-structure");
|
|
15
|
-
var _changeCase = require("change-case");
|
|
16
13
|
//
|
|
17
14
|
// Copyright IBM Corp. 2021, 2021
|
|
18
15
|
//
|
|
@@ -76,15 +73,12 @@ var prepareStory = function prepareStory(template, options) {
|
|
|
76
73
|
*/
|
|
77
74
|
exports.prepareStory = prepareStory;
|
|
78
75
|
var packagePath = 'github/carbon-design-system/ibm-products/tree/main/examples/carbon-for-ibm-products';
|
|
79
|
-
var codeSandboxHref = function codeSandboxHref(exampleDirectory) {
|
|
80
|
-
return "https://codesandbox.io/p/sandbox/".concat(packagePath, "/").concat(exampleDirectory, "?file=%2Fsrc%2FExample%2FExample.jsx");
|
|
81
|
-
};
|
|
82
|
-
exports.codeSandboxHref = codeSandboxHref;
|
|
83
76
|
var CodesandboxLink = function CodesandboxLink(_ref) {
|
|
84
77
|
var exampleDirectory = _ref.exampleDirectory;
|
|
85
|
-
|
|
78
|
+
// const stackblitz = `https://stackblitz.com/${packagePath}/${dir}?file=src%2FExample%2FExample.jsx`;
|
|
79
|
+
var codesandbox = "https://codesandbox.io/p/sandbox/".concat(packagePath, "/").concat(exampleDirectory, "?file=%2Fsrc%2FExample%2FExample.jsx");
|
|
86
80
|
return /*#__PURE__*/_react.default.createElement("a", {
|
|
87
|
-
href:
|
|
81
|
+
href: codesandbox
|
|
88
82
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
89
83
|
alt: "Edit on CodeSandbox",
|
|
90
84
|
src: "https://codesandbox.io/static/img/play-codesandbox.svg"
|
|
@@ -97,15 +91,11 @@ CodesandboxLink.propTypes = {
|
|
|
97
91
|
*/
|
|
98
92
|
exampleDirectory: _propTypes.default.string
|
|
99
93
|
};
|
|
100
|
-
var stackblitzHref = function stackblitzHref(exampleDirectory) {
|
|
101
|
-
return "https://stackblitz.com/".concat(packagePath, "/").concat(exampleDirectory, "?file=src%2FExample%2FExample.jsx");
|
|
102
|
-
};
|
|
103
|
-
exports.stackblitzHref = stackblitzHref;
|
|
104
94
|
var StackblitzLink = function StackblitzLink(_ref2) {
|
|
105
95
|
var exampleDirectory = _ref2.exampleDirectory;
|
|
106
|
-
var
|
|
96
|
+
var stackblitz = "https://stackblitz.com/".concat(packagePath, "/").concat(exampleDirectory, "?file=src%2FExample%2FExample.jsx");
|
|
107
97
|
return /*#__PURE__*/_react.default.createElement("a", {
|
|
108
|
-
href:
|
|
98
|
+
href: stackblitz
|
|
109
99
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
110
100
|
alt: "Edit on Stackblitz",
|
|
111
101
|
src: "https://c.staticblitz.com/assets/favicon_sb-861fe1b85c0dc928750c62de15fed96fc75e57ee366bd937bad17a3938917b3f.svg"
|
|
@@ -118,111 +108,13 @@ StackblitzLink.propTypes = {
|
|
|
118
108
|
*/
|
|
119
109
|
exampleDirectory: _propTypes.default.string
|
|
120
110
|
};
|
|
121
|
-
var palUsageHref = function palUsageHref(csfFile) {
|
|
122
|
-
var _csfFile$meta;
|
|
123
|
-
var title = csfFile === null || csfFile === void 0 ? void 0 : (_csfFile$meta = csfFile.meta) === null || _csfFile$meta === void 0 ? void 0 : _csfFile$meta.title;
|
|
124
|
-
var _title$split = title.split('/'),
|
|
125
|
-
_title$split2 = (0, _slicedToArray2.default)(_title$split, 3),
|
|
126
|
-
_pkg = _title$split2[0],
|
|
127
|
-
kind = _title$split2[1],
|
|
128
|
-
section = _title$split2[2];
|
|
129
|
-
if (/components|patterns/i.test(kind) && name) {
|
|
130
|
-
return "https://pages.github.ibm.com/cdai-design/pal/".concat(kind, "s/").concat((0, _changeCase.paramCase)(section), "/usage");
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
exports.palUsageHref = palUsageHref;
|
|
134
|
-
var storyDocsPageTitle = function storyDocsPageTitle(csfFile) {
|
|
135
|
-
var _csfFile$meta2;
|
|
136
|
-
var title = csfFile === null || csfFile === void 0 ? void 0 : (_csfFile$meta2 = csfFile.meta) === null || _csfFile$meta2 === void 0 ? void 0 : _csfFile$meta2.title;
|
|
137
|
-
var _title$split3 = title.split('/'),
|
|
138
|
-
_title$split4 = (0, _toArray2.default)(_title$split3),
|
|
139
|
-
_pkg = _title$split4[0],
|
|
140
|
-
kind = _title$split4[1],
|
|
141
|
-
a = _title$split4[2],
|
|
142
|
-
b = _title$split4[3],
|
|
143
|
-
rest = _title$split4.slice(4);
|
|
144
|
-
var component;
|
|
145
|
-
if (/components|patterns/i.test(kind)) {
|
|
146
|
-
// components and patterns have an additional level
|
|
147
|
-
component = b;
|
|
148
|
-
} else {
|
|
149
|
-
component = a;
|
|
150
|
-
}
|
|
151
|
-
var name = component.split('#')[0]; // canary always written as Example#canary};
|
|
152
|
-
|
|
153
|
-
if (name) {
|
|
154
|
-
if (rest.length > 0) {
|
|
155
|
-
return "".concat(name, " (").concat(rest.join(' '), ")");
|
|
156
|
-
} else {
|
|
157
|
-
return name;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
console.error('Error: unable to parse title from metadata.');
|
|
161
|
-
return title;
|
|
162
|
-
};
|
|
163
|
-
exports.storyDocsPageTitle = storyDocsPageTitle;
|
|
164
|
-
var storyDocsPageInfo = function storyDocsPageInfo(csfFile) {
|
|
165
|
-
var _csfFile$meta3;
|
|
166
|
-
var title = csfFile === null || csfFile === void 0 ? void 0 : (_csfFile$meta3 = csfFile.meta) === null || _csfFile$meta3 === void 0 ? void 0 : _csfFile$meta3.title;
|
|
167
|
-
var _title$split5 = title.split('/'),
|
|
168
|
-
_title$split6 = (0, _toArray2.default)(_title$split5),
|
|
169
|
-
pkg = _title$split6[0],
|
|
170
|
-
kind = _title$split6[1],
|
|
171
|
-
a = _title$split6[2],
|
|
172
|
-
b = _title$split6[3],
|
|
173
|
-
rest = _title$split6.slice(4);
|
|
174
|
-
var result = {
|
|
175
|
-
package: pkg,
|
|
176
|
-
kind: kind,
|
|
177
|
-
expectCodedExample: false
|
|
178
|
-
};
|
|
179
|
-
var component;
|
|
180
|
-
if (/components|patterns/i.test(kind)) {
|
|
181
|
-
result.expectCodedExample = true;
|
|
182
|
-
// components and patterns have an additional level
|
|
183
|
-
component = b;
|
|
184
|
-
result.section = a;
|
|
185
|
-
result.guidelinesHref = "https://pages.github.ibm.com/cdai-design/pal/".concat(kind, "s/").concat((0, _changeCase.paramCase)(result.section), "/usage");
|
|
186
|
-
} else {
|
|
187
|
-
component = a;
|
|
188
|
-
}
|
|
189
|
-
var nameSplit = component.split('#'); // canary always written as Example#canary};
|
|
190
|
-
var name = nameSplit[0];
|
|
191
|
-
if (nameSplit.length > 1 && nameSplit[1] === 'canary') {
|
|
192
|
-
result.canary = true;
|
|
193
|
-
}
|
|
194
|
-
if (name) {
|
|
195
|
-
if (rest.length > 0) {
|
|
196
|
-
result.component = result.title = "".concat(name, " (").concat(rest.join(' '), ")");
|
|
197
|
-
} else {
|
|
198
|
-
result.component = name;
|
|
199
|
-
result.title = name;
|
|
200
|
-
}
|
|
201
|
-
} else {
|
|
202
|
-
console.error('Error: unable to parse title from metadata.');
|
|
203
|
-
result.title = title;
|
|
204
|
-
}
|
|
205
|
-
if (result.guidelinesHref) {
|
|
206
|
-
result.guidelinesLinkLabel = "".concat(result.title, " usage guidelines");
|
|
207
|
-
}
|
|
208
|
-
return result;
|
|
209
|
-
};
|
|
210
|
-
exports.storyDocsPageInfo = storyDocsPageInfo;
|
|
211
|
-
var storyDocsGuidelines = function storyDocsGuidelines(csfFile) {
|
|
212
|
-
var storyInfo = storyDocsPageInfo(csfFile);
|
|
213
|
-
return {
|
|
214
|
-
href: storyInfo.guidelinesHref,
|
|
215
|
-
label: storyInfo.guidelinesLinkLabel
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
111
|
|
|
219
112
|
/**
|
|
220
113
|
* A helper function that finds the designated theme on the Storybook canvas.
|
|
221
114
|
* @returns "dark" or "light"
|
|
222
115
|
*/
|
|
223
|
-
exports.storyDocsGuidelines = storyDocsGuidelines;
|
|
224
116
|
var getSelectedCarbonTheme = function getSelectedCarbonTheme() {
|
|
225
|
-
var themeId = document.querySelector('
|
|
117
|
+
var themeId = document.querySelector('html').getAttribute('storybook-carbon-theme');
|
|
226
118
|
return themeId === 'g90' || themeId === 'g100' ? 'dark' : 'light';
|
|
227
119
|
};
|
|
228
120
|
exports.getSelectedCarbonTheme = getSelectedCarbonTheme;
|
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.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@babel/cli": "^7.21.5",
|
|
58
58
|
"@babel/core": "^7.22.1",
|
|
59
|
-
"babel-preset-ibm-cloud-cognitive": "^0.14.
|
|
59
|
+
"babel-preset-ibm-cloud-cognitive": "^0.14.37",
|
|
60
60
|
"chalk": "^4.1.2",
|
|
61
61
|
"change-case": "^4.1.2",
|
|
62
62
|
"copyfiles": "^2.4.1",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"fs-extra": "^11.1.1",
|
|
65
65
|
"glob": "^10.2.6",
|
|
66
66
|
"jest": "^29.5.0",
|
|
67
|
-
"jest-config-ibm-cloud-cognitive": "^0.24.
|
|
67
|
+
"jest-config-ibm-cloud-cognitive": "^0.24.24",
|
|
68
68
|
"jest-environment-jsdom": "^29.5.0",
|
|
69
69
|
"namor": "^1.1.2",
|
|
70
70
|
"npm-check-updates": "^16.10.12",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"react": "^16.8.6 || ^17.0.1",
|
|
95
95
|
"react-dom": "^16.8.6 || ^17.0.1"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "36a061543213748633227ce75ea1441e1edaca7d"
|
|
98
98
|
}
|
|
@@ -92,5 +92,6 @@ $_block-class: #{c4p-settings.$pkg-prefix}--breadcrumb-with-overflow;
|
|
|
92
92
|
|
|
93
93
|
.#{$_block-class}__overflow-menu-options.#{$_block-class}__overflow-menu-options {
|
|
94
94
|
// Need to disable stylelint until dart sass namespace support is added
|
|
95
|
+
/* stylelint-disable-next-line function-no-unknown */
|
|
95
96
|
z-index: utilities.z('header');
|
|
96
97
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//
|
|
2
|
-
// Copyright IBM Corp. 2021,
|
|
2
|
+
// Copyright IBM Corp. 2021, 2021
|
|
3
3
|
//
|
|
4
4
|
// This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
@@ -7,10 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
// Standard imports.
|
|
9
9
|
@use '@carbon/styles/scss/spacing' as *;
|
|
10
|
-
@use '@carbon/styles/scss/components/button/tokens' as *;
|
|
11
10
|
@use '../../global/styles/project-settings' as c4p-settings;
|
|
12
|
-
@use '@carbon/react/scss/theme' as *;
|
|
13
|
-
@use '@carbon/styles/scss/type';
|
|
14
11
|
|
|
15
12
|
// TODO: @use(s) of Carbon settings and component styles and other
|
|
16
13
|
// related component styles used by ButtonMenu
|
|
@@ -20,37 +17,9 @@ $block-class: #{c4p-settings.$pkg-prefix}--button-menu;
|
|
|
20
17
|
|
|
21
18
|
.#{$block-class} {
|
|
22
19
|
min-width: 160px;
|
|
23
|
-
&.#{$block-class}__wrapper--primary,
|
|
24
|
-
&.#{$block-class}__wrapper--primary.#{c4p-settings.$carbon-prefix}--overflow-menu.#{c4p-settings.$carbon-prefix}--overflow-menu--open {
|
|
25
|
-
background-color: $button-primary;
|
|
26
|
-
}
|
|
27
|
-
&.#{c4p-settings.$carbon-prefix}--overflow-menu.#{$block-class}__wrapper--primary:hover {
|
|
28
|
-
background-color: $button-primary-hover;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&.#{$block-class}__wrapper--tertiary,
|
|
32
|
-
&.#{$block-class}__wrapper--tertiary.#{c4p-settings.$carbon-prefix}--overflow-menu.#{c4p-settings.$carbon-prefix}--overflow-menu--open {
|
|
33
|
-
background-color: $button-tertiary;
|
|
34
|
-
}
|
|
35
|
-
&.#{c4p-settings.$carbon-prefix}--overflow-menu.#{$block-class}__wrapper--tertiary:hover {
|
|
36
|
-
background-color: $button-tertiary-hover;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&.#{$block-class}__wrapper--ghost,
|
|
40
|
-
&.#{$block-class}__wrapper--ghost.#{c4p-settings.$carbon-prefix}--overflow-menu.#{c4p-settings.$carbon-prefix}--overflow-menu--open {
|
|
41
|
-
background-color: transparent;
|
|
42
|
-
}
|
|
43
|
-
&.#{c4p-settings.$carbon-prefix}--overflow-menu.#{$block-class}__wrapper--ghost:hover {
|
|
44
|
-
background-color: $layer-hover;
|
|
45
|
-
}
|
|
46
20
|
|
|
47
21
|
.#{$block-class}__trigger {
|
|
48
|
-
@include type.type-style('body-compact-01');
|
|
49
|
-
|
|
50
|
-
display: flex;
|
|
51
22
|
width: 100%;
|
|
52
|
-
align-items: center;
|
|
53
|
-
justify-content: space-between;
|
|
54
23
|
padding: 0 $spacing-05;
|
|
55
24
|
}
|
|
56
25
|
}
|