@carbon/ibm-products 1.0.0-rc.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +11 -12
- package/css/index-full-carbon.css +33427 -0
- package/css/index-full-carbon.css.map +1 -0
- package/css/index-full-carbon.min.css +9 -0
- package/css/index-without-carbon-released-only.css +7831 -0
- package/css/index-without-carbon-released-only.css.map +1 -0
- package/css/index-without-carbon-released-only.min.css +9 -0
- package/css/index-without-carbon.css +9841 -0
- package/css/index-without-carbon.css.map +1 -0
- package/css/index-without-carbon.min.css +9 -0
- package/css/index.css +22317 -0
- package/css/index.css.map +1 -0
- package/css/index.min.css +9 -0
- package/es/components/APIKeyModal/APIKeyDownloader.js +103 -0
- package/es/components/APIKeyModal/APIKeyModal.js +593 -0
- package/es/components/APIKeyModal/index.js +7 -0
- package/es/components/AboutModal/AboutModal.js +202 -0
- package/es/components/AboutModal/index.js +7 -0
- package/es/components/ActionBar/ActionBar.js +274 -0
- package/es/components/ActionBar/ActionBarItem.js +99 -0
- package/es/components/ActionBar/ActionBarOverflowItems.js +70 -0
- package/es/components/ActionBar/index.js +8 -0
- package/es/components/ActionSet/ActionSet.js +195 -0
- package/es/components/ActionSet/actions.js +48 -0
- package/es/components/ActionSet/index.js +7 -0
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +349 -0
- package/es/components/BreadcrumbWithOverflow/index.js +8 -0
- package/es/components/ButtonMenu/ButtonMenu.js +108 -0
- package/es/components/ButtonMenu/ButtonMenuItem.js +30 -0
- package/es/components/ButtonMenu/index.js +8 -0
- package/es/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +231 -0
- package/es/components/ButtonSetWithOverflow/index.js +7 -0
- package/es/components/Card/Card.js +242 -0
- package/es/components/Card/CardFooter.js +72 -0
- package/es/components/Card/CardHeader.js +53 -0
- package/es/components/Card/index.js +9 -0
- package/es/components/Cascade/Cascade.js +88 -0
- package/es/components/Cascade/index.js +1 -0
- package/es/components/ComboButton/ComboButton.js +110 -0
- package/es/components/ComboButton/ComboButtonItem/index.js +39 -0
- package/es/components/ComboButton/index.js +8 -0
- package/es/components/CreateFullPage/CreateFullPage.js +454 -0
- package/es/components/CreateFullPage/CreateFullPageSection.js +53 -0
- package/es/components/CreateFullPage/CreateFullPageStep.js +112 -0
- package/es/components/CreateFullPage/constants.js +8 -0
- package/es/components/CreateFullPage/index.js +9 -0
- package/es/components/CreateInfluencer/CreateInfluencer.js +273 -0
- package/es/components/CreateInfluencer/index.js +7 -0
- package/es/components/CreateModal/CreateModal.js +152 -0
- package/es/components/CreateModal/index.js +8 -0
- package/es/components/CreateSidePanel/CreateSidePanel.js +175 -0
- package/es/components/CreateSidePanel/index.js +7 -0
- package/es/components/CreateTearsheet/CreateTearsheet.js +371 -0
- package/es/components/CreateTearsheet/CreateTearsheetDivider.js +33 -0
- package/es/components/CreateTearsheet/CreateTearsheetSection.js +83 -0
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +129 -0
- package/es/components/CreateTearsheet/constants.js +8 -0
- package/es/components/CreateTearsheet/index.js +10 -0
- package/es/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +244 -0
- package/es/components/CreateTearsheet/preview-components/MultiStepWithIntro.js +295 -0
- package/es/components/CreateTearsheet/preview-components/MultiStepWithSectionsTearsheet.js +327 -0
- package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +174 -0
- package/es/components/CreateTearsheetNarrow/index.js +7 -0
- package/es/components/EditSidePanel/EditSidePanel.js +209 -0
- package/es/components/EditSidePanel/index.js +7 -0
- package/es/components/EmptyStates/EmptyState.js +118 -0
- package/es/components/EmptyStates/EmptyStateContent.js +85 -0
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +113 -0
- package/es/components/EmptyStates/ErrorEmptyState/index.js +7 -0
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +113 -0
- package/es/components/EmptyStates/NoDataEmptyState/index.js +7 -0
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +113 -0
- package/es/components/EmptyStates/NoTagsEmptyState/index.js +7 -0
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +113 -0
- package/es/components/EmptyStates/NotFoundEmptyState/index.js +7 -0
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +113 -0
- package/es/components/EmptyStates/NotificationsEmptyState/index.js +7 -0
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +113 -0
- package/es/components/EmptyStates/UnauthorizedEmptyState/index.js +7 -0
- package/es/components/EmptyStates/assets/ErrorIllustration.js +217 -0
- package/es/components/EmptyStates/assets/NoDataIllustration.js +180 -0
- package/es/components/EmptyStates/assets/NoTagsIllustration.js +488 -0
- package/es/components/EmptyStates/assets/NotFoundIllustration.js +365 -0
- package/es/components/EmptyStates/assets/NotificationsIllustration.js +336 -0
- package/es/components/EmptyStates/assets/UnauthorizedIllustration.js +309 -0
- package/es/components/EmptyStates/index.js +13 -0
- package/es/components/ExampleComponent/ExampleComponent.js +160 -0
- package/es/components/ExampleComponent/index.js +7 -0
- package/es/components/ExportModal/ExportModal.js +276 -0
- package/es/components/ExportModal/index.js +7 -0
- package/es/components/ExpressiveCard/ExpressiveCard.js +138 -0
- package/es/components/ExpressiveCard/index.js +7 -0
- package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +87 -0
- package/es/components/HTTPErrors/HTTPError403/index.js +7 -0
- package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +87 -0
- package/es/components/HTTPErrors/HTTPError404/index.js +7 -0
- package/es/components/HTTPErrors/HTTPErrorContent.js +84 -0
- package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +87 -0
- package/es/components/HTTPErrors/HTTPErrorOther/index.js +7 -0
- package/es/components/HTTPErrors/assets/HTTPErrorSvg403.js +1238 -0
- package/es/components/HTTPErrors/assets/HTTPErrorSvg404.js +1037 -0
- package/es/components/HTTPErrors/assets/HTTPErrorSvgOther.js +1088 -0
- package/es/components/HTTPErrors/index.js +9 -0
- package/es/components/ImportModal/ImportModal.js +421 -0
- package/es/components/ImportModal/index.js +7 -0
- package/es/components/LoadingBar/LoadingBar.js +160 -0
- package/es/components/LoadingBar/index.js +7 -0
- package/es/components/ModifiedTabs/ModifiedTabLabelNew.js +34 -0
- package/es/components/ModifiedTabs/ModifiedTabLabelWithClose.js +54 -0
- package/es/components/ModifiedTabs/ModifiedTabs.js +113 -0
- package/es/components/ModifiedTabs/index.js +1 -0
- package/es/components/NotificationsPanel/NotificationsPanel.js +547 -0
- package/es/components/NotificationsPanel/NotificationsPanel_data.js +134 -0
- package/es/components/NotificationsPanel/index.js +7 -0
- package/es/components/NotificationsPanel/preview-components/UnreadNotificationBell.js +49 -0
- package/es/components/NotificationsPanel/utils.js +56 -0
- package/es/components/OptionsTile/OptionsTile.js +306 -0
- package/es/components/OptionsTile/index.js +7 -0
- package/es/components/PageHeader/PageHeader.js +789 -0
- package/es/components/PageHeader/PageHeaderDemo.data.js +614 -0
- package/es/components/PageHeader/PageHeaderTitle.js +49 -0
- package/es/components/PageHeader/PageHeaderUtils.js +187 -0
- package/es/components/PageHeader/index.js +7 -0
- package/es/components/ProductiveCard/ProductiveCard.js +118 -0
- package/es/components/ProductiveCard/index.js +7 -0
- package/es/components/RemoveModal/RemoveModal.js +189 -0
- package/es/components/RemoveModal/index.js +7 -0
- package/es/components/Saving/Saving.js +156 -0
- package/es/components/Saving/index.js +7 -0
- package/es/components/SidePanel/SidePanel.js +643 -0
- package/es/components/SidePanel/constants.js +13 -0
- package/es/components/SidePanel/index.js +7 -0
- package/es/components/StatusIcon/StatusIcon.js +132 -0
- package/es/components/StatusIcon/index.js +7 -0
- package/es/components/TagSet/TagSet.js +326 -0
- package/es/components/TagSet/TagSetModal.js +118 -0
- package/es/components/TagSet/TagSetOverflow.js +121 -0
- package/es/components/TagSet/index.js +7 -0
- package/es/components/Tearsheet/Tearsheet.js +180 -0
- package/es/components/Tearsheet/TearsheetNarrow.js +148 -0
- package/es/components/Tearsheet/TearsheetShell.js +390 -0
- package/es/components/Tearsheet/index.js +8 -0
- package/es/components/Toolbar/Toolbar.js +54 -0
- package/es/components/Toolbar/ToolbarButton.js +57 -0
- package/es/components/Toolbar/ToolbarGroup.js +37 -0
- package/es/components/Toolbar/index.js +9 -0
- package/es/components/UserProfileImage/UserProfileImage.js +136 -0
- package/es/components/UserProfileImage/index.js +8 -0
- package/es/components/WebTerminal/WebTerminal.js +168 -0
- package/es/components/WebTerminal/index.js +1 -0
- package/es/components/WebTerminal/preview-components/Navigation.js +31 -0
- package/es/components/WebTerminal/preview-components/documentationLinks.js +25 -0
- package/es/components/WebTerminal/preview-components/index.js +5 -0
- package/es/components/_Canary/Canary.js +48 -0
- package/es/components/_Canary/index.js +7 -0
- package/es/components/index.js +37 -0
- package/es/generated/feature-flags/feature-flags.js +15 -0
- package/es/global/js/hooks/index.js +14 -0
- package/es/global/js/hooks/useClickOutside.js +21 -0
- package/es/global/js/hooks/useCreateComponentFocus.js +37 -0
- package/es/global/js/hooks/useCreateComponentStepChange.js +250 -0
- package/es/global/js/hooks/usePreviousValue.js +19 -0
- package/es/global/js/hooks/useResetCreateComponent.js +40 -0
- package/es/global/js/hooks/useValidCreateStepCount.js +23 -0
- package/es/global/js/hooks/useWindowResize.js +67 -0
- package/es/global/js/hooks/useWindowScroll.js +80 -0
- package/es/global/js/package-settings.js +161 -0
- package/es/global/js/utils/ClickListener.js +70 -0
- package/es/global/js/utils/Wrap.js +85 -0
- package/es/global/js/utils/devtools.js +20 -0
- package/es/global/js/utils/getFocusableElements.js +14 -0
- package/es/global/js/utils/hasValidType.js +94 -0
- package/es/global/js/utils/keyboardNavigation.js +34 -0
- package/es/global/js/utils/pconsole.js +36 -0
- package/es/global/js/utils/props-helper.js +272 -0
- package/es/global/js/utils/scrollableAncestor.js +40 -0
- package/es/global/js/utils/story-helper.js +75 -0
- package/es/global/js/utils/test-helper.js +296 -0
- package/es/global/js/utils/unwrap-if-fragment.js +71 -0
- package/es/global/js/utils/uuidv4.js +12 -0
- package/es/global/js/utils/uuidv4.spec.js +23 -0
- package/es/global/js/utils/wait.js +8 -0
- package/es/global/js/utils/wrapFocus.js +74 -0
- package/es/index.js +8 -0
- package/es/settings.js +73 -0
- package/lib/components/APIKeyModal/APIKeyDownloader.js +127 -0
- package/lib/components/APIKeyModal/APIKeyModal.js +619 -0
- package/lib/components/APIKeyModal/index.js +13 -0
- package/lib/components/AboutModal/AboutModal.js +222 -0
- package/lib/components/AboutModal/index.js +13 -0
- package/lib/components/ActionBar/ActionBar.js +294 -0
- package/lib/components/ActionBar/ActionBarItem.js +107 -0
- package/lib/components/ActionBar/ActionBarOverflowItems.js +94 -0
- package/lib/components/ActionBar/index.js +21 -0
- package/lib/components/ActionSet/ActionSet.js +205 -0
- package/lib/components/ActionSet/actions.js +60 -0
- package/lib/components/ActionSet/index.js +13 -0
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +366 -0
- package/lib/components/BreadcrumbWithOverflow/index.js +13 -0
- package/lib/components/ButtonMenu/ButtonMenu.js +115 -0
- package/lib/components/ButtonMenu/ButtonMenuItem.js +44 -0
- package/lib/components/ButtonMenu/index.js +21 -0
- package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +255 -0
- package/lib/components/ButtonSetWithOverflow/index.js +13 -0
- package/lib/components/Card/Card.js +260 -0
- package/lib/components/Card/CardFooter.js +90 -0
- package/lib/components/Card/CardHeader.js +70 -0
- package/lib/components/Card/index.js +29 -0
- package/lib/components/Cascade/Cascade.js +109 -0
- package/lib/components/Cascade/index.js +13 -0
- package/lib/components/ComboButton/ComboButton.js +129 -0
- package/lib/components/ComboButton/ComboButtonItem/index.js +49 -0
- package/lib/components/ComboButton/index.js +21 -0
- package/lib/components/CreateFullPage/CreateFullPage.js +478 -0
- package/lib/components/CreateFullPage/CreateFullPageSection.js +74 -0
- package/lib/components/CreateFullPage/CreateFullPageStep.js +134 -0
- package/lib/components/CreateFullPage/constants.js +16 -0
- package/lib/components/CreateFullPage/index.js +29 -0
- package/lib/components/CreateInfluencer/CreateInfluencer.js +304 -0
- package/lib/components/CreateInfluencer/index.js +13 -0
- package/lib/components/CreateModal/CreateModal.js +161 -0
- package/lib/components/CreateModal/index.js +13 -0
- package/lib/components/CreateSidePanel/CreateSidePanel.js +187 -0
- package/lib/components/CreateSidePanel/index.js +13 -0
- package/lib/components/CreateTearsheet/CreateTearsheet.js +397 -0
- package/lib/components/CreateTearsheet/CreateTearsheetDivider.js +48 -0
- package/lib/components/CreateTearsheet/CreateTearsheetSection.js +105 -0
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +151 -0
- package/lib/components/CreateTearsheet/constants.js +17 -0
- package/lib/components/CreateTearsheet/index.js +37 -0
- package/lib/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +268 -0
- package/lib/components/CreateTearsheet/preview-components/MultiStepWithIntro.js +320 -0
- package/lib/components/CreateTearsheet/preview-components/MultiStepWithSectionsTearsheet.js +354 -0
- package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +184 -0
- package/lib/components/CreateTearsheetNarrow/index.js +13 -0
- package/lib/components/EditSidePanel/EditSidePanel.js +220 -0
- package/lib/components/EditSidePanel/index.js +13 -0
- package/lib/components/EmptyStates/EmptyState.js +134 -0
- package/lib/components/EmptyStates/EmptyStateContent.js +94 -0
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +128 -0
- package/lib/components/EmptyStates/ErrorEmptyState/index.js +13 -0
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +128 -0
- package/lib/components/EmptyStates/NoDataEmptyState/index.js +13 -0
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +128 -0
- package/lib/components/EmptyStates/NoTagsEmptyState/index.js +13 -0
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +128 -0
- package/lib/components/EmptyStates/NotFoundEmptyState/index.js +13 -0
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +128 -0
- package/lib/components/EmptyStates/NotificationsEmptyState/index.js +13 -0
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +128 -0
- package/lib/components/EmptyStates/UnauthorizedEmptyState/index.js +13 -0
- package/lib/components/EmptyStates/assets/ErrorIllustration.js +226 -0
- package/lib/components/EmptyStates/assets/NoDataIllustration.js +189 -0
- package/lib/components/EmptyStates/assets/NoTagsIllustration.js +497 -0
- package/lib/components/EmptyStates/assets/NotFoundIllustration.js +374 -0
- package/lib/components/EmptyStates/assets/NotificationsIllustration.js +345 -0
- package/lib/components/EmptyStates/assets/UnauthorizedIllustration.js +318 -0
- package/lib/components/EmptyStates/index.js +61 -0
- package/lib/components/ExampleComponent/ExampleComponent.js +169 -0
- package/lib/components/ExampleComponent/index.js +13 -0
- package/lib/components/ExportModal/ExportModal.js +298 -0
- package/lib/components/ExportModal/index.js +13 -0
- package/lib/components/ExpressiveCard/ExpressiveCard.js +161 -0
- package/lib/components/ExpressiveCard/index.js +13 -0
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +98 -0
- package/lib/components/HTTPErrors/HTTPError403/index.js +13 -0
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +98 -0
- package/lib/components/HTTPErrors/HTTPError404/index.js +13 -0
- package/lib/components/HTTPErrors/HTTPErrorContent.js +90 -0
- package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +98 -0
- package/lib/components/HTTPErrors/HTTPErrorOther/index.js +13 -0
- package/lib/components/HTTPErrors/assets/HTTPErrorSvg403.js +1251 -0
- package/lib/components/HTTPErrors/assets/HTTPErrorSvg404.js +1050 -0
- package/lib/components/HTTPErrors/assets/HTTPErrorSvgOther.js +1101 -0
- package/lib/components/HTTPErrors/index.js +29 -0
- package/lib/components/ImportModal/ImportModal.js +443 -0
- package/lib/components/ImportModal/index.js +13 -0
- package/lib/components/LoadingBar/LoadingBar.js +174 -0
- package/lib/components/LoadingBar/index.js +13 -0
- package/lib/components/ModifiedTabs/ModifiedTabLabelNew.js +48 -0
- package/lib/components/ModifiedTabs/ModifiedTabLabelWithClose.js +68 -0
- package/lib/components/ModifiedTabs/ModifiedTabs.js +137 -0
- package/lib/components/ModifiedTabs/index.js +13 -0
- package/lib/components/NotificationsPanel/NotificationsPanel.js +569 -0
- package/lib/components/NotificationsPanel/NotificationsPanel_data.js +146 -0
- package/lib/components/NotificationsPanel/index.js +13 -0
- package/lib/components/NotificationsPanel/preview-components/UnreadNotificationBell.js +58 -0
- package/lib/components/NotificationsPanel/utils.js +65 -0
- package/lib/components/OptionsTile/OptionsTile.js +327 -0
- package/lib/components/OptionsTile/index.js +13 -0
- package/lib/components/PageHeader/PageHeader.js +822 -0
- package/lib/components/PageHeader/PageHeaderDemo.data.js +623 -0
- package/lib/components/PageHeader/PageHeaderTitle.js +63 -0
- package/lib/components/PageHeader/PageHeaderUtils.js +205 -0
- package/lib/components/PageHeader/index.js +13 -0
- package/lib/components/ProductiveCard/ProductiveCard.js +141 -0
- package/lib/components/ProductiveCard/index.js +13 -0
- package/lib/components/RemoveModal/RemoveModal.js +210 -0
- package/lib/components/RemoveModal/index.js +13 -0
- package/lib/components/Saving/Saving.js +175 -0
- package/lib/components/Saving/index.js +13 -0
- package/lib/components/SidePanel/SidePanel.js +668 -0
- package/lib/components/SidePanel/constants.js +21 -0
- package/lib/components/SidePanel/index.js +13 -0
- package/lib/components/StatusIcon/StatusIcon.js +145 -0
- package/lib/components/StatusIcon/index.js +13 -0
- package/lib/components/TagSet/TagSet.js +352 -0
- package/lib/components/TagSet/TagSetModal.js +139 -0
- package/lib/components/TagSet/TagSetOverflow.js +147 -0
- package/lib/components/TagSet/index.js +13 -0
- package/lib/components/Tearsheet/Tearsheet.js +192 -0
- package/lib/components/Tearsheet/TearsheetNarrow.js +160 -0
- package/lib/components/Tearsheet/TearsheetShell.js +420 -0
- package/lib/components/Tearsheet/index.js +21 -0
- package/lib/components/Toolbar/Toolbar.js +72 -0
- package/lib/components/Toolbar/ToolbarButton.js +75 -0
- package/lib/components/Toolbar/ToolbarGroup.js +52 -0
- package/lib/components/Toolbar/index.js +29 -0
- package/lib/components/UserProfileImage/UserProfileImage.js +146 -0
- package/lib/components/UserProfileImage/index.js +13 -0
- package/lib/components/WebTerminal/WebTerminal.js +186 -0
- package/lib/components/WebTerminal/index.js +13 -0
- package/lib/components/WebTerminal/preview-components/Navigation.js +44 -0
- package/lib/components/WebTerminal/preview-components/documentationLinks.js +32 -0
- package/lib/components/WebTerminal/preview-components/index.js +15 -0
- package/lib/components/_Canary/Canary.js +54 -0
- package/lib/components/_Canary/index.js +13 -0
- package/lib/components/index.js +343 -0
- package/lib/generated/feature-flags/feature-flags.js +22 -0
- package/lib/global/js/hooks/index.js +75 -0
- package/lib/global/js/hooks/useClickOutside.js +31 -0
- package/lib/global/js/hooks/useCreateComponentFocus.js +48 -0
- package/lib/global/js/hooks/useCreateComponentStepChange.js +263 -0
- package/lib/global/js/hooks/usePreviousValue.js +29 -0
- package/lib/global/js/hooks/useResetCreateComponent.js +50 -0
- package/lib/global/js/hooks/useValidCreateStepCount.js +33 -0
- package/lib/global/js/hooks/useWindowResize.js +79 -0
- package/lib/global/js/hooks/useWindowScroll.js +91 -0
- package/lib/global/js/package-settings.js +166 -0
- package/lib/global/js/utils/ClickListener.js +89 -0
- package/lib/global/js/utils/Wrap.js +93 -0
- package/lib/global/js/utils/devtools.js +31 -0
- package/lib/global/js/utils/getFocusableElements.js +25 -0
- package/lib/global/js/utils/hasValidType.js +110 -0
- package/lib/global/js/utils/keyboardNavigation.js +45 -0
- package/lib/global/js/utils/pconsole.js +53 -0
- package/lib/global/js/utils/props-helper.js +304 -0
- package/lib/global/js/utils/scrollableAncestor.js +48 -0
- package/lib/global/js/utils/story-helper.js +100 -0
- package/lib/global/js/utils/test-helper.js +342 -0
- package/lib/global/js/utils/unwrap-if-fragment.js +82 -0
- package/lib/global/js/utils/uuidv4.js +20 -0
- package/lib/global/js/utils/uuidv4.spec.js +28 -0
- package/lib/global/js/utils/wait.js +16 -0
- package/lib/global/js/utils/wrapFocus.js +84 -0
- package/lib/index.js +30 -0
- package/lib/settings.js +92 -0
- package/package.json +5 -5
- package/scss/components/APIKeyModal/_api-key-modal.scss +63 -0
- package/scss/components/APIKeyModal/_index.scss +10 -0
- package/scss/components/APIKeyModal/_storybook-styles.scss +33 -0
- package/scss/components/AboutModal/_about-modal.scss +116 -0
- package/scss/components/AboutModal/_index.scss +8 -0
- package/scss/components/AboutModal/_storybook-styles.scss +15 -0
- package/scss/components/ActionBar/_action-bar.scss +67 -0
- package/scss/components/ActionBar/_index.scss +8 -0
- package/scss/components/ActionSet/_action-set.scss +114 -0
- package/scss/components/ActionSet/_index.scss +8 -0
- package/scss/components/ActionSet/_storybook-styles.scss +38 -0
- package/scss/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss +86 -0
- package/scss/components/BreadcrumbWithOverflow/_index.scss +8 -0
- package/scss/components/ButtonMenu/_button-menu.scss +36 -0
- package/scss/components/ButtonMenu/_index.scss +8 -0
- package/scss/components/ButtonMenu/_storybook-styles.scss +6 -0
- package/scss/components/ButtonSetWithOverflow/_button-set-with-overflow.scss +52 -0
- package/scss/components/ButtonSetWithOverflow/_index.scss +8 -0
- package/scss/components/Card/_card.scss +121 -0
- package/scss/components/Card/_index.scss +10 -0
- package/scss/components/Card/_storybook-styles.scss +12 -0
- package/scss/components/Cascade/_cascade.scss +50 -0
- package/scss/components/Cascade/_index.scss +10 -0
- package/scss/components/Cascade/_storybook-styles.scss +32 -0
- package/scss/components/ComboButton/_combo-button.scss +64 -0
- package/scss/components/ComboButton/_index.scss +10 -0
- package/scss/components/CreateFullPage/_create-full-page.scss +187 -0
- package/scss/components/CreateFullPage/_index.scss +8 -0
- package/scss/components/CreateFullPage/_storybook-styles.scss +51 -0
- package/scss/components/CreateInfluencer/_create-influencer.scss +89 -0
- package/scss/components/CreateInfluencer/_index.scss +8 -0
- package/scss/components/CreateModal/_create-modal.scss +81 -0
- package/scss/components/CreateModal/_index.scss +8 -0
- package/scss/components/CreateModal/_storybook-styles.scss +50 -0
- package/scss/components/CreateSidePanel/_create-side-panel.scss +99 -0
- package/scss/components/CreateSidePanel/_index.scss +8 -0
- package/scss/components/CreateSidePanel/_storybook-styles.scss +27 -0
- package/scss/components/CreateTearsheet/_create-tearsheet.scss +136 -0
- package/scss/components/CreateTearsheet/_index.scss +8 -0
- package/scss/components/CreateTearsheet/_storybook-styles.scss +53 -0
- package/scss/components/CreateTearsheetNarrow/_create-tearsheet-narrow.scss +68 -0
- package/scss/components/CreateTearsheetNarrow/_index.scss +8 -0
- package/scss/components/CreateTearsheetNarrow/_storybook-styles.scss +32 -0
- package/scss/components/EditSidePanel/_edit-side-panel.scss +66 -0
- package/scss/components/EditSidePanel/_index.scss +8 -0
- package/scss/components/EditSidePanel/_storybook-styles.scss +35 -0
- package/scss/components/EmptyStates/_empty-state.scss +62 -0
- package/scss/components/EmptyStates/_index.scss +8 -0
- package/scss/components/EmptyStates/_storybook-styles.scss +6 -0
- package/scss/components/ExampleComponent/_example-component.scss +39 -0
- package/scss/components/ExampleComponent/_index.scss +8 -0
- package/scss/components/ExampleComponent/_storybook-styles.scss +6 -0
- package/scss/components/ExportModal/_export-modal.scss +61 -0
- package/scss/components/ExportModal/_index.scss +10 -0
- package/scss/components/ExportModal/_storybook-styles.scss +6 -0
- package/scss/components/ExpressiveCard/_expressive-card.scss +25 -0
- package/scss/components/ExpressiveCard/_index.scss +10 -0
- package/scss/components/ExpressiveCard/_storybook-styles.scss +25 -0
- package/scss/components/HTTPErrors/_http-errors.scss +72 -0
- package/scss/components/HTTPErrors/_index.scss +8 -0
- package/scss/components/HTTPErrors/_storybook-styles.scss +6 -0
- package/scss/components/ImportModal/_import-modal.scss +88 -0
- package/scss/components/ImportModal/_index.scss +8 -0
- package/scss/components/ImportModal/_storybook-styles.scss +6 -0
- package/scss/components/LoadingBar/_index.scss +8 -0
- package/scss/components/LoadingBar/_loading-bar.scss +211 -0
- package/scss/components/LoadingBar/_storybook-styles.scss +19 -0
- package/scss/components/ModifiedTabs/_index.scss +1 -0
- package/scss/components/ModifiedTabs/_modified-tabs.scss +72 -0
- package/scss/components/ModifiedTabs/_storybook-styles.scss +6 -0
- package/scss/components/NotificationsPanel/_index.scss +8 -0
- package/scss/components/NotificationsPanel/_notifications-panel.scss +285 -0
- package/scss/components/NotificationsPanel/_storybook-styles.scss +6 -0
- package/scss/components/OptionsTile/_index.scss +8 -0
- package/scss/components/OptionsTile/_options-tile.scss +221 -0
- package/scss/components/OptionsTile/_storybook-styles.scss +33 -0
- package/scss/components/PageHeader/_index.scss +10 -0
- package/scss/components/PageHeader/_page-header.scss +641 -0
- package/scss/components/PageHeader/_storybook-styles.scss +76 -0
- package/scss/components/ProductiveCard/_index.scss +10 -0
- package/scss/components/ProductiveCard/_productive-card.scss +71 -0
- package/scss/components/ProductiveCard/_storybook-styles.scss +22 -0
- package/scss/components/RemoveModal/_index.scss +10 -0
- package/scss/components/RemoveModal/_remove-modal.scss +40 -0
- package/scss/components/RemoveModal/_storybook-styles.scss +6 -0
- package/scss/components/Saving/_index.scss +10 -0
- package/scss/components/Saving/_saving.scss +42 -0
- package/scss/components/Saving/_storybook-styles.scss +12 -0
- package/scss/components/SidePanel/_index.scss +8 -0
- package/scss/components/SidePanel/_side-panel-variables.scss +14 -0
- package/scss/components/SidePanel/_side-panel.scss +496 -0
- package/scss/components/SidePanel/_storybook-styles.scss +38 -0
- package/scss/components/StatusIcon/_index.scss +8 -0
- package/scss/components/StatusIcon/_status-icon.scss +139 -0
- package/scss/components/StatusIcon/_storybook-styles.scss +6 -0
- package/scss/components/TagSet/_index.scss +8 -0
- package/scss/components/TagSet/_tag-set.scss +162 -0
- package/scss/components/Tearsheet/_index.scss +8 -0
- package/scss/components/Tearsheet/_storybook-styles.scss +24 -0
- package/scss/components/Tearsheet/_tearsheet.scss +308 -0
- package/scss/components/Toolbar/_index.scss +8 -0
- package/scss/components/Toolbar/_toolbar.scss +78 -0
- package/scss/components/UserProfileImage/_color-map.scss +39 -0
- package/scss/components/UserProfileImage/_index.scss +8 -0
- package/scss/components/UserProfileImage/_storybook.scss +6 -0
- package/scss/components/UserProfileImage/_user-profile-image.scss +137 -0
- package/scss/components/WebTerminal/_index.scss +1 -0
- package/scss/components/WebTerminal/_storybook-styles.scss +14 -0
- package/scss/components/WebTerminal/_web-terminal.scss +70 -0
- package/scss/components/_Canary/_canary.scss +9 -0
- package/scss/components/_index-released-only.scss +34 -0
- package/scss/components/_index.scss +44 -0
- package/scss/generated/feature-flags/_feature-flags.scss +19 -0
- package/scss/global/styles/_generate-carbon-modules.scss +14 -0
- package/scss/global/styles/_imported-carbon-modules.scss +25 -0
- package/scss/global/styles/_mixins.scss +22 -0
- package/scss/global/styles/_project-settings.scss +22 -0
- package/scss/index-full-carbon.scss +11 -0
- package/scss/index-without-carbon-released-only.scss +13 -0
- package/scss/index-without-carbon.scss +13 -0
- package/scss/index.scss +10 -0
@@ -0,0 +1,371 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
+
var _excluded = ["backButtonText", "cancelButtonText", "children", "className", "description", "includeViewAllToggle", "influencerWidth", "initialStep", "label", "nextButtonText", "onClose", "onRequestSubmit", "open", "sideNavAriaLabel", "submitButtonText", "title", "verticalPosition", "viewAllToggleLabelText", "viewAllToggleOffLabelText", "viewAllToggleOnLabelText"];
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Copyright IBM Corp. 2021, 2021
|
9
|
+
*
|
10
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
12
|
+
*/
|
13
|
+
import React, { forwardRef, useCallback, useState, useRef } from 'react';
|
14
|
+
import PropTypes from 'prop-types';
|
15
|
+
import cx from 'classnames';
|
16
|
+
import { Grid, Form } from 'carbon-components-react';
|
17
|
+
import wrapFocus from '../../global/js/utils/wrapFocus';
|
18
|
+
import { TearsheetShell } from '../Tearsheet/TearsheetShell';
|
19
|
+
import { CreateInfluencer } from '../CreateInfluencer';
|
20
|
+
import { pkg } from '../../settings';
|
21
|
+
import { CREATE_TEARSHEET_SECTION, CREATE_TEARSHEET_STEP } from './constants';
|
22
|
+
import { usePreviousValue, useValidCreateStepCount, useResetCreateComponent, useCreateComponentFocus, useCreateComponentStepChange } from '../../global/js/hooks';
|
23
|
+
import { hasValidChildrenType, hasValidChildType, getExtractedSteps } from '../../global/js/utils/hasValidType';
|
24
|
+
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
25
|
+
var componentName = 'CreateTearsheet';
|
26
|
+
var blockClass = "".concat(pkg.prefix, "--tearsheet-create");
|
27
|
+
export var CreateTearsheet = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
28
|
+
var backButtonText = _ref.backButtonText,
|
29
|
+
cancelButtonText = _ref.cancelButtonText,
|
30
|
+
children = _ref.children,
|
31
|
+
className = _ref.className,
|
32
|
+
description = _ref.description,
|
33
|
+
includeViewAllToggle = _ref.includeViewAllToggle,
|
34
|
+
influencerWidth = _ref.influencerWidth,
|
35
|
+
initialStep = _ref.initialStep,
|
36
|
+
label = _ref.label,
|
37
|
+
nextButtonText = _ref.nextButtonText,
|
38
|
+
onClose = _ref.onClose,
|
39
|
+
onRequestSubmit = _ref.onRequestSubmit,
|
40
|
+
open = _ref.open,
|
41
|
+
sideNavAriaLabel = _ref.sideNavAriaLabel,
|
42
|
+
submitButtonText = _ref.submitButtonText,
|
43
|
+
title = _ref.title,
|
44
|
+
verticalPosition = _ref.verticalPosition,
|
45
|
+
viewAllToggleLabelText = _ref.viewAllToggleLabelText,
|
46
|
+
viewAllToggleOffLabelText = _ref.viewAllToggleOffLabelText,
|
47
|
+
viewAllToggleOnLabelText = _ref.viewAllToggleOnLabelText,
|
48
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
49
|
+
|
50
|
+
var _useState = useState([]),
|
51
|
+
_useState2 = _slicedToArray(_useState, 2),
|
52
|
+
createTearsheetActions = _useState2[0],
|
53
|
+
setCreateTearsheetActions = _useState2[1];
|
54
|
+
|
55
|
+
var _useState3 = useState(false),
|
56
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
57
|
+
shouldViewAll = _useState4[0],
|
58
|
+
setShouldViewAll = _useState4[1];
|
59
|
+
|
60
|
+
var _useState5 = useState(0),
|
61
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
62
|
+
currentStep = _useState6[0],
|
63
|
+
setCurrentStep = _useState6[1];
|
64
|
+
|
65
|
+
var _useState7 = useState(false),
|
66
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
67
|
+
isSubmitting = _useState8[0],
|
68
|
+
setIsSubmitting = _useState8[1];
|
69
|
+
|
70
|
+
var _useState9 = useState(0),
|
71
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
72
|
+
activeSectionIndex = _useState10[0],
|
73
|
+
setActiveSectionIndex = _useState10[1];
|
74
|
+
|
75
|
+
var previousState = usePreviousValue({
|
76
|
+
currentStep: currentStep,
|
77
|
+
open: open
|
78
|
+
});
|
79
|
+
var contentRef = useRef(); // returns an array of tearsheet steps
|
80
|
+
|
81
|
+
var getTearsheetSteps = useCallback(function () {
|
82
|
+
var childrenArray = Array.isArray(children) ? children : [children];
|
83
|
+
var steps = getExtractedSteps(childrenArray, CREATE_TEARSHEET_STEP);
|
84
|
+
return steps;
|
85
|
+
}, [children]);
|
86
|
+
useCreateComponentFocus(previousState, currentStep, getTearsheetSteps, blockClass);
|
87
|
+
useValidCreateStepCount(getTearsheetSteps, componentName);
|
88
|
+
useResetCreateComponent({
|
89
|
+
previousState: previousState,
|
90
|
+
open: open,
|
91
|
+
setCurrentStep: setCurrentStep,
|
92
|
+
initialStep: initialStep,
|
93
|
+
totalSteps: getTearsheetSteps().length,
|
94
|
+
componentName: componentName
|
95
|
+
});
|
96
|
+
useCreateComponentStepChange({
|
97
|
+
setCurrentStep: setCurrentStep,
|
98
|
+
setIsSubmitting: setIsSubmitting,
|
99
|
+
setShouldViewAll: setShouldViewAll,
|
100
|
+
onClose: onClose,
|
101
|
+
onRequestSubmit: onRequestSubmit,
|
102
|
+
componentName: componentName,
|
103
|
+
getComponentSteps: getTearsheetSteps,
|
104
|
+
currentStep: currentStep,
|
105
|
+
shouldViewAll: shouldViewAll,
|
106
|
+
backButtonText: backButtonText,
|
107
|
+
cancelButtonText: cancelButtonText,
|
108
|
+
submitButtonText: submitButtonText,
|
109
|
+
nextButtonText: nextButtonText,
|
110
|
+
isSubmitting: isSubmitting,
|
111
|
+
componentBlockClass: blockClass,
|
112
|
+
setCreateComponentActions: setCreateTearsheetActions
|
113
|
+
});
|
114
|
+
|
115
|
+
var getTearsheetComponents = function getTearsheetComponents(childrenElements) {
|
116
|
+
var childrenArray = Array.isArray(childrenElements) ? childrenElements : [childrenElements];
|
117
|
+
var tearsheetStepComponents = getExtractedSteps(childrenArray, CREATE_TEARSHEET_STEP);
|
118
|
+
var tearsheetSectionComponents = [];
|
119
|
+
tearsheetStepComponents.forEach(function (child) {
|
120
|
+
var _child$props, _child$props$children;
|
121
|
+
|
122
|
+
// we have received an array of children, lets check to see that each child is
|
123
|
+
// a CreateTearsheetSection component before adding it to tearsheetSectionComponents
|
124
|
+
if (shouldViewAll && child !== null && child !== void 0 && (_child$props = child.props) !== null && _child$props !== void 0 && (_child$props$children = _child$props.children) !== null && _child$props$children !== void 0 && _child$props$children.length && typeof child.props.children !== 'string') {
|
125
|
+
child.props.children.forEach(function (stepChild) {
|
126
|
+
if (hasValidChildType({
|
127
|
+
child: stepChild,
|
128
|
+
type: CREATE_TEARSHEET_SECTION
|
129
|
+
})) {
|
130
|
+
tearsheetSectionComponents.push(stepChild);
|
131
|
+
}
|
132
|
+
});
|
133
|
+
} // we have received a single child element, lets check to see that it is
|
134
|
+
// a CreateTearsheetSection component before adding it to tearsheetSectionComponents
|
135
|
+
|
136
|
+
|
137
|
+
if (shouldViewAll && typeof child.props.children !== 'undefined' && !child.props.children.length) {
|
138
|
+
if (hasValidChildType({
|
139
|
+
child: child.props.children,
|
140
|
+
type: CREATE_TEARSHEET_SECTION
|
141
|
+
})) {
|
142
|
+
tearsheetSectionComponents.push(child.props.children);
|
143
|
+
}
|
144
|
+
}
|
145
|
+
});
|
146
|
+
return {
|
147
|
+
sections: tearsheetSectionComponents,
|
148
|
+
steps: tearsheetStepComponents
|
149
|
+
};
|
150
|
+
}; // renders all children (CreateTearsheetSteps)
|
151
|
+
|
152
|
+
|
153
|
+
var renderChildren = function renderChildren(childrenElements) {
|
154
|
+
var childrenArray = Array.isArray(childrenElements) ? childrenElements : [childrenElements];
|
155
|
+
var extractedSteps = getExtractedSteps(childrenArray, CREATE_TEARSHEET_STEP);
|
156
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, extractedSteps.map(function (child, stepIndex) {
|
157
|
+
var _cx;
|
158
|
+
|
159
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
160
|
+
className: cx(child.props.className, (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__step--hidden-step"), !shouldViewAll && currentStep !== stepIndex + 1), _defineProperty(_cx, "".concat(blockClass, "__step--visible-step"), currentStep === stepIndex + 1), _cx)),
|
161
|
+
key: "key_".concat(stepIndex)
|
162
|
+
});
|
163
|
+
}));
|
164
|
+
}; // adds focus trap functionality
|
165
|
+
|
166
|
+
/* istanbul ignore next */
|
167
|
+
|
168
|
+
|
169
|
+
var handleBlur = function handleBlur(_ref2) {
|
170
|
+
var oldActiveNode = _ref2.target,
|
171
|
+
currentActiveNode = _ref2.relatedTarget;
|
172
|
+
var visibleStepInnerContent = document.querySelector(".".concat(pkg.prefix, "--tearsheet__body"));
|
173
|
+
|
174
|
+
if (open && visibleStepInnerContent) {
|
175
|
+
wrapFocus({
|
176
|
+
bodyNode: visibleStepInnerContent,
|
177
|
+
currentActiveNode: currentActiveNode,
|
178
|
+
oldActiveNode: oldActiveNode
|
179
|
+
});
|
180
|
+
}
|
181
|
+
};
|
182
|
+
|
183
|
+
return /*#__PURE__*/React.createElement(TearsheetShell, _extends({}, rest, getDevtoolsProps(componentName), {
|
184
|
+
actions: createTearsheetActions,
|
185
|
+
className: cx(blockClass, className),
|
186
|
+
description: description,
|
187
|
+
hasCloseIcon: false,
|
188
|
+
influencer: /*#__PURE__*/React.createElement(CreateInfluencer, {
|
189
|
+
activeSectionIndex: activeSectionIndex,
|
190
|
+
componentBlockClass: blockClass,
|
191
|
+
createComponentName: componentName,
|
192
|
+
currentStep: currentStep,
|
193
|
+
createComponents: getTearsheetComponents(children),
|
194
|
+
includeViewAllToggle: includeViewAllToggle,
|
195
|
+
handleToggleState: function handleToggleState(toggleState) {
|
196
|
+
return setShouldViewAll(toggleState);
|
197
|
+
},
|
198
|
+
handleActiveSectionIndex: function handleActiveSectionIndex(index) {
|
199
|
+
return setActiveSectionIndex(index);
|
200
|
+
},
|
201
|
+
open: open,
|
202
|
+
previousState: previousState,
|
203
|
+
sideNavAriaLabel: sideNavAriaLabel,
|
204
|
+
toggleState: shouldViewAll,
|
205
|
+
viewAllToggleLabelText: viewAllToggleLabelText,
|
206
|
+
viewAllToggleOffLabelText: viewAllToggleOffLabelText,
|
207
|
+
viewAllToggleOnLabelText: viewAllToggleOnLabelText
|
208
|
+
}),
|
209
|
+
influencerPosition: "left",
|
210
|
+
influencerWidth: influencerWidth,
|
211
|
+
label: label,
|
212
|
+
onClose: onClose,
|
213
|
+
open: open,
|
214
|
+
size: "wide",
|
215
|
+
title: title,
|
216
|
+
verticalPosition: verticalPosition,
|
217
|
+
ref: ref
|
218
|
+
}), /*#__PURE__*/React.createElement("div", {
|
219
|
+
className: "".concat(blockClass, "__content"),
|
220
|
+
onBlur: handleBlur,
|
221
|
+
ref: contentRef
|
222
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Form, null, renderChildren(children)))));
|
223
|
+
}); // Return a placeholder if not released and not enabled by feature flag
|
224
|
+
|
225
|
+
CreateTearsheet = pkg.checkComponentEnabled(CreateTearsheet, componentName); // The display name of the component, used by React. Note that displayName
|
226
|
+
// is used in preference to relying on function.name.
|
227
|
+
|
228
|
+
CreateTearsheet.displayName = componentName; // Note that the descriptions here should be kept in sync with those for the
|
229
|
+
// corresponding props for TearsheetNarrow and TearsheetShell components.
|
230
|
+
|
231
|
+
CreateTearsheet.propTypes = {
|
232
|
+
/**
|
233
|
+
* The back button text
|
234
|
+
*/
|
235
|
+
backButtonText: PropTypes.string.isRequired,
|
236
|
+
|
237
|
+
/**
|
238
|
+
* The cancel button text
|
239
|
+
*/
|
240
|
+
cancelButtonText: PropTypes.string.isRequired,
|
241
|
+
|
242
|
+
/**
|
243
|
+
* The main content of the tearsheet
|
244
|
+
*/
|
245
|
+
children: hasValidChildrenType({
|
246
|
+
componentName: componentName,
|
247
|
+
childType: CREATE_TEARSHEET_STEP
|
248
|
+
}),
|
249
|
+
|
250
|
+
/**
|
251
|
+
* An optional class or classes to be added to the outermost element.
|
252
|
+
*/
|
253
|
+
className: PropTypes.string,
|
254
|
+
|
255
|
+
/**
|
256
|
+
* A description of the flow, displayed in the header area of the tearsheet.
|
257
|
+
*/
|
258
|
+
description: PropTypes.node,
|
259
|
+
|
260
|
+
/**
|
261
|
+
* @ignore
|
262
|
+
* Used to optionally include view all toggle
|
263
|
+
*/
|
264
|
+
includeViewAllToggle: PropTypes.bool,
|
265
|
+
|
266
|
+
/**
|
267
|
+
* Used to set the size of the influencer
|
268
|
+
*/
|
269
|
+
influencerWidth: PropTypes.oneOf(['narrow', 'wide']),
|
270
|
+
|
271
|
+
/**
|
272
|
+
* This can be used to open the component to a step other than the first step.
|
273
|
+
* For example, a create flow was previously in progress, data was saved, and
|
274
|
+
* is now being completed.
|
275
|
+
*/
|
276
|
+
initialStep: PropTypes.number,
|
277
|
+
|
278
|
+
/**
|
279
|
+
* A label for the tearsheet, displayed in the header area of the tearsheet
|
280
|
+
* to maintain context for the tearsheet (e.g. as the title changes from page
|
281
|
+
* to page of a multi-page task).
|
282
|
+
*/
|
283
|
+
label: PropTypes.node,
|
284
|
+
|
285
|
+
/**
|
286
|
+
* The next button text
|
287
|
+
*/
|
288
|
+
nextButtonText: PropTypes.string.isRequired,
|
289
|
+
|
290
|
+
/**
|
291
|
+
* An optional handler that is called when the user closes the tearsheet (by
|
292
|
+
* clicking the close button, if enabled, or clicking outside, if enabled).
|
293
|
+
* Returning `false` here prevents the modal from closing.
|
294
|
+
*/
|
295
|
+
onClose: PropTypes.func,
|
296
|
+
|
297
|
+
/**
|
298
|
+
* Specify a handler for submitting the multi step tearsheet (final step).
|
299
|
+
* This function can _optionally_ return a promise that is either resolved or rejected and the CreateTearsheet will handle the submitting state of the create button.
|
300
|
+
*/
|
301
|
+
onRequestSubmit: PropTypes.func.isRequired,
|
302
|
+
|
303
|
+
/**
|
304
|
+
* Specifies whether the tearsheet is currently open.
|
305
|
+
*/
|
306
|
+
open: PropTypes.bool,
|
307
|
+
|
308
|
+
/**
|
309
|
+
* @ignore
|
310
|
+
* The aria label to be used for the UI Shell SideNav Carbon component
|
311
|
+
*/
|
312
|
+
sideNavAriaLabel: PropTypes.string.isRequired.if(function (_ref3) {
|
313
|
+
var includeViewAllToggle = _ref3.includeViewAllToggle;
|
314
|
+
return includeViewAllToggle;
|
315
|
+
}),
|
316
|
+
|
317
|
+
/**
|
318
|
+
* The submit button text
|
319
|
+
*/
|
320
|
+
submitButtonText: PropTypes.string.isRequired,
|
321
|
+
|
322
|
+
/**
|
323
|
+
* The main title of the tearsheet, displayed in the header area.
|
324
|
+
*/
|
325
|
+
title: PropTypes.node,
|
326
|
+
|
327
|
+
/**
|
328
|
+
* The position of the top of tearsheet in the viewport. The 'normal'
|
329
|
+
* position (the default) is a short distance down from the top of the
|
330
|
+
* viewport, leaving room at the top for a global header bar to show through
|
331
|
+
* from below. The 'lower' position provides a little extra room at the top
|
332
|
+
* to allow an action bar navigation or breadcrumbs to also show through.
|
333
|
+
*/
|
334
|
+
verticalPosition: PropTypes.oneOf(['normal', 'lower']),
|
335
|
+
|
336
|
+
/**
|
337
|
+
* @ignore
|
338
|
+
* Sets the label text for the view all toggle component
|
339
|
+
*/
|
340
|
+
viewAllToggleLabelText: PropTypes.string.isRequired.if(function (_ref4) {
|
341
|
+
var includeViewAllToggle = _ref4.includeViewAllToggle;
|
342
|
+
return includeViewAllToggle === true;
|
343
|
+
}),
|
344
|
+
|
345
|
+
/**
|
346
|
+
* @ignore
|
347
|
+
* Sets the label text for the view all toggle `off` text
|
348
|
+
*/
|
349
|
+
viewAllToggleOffLabelText: PropTypes.string.isRequired.if(function (_ref5) {
|
350
|
+
var includeViewAllToggle = _ref5.includeViewAllToggle;
|
351
|
+
return includeViewAllToggle === true;
|
352
|
+
}),
|
353
|
+
|
354
|
+
/**
|
355
|
+
* @ignore
|
356
|
+
* Sets the label text for the view all toggle `on` text
|
357
|
+
*/
|
358
|
+
viewAllToggleOnLabelText: PropTypes.string.isRequired.if(function (_ref6) {
|
359
|
+
var includeViewAllToggle = _ref6.includeViewAllToggle;
|
360
|
+
return includeViewAllToggle === true;
|
361
|
+
})
|
362
|
+
}; // Default values for component props. Default values are not required for
|
363
|
+
// props that are required, nor for props where the component can apply
|
364
|
+
// 'undefined' values reasonably. Default values should be provided when the
|
365
|
+
// component needs to make a choice or assumption when a prop is not supplied.
|
366
|
+
|
367
|
+
CreateTearsheet.defaultProps = {
|
368
|
+
verticalPosition: 'normal',
|
369
|
+
includeViewAllToggle: false,
|
370
|
+
influencerWidth: 'narrow'
|
371
|
+
};
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
|
+
var _excluded = ["className"];
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Copyright IBM Corp. 2021, 2021
|
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
|
+
import React, { forwardRef } from 'react';
|
12
|
+
import PropTypes from 'prop-types';
|
13
|
+
import cx from 'classnames';
|
14
|
+
import { pkg } from '../../settings';
|
15
|
+
var componentName = 'CreateTearsheetDivider';
|
16
|
+
var blockClass = "".concat(pkg.prefix, "--tearsheet-create__section--divider");
|
17
|
+
export var CreateTearsheetDivider = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
18
|
+
var className = _ref.className,
|
19
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
20
|
+
|
21
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, rest, {
|
22
|
+
ref: ref,
|
23
|
+
className: cx(blockClass, className)
|
24
|
+
}));
|
25
|
+
}); // Return a placeholder if not released and not enabled by feature flag
|
26
|
+
|
27
|
+
CreateTearsheetDivider = pkg.checkComponentEnabled(CreateTearsheetDivider, componentName);
|
28
|
+
CreateTearsheetDivider.propTypes = {
|
29
|
+
/**
|
30
|
+
* Sets an optional className to be added to the tearsheet step
|
31
|
+
*/
|
32
|
+
className: PropTypes.string
|
33
|
+
};
|
@@ -0,0 +1,83 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2021, 2021
|
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, { forwardRef } from 'react';
|
8
|
+
import PropTypes from 'prop-types';
|
9
|
+
import cx from 'classnames';
|
10
|
+
import { Column, Row } from 'carbon-components-react';
|
11
|
+
import { pkg } from '../../settings';
|
12
|
+
import { CREATE_TEARSHEET_SECTION } from './constants';
|
13
|
+
var componentName = 'CreateTearsheetSection';
|
14
|
+
var blockClass = "".concat(pkg.prefix, "--tearsheet-create__section");
|
15
|
+
export var CreateTearsheetSection = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
16
|
+
var id = _ref.id,
|
17
|
+
children = _ref.children,
|
18
|
+
className = _ref.className,
|
19
|
+
subtitle = _ref.subtitle,
|
20
|
+
description = _ref.description,
|
21
|
+
title = _ref.title,
|
22
|
+
isViewingAllStepsTogether = _ref.isViewingAllStepsTogether;
|
23
|
+
return /*#__PURE__*/React.createElement("div", {
|
24
|
+
className: cx(blockClass, className),
|
25
|
+
ref: ref,
|
26
|
+
id: id
|
27
|
+
}, /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Column, {
|
28
|
+
xlg: 12,
|
29
|
+
lg: 12,
|
30
|
+
md: 8,
|
31
|
+
sm: 8
|
32
|
+
}, isViewingAllStepsTogether && /*#__PURE__*/React.createElement("h4", {
|
33
|
+
className: "".concat(blockClass, "--title")
|
34
|
+
}, title), isViewingAllStepsTogether && subtitle && /*#__PURE__*/React.createElement("h6", {
|
35
|
+
className: "".concat(blockClass, "--subtitle")
|
36
|
+
}, subtitle), isViewingAllStepsTogether && description && /*#__PURE__*/React.createElement("p", {
|
37
|
+
className: "".concat(blockClass, "--description")
|
38
|
+
}, description))), children);
|
39
|
+
});
|
40
|
+
CreateTearsheetSection.displayName = componentName;
|
41
|
+
CreateTearsheetSection.propTypes = {
|
42
|
+
/**
|
43
|
+
* Content that shows in the tearsheet step
|
44
|
+
*/
|
45
|
+
children: PropTypes.node,
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Sets an optional className to be added to the tearsheet step
|
49
|
+
*/
|
50
|
+
className: PropTypes.string,
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Sets an optional description on the section component
|
54
|
+
*/
|
55
|
+
description: PropTypes.string,
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Sets the id of the CreateTearsheetSection outermost element
|
59
|
+
*/
|
60
|
+
id: PropTypes.string.isRequired,
|
61
|
+
|
62
|
+
/**
|
63
|
+
* The is an internal prop set in CreateTearsheet so the section knows when to render it's title
|
64
|
+
*/
|
65
|
+
isViewingAllStepsTogether: PropTypes.bool,
|
66
|
+
|
67
|
+
/**
|
68
|
+
* Sets an optional subtitle on the section component
|
69
|
+
*/
|
70
|
+
subtitle: PropTypes.string,
|
71
|
+
|
72
|
+
/**
|
73
|
+
* Sets the title text for a tearsheet step
|
74
|
+
*/
|
75
|
+
title: PropTypes.node.isRequired
|
76
|
+
}; // Default values for component props. Default values are not required for
|
77
|
+
// props that are required, nor for props where the component can apply
|
78
|
+
// 'undefined' values reasonably. Default values should be provided when the
|
79
|
+
// component needs to make a choice or assumption when a prop is not supplied.
|
80
|
+
|
81
|
+
CreateTearsheetSection.defaultProps = {
|
82
|
+
type: CREATE_TEARSHEET_SECTION
|
83
|
+
};
|
@@ -0,0 +1,129 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2021, 2021
|
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, { forwardRef } from 'react';
|
8
|
+
import PropTypes from 'prop-types';
|
9
|
+
import cx from 'classnames';
|
10
|
+
import { Column, FormGroup, Row } from 'carbon-components-react';
|
11
|
+
import { pkg } from '../../settings';
|
12
|
+
import { CREATE_TEARSHEET_STEP } from './constants';
|
13
|
+
var componentName = 'CreateTearsheetStep';
|
14
|
+
var blockClass = "".concat(pkg.prefix, "--tearsheet-create__step");
|
15
|
+
export var CreateTearsheetStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
16
|
+
var children = _ref.children,
|
17
|
+
className = _ref.className,
|
18
|
+
subtitle = _ref.subtitle,
|
19
|
+
description = _ref.description,
|
20
|
+
title = _ref.title,
|
21
|
+
hasFieldset = _ref.hasFieldset,
|
22
|
+
fieldsetLegendText = _ref.fieldsetLegendText,
|
23
|
+
isViewingAllStepsTogether = _ref.isViewingAllStepsTogether;
|
24
|
+
return /*#__PURE__*/React.createElement("div", {
|
25
|
+
className: cx(blockClass, className),
|
26
|
+
ref: ref
|
27
|
+
}, /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Column, {
|
28
|
+
xlg: 12,
|
29
|
+
lg: 12,
|
30
|
+
md: 8,
|
31
|
+
sm: 8
|
32
|
+
}, !isViewingAllStepsTogether && /*#__PURE__*/React.createElement("h4", {
|
33
|
+
className: "".concat(blockClass, "--title")
|
34
|
+
}, title), !isViewingAllStepsTogether && subtitle && /*#__PURE__*/React.createElement("h6", {
|
35
|
+
className: "".concat(blockClass, "--subtitle")
|
36
|
+
}, subtitle), !isViewingAllStepsTogether && description && /*#__PURE__*/React.createElement("p", {
|
37
|
+
className: "".concat(blockClass, "--description")
|
38
|
+
}, description))), hasFieldset ? /*#__PURE__*/React.createElement(FormGroup, {
|
39
|
+
legendText: fieldsetLegendText,
|
40
|
+
className: "".concat(blockClass, "--fieldset")
|
41
|
+
}, children) : children);
|
42
|
+
}); // Return a placeholder if not released and not enabled by feature flag
|
43
|
+
|
44
|
+
CreateTearsheetStep = pkg.checkComponentEnabled(CreateTearsheetStep, componentName);
|
45
|
+
CreateTearsheetStep.propTypes = {
|
46
|
+
/**
|
47
|
+
* Content that shows in the tearsheet step
|
48
|
+
*/
|
49
|
+
children: PropTypes.node,
|
50
|
+
|
51
|
+
/**
|
52
|
+
* Sets an optional className to be added to the tearsheet step
|
53
|
+
*/
|
54
|
+
className: PropTypes.string,
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Sets an optional description on the step component
|
58
|
+
*/
|
59
|
+
description: PropTypes.string,
|
60
|
+
|
61
|
+
/**
|
62
|
+
* This will conditionally disable the submit button in the multi step Tearsheet
|
63
|
+
*/
|
64
|
+
disableSubmit: PropTypes.bool,
|
65
|
+
|
66
|
+
/**
|
67
|
+
* This is the required legend text that appears above a fieldset html element for accessibility purposes.
|
68
|
+
* You can set the `hasFieldset` prop to false if you have multiple fieldset elements or want to control the children of your Full Page's step content.
|
69
|
+
* Otherwise, use CSS to hide/remove this label text.
|
70
|
+
*/
|
71
|
+
fieldsetLegendText: PropTypes.string.isRequired.if(function (_ref2) {
|
72
|
+
var hasFieldset = _ref2.hasFieldset;
|
73
|
+
return !!hasFieldset;
|
74
|
+
}),
|
75
|
+
|
76
|
+
/**
|
77
|
+
* This optional prop will render your form content inside of a fieldset html element
|
78
|
+
* and is defaulted to true.
|
79
|
+
* You can set this prop to `false` if you have multiple fieldset elements or want to control the children of your Full Page's step content.
|
80
|
+
*/
|
81
|
+
hasFieldset: PropTypes.bool,
|
82
|
+
|
83
|
+
/**
|
84
|
+
* This prop can be used on the first step to mark it as an intro step, which will not render the progress indicator steps
|
85
|
+
*/
|
86
|
+
introStep: PropTypes.bool,
|
87
|
+
|
88
|
+
/**
|
89
|
+
* @ignore
|
90
|
+
* The is an internal prop set in CreateTearsheet so the step knows when to render it's title
|
91
|
+
*/
|
92
|
+
isViewingAllStepsTogether: PropTypes.bool,
|
93
|
+
|
94
|
+
/**
|
95
|
+
* Optional function to be called on initial mount of a step.
|
96
|
+
* For example, this can be used to fetch data that is required on a particular step.
|
97
|
+
*/
|
98
|
+
onMount: PropTypes.func,
|
99
|
+
|
100
|
+
/**
|
101
|
+
* Optional function to be called on a step change.
|
102
|
+
* For example, this can be used to validate input fields before proceeding to the next step.
|
103
|
+
* This function can _optionally_ return a promise that is either resolved or rejected and the CreateTearsheet will handle the submitting state of the next button.
|
104
|
+
*/
|
105
|
+
onNext: PropTypes.func,
|
106
|
+
|
107
|
+
/**
|
108
|
+
* Sets the optional secondary label on the progress step component
|
109
|
+
*/
|
110
|
+
secondaryLabel: PropTypes.string,
|
111
|
+
|
112
|
+
/**
|
113
|
+
* Sets an optional subtitle on the step component
|
114
|
+
*/
|
115
|
+
subtitle: PropTypes.string,
|
116
|
+
|
117
|
+
/**
|
118
|
+
* Sets the title text for a tearsheet step
|
119
|
+
*/
|
120
|
+
title: PropTypes.node.isRequired
|
121
|
+
}; // Default values for component props. Default values are not required for
|
122
|
+
// props that are required, nor for props where the component can apply
|
123
|
+
// 'undefined' values reasonably. Default values should be provided when the
|
124
|
+
// component needs to make a choice or assumption when a prop is not supplied.
|
125
|
+
|
126
|
+
CreateTearsheetStep.defaultProps = {
|
127
|
+
type: CREATE_TEARSHEET_STEP,
|
128
|
+
hasFieldset: true
|
129
|
+
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2021, 2021
|
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
|
+
export var CREATE_TEARSHEET_STEP = 'CreateTearsheetStep';
|
8
|
+
export var CREATE_TEARSHEET_SECTION = 'CreateTearsheetSection';
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2021, 2021
|
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
|
+
export { CreateTearsheet } from './CreateTearsheet';
|
8
|
+
export { CreateTearsheetStep } from './CreateTearsheetStep';
|
9
|
+
export { CreateTearsheetSection } from './CreateTearsheetSection';
|
10
|
+
export { CreateTearsheetDivider } from './CreateTearsheetDivider';
|