@carbon/ibm-products 2.1.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. package/css/index-full-carbon.css +562 -189
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +2 -2
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +151 -0
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +320 -18
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +2 -2
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +231 -94
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +3 -3
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/APIKeyModal/APIKeyModal.docs-page.js +26 -0
  18. package/es/components/AboutModal/AboutModal.docs-page.js +21 -0
  19. package/es/components/AboutModal/AboutModal.js +1 -1
  20. package/es/components/Cascade/Cascade.docs-page.js +22 -0
  21. package/es/components/Cascade/Cascade.js +11 -1
  22. package/es/components/CreateFullPage/CreateFullPage.docs-page.js +39 -0
  23. package/es/components/CreateFullPage/CreateFullPage.js +13 -0
  24. package/es/components/CreateModal/CreateModal.docs-page.js +24 -0
  25. package/es/components/CreateModal/CreateModal.js +7 -0
  26. package/es/components/CreateSidePanel/CreateSidePanel.docs-page.js +18 -0
  27. package/es/components/CreateSidePanel/CreateSidePanel.js +1 -1
  28. package/es/components/CreateTearsheet/CreateTearsheet.docs-page.js +29 -0
  29. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -3
  30. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +3 -2
  31. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +19 -17
  32. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +2 -2
  33. package/es/components/EditFullPage/EditFullPage.docs-page.js +39 -0
  34. package/es/components/EditFullPage/EditFullPage.js +2 -1
  35. package/es/components/EditSidePanel/EditSidePanel.js +1 -1
  36. package/es/components/EditTearsheet/EditTearsheet.docs-page.js +25 -0
  37. package/es/components/EditTearsheet/EditTearsheet.js +4 -0
  38. package/es/components/EditTearsheetNarrow/EditTearsheetNarrow.js +1 -1
  39. package/es/components/EditUpdateCards/EditUpdateCards.js +3 -2
  40. package/es/components/EmptyStates/EmptyState.js +4 -0
  41. package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +4 -0
  42. package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +4 -0
  43. package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +4 -0
  44. package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +4 -0
  45. package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +4 -0
  46. package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +4 -0
  47. package/es/components/ExampleComponent/ExampleComponent.docs-page.js +22 -0
  48. package/es/components/ExportModal/ExportModal.js +4 -0
  49. package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
  50. package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
  51. package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
  52. package/es/components/ImportModal/ImportModal.docs-page.js +18 -0
  53. package/es/components/MultiAddSelect/MultiAddSelect.docs-page.js +17 -0
  54. package/es/components/MultiAddSelect/MultiAddSelect.js +4 -0
  55. package/es/components/RemoveModal/RemoveModal.docs-page.js +18 -0
  56. package/es/components/RemoveModal/RemoveModal.js +6 -0
  57. package/es/components/SingleAddSelect/SingleAddSelect.docs-page.js +15 -0
  58. package/es/components/SingleAddSelect/SingleAddSelect.js +4 -0
  59. package/es/components/StatusIcon/StatusIcon.docs-page.js +17 -0
  60. package/es/components/StatusIcon/StatusIcon.js +10 -0
  61. package/es/components/Tearsheet/TearsheetShell.js +7 -1
  62. package/es/components/Toolbar/Toolbar.docs-page.js +14 -0
  63. package/es/components/UserProfileImage/UserProfileImage.docs-page.js +17 -0
  64. package/es/components/UserProfileImage/UserProfileImage.js +1 -1
  65. package/es/components/WebTerminal/WebTerminal.docs-page.js +52 -0
  66. package/es/components/WebTerminal/WebTerminal.js +4 -0
  67. package/es/global/js/utils/StoryDocsPage.js +218 -0
  68. package/es/global/js/utils/story-helper.js +107 -5
  69. package/lib/components/APIKeyModal/APIKeyModal.docs-page.js +37 -0
  70. package/lib/components/AboutModal/AboutModal.docs-page.js +32 -0
  71. package/lib/components/AboutModal/AboutModal.js +1 -1
  72. package/lib/components/Cascade/Cascade.docs-page.js +33 -0
  73. package/lib/components/Cascade/Cascade.js +11 -1
  74. package/lib/components/CreateFullPage/CreateFullPage.docs-page.js +50 -0
  75. package/lib/components/CreateFullPage/CreateFullPage.js +13 -0
  76. package/lib/components/CreateModal/CreateModal.docs-page.js +35 -0
  77. package/lib/components/CreateModal/CreateModal.js +7 -0
  78. package/lib/components/CreateSidePanel/CreateSidePanel.docs-page.js +29 -0
  79. package/lib/components/CreateSidePanel/CreateSidePanel.js +1 -1
  80. package/lib/components/CreateTearsheet/CreateTearsheet.docs-page.js +40 -0
  81. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -3
  82. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +3 -2
  83. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +19 -17
  84. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +2 -2
  85. package/lib/components/EditFullPage/EditFullPage.docs-page.js +50 -0
  86. package/lib/components/EditFullPage/EditFullPage.js +2 -1
  87. package/lib/components/EditSidePanel/EditSidePanel.js +1 -1
  88. package/lib/components/EditTearsheet/EditTearsheet.docs-page.js +36 -0
  89. package/lib/components/EditTearsheet/EditTearsheet.js +4 -0
  90. package/lib/components/EditTearsheetNarrow/EditTearsheetNarrow.js +1 -1
  91. package/lib/components/EditUpdateCards/EditUpdateCards.js +3 -2
  92. package/lib/components/EmptyStates/EmptyState.js +4 -0
  93. package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +4 -0
  94. package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +4 -0
  95. package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +4 -0
  96. package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +4 -0
  97. package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +4 -0
  98. package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +4 -0
  99. package/lib/components/ExampleComponent/ExampleComponent.docs-page.js +33 -0
  100. package/lib/components/ExportModal/ExportModal.js +4 -0
  101. package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
  102. package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
  103. package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
  104. package/lib/components/ImportModal/ImportModal.docs-page.js +26 -0
  105. package/lib/components/MultiAddSelect/MultiAddSelect.docs-page.js +25 -0
  106. package/lib/components/MultiAddSelect/MultiAddSelect.js +4 -0
  107. package/lib/components/RemoveModal/RemoveModal.docs-page.js +26 -0
  108. package/lib/components/RemoveModal/RemoveModal.js +6 -0
  109. package/lib/components/SingleAddSelect/SingleAddSelect.docs-page.js +23 -0
  110. package/lib/components/SingleAddSelect/SingleAddSelect.js +4 -0
  111. package/lib/components/StatusIcon/StatusIcon.docs-page.js +28 -0
  112. package/lib/components/StatusIcon/StatusIcon.js +10 -0
  113. package/lib/components/Tearsheet/TearsheetShell.js +7 -1
  114. package/lib/components/Toolbar/Toolbar.docs-page.js +25 -0
  115. package/lib/components/UserProfileImage/UserProfileImage.docs-page.js +28 -0
  116. package/lib/components/UserProfileImage/UserProfileImage.js +1 -1
  117. package/lib/components/WebTerminal/WebTerminal.docs-page.js +63 -0
  118. package/lib/components/WebTerminal/WebTerminal.js +4 -0
  119. package/lib/global/js/utils/StoryDocsPage.js +225 -0
  120. package/lib/global/js/utils/story-helper.js +114 -6
  121. package/package.json +8 -8
  122. package/scss/components/Cascade/_storybook-styles.scss +3 -2
  123. package/scss/components/Datagrid/_storybook-styles.scss +1 -1
  124. package/scss/components/Datagrid/styles/_datagrid.scss +14 -0
  125. package/scss/components/NotificationsPanel/_storybook-styles.scss +12 -0
  126. package/scss/components/PageHeader/_storybook-styles.scss +0 -18
  127. package/scss/components/WebTerminal/_storybook-styles.scss +7 -12
  128. package/scss/components/HTTPErrors/_storybook-styles.scss +0 -20
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _StoryDocsPage = require("../../global/js/utils/StoryDocsPage");
11
+ var stories = _interopRequireWildcard(require("./Cascade.stories"));
12
+ var _blocks = require("@storybook/blocks");
13
+ var _storyHelper = require("../../global/js/utils/story-helper");
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+ 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; }
16
+ var DocsPage = function DocsPage() {
17
+ var _useOf = (0, _blocks.useOf)('meta', ['meta']),
18
+ csfFile = _useOf.csfFile;
19
+ return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
20
+ altGuidelinesHref: [(0, _storyHelper.storyDocsGuidelines)(csfFile), {
21
+ href: 'https://www.carbondesignsystem.com/guidelines/motion/overview/',
22
+ label: 'Carbon motion guidelines'
23
+ }],
24
+ blocks: [{
25
+ story: stories.WithoutGrid
26
+ }, {
27
+ description: 'When using `Cascade` with grid support its important that you follow the example code structure and provide the rows and columns. The component will assume this structure and add the appropriate CSS classes to the columns.',
28
+ story: stories.WithGrid
29
+ }]
30
+ });
31
+ };
32
+ var _default = DocsPage;
33
+ exports.default = _default;
@@ -29,6 +29,16 @@ var componentName = 'Cascade';
29
29
  var defaults = {
30
30
  grid: false
31
31
  };
32
+
33
+ /**
34
+
35
+ This pattern is intended for use with cards, tiles, or similarly styled
36
+ components. Use this patterns in areas that are the primary focus on the page to
37
+ help the user along their journey or locate the most important information on
38
+ the page. It should not be used on a page if it is the secondary focus of the
39
+ page as that will distract the user.
40
+
41
+ */
32
42
  var Cascade = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
33
43
  var children = _ref.children,
34
44
  className = _ref.className,
@@ -81,7 +91,7 @@ Cascade.propTypes = {
81
91
  */
82
92
  className: _propTypes.default.string,
83
93
  /**
84
- * Specifies whether or not to wrap the child content in a <Grid />.
94
+ * Specifies whether or not to wrap the child content in a `<Grid />`.
85
95
  * If this is set to true it's important that the children are being wrapped in rows in columns.
86
96
  * Check the documentation for additional clarification.
87
97
  */
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _StoryDocsPage = require("../../global/js/utils/StoryDocsPage");
11
+ var stories = _interopRequireWildcard(require("./CreateFullPage.stories"));
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+ 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; }
14
+ var DocsPage = function DocsPage() {
15
+ return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
16
+ altGuidelinesHref: "https://pages.github.ibm.com/cdai-design/pal/patterns/creation-flows/usage#full-page",
17
+ blocks: [{
18
+ description: "There are **2** components that make up a Create Full Page component, which can\nbe used in unison to create the desired look, or flow. Please note, to utilize\nthe Create Full Page component, you'll need to have a minimum of two steps. If\nyou are looking for a one step creation flow, consider Create Tearsheet, Create\nSide Panel, or Create Modal."
19
+ }, {
20
+ story: stories.createFullPage,
21
+ description: "This is used when you have one section per step. This can be created by passing\nin the overall `<CreateFullPage />` component and the `<CreateFullPageStep />`\ncomponent with form items as children:\n",
22
+ source: {
23
+ code: "<CreateFullPage {...props}>\n <CreateFullPageStep\n title=\"Required title\"\n subtitle=\"Optional subtitle\"\n description=\"Optional description\"\n onNext={() => {'Optional function'}}\n >\n <Row>\n <Column xlg={5} lg={5} md={4} sm={4}>\n <TextInput\n id=\"test-1\"\n invalidText=\"A valid value is required\"\n labelText=\"Topic name\"\n placeholder=\"Enter topic name\"\n />\n </Column>\n </Row>\n </CreateFullPageStep>\n </CreateFullPage>"
24
+ }
25
+ }, {
26
+ story: stories.createFullPageWithSections,
27
+ description: "This is used when you have several sections per step. This can be created by\npassing in the overall `<CreateFullPage />` component and the\n`<CreateFullPageStep />` component for the first `section`. All additional\n`sections` must be passed in as children, as shown below:",
28
+ source: {
29
+ code: "<CreateFullPageStep\n title=\"Required title\"\n subtitle=\"Optional subtitle\"\n description=\"Optional description\"\n onNext={() => {'Optional function'}}\n >\n <Row>\n <Column xlg={5} lg={5} md={4} sm={4}>\n <fieldset className={`#{$pkg-prefix}--create-full-page__step-fieldset`}>\n <TextInput\n id=\"test-1\"\n invalidText=\"A valid value is required\"\n labelText=\"Topic name\"\n placeholder=\"Enter topic name\"\n />\n </fieldset>\n </Column>\n </Row>\n <span className={`#{$pkg-prefix}--create-full-page__section-divider`} />\n <h5 className={`#{$pkg-prefix}--create-full-page__step-title`}>Required title</h5>\n <h6 className={`#{$pkg-prefix}--create-full-page__step-subtitle`}>\n Optional subtitle\n </h6>\n <p className={`#{$pkg-prefix}--create-full-page__step-description`}>\n Optional description\n </p>\n <Row>\n <Column xlg={5} lg={5} md={4} sm={4}>\n <fieldset className={`#{$pkg-prefix}--create-full-page__step-fieldset`}>\n <TextInput\n id=\"test-2\"\n invalidText=\"A valid value is required\"\n labelText=\"Topic name\"\n placeholder=\"Enter topic name\"\n />\n </fieldset>\n </Column>\n </Row>\n</CreateFullPageStep>"
30
+ }
31
+ }, {
32
+ title: 'Using custom components',
33
+ description: "It is possible to use custom components that return `CreateFullPageStep`s in\norder to help reduce the amount of logic in the component that contains the main\n`CreateFullPage`. _It is required that each child of the `CreateFullPage` either\nbe a custom step or a `CreateFullPageStep`_. An example of this could look like\nthe following:",
34
+ source: {
35
+ code: "const CreateStepCustom = ({ subtitle, ...rest }) => {\n return (\n <CreateFullPageStep\n {...rest}\n subtitle={subtitle}\n title=\"Step 1\"\n onNext={() => console.log('optional validation check')}\n onMount={() => console.log('optional onMount fn')}\n disableSubmit={false}\n >\n step content here\n </CreateFullPageStep>\n );\n};\n\nconst CreateComponent = () => {\n return (\n <CreateFullPage {...createFullPageProps}>\n <CreateStepCustom subtitle=\"Custom step subtitle\" />\n <CreateFullPageStep\n title=\"Topic name\"\n fieldsetLegendText=\"Topic information\"\n disableSubmit={!value}\n subtitle=\"This is the unique name used to recognize your topic\"\n description=\"It will also be used by your producers and consumers as part of the\n connection information, so make it something easy to recognize.\"\n >\n Content for second step\n </CreateFullPageStep>\n </CreateFullPage>\n );\n};"
36
+ }
37
+ }, {
38
+ title: 'Using dynamic steps',
39
+ description: "The use of dynamic steps can be utilized in a scenario when the user makes a\ncertain selection on one step that effects which steps will follow it, this is\ncontrolled via the `includeStep` prop. See abbreviated example below:",
40
+ source: {
41
+ code: "import { useState } from 'react';\n\nconst CreateFlow = () => {\n const [shouldIncludeAdditionalStep, setShouldIncludeAdditionalStep] =\n useState(false);\n return (\n <CreateFullPage {...createFullPageProps}>\n <CreateFullPageStep {...step1Props}>\n Step 1 content\n <Checkbox\n labelText={`Include additional step`}\n id=\"include-additional-step-checkbox\"\n onChange={(value) => setShouldIncludeAdditionalStep(value)}\n checked={shouldIncludeAdditionalStep}\n />\n </CreateFullPageStep>\n <CreateFullPageStep\n {...step2Props}\n includeStep={shouldIncludeAdditionalStep}\n >\n Dynamic step content\n </CreateFullPageStep>\n <CreateFullPageStep {...step3Props}>\n Final step content\n </CreateFullPageStep>\n </CreateFullPage>\n );\n};"
42
+ }
43
+ }, {
44
+ title: 'Class names',
45
+ description: "Additionally, to get the preferred styling when including your own children as\nsections, you can utilize the below included class names.\n\n| Class name | Element | Features |\n| ---------------------------------------------------- | ----------- | ---------------------------------------------------------- |\n| `#{$pkg-prefix}--create-full-page__step-title` | title | `productive-heading-04` & `margin-bottom` of `$spacing-05` |\n| `#{$pkg-prefix}--create-full-page__step-subtitle` | subtitle | `productive-heading-01` & `margin-bottom` of `$spacing-03` |\n| `#{$pkg-prefix}--create-full-page__step-description` | description | `body-long-01` & `margin-bottom` of `$spacing-06` |\n| `#{$pkg-prefix}--create-full-page__step-fieldset` | fieldset | `margin-bottom` of `$spacing-05` to all children elements |\n| `#{$pkg-prefix}--create-full-page__section-divider` | divider | Includes a `1px` divider line inside the `main` content |\n"
46
+ }]
47
+ });
48
+ };
49
+ var _default = DocsPage;
50
+ exports.default = _default;
@@ -43,6 +43,19 @@ var StepsContext = /*#__PURE__*/(0, _react.createContext)(null);
43
43
  // to let it know what number it is in the sequence of steps
44
44
  exports.StepsContext = StepsContext;
45
45
  var StepNumberContext = /*#__PURE__*/(0, _react.createContext)(-1);
46
+
47
+ /**
48
+ * Use with creations that must be completed in order for a service to be usable.
49
+ *
50
+ * ### Grid
51
+ *
52
+ * The `CreateFullPage` component utilizes Carbons' grid system in the inner
53
+ content of the main section inside of the component. You can read more guidance
54
+ on the Carbon's grid system
55
+ [here](https://www.carbondesignsystem.com/guidelines/2x-grid/overview). You can
56
+ include `<Row>` and `<Column>` components inside of each `CreateFullPageStep`
57
+ component to get the desired affect.
58
+ */
46
59
  exports.StepNumberContext = StepNumberContext;
47
60
  var CreateFullPage = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
48
61
  var backButtonText = _ref.backButtonText,
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _StoryDocsPage = require("../../global/js/utils/StoryDocsPage");
11
+ var stories = _interopRequireWildcard(require("./CreateModal.stories"));
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+ 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; }
14
+ var DocsPage = function DocsPage() {
15
+ return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
16
+ altGuidelinesHref: "https://pages.github.ibm.com/cdai-design/pal/patterns/creation-flows/usage#modal",
17
+ blocks: [{
18
+ story: stories.Default
19
+ }, {
20
+ title: 'Form validation',
21
+ description: "All forms, including that within the `CreateModal` should follow C&CS guidelines\nfor form validation.\n\nThis includes the following:\n\n- The `Submit` button in the modal should be disabled, until all required inputs\n are filled in and valid\n- All required inputs should _only_ throw an invalid error _after_ the element\n loses focus\n- All optional form fields should have an `(optional)` text at the end of the\n input `labelText`. Optional should always be in parentheses\n\nYou can find more information on how to validate your form fields in\n[Carbon's Form usage page](https://www.carbondesignsystem.com/components/form/usage)."
22
+ }, {
23
+ title: 'Overriding Carbon theme',
24
+ description: "The design recommendation is to use a dark theme for the CreateModal if the\napplication is currently using a light theme, and vice versa. The theme applied\nto the CreateModal can easily be customized as follows:\n\nIn SCSS:",
25
+ source: {
26
+ language: 'css',
27
+ code: " .#{$pkg-prefix}--create-modal {\n @include carbon--theme(\n $theme: $carbon--theme--g90\n );\n }"
28
+ }
29
+ }, {
30
+ description: "Alternatively, the required Carbon theme can be set as above in a custom CSS\nclass which is then applied to the CreateModal using the `className` prop."
31
+ }]
32
+ });
33
+ };
34
+ var _default = DocsPage;
35
+ exports.default = _default;
@@ -35,6 +35,13 @@ var isValidChildren = function isValidChildren() {
35
35
  return;
36
36
  };
37
37
  };
38
+
39
+ /**
40
+ * The `CreateModal` component provides a way for a user to quickly generate a new
41
+ resource. It is triggered by a user’s action, appears on top of the main page
42
+ content, and is persistent until dismissed. The purpose of this modal should be
43
+ immediately apparent to the user, with a clear and obvious path to completion.
44
+ */
38
45
  var CreateModal = /*#__PURE__*/_react.default.forwardRef(function (_ref2, ref) {
39
46
  var className = _ref2.className,
40
47
  children = _ref2.children,
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _StoryDocsPage = require("../../global/js/utils/StoryDocsPage");
11
+ var stories = _interopRequireWildcard(require("./CreateSidePanel.stories"));
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+ 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; }
14
+ var DocsPage = function DocsPage() {
15
+ return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
16
+ altGuidelinesHref: [{
17
+ href: 'https://pages.github.ibm.com/cdai-design/pal/patterns/creation-flows/usage#side-panel',
18
+ label: 'Carbon create flows side panel usage guidelines'
19
+ }],
20
+ blocks: [{
21
+ story: stories.Default
22
+ }, {
23
+ title: 'Form validation',
24
+ description: "All forms, including that within the `CreateSidePanel` should follow C&CS\nguidelines for form validation.\n\nThis includes the following:\n\n- The `Submit` button in the side panel should be disabled, until all required\n inputs are filled in and valid\n- All required inputs should _only_ throw an invalid error _after_ the element\n loses focus\n- All optional form fields should have an `(optional)` text at the end of the\n input `labelText`. Optional should always be in parentheses\n\nYou can find more information on how to validate your form fields in\n[Carbon's Form usage page](https://www.carbondesignsystem.com/components/form/usage)."
25
+ }]
26
+ });
27
+ };
28
+ var _default = DocsPage;
29
+ exports.default = _default;
@@ -34,7 +34,7 @@ var componentName = 'CreateSidePanel';
34
34
  // NOTE: the component SCSS is not imported here: it is rolled up separately.
35
35
 
36
36
  /**
37
- * This is an example component to show relevant conventions and usage.
37
+ * Use with medium complexity creations if the user needs page context. On-page content can be seen and interacted with.
38
38
  */
39
39
  var CreateSidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
40
40
  var className = _ref.className,
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _StoryDocsPage = require("../../global/js/utils/StoryDocsPage");
11
+ var stories = _interopRequireWildcard(require("./CreateTearsheet.stories"));
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+ 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; }
14
+ var DocsPage = function DocsPage() {
15
+ return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
16
+ altGuidelinesHref: "https://pages.github.ibm.com/cdai-design/pal/patterns/creation-flows/usage#wide-tearsheet",
17
+ blocks: [{
18
+ story: stories.multiStepTearsheet,
19
+ description: "This is used when you have one section per step. This can be created by passing\nin the overall `<CreateTearsheet />` component and the `<CreateTearsheetStep />`\ncomponent with form items as children:",
20
+ source: {
21
+ code: " <CreateTearsheet {...props}>\n <CreateTearsheetStep\n title=\"Required title\"\n subtitle=\"Optional subtitle\"\n description=\"Optional description\"\n onNext={() => {'Optional function'}}\n disableSubmit={}\n >\n <TextInput\n id=\"test-1\"\n invalidText=\"A valid value is required\"\n labelText=\"Topic name\"\n placeholder=\"Enter topic name\"\n />\n </CreateTearsheetStep>\n </CreateTearsheet>"
22
+ }
23
+ }, {
24
+ title: 'Using custom components',
25
+ description: "It is possible to use custom components that return `CreateTearsheetStep`s in\norder to help reduce the amount of logic in the component that contains the main\n`CreateTearsheet`. _It is required that each child of the `CreateTearsheet`\neither be a custom step or a `CreateTearsheetStep`_. An example of this could\nlook like the following:",
26
+ source: {
27
+ code: "const CreateStepCustom = ({ subtitle, ...rest }) => {\n return (\n <CreateTearsheetStep\n {...rest}\n subtitle={subtitle}\n title=\"Step 1\"\n onNext={() => console.log('optional validation check')}\n onMount={() => console.log('optional onMount fn')}\n disableSubmit={false}\n >\n step content here\n </CreateTearsheetStep>\n );\n};\n\nconst CreateComponent = () => {\n return (\n <CreateTearsheet {...createTearsheetProps}>\n <CreateStepCustom subtitle=\"Custom step subtitle\" />\n <CreateTearsheetStep\n title=\"Topic name\"\n fieldsetLegendText=\"Topic information\"\n disableSubmit={!value}\n subtitle=\"This is the unique name used to recognize your topic\"\n description=\"It will also be used by your producers and consumers as part of the\n connection information, so make it something easy to recognize.\"\n >\n Content for second step\n </CreateTearsheetStep>\n </CreateTearsheet>\n );\n};"
28
+ }
29
+ }, {
30
+ title: 'Using dynamic steps',
31
+ description: "The use of dynamic steps can be utilized in a scenario when the user makes a\ncertain selection on one step that effects which steps will follow it, this is\ncontrolled via the `includeStep` prop. See abbreviated example below:",
32
+ code: "import { useState } from 'react';\n\nconst CreateFlow = () => {\n const [shouldIncludeAdditionalStep, setShouldIncludeAdditionalStep] =\n useState(false);\n return (\n <CreateTearsheet {...createTearsheetProps}>\n <CreateTearsheetStep {...step1Props}>\n Step 1 content\n <Checkbox\n labelText={`Include additional step`}\n id=\"include-additional-step-checkbox\"\n onChange={(value) => setShouldIncludeAdditionalStep(value)}\n checked={shouldIncludeAdditionalStep}\n />\n </CreateTearsheetStep>\n <CreateTearsheetStep\n {...step2Props}\n includeStep={shouldIncludeAdditionalStep}\n >\n Dynamic step content\n </CreateTearsheetStep>\n <CreateTearsheetStep {...step3Props}>\n Final step content\n </CreateTearsheetStep>\n </CreateTearsheet>\n );\n};"
33
+ }, {
34
+ title: 'Class names',
35
+ description: "Additionally, to get the preferred styling when including your own children as\nsections, you can utilize the below included class names.\n\n| Class name | Element | Features |\n| ----------------------------------------------------- | ----------- | ---------------------------------------------------------- |\n| `#{$pkg-prefix}--create-tearsheet__step--title` | title | `productive-heading-04` & `margin-bottom` of `$spacing-05` |\n| `#{$pkg-prefix}--create-tearsheet__step--subtitle` | subtitle | `productive-heading-01` & `margin-bottom` of `$spacing-03` |\n| `#{$pkg-prefix}--create-tearsheet__step--description` | description | `body-long-01` & `margin-bottom` of `$spacing-06` |\n| `#{$pkg-prefix}--create-tearsheet__step--fieldset` | fieldset | `margin-bottom` of `$spacing-05` to all children elements |\n| `#{$pkg-prefix}--create-tearsheet__section--divider` | divider | Includes a `1px` divider line inside the `main` content |\n"
36
+ }]
37
+ });
38
+ };
39
+ var _default = DocsPage;
40
+ exports.default = _default;
@@ -44,6 +44,9 @@ var SelectAllWithToggle = function SelectAllWithToggle(_ref) {
44
44
  allRowsLabel = _ref$allRowsLabel === void 0 ? 'Select all' : _ref$allRowsLabel,
45
45
  columns = _ref.columns,
46
46
  withStickyColumn = _ref.withStickyColumn;
47
+ var _ref2 = selectAllToggle || {},
48
+ onSelectAllRows = _ref2.onSelectAllRows,
49
+ labels = _ref2.labels;
47
50
  var _useState = (0, _react.useState)(SELECT_ALL_PAGE_ROWS),
48
51
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
49
52
  selectAllMode = _useState2[0],
@@ -66,9 +69,6 @@ var SelectAllWithToggle = function SelectAllWithToggle(_ref) {
66
69
  return window.removeEventListener('resize', updateSize);
67
70
  };
68
71
  }, []);
69
- var _ref2 = selectAllToggle || {},
70
- onSelectAllRows = _ref2.onSelectAllRows,
71
- labels = _ref2.labels;
72
72
  if (labels) {
73
73
  allPageRowsLabel = labels.allPageRows || allPageRowsLabel;
74
74
  allRowsLabel = labels.allRows || allRowsLabel;
@@ -26,6 +26,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
26
26
 
27
27
  var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
28
28
  var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridState, width, ref) {
29
+ var _Object$keys;
29
30
  var _useState = (0, _react.useState)(false),
30
31
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
31
32
  displayAllInMenu = _useState2[0],
@@ -38,11 +39,11 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
38
39
  _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
39
40
  receivedInitialWidth = _useState6[0],
40
41
  setReceivedInitialWidth = _useState6[1];
41
- var selectedFlatRows = datagridState.selectedFlatRows,
42
+ var selectedRowIds = datagridState.state.selectedRowIds,
42
43
  toggleAllRowsSelected = datagridState.toggleAllRowsSelected,
43
44
  toolbarBatchActions = datagridState.toolbarBatchActions,
44
45
  setGlobalFilter = datagridState.setGlobalFilter;
45
- var totalSelected = selectedFlatRows && selectedFlatRows.length;
46
+ var totalSelected = (_Object$keys = Object.keys(selectedRowIds || {})) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length;
46
47
 
47
48
  // Get initial width of batch actions container,
48
49
  // used to measure when all items are put inside
@@ -24,7 +24,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
24
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(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; }
25
25
  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; }
26
26
  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; } /**
27
- * Copyright IBM Corp. 2022, 2022
27
+ * Copyright IBM Corp. 2022, 2023
28
28
  *
29
29
  * This source code is licensed under the Apache-2.0 license found in the
30
30
  * LICENSE file in the root directory of this source tree.
@@ -39,7 +39,8 @@ var InlineEditCell = function InlineEditCell(_ref) {
39
39
  placeholder = _ref$placeholder === void 0 ? '' : _ref$placeholder,
40
40
  tabIndex = _ref.tabIndex,
41
41
  value = _ref.value,
42
- nonEditCell = _ref.nonEditCell,
42
+ _ref$nonEditCell = _ref.nonEditCell,
43
+ nonEditCell = _ref$nonEditCell === void 0 ? false : _ref$nonEditCell,
43
44
  totalInlineEditColumns = _ref.totalInlineEditColumns,
44
45
  type = _ref.type;
45
46
  var columnId = cell.column.id;
@@ -82,21 +83,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
82
83
  var outerButtonElement = (0, _react.useRef)();
83
84
  var rowSize = instance.rowSize,
84
85
  onDataUpdate = instance.onDataUpdate;
85
-
86
- // Saves the new cell data, onDataUpdate is a required function to be
87
- // passed to useDatagrid when using useInlineEdit
88
- var saveCellData = (0, _react.useCallback)(function (newValue) {
89
- var columnId = cell.column.id;
90
- var rowIndex = cell.row.index;
91
- onDataUpdate(function (prev) {
92
- return prev.map(function (row, index) {
93
- if (index === rowIndex) {
94
- return _objectSpread(_objectSpread({}, prev[rowIndex]), {}, (0, _defineProperty2.default)({}, columnId, newValue));
95
- }
96
- return row;
97
- });
98
- });
99
- }, [cell, onDataUpdate]);
86
+ var saveCellData;
100
87
  (0, _react.useEffect)(function () {
101
88
  setInitialValue(value);
102
89
  var columnId = cell.column.id;
@@ -183,6 +170,21 @@ var InlineEditCell = function InlineEditCell(_ref) {
183
170
  }
184
171
  }, [inEditMode, type]);
185
172
 
173
+ // Saves the new cell data, onDataUpdate is a required function to be
174
+ // passed to useDatagrid when using useInlineEdit
175
+ saveCellData = (0, _react.useCallback)(function (newValue) {
176
+ var columnId = cell.column.id;
177
+ var rowIndex = cell.row.index;
178
+ onDataUpdate(function (prev) {
179
+ return prev.map(function (row, index) {
180
+ if (index === rowIndex) {
181
+ return _objectSpread(_objectSpread({}, prev[rowIndex]), {}, (0, _defineProperty2.default)({}, columnId, newValue));
182
+ }
183
+ return row;
184
+ });
185
+ });
186
+ }, [cell, onDataUpdate]);
187
+
186
188
  // Initialize cellValue from value prop
187
189
  (0, _react.useEffect)(function () {
188
190
  setCellValue(value);
@@ -11,7 +11,7 @@ var _handleMultipleKeys = require("./handleMultipleKeys");
11
11
  var _getCellIdAsObject = require("./InlineEditContext/getCellIdAsObject");
12
12
  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; }
13
13
  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; } /**
14
- * Copyright IBM Corp. 2022, 2022
14
+ * Copyright IBM Corp. 2022, 2023
15
15
  *
16
16
  * This source code is licensed under the Apache-2.0 license found in the
17
17
  * LICENSE file in the root directory of this source tree.
@@ -91,7 +91,7 @@ var handleGridKeyPress = function handleGridKeyPress(_ref) {
91
91
  if (['End', 'Home', 'ArrowLeft', 'ArrowUp', 'ArrowRight', 'ArrowDown'].indexOf(key) > -1 && !isEditing && keysPressedList.length < 2) {
92
92
  event.preventDefault();
93
93
  }
94
- var isDisabledCell = !!focusedCell.getAttribute('data-disabled');
94
+ var isDisabledCell = focusedCell.getAttribute('data-disabled') === 'false' ? false : true;
95
95
  var sharedUpdateParams = {
96
96
  oldId: activeCellId,
97
97
  instance: instance
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _StoryDocsPage = require("../../global/js/utils/StoryDocsPage");
11
+ var stories = _interopRequireWildcard(require("./EditFullPage.stories"));
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+ 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; }
14
+ var DocsPage = function DocsPage() {
15
+ return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
16
+ altGuidelinesHref: "https://pages.github.ibm.com/cdai-design/pal/patterns/edit/usage#full-page-edit",
17
+ blocks: [{
18
+ description: "There are **2** components that make up a Create Full Page component, which can\nbe used in unison to create the desired look, or flow. Please note, to utilize\nthe Create Full Page component, you'll need to have a minimum of two steps. If\nyou are looking for a one step creation flow, consider Create Tearsheet, Create\nSide Panel, or Create Modal."
19
+ }, {
20
+ story: stories.editFullPage,
21
+ description: "This is used when you have one section per step. This can be created by passing\nin the overall `<CreateFullPage />` component and the `<CreateFullPageStep />`\ncomponent with form items as children:",
22
+ source: {
23
+ code: "<CreateFullPage {...props}>\n <CreateFullPageStep\n title=\"Required title\"\n subtitle=\"Optional subtitle\"\n description=\"Optional description\"\n onNext={() => {'Optional function'}}\n >\n <Row>\n <Column xlg={5} lg={5} md={4} sm={4}>\n <TextInput\n id=\"test-1\"\n invalidText=\"A valid value is required\"\n labelText=\"Topic name\"\n placeholder=\"Enter topic name\"\n />\n </Column>\n </Row>\n </CreateFullPageStep>\n </CreateFullPage>"
24
+ }
25
+ }, {
26
+ story: stories.editFullPageWithSections,
27
+ description: "This is used when you have several sections per step. This can be created by\npassing in the overall `<CreateFullPage />` component and the\n`<CreateFullPageStep />` component for the first `section`. All additional\n`sections` must be passed in as children, as shown below:",
28
+ source: {
29
+ code: "<CreateFullPageStep\n title=\"Required title\"\n subtitle=\"Optional subtitle\"\n description=\"Optional description\"\n onNext={() => {'Optional function'}}\n >\n <Row>\n <Column xlg={5} lg={5} md={4} sm={4}>\n <fieldset className={`#{$pkg-prefix}--create-full-page__step-fieldset`}>\n <TextInput\n id=\"test-1\"\n invalidText=\"A valid value is required\"\n labelText=\"Topic name\"\n placeholder=\"Enter topic name\"\n />\n </fieldset>\n </Column>\n </Row>\n <span className={`#{$pkg-prefix}--create-full-page__section-divider`} />\n <h5 className={`#{$pkg-prefix}--create-full-page__step-title`}>Required title</h5>\n <h6 className={`#{$pkg-prefix}--create-full-page__step-subtitle`}>\n Optional subtitle\n </h6>\n <p className={`#{$pkg-prefix}--create-full-page__step-description`}>\n Optional description\n </p>\n <Row>\n <Column xlg={5} lg={5} md={4} sm={4}>\n <fieldset className={`#{$pkg-prefix}--create-full-page__step-fieldset`}>\n <TextInput\n id=\"test-2\"\n invalidText=\"A valid value is required\"\n labelText=\"Topic name\"\n placeholder=\"Enter topic name\"\n />\n </fieldset>\n </Column>\n </Row>\n</CreateFullPageStep>"
30
+ }
31
+ }, {
32
+ title: 'Using custom components',
33
+ description: "It is possible to use custom components that return `CreateFullPageStep`s in\norder to help reduce the amount of logic in the component that contains the main\n`CreateFullPage`. _It is required that each child of the `CreateFullPage` either\nbe a custom step or a `CreateFullPageStep`_. An example of this could look like\nthe following:",
34
+ source: {
35
+ code: "const CreateStepCustom = ({ subtitle, ...rest }) => {\n return (\n <CreateFullPageStep\n {...rest}\n subtitle={subtitle}\n title=\"Step 1\"\n onNext={() => console.log('optional validation check')}\n onMount={() => console.log('optional onMount fn')}\n disableSubmit={false}\n >\n step content here\n </CreateFullPageStep>\n );\n};\n\nconst CreateComponent = () => {\n return (\n <CreateFullPage {...createFullPageProps}>\n <CreateStepCustom subtitle=\"Custom step subtitle\" />\n <CreateFullPageStep\n title=\"Topic name\"\n fieldsetLegendText=\"Topic information\"\n disableSubmit={!value}\n subtitle=\"This is the unique name used to recognize your topic\"\n description=\"It will also be used by your producers and consumers as part of the\n connection information, so make it something easy to recognize.\"\n >\n Content for second step\n </CreateFullPageStep>\n </CreateFullPage>\n );\n};"
36
+ }
37
+ }, {
38
+ title: 'Using dynamic steps',
39
+ description: "The use of dynamic steps can be utilized in a scenario when the user makes a\ncertain selection on one step that effects which steps will follow it, this is\ncontrolled via the `includeStep` prop. See abbreviated example below:",
40
+ source: {
41
+ code: "import { useState } from 'react';\n\nconst CreateFlow = () => {\n const [shouldIncludeAdditionalStep, setShouldIncludeAdditionalStep] =\n useState(false);\n return (\n <CreateFullPage {...createFullPageProps}>\n <CreateFullPageStep {...step1Props}>\n Step 1 content\n <Checkbox\n labelText={`Include additional step`}\n id=\"include-additional-step-checkbox\"\n onChange={(value) => setShouldIncludeAdditionalStep(value)}\n checked={shouldIncludeAdditionalStep}\n />\n </CreateFullPageStep>\n <CreateFullPageStep\n {...step2Props}\n includeStep={shouldIncludeAdditionalStep}\n >\n Dynamic step content\n </CreateFullPageStep>\n <CreateFullPageStep {...step3Props}>\n Final step content\n </CreateFullPageStep>\n </CreateFullPage>\n );\n};"
42
+ }
43
+ }, {
44
+ title: 'Class names',
45
+ description: "Additionally, to get the preferred styling when including your own children as\nsections, you can utilize the below included class names.\n\n| Class name | Element | Features |\n| ---------------------------------------------------- | ----------- | ---------------------------------------------------------- |\n| `#{$pkg-prefix}--create-full-page__step-title` | title | `productive-heading-04` & `margin-bottom` of `$spacing-05` |\n| `#{$pkg-prefix}--create-full-page__step-subtitle` | subtitle | `productive-heading-01` & `margin-bottom` of `$spacing-03` |\n| `#{$pkg-prefix}--create-full-page__step-description` | description | `body-long-01` & `margin-bottom` of `$spacing-06` |\n| `#{$pkg-prefix}--create-full-page__step-fieldset` | fieldset | `margin-bottom` of `$spacing-05` to all children elements |\n| `#{$pkg-prefix}--create-full-page__section-divider` | divider | Includes a `1px` divider line inside the `main` content |\n"
46
+ }]
47
+ });
48
+ };
49
+ var _default = DocsPage;
50
+ exports.default = _default;
@@ -43,7 +43,8 @@ var componentName = 'EditFullPage';
43
43
  // };
44
44
 
45
45
  /**
46
- * TODO: A description of the component.
46
+ * Use when settings on a page need to always be shown in edit mode, or when the context of the page is needed to make several changes.
47
+ * See usage guidance for further details.
47
48
  */
48
49
  var EditFullPage = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
49
50
  var children = _ref.children,
@@ -41,7 +41,7 @@ var defaults = {
41
41
  };
42
42
 
43
43
  /**
44
- * TODO: A description of the component.
44
+ * Use with medium complexity edits if the user needs page context.
45
45
  */
46
46
  var EditSidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
47
47
  var children = _ref.children,
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _StoryDocsPage = require("../../global/js/utils/StoryDocsPage");
11
+ var stories = _interopRequireWildcard(require("./EditTearsheet.stories"));
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+ 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; }
14
+ var DocsPage = function DocsPage() {
15
+ return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
16
+ altGuidelinesHref: "https://pages.github.ibm.com/cdai-design/pal/patterns/edit/usage#tearsheet-edit",
17
+ blocks: [{
18
+ story: stories.multiFormEditTearsheet,
19
+ description: "This is used when you have one section per step. This can be created by passing\nin the overall `<EditTearsheet />` component and the `<EditTearsheetForm />`\ncomponent with form items as children:",
20
+ source: {
21
+ code: "<EditTearsheet {...props}>\n <EditTearsheetForm\n title=\"Required title\"\n subtitle=\"Optional subtitle\"\n description=\"Optional description\"\n onNext={() => {\n 'Optional function';\n }}\n >\n <TextInput\n id=\"test-1\"\n invalidText=\"A valid value is required\"\n labelText=\"Topic name\"\n placeholder=\"Enter topic name\"\n />\n </EditTearsheetForm>\n</EditTearsheet>"
22
+ }
23
+ }, {
24
+ title: 'Using custom components',
25
+ description: "It is possible to use custom components that return `EditTearsheetForms` in\norder to help reduce the amount of logic in the component that contains the main\n`EditTearsheet`. _It is required that each child of the `EditTearsheet` either\nbe a custom step or a `EditTearsheetForm`_. An example of this could look like\nthe following:",
26
+ source: {
27
+ code: "const CreateFormCustom = ({ subtitle, ...rest }) => {\n return (\n <EditTearsheetForm {...rest} subtitle={subtitle} title=\"Form 1\">\n form content here\n </EditTearsheetForm>\n );\n};\n\nconst CreateComponent = () => {\n return (\n <EditTearsheet {...EditTearsheetProps}>\n <CreateFormCustom subtitle=\"Custom form subtitle\" />\n <EditTearsheetForm\n title=\"Topic name\"\n fieldsetLegendText=\"Topic information\"\n subtitle=\"This is the unique name used to recognize your topic\"\n description=\"It will also be used by your producers and consumers as part of the\n connection information, so make it something easy to recognize.\"\n >\n Content for second form\n </EditTearsheetForm>\n </EditTearsheet>\n );\n};"
28
+ }
29
+ }, {
30
+ title: "Class names",
31
+ description: "Additionally, to get the preferred styling when including your own children as\nsections, you can utilize the below included class names.\n\n| Class name | Element | Features |\n| ----------------------------------------------------- | ----------- | ---------------------------------------------------------- |\n| `#{$pkg-prefix}--create-tearsheet__form--title` | title | `productive-heading-04` & `margin-bottom` of `$spacing-05` |\n| `#{$pkg-prefix}--create-tearsheet__form--subtitle` | subtitle | `productive-heading-01` & `margin-bottom` of `$spacing-03` |\n| `#{$pkg-prefix}--create-tearsheet__form--description` | description | `body-long-01` & `margin-bottom` of `$spacing-06` |\n| `#{$pkg-prefix}--create-tearsheet__form--fieldset` | fieldset | `margin-bottom` of `$spacing-05` to all children elements |\n"
32
+ }]
33
+ });
34
+ };
35
+ var _default = DocsPage;
36
+ exports.default = _default;
@@ -44,6 +44,10 @@ var defaults = {
44
44
  verticalPosition: 'normal',
45
45
  influencerWidth: 'narrow'
46
46
  };
47
+
48
+ /**
49
+ * Use Tearsheet with medium to complex edits. See usage guidance for further information.
50
+ */
47
51
  var EditTearsheet = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
48
52
  var cancelButtonText = _ref.cancelButtonText,
49
53
  children = _ref.children,
@@ -43,7 +43,7 @@ var componentName = 'EditTearsheetNarrow';
43
43
  // };
44
44
 
45
45
  /**
46
- * TODO: A description of the component.
46
+ * Use a narrow tearsheet as an alternative to a modal when there is scrolling. See usage guidance for further information.
47
47
  */
48
48
  var EditTearsheetNarrow = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
49
49
  var children = _ref.children,
@@ -47,9 +47,10 @@ var componentName = 'EditUpdateCards';
47
47
  // };
48
48
 
49
49
  /**
50
- * TODO: A description of the component.
50
+ Editable cards allow a user to view, modify, and save the content contained within the card.
51
+ These cards are generally used in instances where a user needs to make changes to a resource instances
52
+ (ex. configuration details), account plan, etc. Editable cards allow a user to edit something within context.
51
53
  */
52
-
53
54
  var EditUpdateCards = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
54
55
  var actionIcons = _ref.actionIcons,
55
56
  actionsPlacement = _ref.actionsPlacement,
@@ -36,6 +36,10 @@ var defaults = {
36
36
  position: 'top',
37
37
  size: 'lg'
38
38
  };
39
+
40
+ /**
41
+ * The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
42
+ */
39
43
  exports.defaults = defaults;
40
44
  var EmptyState = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
41
45
  var action = _ref.action,
@@ -31,6 +31,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
31
31
  // The block part of our conventional BEM class names (blockClass__E--M).
32
32
  var blockClass = "".concat(_settings.pkg.prefix, "--empty-state");
33
33
  var componentName = 'ErrorEmptyState';
34
+
35
+ /**
36
+ * The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
37
+ */
34
38
  var ErrorEmptyState = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
35
39
  var action = _ref.action,
36
40
  className = _ref.className,