@carbon/ibm-products 2.1.3 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. package/css/index-full-carbon.css +246 -777
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +3 -3
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +11 -210
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +2 -2
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +48 -412
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +3 -3
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +121 -344
  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/AboutModal/AboutModal.js +4 -2
  18. package/es/components/ActionBar/ActionBar.js +6 -2
  19. package/es/components/AddSelect/AddSelectFormControl.js +6 -6
  20. package/es/components/AddSelect/AddSelectRow.js +5 -15
  21. package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +6 -5
  22. package/es/components/ButtonMenu/ButtonMenu.js +4 -4
  23. package/es/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +9 -3
  24. package/es/components/Cascade/Cascade.js +1 -11
  25. package/es/components/CreateFullPage/CreateFullPage.js +0 -13
  26. package/es/components/CreateModal/CreateModal.js +0 -7
  27. package/es/components/CreateSidePanel/CreateSidePanel.js +1 -1
  28. package/es/components/DataSpreadsheet/DataSpreadsheet.js +3 -3
  29. package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  30. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -3
  31. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +2 -3
  32. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -1
  33. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +1 -1
  34. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +47 -39
  35. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +24 -20
  36. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/index.js +1 -0
  37. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +15 -44
  38. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +21 -0
  39. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +10 -12
  40. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +2 -2
  41. package/es/components/Datagrid/useActionsColumn.js +7 -10
  42. package/es/components/Datagrid/useCustomizeColumns.js +7 -9
  43. package/es/components/Datagrid/useExpandedRow.js +7 -11
  44. package/es/components/Datagrid/useFiltering.js +8 -12
  45. package/es/components/Datagrid/useInlineEdit.js +0 -3
  46. package/es/components/Datagrid/useNestedRows.js +6 -10
  47. package/es/components/Datagrid/useStickyColumn.js +3 -10
  48. package/es/components/Datagrid/utils/DatagridActions.js +14 -6
  49. package/es/components/EditFullPage/EditFullPage.js +1 -2
  50. package/es/components/EditSidePanel/EditSidePanel.js +1 -1
  51. package/es/components/EditTearsheet/EditTearsheet.js +0 -4
  52. package/es/components/EditTearsheetNarrow/EditTearsheetNarrow.js +1 -1
  53. package/es/components/EditUpdateCards/EditUpdateCards.js +2 -3
  54. package/es/components/EmptyStates/EmptyState.js +0 -4
  55. package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +0 -4
  56. package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +0 -4
  57. package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +0 -4
  58. package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +0 -4
  59. package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +0 -4
  60. package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +0 -4
  61. package/es/components/ExportModal/ExportModal.js +0 -4
  62. package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +0 -6
  63. package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +0 -6
  64. package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +0 -6
  65. package/es/components/ImportModal/ImportModal.js +6 -13
  66. package/es/components/MultiAddSelect/MultiAddSelect.js +0 -4
  67. package/es/components/NotificationsPanel/preview-components/UnreadNotificationBell.js +17 -2
  68. package/es/components/PageHeader/PageHeader.js +6 -2
  69. package/es/components/PageHeader/PageHeaderUtils.js +2 -2
  70. package/es/components/RemoveModal/RemoveModal.js +0 -6
  71. package/es/components/SidePanel/SidePanel.js +3 -1
  72. package/es/components/SingleAddSelect/SingleAddSelect.js +0 -4
  73. package/es/components/StatusIcon/StatusIcon.js +0 -10
  74. package/es/components/TagSet/TagSet.js +7 -4
  75. package/es/components/Tearsheet/TearsheetShell.js +6 -11
  76. package/es/components/UserProfileImage/UserProfileImage.js +3 -14
  77. package/es/components/WebTerminal/WebTerminal.js +0 -4
  78. package/es/global/js/hooks/useCreateComponentStepChange.js +15 -16
  79. package/es/global/js/hooks/useResizeObserver.js +28 -14
  80. package/es/global/js/package-settings.js +1 -14
  81. package/es/global/js/utils/story-helper.js +6 -108
  82. package/lib/components/AboutModal/AboutModal.js +4 -2
  83. package/lib/components/ActionBar/ActionBar.js +6 -2
  84. package/lib/components/AddSelect/AddSelectFormControl.js +6 -6
  85. package/lib/components/AddSelect/AddSelectRow.js +5 -15
  86. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +6 -5
  87. package/lib/components/ButtonMenu/ButtonMenu.js +4 -4
  88. package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +9 -3
  89. package/lib/components/Cascade/Cascade.js +1 -11
  90. package/lib/components/CreateFullPage/CreateFullPage.js +0 -13
  91. package/lib/components/CreateModal/CreateModal.js +0 -7
  92. package/lib/components/CreateSidePanel/CreateSidePanel.js +1 -1
  93. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +3 -3
  94. package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  95. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -3
  96. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +2 -3
  97. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -1
  98. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +1 -1
  99. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +45 -37
  100. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +24 -20
  101. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/index.js +7 -0
  102. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +13 -42
  103. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +30 -0
  104. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +10 -12
  105. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +2 -2
  106. package/lib/components/Datagrid/useActionsColumn.js +7 -12
  107. package/lib/components/Datagrid/useCustomizeColumns.js +8 -10
  108. package/lib/components/Datagrid/useExpandedRow.js +6 -9
  109. package/lib/components/Datagrid/useFiltering.js +7 -10
  110. package/lib/components/Datagrid/useInlineEdit.js +0 -3
  111. package/lib/components/Datagrid/useNestedRows.js +6 -9
  112. package/lib/components/Datagrid/useStickyColumn.js +3 -10
  113. package/lib/components/Datagrid/utils/DatagridActions.js +13 -5
  114. package/lib/components/EditFullPage/EditFullPage.js +1 -2
  115. package/lib/components/EditSidePanel/EditSidePanel.js +1 -1
  116. package/lib/components/EditTearsheet/EditTearsheet.js +0 -4
  117. package/lib/components/EditTearsheetNarrow/EditTearsheetNarrow.js +1 -1
  118. package/lib/components/EditUpdateCards/EditUpdateCards.js +2 -3
  119. package/lib/components/EmptyStates/EmptyState.js +0 -4
  120. package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +0 -4
  121. package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +0 -4
  122. package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +0 -4
  123. package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +0 -4
  124. package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +0 -4
  125. package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +0 -4
  126. package/lib/components/ExportModal/ExportModal.js +0 -4
  127. package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +0 -6
  128. package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +0 -6
  129. package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +0 -6
  130. package/lib/components/ImportModal/ImportModal.js +6 -13
  131. package/lib/components/MultiAddSelect/MultiAddSelect.js +0 -4
  132. package/lib/components/NotificationsPanel/preview-components/UnreadNotificationBell.js +17 -2
  133. package/lib/components/PageHeader/PageHeader.js +6 -2
  134. package/lib/components/PageHeader/PageHeaderUtils.js +2 -2
  135. package/lib/components/RemoveModal/RemoveModal.js +0 -6
  136. package/lib/components/SidePanel/SidePanel.js +3 -1
  137. package/lib/components/SingleAddSelect/SingleAddSelect.js +0 -4
  138. package/lib/components/StatusIcon/StatusIcon.js +0 -10
  139. package/lib/components/TagSet/TagSet.js +7 -4
  140. package/lib/components/Tearsheet/TearsheetShell.js +6 -11
  141. package/lib/components/UserProfileImage/UserProfileImage.js +3 -14
  142. package/lib/components/WebTerminal/WebTerminal.js +0 -4
  143. package/lib/global/js/hooks/useCreateComponentStepChange.js +15 -16
  144. package/lib/global/js/hooks/useResizeObserver.js +27 -13
  145. package/lib/global/js/package-settings.js +1 -14
  146. package/lib/global/js/utils/story-helper.js +7 -115
  147. package/package.json +4 -4
  148. package/scss/components/AddSelect/_add-select.scss +0 -4
  149. package/scss/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss +1 -0
  150. package/scss/components/ButtonMenu/_button-menu.scss +1 -32
  151. package/scss/components/Cascade/_storybook-styles.scss +2 -3
  152. package/scss/components/DataSpreadsheet/_storybook-styles.scss +0 -6
  153. package/scss/components/Datagrid/_datagrid.scss +2 -4
  154. package/scss/components/Datagrid/_storybook-styles.scss +2 -16
  155. package/scss/components/Datagrid/styles/_datagrid.scss +13 -26
  156. package/scss/components/Datagrid/styles/addons/_FilterFlyout.scss +0 -7
  157. package/scss/components/Datagrid/styles/addons/_FilterPanel.scss +0 -4
  158. package/scss/components/HTTPErrors/_storybook-styles.scss +6 -0
  159. package/scss/components/NotificationsPanel/_notifications-panel.scss +1 -1
  160. package/scss/components/NotificationsPanel/_storybook-styles.scss +2 -10
  161. package/scss/components/PageHeader/_page-header.scss +1 -0
  162. package/scss/components/PageHeader/_storybook-styles.scss +14 -24
  163. package/scss/components/SidePanel/_side-panel.scss +2 -0
  164. package/scss/components/Tearsheet/_tearsheet.scss +6 -7
  165. package/scss/components/WebTerminal/_storybook-styles.scss +1 -11
  166. package/scss/global/styles/_display-box.scss +0 -1
  167. package/es/components/APIKeyModal/APIKeyModal.docs-page.js +0 -26
  168. package/es/components/AboutModal/AboutModal.docs-page.js +0 -21
  169. package/es/components/Cascade/Cascade.docs-page.js +0 -22
  170. package/es/components/CreateFullPage/CreateFullPage.docs-page.js +0 -39
  171. package/es/components/CreateModal/CreateModal.docs-page.js +0 -24
  172. package/es/components/CreateSidePanel/CreateSidePanel.docs-page.js +0 -18
  173. package/es/components/CreateTearsheet/CreateTearsheet.docs-page.js +0 -29
  174. package/es/components/EditFullPage/EditFullPage.docs-page.js +0 -39
  175. package/es/components/EditTearsheet/EditTearsheet.docs-page.js +0 -25
  176. package/es/components/ExampleComponent/ExampleComponent.docs-page.js +0 -22
  177. package/es/components/ImportModal/ImportModal.docs-page.js +0 -18
  178. package/es/components/MultiAddSelect/MultiAddSelect.docs-page.js +0 -17
  179. package/es/components/RemoveModal/RemoveModal.docs-page.js +0 -18
  180. package/es/components/SingleAddSelect/SingleAddSelect.docs-page.js +0 -15
  181. package/es/components/StatusIcon/StatusIcon.docs-page.js +0 -17
  182. package/es/components/Toolbar/Toolbar.docs-page.js +0 -14
  183. package/es/components/UserProfileImage/UserProfileImage.docs-page.js +0 -17
  184. package/es/components/WebTerminal/WebTerminal.docs-page.js +0 -52
  185. package/es/global/js/utils/StoryDocsPage.js +0 -218
  186. package/lib/components/APIKeyModal/APIKeyModal.docs-page.js +0 -37
  187. package/lib/components/AboutModal/AboutModal.docs-page.js +0 -32
  188. package/lib/components/Cascade/Cascade.docs-page.js +0 -33
  189. package/lib/components/CreateFullPage/CreateFullPage.docs-page.js +0 -50
  190. package/lib/components/CreateModal/CreateModal.docs-page.js +0 -35
  191. package/lib/components/CreateSidePanel/CreateSidePanel.docs-page.js +0 -29
  192. package/lib/components/CreateTearsheet/CreateTearsheet.docs-page.js +0 -40
  193. package/lib/components/EditFullPage/EditFullPage.docs-page.js +0 -50
  194. package/lib/components/EditTearsheet/EditTearsheet.docs-page.js +0 -36
  195. package/lib/components/ExampleComponent/ExampleComponent.docs-page.js +0 -33
  196. package/lib/components/ImportModal/ImportModal.docs-page.js +0 -26
  197. package/lib/components/MultiAddSelect/MultiAddSelect.docs-page.js +0 -25
  198. package/lib/components/RemoveModal/RemoveModal.docs-page.js +0 -26
  199. package/lib/components/SingleAddSelect/SingleAddSelect.docs-page.js +0 -23
  200. package/lib/components/StatusIcon/StatusIcon.docs-page.js +0 -28
  201. package/lib/components/Toolbar/Toolbar.docs-page.js +0 -25
  202. package/lib/components/UserProfileImage/UserProfileImage.docs-page.js +0 -28
  203. package/lib/components/WebTerminal/WebTerminal.docs-page.js +0 -63
  204. package/lib/global/js/utils/StoryDocsPage.js +0 -225
@@ -1,25 +0,0 @@
1
- import React from 'react';
2
- import { StoryDocsPage } from '../../global/js/utils/StoryDocsPage';
3
- import * as stories from './EditTearsheet.stories';
4
- var DocsPage = function DocsPage() {
5
- return /*#__PURE__*/React.createElement(StoryDocsPage, {
6
- altGuidelinesHref: "https://pages.github.ibm.com/cdai-design/pal/patterns/edit/usage#tearsheet-edit",
7
- blocks: [{
8
- story: stories.multiFormEditTearsheet,
9
- 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:",
10
- source: {
11
- 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>"
12
- }
13
- }, {
14
- title: 'Using custom components',
15
- 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:",
16
- source: {
17
- 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};"
18
- }
19
- }, {
20
- title: "Class names",
21
- 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"
22
- }]
23
- });
24
- };
25
- export default DocsPage;
@@ -1,22 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2023, 2023
3
- *
4
- * This source code is licensed under the Apache-2.0 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
- import React from 'react';
8
- import { StoryDocsPage } from '../../global/js/utils/StoryDocsPage';
9
- import * as stories from './ExampleComponent.stories';
10
-
11
- /**
12
- * OPTIONAL: required only to customize default docs page
13
- */
14
- var DocsPage = function DocsPage() {
15
- return /*#__PURE__*/React.createElement(StoryDocsPage, {
16
- blocks: [{
17
- description: 'Here it is in use.',
18
- story: stories.exampleComponent
19
- }]
20
- });
21
- };
22
- export default DocsPage;
@@ -1,18 +0,0 @@
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;
@@ -1,17 +0,0 @@
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;
@@ -1,18 +0,0 @@
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;
@@ -1,15 +0,0 @@
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;
@@ -1,17 +0,0 @@
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;
@@ -1,14 +0,0 @@
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;
@@ -1,17 +0,0 @@
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;
@@ -1,52 +0,0 @@
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;
@@ -1,218 +0,0 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- 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; }
4
- 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) { _defineProperty(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; }
5
- /**
6
- * Copyright IBM Corp. 2023, 2023
7
- *
8
- * This source code is licensed under the Apache-2.0 license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
-
12
- import React from 'react';
13
- import PropTypes from 'prop-types';
14
- import { Title, Description, Source, Controls, Canvas, Stories, AnchorMdx, useOf } from '@storybook/blocks';
15
- import { paramCase } from 'change-case';
16
- import { codeSandboxHref, stackblitzHref, storyDocsPageInfo } from './story-helper';
17
- export var CustomBlocks = function CustomBlocks(_ref) {
18
- var blocks = _ref.blocks;
19
- return blocks.map(function (block, index) {
20
- var source = _objectSpread({}, block === null || block === void 0 ? void 0 : block.source);
21
- if (source.code && !source.language) {
22
- source.language = 'jsx';
23
- }
24
- return /*#__PURE__*/React.createElement("div", {
25
- key: "block-index--".concat(index)
26
- }, block.title && /*#__PURE__*/React.createElement("h3", {
27
- id: paramCase(block.title)
28
- }, block.title), block.subTitle && /*#__PURE__*/React.createElement("h4", null, block.subTitle), block.description && typeof block.description === 'string' ? /*#__PURE__*/React.createElement(Description, null, block.description) : block.description, block.story && /*#__PURE__*/React.createElement(Canvas, {
29
- of: block.story
30
- }), block.source && /*#__PURE__*/React.createElement(Source, source));
31
- });
32
- };
33
-
34
- /**
35
- * This function checks blocks against stories and then
36
- * - Adds title if no alternative is supplied
37
- * - Adds blocks for unreferenced stories if omitUnreferencedStories is false
38
- */
39
- var processBlocks = function processBlocks(blocks, stories, omitUnreferencedStories) {
40
- var blocksWithStoryTitles = blocks ? _toConsumableArray(blocks) : [];
41
- var restOfStories = [];
42
- var storyKeys = Object.keys(stories);
43
- storyKeys.forEach(function (sk) {
44
- var story = stories[sk].moduleExport;
45
- var storyName = stories[sk].name;
46
- var matchingBlock = blocksWithStoryTitles.find(function (block) {
47
- return block.story === story;
48
- });
49
- if (matchingBlock) {
50
- var _matchingBlock$title;
51
- matchingBlock.title = (_matchingBlock$title = matchingBlock.title) !== null && _matchingBlock$title !== void 0 ? _matchingBlock$title : storyName;
52
- } else if (!omitUnreferencedStories) {
53
- restOfStories.push({
54
- story: story,
55
- title: storyName
56
- });
57
- }
58
- });
59
- if (!omitUnreferencedStories) {
60
- return blocksWithStoryTitles.concat(restOfStories);
61
- }
62
- return blocksWithStoryTitles;
63
- };
64
-
65
- /**
66
- * Calling with no parameters will produce the default output.
67
- * Customize by providing alternative values and/or blocks defining sections
68
- * @param {*} param0
69
- * @returns
70
- */
71
- export var StoryDocsPage = function StoryDocsPage(_ref2) {
72
- var _csfFile$meta, _csfFile$meta$paramet, _processedBlocks$filt;
73
- var altTitle = _ref2.altTitle,
74
- altDescription = _ref2.altDescription,
75
- altGuidelinesHref = _ref2.altGuidelinesHref,
76
- blocks = _ref2.blocks,
77
- omitCodedExample = _ref2.omitCodedExample,
78
- omitUnreferencedStories = _ref2.omitUnreferencedStories;
79
- var _useOf = useOf('meta', ['meta']),
80
- csfFile = _useOf.csfFile;
81
- var storyInfo = storyDocsPageInfo(csfFile);
82
- var guidelinesHref = altGuidelinesHref !== null && altGuidelinesHref !== void 0 ? altGuidelinesHref : storyInfo.guidelinesHref;
83
- var isFullScreen = (csfFile === null || csfFile === void 0 ? void 0 : (_csfFile$meta = csfFile.meta) === null || _csfFile$meta === void 0 ? void 0 : (_csfFile$meta$paramet = _csfFile$meta.parameters) === null || _csfFile$meta$paramet === void 0 ? void 0 : _csfFile$meta$paramet.layout) === 'fullscreen' || false;
84
- var storyHelperClass = isFullScreen ? 'c4p--story-docs-page--fullscreen' : '';
85
- var processedBlocks = processBlocks(blocks, csfFile.stories, omitUnreferencedStories);
86
- console.log(processBlocks);
87
- var storyCount = (_processedBlocks$filt = processedBlocks === null || processedBlocks === void 0 ? void 0 : processedBlocks.filter(function (block) {
88
- return !!block.story;
89
- }).length) !== null && _processedBlocks$filt !== void 0 ? _processedBlocks$filt : 0;
90
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Title, null, altTitle !== null && altTitle !== void 0 ? altTitle : storyInfo.title), guidelinesHref ? guidelinesHref && Array.isArray(guidelinesHref) ? guidelinesHref.map(function (_ref3, index) {
91
- var href = _ref3.href,
92
- label = _ref3.label;
93
- return /*#__PURE__*/React.createElement(React.Fragment, null, index > 0 && ' | ', /*#__PURE__*/React.createElement(AnchorMdx, {
94
- key: href,
95
- href: href
96
- }, label));
97
- }) : /*#__PURE__*/React.createElement(AnchorMdx, {
98
- href: guidelinesHref
99
- }, altTitle ? "".concat(altTitle, " usage guidelines") : storyInfo.guidelinesLinkLabel) : null, /*#__PURE__*/React.createElement("h2", {
100
- style: {
101
- marginTop: guidelinesHref ? '16px' : ''
102
- }
103
- }, "Table of contents"), /*#__PURE__*/React.createElement("ul", null, ['Overview', 'Coded examples', 'Example usage', 'Component API'].map(function (item) {
104
- return /*#__PURE__*/React.createElement("li", {
105
- key: item
106
- }, /*#__PURE__*/React.createElement(AnchorMdx, {
107
- href: "#".concat(paramCase(item))
108
- }, item), processedBlocks && item === 'Example usage' ? /*#__PURE__*/React.createElement("ul", null, processedBlocks.map(function (block) {
109
- return block !== null && block !== void 0 && block.title ? /*#__PURE__*/React.createElement("li", {
110
- key: block.title
111
- }, /*#__PURE__*/React.createElement(AnchorMdx, {
112
- href: "#".concat(paramCase(block.title))
113
- }, block.title)) : null;
114
- })) : null);
115
- })), /*#__PURE__*/React.createElement("h2", {
116
- id: "overview"
117
- }, "Overview"), /*#__PURE__*/React.createElement(Description, null, altDescription), !omitCodedExample && storyInfo.expectCodedExample ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h2", {
118
- id: "coded-examples"
119
- }, "Coded examples"), /*#__PURE__*/React.createElement("p", null, "Coded examples can be edited and are a great way to try out a component."), /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", {
120
- key: "codesandbox"
121
- }, /*#__PURE__*/React.createElement(AnchorMdx, {
122
- href: codeSandboxHref(storyInfo.title)
123
- }, /*#__PURE__*/React.createElement("svg", {
124
- viewBox: "0 0 24 24",
125
- xmlns: "http://www.w3.org/2000/svg",
126
- style: {
127
- height: '16px',
128
- width: '16px',
129
- color: 'black',
130
- boxShadow: '0 0 0 2px white',
131
- marginRight: '8px',
132
- verticalAlign: '-2px'
133
- }
134
- }, /*#__PURE__*/React.createElement("path", {
135
- fillRule: "evenodd",
136
- clipRule: "evenodd",
137
- d: "M0 0h23.987v24H0V0Zm21.533 2.455v19.09H2.453V2.456h19.08Z",
138
- fill: "currentColor"
139
- })), "CodeSandbox")), /*#__PURE__*/React.createElement("li", {
140
- key: "stackblitz"
141
- }, /*#__PURE__*/React.createElement(AnchorMdx, {
142
- href: stackblitzHref(storyInfo.title)
143
- }, /*#__PURE__*/React.createElement("img", {
144
- src: "https://c.staticblitz.com/assets/favicon_sb-861fe1b85c0dc928750c62de15fed96fc75e57ee366bd937bad17a3938917b3f.svg",
145
- alt: "Stackblitz logo",
146
- style: {
147
- verticalAlign: '-2px',
148
- marginRight: '8px'
149
- }
150
- }), "Stackblitz")))) : null, /*#__PURE__*/React.createElement("h2", {
151
- id: "example-usage"
152
- }, "Example usage"), /*#__PURE__*/React.createElement("div", {
153
- className: storyHelperClass
154
- }, processedBlocks ? /*#__PURE__*/React.createElement(CustomBlocks, {
155
- blocks: processedBlocks
156
- }) : /*#__PURE__*/React.createElement(Stories, null)), /*#__PURE__*/React.createElement("h2", {
157
- id: "component-api"
158
- }, "Component API"), storyCount > 1 && /*#__PURE__*/React.createElement("p", null, "NOTE: Changing the controls below affects the default/primary example shown on the docs page."), /*#__PURE__*/React.createElement(Controls, null));
159
- };
160
- StoryDocsPage.propTypes = {
161
- /**
162
- * Uses doc block from the component where possible.
163
- *
164
- * Note: use `export default { component: ExampleComponent }` in the story if the main component is wrapped by some
165
- * additional code. This will allow the doc block to pass through.
166
- *
167
- * If passed as string treated as markdown.
168
- */
169
- altDescription: PropTypes.node,
170
- /**
171
- * location if any of guidelines on the PAL site, constructed by default
172
- */
173
- altGuidelinesHref: PropTypes.oneOfType(PropTypes.string, PropTypes.arrayOf(PropTypes.shape({
174
- href: PropTypes.string,
175
- label: PropTypes.string
176
- }))),
177
- /**
178
- * Uses component name by default
179
- */
180
- altTitle: PropTypes.string,
181
- /**
182
- * Array with content sections
183
- */
184
- blocks: PropTypes.arrayOf(PropTypes.shape({
185
- /**
186
- * Optional title story name used by default<h3>
187
- */
188
- title: PropTypes.string,
189
- /**
190
- * Optional subTitle a <h4>
191
- */
192
- subTitle: PropTypes.string,
193
- /**
194
- * Optional description, strings treated as markdown.
195
- */
196
- description: PropTypes.node,
197
- /**
198
- * Story imported from story file
199
- */
200
- story: PropTypes.func,
201
- /**
202
- * Some source code
203
- * default language `jsx`
204
- */
205
- source: PropTypes.shape({
206
- language: PropTypes.oneOf('javascript', 'css', 'jsx'),
207
- code: PropTypes.string
208
- })
209
- })),
210
- /**
211
- * Set to true if no published example exists (all components and patterns should have an example)
212
- */
213
- omitCodedExample: PropTypes.bool,
214
- /**
215
- * Stories unreferenced in blocks included by default
216
- */
217
- omitUnreferencedStories: PropTypes.bool
218
- };
@@ -1,37 +0,0 @@
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 _blocks = require("@storybook/blocks");
12
- var _storyHelper = require("../../global/js/utils/story-helper");
13
- var stories = _interopRequireWildcard(require("./APIKeyModal.stories"));
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/components/modal/usage',
22
- label: 'Carbon Modal usage guidelines'
23
- }, {
24
- href: 'https://react.carbondesignsystem.com/?path=/docs/modal--default',
25
- label: 'Carbon Modal documentation'
26
- }],
27
- blocks: [{
28
- story: stories.Edit,
29
- description: "API key creation / generation is assumed to be the default mode for this modal.\nTo enable key editing you have to set the `edit` prop to true and supply any\nother edit related props with the relevant input."
30
- }, {
31
- description: "By default generate and edit only supply a name input for your key. If you need additional input you should use custom steps",
32
- story: stories.CustomEdit
33
- }]
34
- });
35
- };
36
- var _default = DocsPage;
37
- exports.default = _default;
@@ -1,32 +0,0 @@
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("./AboutModal.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
- guidelinesHref: "https://pages.github.ibm.com/cdai-design/pal/patterns/about-modal/usage",
17
- blocks: [{
18
- story: stories.aboutModal
19
- }, {
20
- story: stories.fullyLoaded
21
- }, {
22
- title: 'Overriding the Carbon theme',
23
- description: 'The design recommendation is to use a dark theme for the AboutModal if the application is currently using a light theme, and vice versa. The theme applied to the AboutModal can easily be customized as follows:',
24
- source: {
25
- language: 'css',
26
- code: ".#{$pkg-prefix}--about-modal {\n @include carbon--theme(\n $theme: $carbon--theme--g90\n );\n}"
27
- }
28
- }]
29
- });
30
- };
31
- var _default = DocsPage;
32
- exports.default = _default;
@@ -1,33 +0,0 @@
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;
@@ -1,50 +0,0 @@
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;