@carbon/ibm-products 2.1.1 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +586 -191
- 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 +157 -1
- 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 +344 -20
- 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 +248 -95
- 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/APIKeyModal/APIKeyModal.docs-page.js +26 -0
- package/es/components/AboutModal/AboutModal.docs-page.js +21 -0
- package/es/components/AboutModal/AboutModal.js +1 -1
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +3 -0
- package/es/components/Cascade/Cascade.docs-page.js +22 -0
- package/es/components/Cascade/Cascade.js +11 -1
- package/es/components/CreateFullPage/CreateFullPage.docs-page.js +39 -0
- package/es/components/CreateFullPage/CreateFullPage.js +13 -0
- package/es/components/CreateModal/CreateModal.docs-page.js +24 -0
- package/es/components/CreateModal/CreateModal.js +7 -0
- package/es/components/CreateSidePanel/CreateSidePanel.docs-page.js +18 -0
- package/es/components/CreateSidePanel/CreateSidePanel.js +1 -1
- package/es/components/CreateTearsheet/CreateTearsheet.docs-page.js +29 -0
- 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 +3 -2
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +5 -11
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +12 -10
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +2 -2
- package/es/components/Datagrid/utils/DatagridActions.js +6 -14
- package/es/components/EditFullPage/EditFullPage.docs-page.js +39 -0
- package/es/components/EditFullPage/EditFullPage.js +2 -1
- package/es/components/EditSidePanel/EditSidePanel.js +1 -1
- package/es/components/EditTearsheet/EditTearsheet.docs-page.js +25 -0
- package/es/components/EditTearsheet/EditTearsheet.js +4 -0
- package/es/components/EditTearsheetNarrow/EditTearsheetNarrow.js +1 -1
- package/es/components/EditUpdateCards/EditUpdateCards.js +3 -2
- package/es/components/EmptyStates/EmptyState.js +4 -0
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +4 -0
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +4 -0
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +4 -0
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +4 -0
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +4 -0
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +4 -0
- package/es/components/ExampleComponent/ExampleComponent.docs-page.js +22 -0
- package/es/components/ExportModal/ExportModal.js +4 -0
- package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
- package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
- package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
- package/es/components/ImportModal/ImportModal.docs-page.js +18 -0
- package/es/components/ImportModal/ImportModal.js +13 -6
- package/es/components/MultiAddSelect/MultiAddSelect.docs-page.js +17 -0
- package/es/components/MultiAddSelect/MultiAddSelect.js +4 -0
- package/es/components/NotificationsPanel/preview-components/UnreadNotificationBell.js +2 -17
- package/es/components/PageHeader/PageHeaderUtils.js +2 -2
- package/es/components/RemoveModal/RemoveModal.docs-page.js +18 -0
- package/es/components/RemoveModal/RemoveModal.js +6 -0
- package/es/components/SingleAddSelect/SingleAddSelect.docs-page.js +15 -0
- package/es/components/SingleAddSelect/SingleAddSelect.js +4 -0
- package/es/components/StatusIcon/StatusIcon.docs-page.js +17 -0
- package/es/components/StatusIcon/StatusIcon.js +10 -0
- package/es/components/Tearsheet/TearsheetShell.js +11 -6
- package/es/components/Toolbar/Toolbar.docs-page.js +14 -0
- package/es/components/UserProfileImage/UserProfileImage.docs-page.js +17 -0
- package/es/components/UserProfileImage/UserProfileImage.js +1 -1
- package/es/components/WebTerminal/WebTerminal.docs-page.js +52 -0
- package/es/components/WebTerminal/WebTerminal.js +4 -0
- package/es/global/js/hooks/useCreateComponentStepChange.js +16 -15
- package/es/global/js/utils/StoryDocsPage.js +218 -0
- package/es/global/js/utils/story-helper.js +108 -6
- package/lib/components/APIKeyModal/APIKeyModal.docs-page.js +37 -0
- package/lib/components/AboutModal/AboutModal.docs-page.js +32 -0
- package/lib/components/AboutModal/AboutModal.js +1 -1
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +3 -0
- package/lib/components/Cascade/Cascade.docs-page.js +33 -0
- package/lib/components/Cascade/Cascade.js +11 -1
- package/lib/components/CreateFullPage/CreateFullPage.docs-page.js +50 -0
- package/lib/components/CreateFullPage/CreateFullPage.js +13 -0
- package/lib/components/CreateModal/CreateModal.docs-page.js +35 -0
- package/lib/components/CreateModal/CreateModal.js +7 -0
- package/lib/components/CreateSidePanel/CreateSidePanel.docs-page.js +29 -0
- package/lib/components/CreateSidePanel/CreateSidePanel.js +1 -1
- package/lib/components/CreateTearsheet/CreateTearsheet.docs-page.js +40 -0
- 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 +3 -2
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +4 -10
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +12 -10
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +2 -2
- package/lib/components/Datagrid/utils/DatagridActions.js +5 -13
- package/lib/components/EditFullPage/EditFullPage.docs-page.js +50 -0
- package/lib/components/EditFullPage/EditFullPage.js +2 -1
- package/lib/components/EditSidePanel/EditSidePanel.js +1 -1
- package/lib/components/EditTearsheet/EditTearsheet.docs-page.js +36 -0
- package/lib/components/EditTearsheet/EditTearsheet.js +4 -0
- package/lib/components/EditTearsheetNarrow/EditTearsheetNarrow.js +1 -1
- package/lib/components/EditUpdateCards/EditUpdateCards.js +3 -2
- package/lib/components/EmptyStates/EmptyState.js +4 -0
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +4 -0
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +4 -0
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +4 -0
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +4 -0
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +4 -0
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +4 -0
- package/lib/components/ExampleComponent/ExampleComponent.docs-page.js +33 -0
- package/lib/components/ExportModal/ExportModal.js +4 -0
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
- package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
- package/lib/components/ImportModal/ImportModal.docs-page.js +26 -0
- package/lib/components/ImportModal/ImportModal.js +13 -6
- package/lib/components/MultiAddSelect/MultiAddSelect.docs-page.js +25 -0
- package/lib/components/MultiAddSelect/MultiAddSelect.js +4 -0
- package/lib/components/NotificationsPanel/preview-components/UnreadNotificationBell.js +2 -17
- package/lib/components/PageHeader/PageHeaderUtils.js +2 -2
- package/lib/components/RemoveModal/RemoveModal.docs-page.js +26 -0
- package/lib/components/RemoveModal/RemoveModal.js +6 -0
- package/lib/components/SingleAddSelect/SingleAddSelect.docs-page.js +23 -0
- package/lib/components/SingleAddSelect/SingleAddSelect.js +4 -0
- package/lib/components/StatusIcon/StatusIcon.docs-page.js +28 -0
- package/lib/components/StatusIcon/StatusIcon.js +10 -0
- package/lib/components/Tearsheet/TearsheetShell.js +11 -6
- package/lib/components/Toolbar/Toolbar.docs-page.js +25 -0
- package/lib/components/UserProfileImage/UserProfileImage.docs-page.js +28 -0
- package/lib/components/UserProfileImage/UserProfileImage.js +1 -1
- package/lib/components/WebTerminal/WebTerminal.docs-page.js +63 -0
- package/lib/components/WebTerminal/WebTerminal.js +4 -0
- package/lib/global/js/hooks/useCreateComponentStepChange.js +16 -15
- package/lib/global/js/utils/StoryDocsPage.js +225 -0
- package/lib/global/js/utils/story-helper.js +115 -7
- package/package.json +10 -10
- package/scss/components/Cascade/_storybook-styles.scss +3 -2
- package/scss/components/DataSpreadsheet/_storybook-styles.scss +6 -0
- package/scss/components/Datagrid/_storybook-styles.scss +8 -2
- package/scss/components/Datagrid/styles/_datagrid.scss +14 -0
- package/scss/components/Datagrid/styles/addons/_FilterFlyout.scss +7 -0
- package/scss/components/Datagrid/styles/addons/_FilterPanel.scss +4 -0
- package/scss/components/NotificationsPanel/_storybook-styles.scss +10 -2
- package/scss/components/PageHeader/_storybook-styles.scss +24 -14
- package/scss/components/Tearsheet/_tearsheet.scss +7 -1
- package/scss/components/WebTerminal/_storybook-styles.scss +11 -1
- package/scss/global/styles/_display-box.scss +1 -0
- package/scss/components/HTTPErrors/_storybook-styles.scss +0 -6
@@ -22,6 +22,12 @@ import { pkg } from '../../../settings';
|
|
22
22
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
23
23
|
var blockClass = "".concat(pkg.prefix, "--http-errors");
|
24
24
|
var componentName = 'HTTPError403';
|
25
|
+
|
26
|
+
/**
|
27
|
+
* HTTP errors are used in an attempt to access something that isn’t available or
|
28
|
+
the user doesn’t have permission for. This HTTPError component is generic so you
|
29
|
+
can use it when you receive an error code that isn't provided.
|
30
|
+
*/
|
25
31
|
export var HTTPError403 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
26
32
|
var className = _ref.className,
|
27
33
|
description = _ref.description,
|
@@ -22,6 +22,12 @@ import { pkg } from '../../../settings';
|
|
22
22
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
23
23
|
var blockClass = "".concat(pkg.prefix, "--http-errors");
|
24
24
|
var componentName = 'HTTPError404';
|
25
|
+
|
26
|
+
/**
|
27
|
+
* HTTP errors are used in an attempt to access something that isn’t available or
|
28
|
+
the user doesn’t have permission for. This HTTPError component is generic so you
|
29
|
+
can use it when you receive an error code that isn't provided.
|
30
|
+
*/
|
25
31
|
export var HTTPError404 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
26
32
|
var className = _ref.className,
|
27
33
|
description = _ref.description,
|
@@ -22,6 +22,12 @@ import { pkg } from '../../../settings';
|
|
22
22
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
23
23
|
var blockClass = "".concat(pkg.prefix, "--http-errors");
|
24
24
|
var componentName = 'HTTPErrorOther';
|
25
|
+
|
26
|
+
/**
|
27
|
+
* HTTP errors are used in an attempt to access something that isn’t available or
|
28
|
+
the user doesn’t have permission for. This HTTPError component is generic so you
|
29
|
+
can use it when you receive an error code that isn't provided.
|
30
|
+
*/
|
25
31
|
export var HTTPErrorOther = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
26
32
|
var className = _ref.className,
|
27
33
|
description = _ref.description,
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { StoryDocsPage } from '../../global/js/utils/StoryDocsPage';
|
3
|
+
import { useOf } from '@storybook/blocks';
|
4
|
+
import { storyDocsGuidelines } from '../../global/js/utils/story-helper';
|
5
|
+
var DocsPage = function DocsPage() {
|
6
|
+
var _useOf = useOf('meta', ['meta']),
|
7
|
+
csfFile = _useOf.csfFile;
|
8
|
+
return /*#__PURE__*/React.createElement(StoryDocsPage, {
|
9
|
+
altGuidelinesHref: [storyDocsGuidelines(csfFile), {
|
10
|
+
href: 'https://www.carbondesignsystem.com/components/modal/usage',
|
11
|
+
label: 'Carbon Modal usage guidelines'
|
12
|
+
}, {
|
13
|
+
href: 'https://react.carbondesignsystem.com/?path=/docs/modal--default',
|
14
|
+
label: 'Carbon Modal documentation'
|
15
|
+
}]
|
16
|
+
});
|
17
|
+
};
|
18
|
+
export default DocsPage;
|
@@ -179,6 +179,13 @@ export var ImportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
179
179
|
var inputHandler = function inputHandler(evt) {
|
180
180
|
setImportUrl(evt.target.value);
|
181
181
|
};
|
182
|
+
var onCloseHandler = function onCloseHandler() {
|
183
|
+
setFiles([]);
|
184
|
+
setImportUrl('');
|
185
|
+
if (onClose) {
|
186
|
+
onClose();
|
187
|
+
}
|
188
|
+
};
|
182
189
|
var numberOfFiles = files.length;
|
183
190
|
var numberOfValidFiles = files.filter(function (f) {
|
184
191
|
return !f.invalid;
|
@@ -190,13 +197,13 @@ export var ImportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
190
197
|
var blockClass = "".concat(pkg.prefix, "--import-modal");
|
191
198
|
return /*#__PURE__*/React.createElement(ComposedModal, _extends({}, rest, _objectSpread({
|
192
199
|
open: open,
|
193
|
-
ref: ref
|
194
|
-
onClose: onClose
|
200
|
+
ref: ref
|
195
201
|
}, getDevtoolsProps(componentName)), {
|
196
202
|
"aria-label": title,
|
197
203
|
className: cx(blockClass, className),
|
198
204
|
size: "sm",
|
199
|
-
preventCloseOnClickOutside: true
|
205
|
+
preventCloseOnClickOutside: true,
|
206
|
+
onClose: onCloseHandler
|
200
207
|
}), /*#__PURE__*/React.createElement(ModalHeader, {
|
201
208
|
className: "".concat(blockClass, "__header"),
|
202
209
|
title: title
|
@@ -259,7 +266,7 @@ export var ImportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
259
266
|
}, /*#__PURE__*/React.createElement(Button, {
|
260
267
|
type: "button",
|
261
268
|
kind: "secondary",
|
262
|
-
onClick:
|
269
|
+
onClick: onCloseHandler
|
263
270
|
}, secondaryButtonText), /*#__PURE__*/React.createElement(Button, {
|
264
271
|
type: "submit",
|
265
272
|
kind: "primary",
|
@@ -362,11 +369,11 @@ ImportModal.propTypes = {
|
|
362
369
|
/**
|
363
370
|
* Specify a handler for "submitting" modal. Access the imported file via `file => {}`
|
364
371
|
*/
|
365
|
-
onRequestSubmit: PropTypes.func,
|
372
|
+
onRequestSubmit: PropTypes.func.isRequired,
|
366
373
|
/**
|
367
374
|
* Specify whether the Modal is currently open
|
368
375
|
*/
|
369
|
-
open: PropTypes.bool,
|
376
|
+
open: PropTypes.bool.isRequired,
|
370
377
|
/**
|
371
378
|
* Specify the text for the primary button
|
372
379
|
*/
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { StoryDocsPage } from '../../global/js/utils/StoryDocsPage';
|
3
|
+
var DocsPage = function DocsPage() {
|
4
|
+
return /*#__PURE__*/React.createElement(StoryDocsPage, {
|
5
|
+
altGuidelinesHref: "https://pages.github.ibm.com/cdai-design/pal/patterns/add-and-select/usage",
|
6
|
+
blocks: [{
|
7
|
+
title: 'Structuring items',
|
8
|
+
description: "The `items` object has a lot of customization potential and can greatly effect\nthe way the component is displayed and how you interact with it.\n\nLet's walk through an example.",
|
9
|
+
source: {
|
10
|
+
code: "items: {\n modifiers: { // adds a modifier dropdown inside the items\n label: PropTypes.string, // label for the dropdown\n options: PropTypes.array, // list of options / values for the dropdown\n },\n sortBy: ['title'], // designates which properties should be used to sort the column when using a hierarchy\n entries: [ // the actual list of items / entries\n {\n id: '1', // required unique id for the entry\n value: '1', // required value of the entry\n title: 'item 1', // required title to display\n subtitle: 'item 1 subtitle', // subtitle to display\n children: { // designates if entry has children. if the children prop is found a hierarchy list will be used\n sortBy: ['title', 'size'],\n filterBy: 'fileType', // designates which property should be used to filter the column of items\n entries: [\n {\n id: '1-1',\n value: 'file1.pdf',\n title: 'file1.pdf',\n fileType: 'pdf',\n size: '100',\n icon: Document16, // designates if an icon should be displayed. While similar to avatar icon, both have different displays.\n tag: 'business',\n avatar: { // designates if an avatar should be displayed\n alt: 'alt text',\n icon: <Icon />,\n src: 'avatar.png',\n },\n },\n ],\n },\n },\n ],\n}"
|
11
|
+
}
|
12
|
+
}, {
|
13
|
+
description: "The properties that have been commented on like `id`, `value`, and `icon` have\nspecific use within the component and are generally required. Other properties\nlike `fileType` and `size` do not and will simply show up as details in the\nsidebar when selected."
|
14
|
+
}]
|
15
|
+
});
|
16
|
+
};
|
17
|
+
export default DocsPage;
|
@@ -12,6 +12,10 @@ import { AddSelect } from '../AddSelect';
|
|
12
12
|
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
13
13
|
import { pkg } from '../../settings';
|
14
14
|
var componentName = 'MultiAddSelect';
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Used to add or select multiple or more items from larger lists or hierarchies.
|
18
|
+
*/
|
15
19
|
export var MultiAddSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
16
20
|
return /*#__PURE__*/React.createElement(AddSelect, _extends({}, props, {
|
17
21
|
multi: true,
|
@@ -15,34 +15,19 @@ var UnreadNotificationBell = function UnreadNotificationBell() {
|
|
15
15
|
xmlns: "http://www.w3.org/2000/svg",
|
16
16
|
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
17
17
|
}, /*#__PURE__*/React.createElement("title", null, "Unread notification bell"), /*#__PURE__*/React.createElement("g", {
|
18
|
-
id: "Page-1",
|
19
|
-
stroke: "none",
|
20
|
-
strokeWidth: "1",
|
21
|
-
fill: "none",
|
22
|
-
fillRule: "evenodd"
|
23
|
-
}, /*#__PURE__*/React.createElement("g", {
|
24
18
|
id: "Group",
|
25
19
|
transform: "translate(-1.000000, 0.000000)"
|
26
|
-
}, /*#__PURE__*/React.createElement("g", {
|
27
|
-
id: "notification"
|
28
20
|
}, /*#__PURE__*/React.createElement("path", {
|
29
21
|
d: "M17.9419375,12.058125 L16.25,10.3661875 L16.25,8.125 C16.245845,4.91692673 13.816599,2.23147626 10.625,1.90675 L10.625,0.625 L9.375,0.625 L9.375,1.90675 C6.183401,2.23147626 3.754155,4.91692673 3.75,8.125 L3.75,10.3661875 L2.0580625,12.058125 C1.94086706,12.1753182 1.875,12.3342622 1.875,12.5 L1.875,14.375 C1.875,14.720178 2.15482203,15 2.5,15 L6.875,15 L6.875,15.4855 C6.84694527,17.1272367 8.05869477,18.5271305 9.6875,18.7346875 C10.5660567,18.8218694 11.4405518,18.5337871 12.0952737,17.9415019 C12.7499955,17.3492167 13.1239886,16.5078712 13.125,15.625 L13.125,15 L17.5,15 C17.845178,15 18.125,14.720178 18.125,14.375 L18.125,12.5 C18.125,12.3342622 18.0591329,12.1753182 17.9419375,12.058125 Z M11.875,15.625 C11.875,16.6605339 11.0355339,17.5 10,17.5 C8.96446609,17.5 8.125,16.6605339 8.125,15.625 L8.125,15 L11.875,15 L11.875,15.625 Z M16.875,13.75 L3.125,13.75 L3.125,12.7588125 L4.816875,11.066875 C4.93409336,10.949692 4.9999646,10.7907468 5,10.625 L5,8.125 C5,5.36357625 7.23857625,3.125 10,3.125 C12.7614237,3.125 15,5.36357625 15,8.125 L15,10.625 C15.0000354,10.7907468 15.0659066,10.949692 15.183125,11.066875 L16.875,12.7588125 L16.875,13.75 Z",
|
30
22
|
id: "Shape",
|
31
|
-
fill: "#FFFFFF",
|
32
23
|
fillRule: "nonzero"
|
33
|
-
}), /*#__PURE__*/React.createElement("
|
34
|
-
id: "_Transparent_Rectangle_",
|
35
|
-
x: "0",
|
36
|
-
y: "0",
|
37
|
-
width: "20",
|
38
|
-
height: "20"
|
39
|
-
})), /*#__PURE__*/React.createElement("circle", {
|
24
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
40
25
|
id: "Oval",
|
41
26
|
stroke: "#161616",
|
42
27
|
fill: "#DA1E28",
|
43
28
|
cx: "15",
|
44
29
|
cy: "4.375",
|
45
30
|
r: "2.5"
|
46
|
-
})))
|
31
|
+
})));
|
47
32
|
};
|
48
33
|
export { UnreadNotificationBell };
|
@@ -65,11 +65,11 @@ export var utilCheckUpdateVerticalSpace = function utilCheckUpdateVerticalSpace(
|
|
65
65
|
var scrollableContainer = scrollableAncestor(headerRef.current);
|
66
66
|
|
67
67
|
/* istanbul ignore next */
|
68
|
-
var scrollableContainerTop = scrollableContainer ? scrollableContainer.scrollTop - scrollableContainer.
|
68
|
+
var scrollableContainerTop = scrollableContainer ? scrollableContainer.scrollTop - scrollableContainer.getBoundingClientRect().top : 0;
|
69
69
|
|
70
70
|
// The header offset calculation is either going to work out at 0 if we have no gap between scrolling container
|
71
71
|
// top and the measuring ref top, or the difference between. It does not change on scroll or resize.
|
72
|
-
update.headerOffset =
|
72
|
+
update.headerOffset = (offsetTopMeasuringRef.current ? offsetTopMeasuringRef.current.getBoundingClientRect().top : 0) + scrollableContainerTop;
|
73
73
|
|
74
74
|
/* istanbul ignore next */
|
75
75
|
update.breadcrumbRowHeight = breadcrumbRowEl ? breadcrumbRowEl.clientHeight : 0;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { StoryDocsPage } from '../../global/js/utils/StoryDocsPage';
|
3
|
+
import { useOf } from '@storybook/blocks';
|
4
|
+
import { storyDocsGuidelines } from '../../global/js/utils/story-helper';
|
5
|
+
var DocsPage = function DocsPage() {
|
6
|
+
var _useOf = useOf('meta', ['meta']),
|
7
|
+
csfFile = _useOf.csfFile;
|
8
|
+
return /*#__PURE__*/React.createElement(StoryDocsPage, {
|
9
|
+
altGuidelinesHref: [storyDocsGuidelines(csfFile), {
|
10
|
+
href: 'https://www.carbondesignsystem.com/components/modal/usage',
|
11
|
+
label: 'Carbon Modal usage guidelines'
|
12
|
+
}, {
|
13
|
+
href: 'https://react.carbondesignsystem.com/?path=/docs/modal--default',
|
14
|
+
label: 'Carbon Modal documentation'
|
15
|
+
}]
|
16
|
+
});
|
17
|
+
};
|
18
|
+
export default DocsPage;
|
@@ -21,6 +21,12 @@ import uuidv4 from '../../global/js/utils/uuidv4';
|
|
21
21
|
import { pkg } from '../../settings';
|
22
22
|
import { usePreviousValue } from '../../global/js/hooks';
|
23
23
|
var componentName = 'RemoveModal';
|
24
|
+
|
25
|
+
/**
|
26
|
+
The `RemoveModal` covers what is known as high impact and medium impact deleting.
|
27
|
+
Enabling `textConfirmation` enables what would be considered the high impact state of the modal.
|
28
|
+
For additional information on differentiating between delete / remove and low / medium / high impact please refer to the usage guidelines.
|
29
|
+
*/
|
24
30
|
export var RemoveModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
25
31
|
var body = _ref.body,
|
26
32
|
className = _ref.className,
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { StoryDocsPage } from '../../global/js/utils/StoryDocsPage';
|
3
|
+
var DocsPage = function DocsPage() {
|
4
|
+
return /*#__PURE__*/React.createElement(StoryDocsPage, {
|
5
|
+
altGuidelinesHref: "https://pages.github.ibm.com/cdai-design/pal/patterns/add-and-select/usage",
|
6
|
+
blocks: [{
|
7
|
+
title: 'Structuring items',
|
8
|
+
description: "The `items` object has a lot of customization potential and can greatly effect\nthe way the component is displayed and how you interact with it..\n\nLet's walk through an example.",
|
9
|
+
source: {
|
10
|
+
code: "items: {\n entries: [ // the actual list of items / entries\n {\n id: '1', // required unique id for the entry\n value: '1', // required value of the entry\n title: 'item 1', // required title to display\n subtitle: 'item 1 subtitle', // subtitle to display\n children: { // designates if entry has children. if the children prop is found a hierarchy list will be used\n entries: [\n {\n id: '1-1',\n value: 'file1.pdf',\n title: 'file1.pdf',\n },\n ],\n },\n },\n ],\n}"
|
11
|
+
}
|
12
|
+
}]
|
13
|
+
});
|
14
|
+
};
|
15
|
+
export default DocsPage;
|
@@ -13,6 +13,10 @@ import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
|
13
13
|
import { pkg } from '../../settings';
|
14
14
|
import { prepareProps } from '../../global/js/utils/props-helper';
|
15
15
|
var componentName = 'SingleAddSelect';
|
16
|
+
|
17
|
+
/**
|
18
|
+
* Used to add or select one or more items from larger lists or hierarchies.
|
19
|
+
*/
|
16
20
|
export var SingleAddSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
17
21
|
// remove multi add select specific props
|
18
22
|
var validProps = prepareProps(props, ['columnInputPlaceholder', 'globalFilters', 'globalFiltersIconDescription', 'globalFiltersPlaceholderText', 'globalFiltersPrimaryButtonText', 'globalFiltersSecondaryButtonText', 'influencerTitle', 'multi', 'noSelectionDescription', 'noSelectionTitle', 'removeIconDescription']);
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { StoryDocsPage } from '../../global/js/utils/StoryDocsPage';
|
3
|
+
import * as stories from './StatusIcon.stories';
|
4
|
+
var DocsPage = function DocsPage() {
|
5
|
+
return /*#__PURE__*/React.createElement(StoryDocsPage, {
|
6
|
+
blocks: [{
|
7
|
+
story: stories.Default
|
8
|
+
}, {
|
9
|
+
title: 'Accessibility',
|
10
|
+
description: "The `StatusIcon` component follows the Carbon guidelines for status icons with\nsome added specifications around illustration usage. For additional usage\nguidelines and documentation please refer to the links above.\n\n_Status icons_ are an important method of communicating severity level\ninformation to users. The shapes and colors, communicate severity that enable\nusers to quickly assess and identify status and respond accordingly."
|
11
|
+
}, {
|
12
|
+
title: 'Sizing',
|
13
|
+
description: "\n| Size | Pixels |\n| ------- | ------- |\n| small | 16 x 16 |\n| medium | 20 x 20 |\n| large | 24 x 24 |\n| x-large | 32 x 32 |\n "
|
14
|
+
}]
|
15
|
+
});
|
16
|
+
};
|
17
|
+
export default DocsPage;
|
@@ -16,6 +16,16 @@ 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
|
+
*/
|
19
29
|
export var StatusIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
20
30
|
var _icons$kind;
|
21
31
|
var kind = _ref.kind,
|
@@ -55,7 +55,13 @@ export var tearsheetHasCloseIcon = function tearsheetHasCloseIcon(actions, hasCl
|
|
55
55
|
return hasCloseIcon !== null && hasCloseIcon !== void 0 ? hasCloseIcon : tearsheetIsPassive(actions);
|
56
56
|
};
|
57
57
|
|
58
|
-
|
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
|
+
* */
|
59
65
|
export var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
60
66
|
var actions = _ref.actions,
|
61
67
|
children = _ref.children,
|
@@ -216,7 +222,8 @@ export var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
216
222
|
closeModal: onClose,
|
217
223
|
iconDescription: closeIconDescription
|
218
224
|
}, /*#__PURE__*/React.createElement(Wrap, {
|
219
|
-
className: "".concat(bc, "__header-content")
|
225
|
+
className: "".concat(bc, "__header-content"),
|
226
|
+
element: wide ? Layer : undefined
|
220
227
|
}, /*#__PURE__*/React.createElement(Wrap, {
|
221
228
|
className: "".concat(bc, "__header-fields")
|
222
229
|
}, /*#__PURE__*/React.createElement(Wrap, {
|
@@ -241,12 +248,10 @@ export var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
241
248
|
className: "".concat(bc, "__right")
|
242
249
|
}, /*#__PURE__*/React.createElement(Wrap, {
|
243
250
|
className: "".concat(bc, "__main"),
|
244
|
-
alwaysRender: includeActions
|
245
|
-
element: wide ? Layer : undefined
|
251
|
+
alwaysRender: includeActions
|
246
252
|
}, /*#__PURE__*/React.createElement(Wrap, {
|
247
253
|
className: "".concat(bc, "__content"),
|
248
|
-
alwaysRender: influencer && influencerPosition === 'right'
|
249
|
-
element: wide ? Layer : undefined
|
254
|
+
alwaysRender: influencer && influencerPosition === 'right'
|
250
255
|
}, children), /*#__PURE__*/React.createElement(Wrap, {
|
251
256
|
className: cx((_cx6 = {}, _defineProperty(_cx6, "".concat(bc, "__influencer"), true), _defineProperty(_cx6, "".concat(bc, "__influencer--wide"), influencerWidth === 'wide'), _cx6)),
|
252
257
|
neverRender: influencerPosition !== 'right'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { StoryDocsPage } from '../../global/js/utils/StoryDocsPage';
|
3
|
+
import * as stories from './Toolbar.stories';
|
4
|
+
var DocsPage = function DocsPage() {
|
5
|
+
return /*#__PURE__*/React.createElement(StoryDocsPage, {
|
6
|
+
blocks: [{
|
7
|
+
story: stories._Toolbar
|
8
|
+
}, {
|
9
|
+
story: stories.vertical,
|
10
|
+
description: "A toolbar orientation for floating the toolbar on the canvas."
|
11
|
+
}]
|
12
|
+
});
|
13
|
+
};
|
14
|
+
export default DocsPage;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { StoryDocsPage } from '../../global/js/utils/StoryDocsPage';
|
3
|
+
import * as stories from './UserProfileImage.stories';
|
4
|
+
var DocsPage = function DocsPage() {
|
5
|
+
return /*#__PURE__*/React.createElement(StoryDocsPage, {
|
6
|
+
blocks: [{
|
7
|
+
story: stories.Default
|
8
|
+
}, {
|
9
|
+
story: stories.WithGroupIcon,
|
10
|
+
description: "By passing in icon prop with a value of `group`, the avatar will display the group icon"
|
11
|
+
}, {
|
12
|
+
story: stories.WithInitials,
|
13
|
+
description: "When passing a display name to the component, the display name will be distilled down to the first and last initials of the display name. `Thomas Watson` and `Thomas J. Watson` will both display `TW` as the initials."
|
14
|
+
}]
|
15
|
+
});
|
16
|
+
};
|
17
|
+
export default DocsPage;
|
@@ -33,7 +33,7 @@ var defaults = {
|
|
33
33
|
tooltipAlignment: 'bottom'
|
34
34
|
};
|
35
35
|
/**
|
36
|
-
*
|
36
|
+
* The user profile avatar allows for an image of the user to be displayed by passing in the image prop. By default the component will display a user icon on a blue background.
|
37
37
|
*/
|
38
38
|
export var UserProfileImage = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
39
39
|
var backgroundColor = _ref.backgroundColor,
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { StoryDocsPage } from '../../global/js/utils/StoryDocsPage';
|
3
|
+
import * as stories from './WebTerminal.stories';
|
4
|
+
var DocsPage = function DocsPage() {
|
5
|
+
return /*#__PURE__*/React.createElement(StoryDocsPage, {
|
6
|
+
blocks: [{
|
7
|
+
description: "To get started using the WebTerminal, you have to first wrap your\n application with the `<WebTerminalProvider>`\n component. This will allow all the WebTerminal components to be\n used with the `useWebTerminal()` custom hook.\n ",
|
8
|
+
title: 'Getting Started',
|
9
|
+
source: {
|
10
|
+
code: "import { WebTerminalProvider } from '@carbon/ibm-products';\n\nconst App = () => {\n return (\n <WebTerminalProvider>\n ...\n <WebTerminalProvider>\n )\n};"
|
11
|
+
}
|
12
|
+
}, {
|
13
|
+
title: 'useWebTerminal()',
|
14
|
+
source: {
|
15
|
+
code: "const { open, openWebTerminal, closeWebTerminal, toggleWebTerminal } =\n useWebTerminal();"
|
16
|
+
}
|
17
|
+
}, {
|
18
|
+
description: "The `useWebTerminal()` hook returns an object with 4 properties:\n1. Read the `open` state (true or false)\n2. `openWebTerminal` sets the `open` state to true\n3. `closeWebTerminal` sets the `open` state to false\n4. `toggleWebTerminal` toggles between true and false\n\nExample:\n",
|
19
|
+
source: {
|
20
|
+
code: "const MyComponent = () => {\n const { open, openWebTerminal, closeWebTerminal, toggleWebTerminal } =\n useWebTerminal();\n\n return (\n <div>\n <button onClick={() => openWebTerminal()}>Open web terminal</button>\n <button onClick={() => closeWebTerminal()}>Close web terminal</button>\n <button onClick={() => toggleWebTerminal()}>Toggle web terminal</button>\n <p>The web terminal is now {open}</p>\n\n <WebTerminal>...</WebTerminal>\n </div>\n );\n};"
|
21
|
+
}
|
22
|
+
}, {
|
23
|
+
subTitle: 'Passing in your own terminal.',
|
24
|
+
description: "The `WebTerminal` is wrapper component for your own\nterminal component that you may have been using for your product.\nSimply pass your own terminal component as children.\n "
|
25
|
+
}, {
|
26
|
+
subTitle: 'Optional wrapper component.',
|
27
|
+
description: "Optionally you can import `WebTerminalContentWrapper` to have\n content adjust their width based off the `WebTerminal` width when\n it is opened.",
|
28
|
+
source: {
|
29
|
+
code: "<WebTerminalContentWrapper>\n content\n</WebTerminalContentWrapper>\n\n<WebTerminal>\n ...\n</WebTerminal>"
|
30
|
+
}
|
31
|
+
}, {
|
32
|
+
description: 'The default web terminal is one which opens and the terminal loads. Then if the user desires to dismiss it they can click the close icon on the top right corner of the component.',
|
33
|
+
story: stories.Default
|
34
|
+
}, {
|
35
|
+
story: stories.WithDocumentationLinks
|
36
|
+
}, {
|
37
|
+
subTitle: 'Help users with helpful documentation links',
|
38
|
+
description: "Optionally you can pass documentation links to help point your users to useful\ndocumentation for your terminal, or kubernetes commands etc.\n\nThe documentation links should reflect the same props as `OverflowMenuItem` from\ncarbon.\n\nLearn more:\nhttps://react.carbondesignsystem.com/?path=/docs/components-overflowmenu--default\n",
|
39
|
+
source: {
|
40
|
+
code: "const documentationLinks = [\n {\n itemText: 'BX/ICP docs',\n href: '#',\n onClick: () => console.log('clicked'),\n },\n {\n itemText: 'Kubernetes docs',\n href: '#',\n onClick: () => console.log('clicked'),\n },\n {\n itemText: 'Docker docs',\n href: '#',\n onClick: () => console.log('clicked'),\n },\n {\n itemText: 'Helm docs',\n href: '#',\n onClick: () => console.log('clicked'),\n },\n];"
|
41
|
+
}
|
42
|
+
}, {
|
43
|
+
story: stories.WithActions
|
44
|
+
}, {
|
45
|
+
description: "Optionally you can add actions to the web terminal header bar. To add actions\nyou need to pass in an array of actions with objects for each object.",
|
46
|
+
source: {
|
47
|
+
code: "<WebTerminal\n actions={[\n {\n renderIcon: Code32,\n onClick: () => {},\n iconDescription: 'Create new deployment',\n },\n ]}\n>\n ...\n</WebTerminal>"
|
48
|
+
}
|
49
|
+
}]
|
50
|
+
});
|
51
|
+
};
|
52
|
+
export default DocsPage;
|
@@ -39,6 +39,10 @@ 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
|
+
*/
|
42
46
|
export var WebTerminal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
43
47
|
var _ref3;
|
44
48
|
var _ref$actions = _ref.actions,
|
@@ -30,6 +30,20 @@ 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
|
+
|
33
47
|
// useEffect to handle multi step logic
|
34
48
|
useEffect(function () {
|
35
49
|
var onUnmount = function onUnmount() {
|
@@ -157,9 +171,9 @@ export var useCreateComponentStepChange = function useCreateComponentStepChange(
|
|
157
171
|
// There will always be a previous step otherwise we will
|
158
172
|
// have disabled the back button since we have reached the first visible step
|
159
173
|
do {
|
160
|
-
var
|
174
|
+
var _stepData2;
|
161
175
|
prev--;
|
162
|
-
} while (!((
|
176
|
+
} while (!((_stepData2 = stepData[prev - 1]) !== null && _stepData2 !== void 0 && _stepData2.shouldIncludeStep));
|
163
177
|
return prev;
|
164
178
|
});
|
165
179
|
},
|
@@ -187,17 +201,4 @@ export var useCreateComponentStepChange = function useCreateComponentStepChange(
|
|
187
201
|
setCreateComponentActions(buttons);
|
188
202
|
}
|
189
203
|
}, [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]);
|
203
204
|
};
|