@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,668 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
6
|
+
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
8
|
+
value: true
|
9
|
+
});
|
10
|
+
exports.SidePanel = void 0;
|
11
|
+
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13
|
+
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
15
|
+
|
16
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
17
|
+
|
18
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
19
|
+
|
20
|
+
var _react = _interopRequireWildcard(require("react"));
|
21
|
+
|
22
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
23
|
+
|
24
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
25
|
+
|
26
|
+
var _reactResizeDetector = require("react-resize-detector");
|
27
|
+
|
28
|
+
var _motion = require("@carbon/motion");
|
29
|
+
|
30
|
+
var _devtools = require("../../global/js/utils/devtools");
|
31
|
+
|
32
|
+
var _propsHelper = require("../../global/js/utils/props-helper");
|
33
|
+
|
34
|
+
var _wrapFocus = _interopRequireDefault(require("../../global/js/utils/wrapFocus"));
|
35
|
+
|
36
|
+
var _settings = require("../../settings");
|
37
|
+
|
38
|
+
var _constants = require("./constants");
|
39
|
+
|
40
|
+
var _hooks = require("../../global/js/hooks");
|
41
|
+
|
42
|
+
var _carbonComponentsReact = require("carbon-components-react");
|
43
|
+
|
44
|
+
var _iconsReact = require("@carbon/icons-react");
|
45
|
+
|
46
|
+
var _ActionSet = require("../ActionSet");
|
47
|
+
|
48
|
+
var _excluded = ["actionToolbarButtons", "actions", "animateTitle", "children", "className", "closeIconDescription", "condensedActions", "currentStep", "includeOverlay", "labelText", "navigationBackIconDescription", "onNavigationBack", "onRequestClose", "onUnmount", "open", "placement", "preventCloseOnClickOutside", "selectorPageContent", "selectorPrimaryFocus", "size", "slideIn", "subtitle", "title"],
|
49
|
+
_excluded2 = ["label", "kind", "icon", "leading", "disabled", "className", "onClick"];
|
50
|
+
|
51
|
+
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); }
|
52
|
+
|
53
|
+
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; }
|
54
|
+
|
55
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
56
|
+
|
57
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
58
|
+
|
59
|
+
var blockClass = "".concat(_settings.pkg.prefix, "--side-panel");
|
60
|
+
var componentName = 'SidePanel'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Side panels keep users in-context of a page while performing tasks like navigating, editing, viewing details, or configuring something new.
|
64
|
+
*/
|
65
|
+
|
66
|
+
var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
67
|
+
var _ref4, _cx4;
|
68
|
+
|
69
|
+
var actionToolbarButtons = _ref.actionToolbarButtons,
|
70
|
+
actions = _ref.actions,
|
71
|
+
animateTitle = _ref.animateTitle,
|
72
|
+
children = _ref.children,
|
73
|
+
className = _ref.className,
|
74
|
+
closeIconDescription = _ref.closeIconDescription,
|
75
|
+
condensedActions = _ref.condensedActions,
|
76
|
+
currentStep = _ref.currentStep,
|
77
|
+
includeOverlay = _ref.includeOverlay,
|
78
|
+
labelText = _ref.labelText,
|
79
|
+
navigationBackIconDescription = _ref.navigationBackIconDescription,
|
80
|
+
onNavigationBack = _ref.onNavigationBack,
|
81
|
+
onRequestClose = _ref.onRequestClose,
|
82
|
+
onUnmount = _ref.onUnmount,
|
83
|
+
open = _ref.open,
|
84
|
+
placement = _ref.placement,
|
85
|
+
preventCloseOnClickOutside = _ref.preventCloseOnClickOutside,
|
86
|
+
selectorPageContent = _ref.selectorPageContent,
|
87
|
+
selectorPrimaryFocus = _ref.selectorPrimaryFocus,
|
88
|
+
size = _ref.size,
|
89
|
+
slideIn = _ref.slideIn,
|
90
|
+
subtitle = _ref.subtitle,
|
91
|
+
title = _ref.title,
|
92
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
93
|
+
|
94
|
+
var _useState = (0, _react.useState)(open),
|
95
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
96
|
+
shouldRender = _useState2[0],
|
97
|
+
setRender = _useState2[1];
|
98
|
+
|
99
|
+
var _useState3 = (0, _react.useState)(false),
|
100
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
101
|
+
animationComplete = _useState4[0],
|
102
|
+
setAnimationComplete = _useState4[1];
|
103
|
+
|
104
|
+
var _useState5 = (0, _react.useState)(0),
|
105
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
106
|
+
panelHeight = _useState6[0],
|
107
|
+
setPanelHeight = _useState6[1];
|
108
|
+
|
109
|
+
var sidePanelRef = (0, _react.useRef)();
|
110
|
+
var sidePanelOverlayRef = (0, _react.useRef)();
|
111
|
+
var startTrapRef = (0, _react.useRef)();
|
112
|
+
var endTrapRef = (0, _react.useRef)();
|
113
|
+
var sidePanelInnerRef = (0, _react.useRef)();
|
114
|
+
var sidePanelCloseRef = (0, _react.useRef)();
|
115
|
+
var previousState = (0, _hooks.usePreviousValue)({
|
116
|
+
size: size
|
117
|
+
}); // scroll panel to top going between steps
|
118
|
+
|
119
|
+
(0, _react.useEffect)(function () {
|
120
|
+
var panelRef = ref || sidePanelRef;
|
121
|
+
|
122
|
+
if (panelRef && panelRef.current) {
|
123
|
+
var _document$querySelect;
|
124
|
+
|
125
|
+
var scrollableSection = panelRef.current.querySelector(".".concat(blockClass, "__inner-content"));
|
126
|
+
var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
|
127
|
+
var initialTitleHeight = (_document$querySelect = document.querySelector(".".concat(blockClass, "__title-container"))) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.offsetHeight;
|
128
|
+
scrollableSection.scrollTop = 0; // The size of the panel has changed while it is still opened
|
129
|
+
// so we need to scroll it to the top and reset the title container
|
130
|
+
// height css custom property
|
131
|
+
|
132
|
+
if ((previousState === null || previousState === void 0 ? void 0 : previousState.size) !== size) {
|
133
|
+
scrollableSection.scrollTop = 0;
|
134
|
+
sidePanelOuter.style.setProperty("--".concat(blockClass, "--title-container-height"), "".concat(Number(initialTitleHeight), "px"));
|
135
|
+
}
|
136
|
+
}
|
137
|
+
}, [currentStep, ref, size, previousState === null || previousState === void 0 ? void 0 : previousState.size]); // set initial focus when side panel opens
|
138
|
+
|
139
|
+
(0, _react.useEffect)(function () {
|
140
|
+
var initialFocus = function initialFocus(focusContainerElement) {
|
141
|
+
var containerElement = focusContainerElement;
|
142
|
+
var primaryFocusElement = containerElement && containerElement.querySelector(selectorPrimaryFocus);
|
143
|
+
|
144
|
+
if (primaryFocusElement) {
|
145
|
+
return primaryFocusElement;
|
146
|
+
} else {
|
147
|
+
return sidePanelCloseRef && sidePanelCloseRef.current;
|
148
|
+
}
|
149
|
+
};
|
150
|
+
|
151
|
+
var focusButton = function focusButton(focusContainerElement) {
|
152
|
+
var target = initialFocus(focusContainerElement);
|
153
|
+
target === null || target === void 0 ? void 0 : target.focus();
|
154
|
+
};
|
155
|
+
|
156
|
+
if (open && animationComplete) {
|
157
|
+
focusButton(sidePanelInnerRef.current);
|
158
|
+
}
|
159
|
+
}, [selectorPrimaryFocus, open, animationComplete]);
|
160
|
+
(0, _react.useEffect)(function () {
|
161
|
+
if (open && actions && actions.length && animationComplete) {
|
162
|
+
var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
|
163
|
+
var actionsContainer = getActionsContainerElement();
|
164
|
+
var actionsHeight = (actionsContainer === null || actionsContainer === void 0 ? void 0 : actionsContainer.offsetHeight) + 16; // add additional 1rem spacing to bottom padding
|
165
|
+
|
166
|
+
actionsHeight = "".concat(Math.round(actionsHeight / 16), "rem");
|
167
|
+
sidePanelOuter === null || sidePanelOuter === void 0 ? void 0 : sidePanelOuter.style.setProperty("--".concat(blockClass, "--content-bottom-padding"), actionsHeight);
|
168
|
+
}
|
169
|
+
}, [actions, condensedActions, open, animationComplete]); // Add console warning if labelText is provided without a title.
|
170
|
+
// This combination is not allowed.
|
171
|
+
|
172
|
+
(0, _react.useEffect)(function () {
|
173
|
+
if (!title && labelText) {
|
174
|
+
console.warn("".concat(componentName, ": The prop `labelText` was provided without a `title`. It is required to have a `title` when using the `labelText` prop."));
|
175
|
+
}
|
176
|
+
}, [labelText, title]);
|
177
|
+
/* istanbul ignore next */
|
178
|
+
|
179
|
+
var handleResize = function handleResize(width, height) {
|
180
|
+
setPanelHeight(height);
|
181
|
+
var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
|
182
|
+
var actionsContainer = getActionsContainerElement();
|
183
|
+
var actionsHeight = actionsContainer.offsetHeight + 16; // add additional 1rem spacing to bottom padding
|
184
|
+
|
185
|
+
actionsHeight = "".concat(Math.round(actionsHeight / 16), "rem");
|
186
|
+
sidePanelOuter.style.setProperty("--".concat(blockClass, "--content-bottom-padding"), actionsHeight);
|
187
|
+
};
|
188
|
+
|
189
|
+
var getActionsContainerElement = function getActionsContainerElement() {
|
190
|
+
var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
|
191
|
+
return sidePanelOuter && sidePanelOuter.querySelector(".".concat(blockClass, "__actions-container"));
|
192
|
+
}; // Title and subtitle scroll animation
|
193
|
+
|
194
|
+
|
195
|
+
(0, _react.useEffect)(function () {
|
196
|
+
if (open && animateTitle && animationComplete && title && title.length) {
|
197
|
+
var _document$querySelect2, _document$querySelect3, _document$querySelect4;
|
198
|
+
|
199
|
+
var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
|
200
|
+
var sidePanelScrollArea = document.querySelector("#".concat(blockClass, "-outer .").concat(blockClass, "__inner-content"));
|
201
|
+
var sidePanelTitleElement = document.querySelector(".".concat(blockClass, "__title-text"));
|
202
|
+
var sidePanelCollapsedTitleElement = document.querySelector(".".concat(blockClass, "__collapsed-title-text"));
|
203
|
+
var sidePanelSubtitleElement = document.querySelector(".".concat("".concat(blockClass, "__subtitle-text")));
|
204
|
+
var sidePanelSubtitleElementHeight = (sidePanelSubtitleElement === null || sidePanelSubtitleElement === void 0 ? void 0 : sidePanelSubtitleElement.offsetHeight) || 0; // set default subtitle height if a subtitle is not provided to enable scrolling animation
|
205
|
+
|
206
|
+
var panelOuterHeight = panelHeight;
|
207
|
+
var scrollSectionHeight = (_document$querySelect2 = document.querySelector(".".concat(blockClass, "__body-content"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.offsetHeight;
|
208
|
+
var titleContainerHeight = (_document$querySelect3 = document.querySelector(".".concat(blockClass, "__title-container"))) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.offsetHeight;
|
209
|
+
var labelTextHeight = (_document$querySelect4 = document.querySelector(".".concat(blockClass, "__label-text"))) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.offsetHeight;
|
210
|
+
var totalScrollingContentHeight = titleContainerHeight + sidePanelSubtitleElementHeight + scrollSectionHeight; // if the difference between the total scrolling height and the panel height is less than
|
211
|
+
// the subtitleElement height OR if the subtitle element height is 0, use that difference
|
212
|
+
// as the length of the scroll animation (otherwise the animation will not be able to complete
|
213
|
+
// because there is not enough scrolling distance to complete it).
|
214
|
+
|
215
|
+
sidePanelSubtitleElementHeight = totalScrollingContentHeight - panelOuterHeight < sidePanelSubtitleElementHeight ? totalScrollingContentHeight - panelOuterHeight : sidePanelSubtitleElementHeight === 0 ? 16 : sidePanelSubtitleElementHeight;
|
216
|
+
sidePanelSubtitleElementHeight = sidePanelSubtitleElementHeight < 0 ? (sidePanelScrollArea === null || sidePanelScrollArea === void 0 ? void 0 : sidePanelScrollArea.scrollHeight) - (sidePanelScrollArea === null || sidePanelScrollArea === void 0 ? void 0 : sidePanelScrollArea.clientHeight) : sidePanelSubtitleElementHeight;
|
217
|
+
/* istanbul ignore next */
|
218
|
+
|
219
|
+
sidePanelScrollArea && sidePanelScrollArea.addEventListener('scroll', function () {
|
220
|
+
var scrollTop = sidePanelScrollArea.scrollTop; // if scrolling has occurred
|
221
|
+
|
222
|
+
if (scrollTop > 0) {
|
223
|
+
sidePanelOuter.classList.add("".concat(blockClass, "__with-condensed-header")); // Set subtitle opacity calculation here
|
224
|
+
// as scroll progresses
|
225
|
+
|
226
|
+
var titleOpacity = Math.min(1, (sidePanelSubtitleElementHeight - scrollTop) / sidePanelSubtitleElementHeight);
|
227
|
+
titleOpacity = titleOpacity < 0 ? 0 : titleOpacity;
|
228
|
+
sidePanelOuter.style.setProperty("--".concat(blockClass, "--subtitle-opacity"), titleOpacity); // Calculate divider opacity to avoid border
|
229
|
+
// abruptly appearing when scrolling starts.
|
230
|
+
// This approach uses a pseudo element and sets
|
231
|
+
// the opacity as scroll progresses.
|
232
|
+
|
233
|
+
var dividerOpacity = Math.min(scrollTop / sidePanelSubtitleElementHeight, 1);
|
234
|
+
sidePanelOuter.style.setProperty("--".concat(blockClass, "--divider-opacity"), "".concat(Math.min(1, dividerOpacity))); // We need to know the height of the title element
|
235
|
+
// so that we know how far to place the action toolbar
|
236
|
+
// from the top since it is sticky
|
237
|
+
|
238
|
+
var titleTextHeight = Math.max(sidePanelTitleElement.offsetHeight);
|
239
|
+
sidePanelOuter.style.setProperty("--".concat(blockClass, "--title-height"), "".concat(titleTextHeight + 16, "px")); // Set title y positioning
|
240
|
+
|
241
|
+
var titleYPosition = Math.min(scrollTop / sidePanelSubtitleElementHeight, 1);
|
242
|
+
sidePanelOuter.style.setProperty("--".concat(blockClass, "--title-y-position"), "".concat(-Math.abs(titleYPosition), "rem")); // mark title with aria-hidden={true} if opacity reaches 0
|
243
|
+
|
244
|
+
if (titleOpacity === 0) {
|
245
|
+
sidePanelTitleElement.setAttribute('aria-hidden', 'true');
|
246
|
+
sidePanelCollapsedTitleElement.setAttribute('aria-hidden', 'false');
|
247
|
+
} // Set collapsed title y positioning
|
248
|
+
|
249
|
+
|
250
|
+
var collapsedTitleYPosition = Math.min(1, (sidePanelSubtitleElementHeight - scrollTop) / sidePanelSubtitleElementHeight);
|
251
|
+
collapsedTitleYPosition = collapsedTitleYPosition < 0 ? 0 : collapsedTitleYPosition;
|
252
|
+
sidePanelOuter.style.setProperty("--".concat(blockClass, "--collapsed-title-y-position"), "".concat(collapsedTitleYPosition, "rem")); // Set label text height
|
253
|
+
|
254
|
+
var scrollAnimationProgress = dividerOpacity;
|
255
|
+
var reduceTitleContainerHeightAmount = labelTextHeight * scrollAnimationProgress / titleContainerHeight * 100;
|
256
|
+
sidePanelOuter.style.setProperty("--".concat(blockClass, "--label-text-height"), "".concat(Math.trunc(reduceTitleContainerHeightAmount), "px"));
|
257
|
+
sidePanelOuter.style.setProperty("--".concat(blockClass, "--title-container-height"), "".concat(titleContainerHeight, "px"));
|
258
|
+
} else {
|
259
|
+
sidePanelTitleElement.setAttribute('aria-hidden', 'false');
|
260
|
+
sidePanelCollapsedTitleElement.setAttribute('aria-hidden', 'true');
|
261
|
+
sidePanelOuter.classList.remove("".concat(blockClass, "__with-condensed-header"));
|
262
|
+
sidePanelOuter.style.setProperty("--".concat(blockClass, "--subtitle-opacity"), 1);
|
263
|
+
sidePanelOuter.style.setProperty("--".concat(blockClass, "--title-y-position"), 0);
|
264
|
+
sidePanelOuter.style.setProperty("--".concat(blockClass, "--divider-opacity"), 0);
|
265
|
+
sidePanelOuter.style.setProperty("--".concat(blockClass, "--collapsed-title-y-position"), "1rem");
|
266
|
+
sidePanelOuter.style.setProperty("--".concat(blockClass, "--label-text-height"), "0px");
|
267
|
+
}
|
268
|
+
});
|
269
|
+
}
|
270
|
+
|
271
|
+
if (open && shouldRender && !animateTitle) {
|
272
|
+
var _sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
|
273
|
+
|
274
|
+
var _sidePanelTitleElement = document.querySelector(".".concat(blockClass, "__title-container .").concat(blockClass, "__title-text"));
|
275
|
+
|
276
|
+
var _sidePanelSubtitleElement = document.querySelector(".".concat(blockClass, "__subtitle-text"));
|
277
|
+
|
278
|
+
var actionToolbarElement = document.querySelector(".".concat(blockClass, "__action-toolbar"));
|
279
|
+
|
280
|
+
var _sidePanelSubtitleElementHeight = (_sidePanelSubtitleElement === null || _sidePanelSubtitleElement === void 0 ? void 0 : _sidePanelSubtitleElement.offsetHeight) || 0;
|
281
|
+
|
282
|
+
var sidePanelActionBarElementHeight = (actionToolbarElement === null || actionToolbarElement === void 0 ? void 0 : actionToolbarElement.offsetHeight) || 0;
|
283
|
+
var titleHeight = (_sidePanelTitleElement === null || _sidePanelTitleElement === void 0 ? void 0 : _sidePanelTitleElement.offsetHeight) + 24;
|
284
|
+
_sidePanelOuter === null || _sidePanelOuter === void 0 ? void 0 : _sidePanelOuter.style.setProperty("--".concat(blockClass, "--title-text-height"), "".concat(titleHeight, "px"));
|
285
|
+
_sidePanelOuter === null || _sidePanelOuter === void 0 ? void 0 : _sidePanelOuter.style.setProperty("--".concat(blockClass, "--subtitle-container-height"), "".concat(_sidePanelSubtitleElementHeight, "px"));
|
286
|
+
_sidePanelOuter === null || _sidePanelOuter === void 0 ? void 0 : _sidePanelOuter.style.setProperty("--".concat(blockClass, "--action-bar-container-height"), "".concat(sidePanelActionBarElementHeight, "px"));
|
287
|
+
}
|
288
|
+
}, [open, animateTitle, animationComplete, shouldRender, panelHeight, title, size]); // click outside functionality if `includeOverlay` prop is set
|
289
|
+
|
290
|
+
(0, _react.useEffect)(function () {
|
291
|
+
var handleOutsideClick = function handleOutsideClick(event) {
|
292
|
+
var panelRef = ref || sidePanelRef;
|
293
|
+
|
294
|
+
if (panelRef.current && sidePanelOverlayRef.current && sidePanelOverlayRef.current.contains(event.target) && onRequestClose) {
|
295
|
+
onRequestClose();
|
296
|
+
}
|
297
|
+
};
|
298
|
+
|
299
|
+
var bodyElement = document.body;
|
300
|
+
|
301
|
+
if (includeOverlay && open) {
|
302
|
+
bodyElement.style.overflow = 'hidden';
|
303
|
+
} else if (includeOverlay && !open) {
|
304
|
+
bodyElement.style.overflow = 'initial';
|
305
|
+
}
|
306
|
+
|
307
|
+
if (includeOverlay && !preventCloseOnClickOutside) {
|
308
|
+
document.addEventListener('click', handleOutsideClick);
|
309
|
+
}
|
310
|
+
|
311
|
+
return function () {
|
312
|
+
document.removeEventListener('click', handleOutsideClick);
|
313
|
+
};
|
314
|
+
}, [includeOverlay, onRequestClose, open, preventCloseOnClickOutside, ref]); // initialize the side panel to open
|
315
|
+
|
316
|
+
(0, _react.useEffect)(function () {
|
317
|
+
if (open) {
|
318
|
+
setRender(true);
|
319
|
+
}
|
320
|
+
}, [open]); // initializes the side panel to close
|
321
|
+
|
322
|
+
var onAnimationEnd = function onAnimationEnd() {
|
323
|
+
if (!open) {
|
324
|
+
onUnmount && onUnmount();
|
325
|
+
setRender(false);
|
326
|
+
}
|
327
|
+
|
328
|
+
setAnimationComplete(true);
|
329
|
+
}; // initializes the side panel to open
|
330
|
+
|
331
|
+
|
332
|
+
var _onAnimationStart = function onAnimationStart(event) {
|
333
|
+
event.persist();
|
334
|
+
var isPanelTarget = event.target.id === "".concat(blockClass, "-outer");
|
335
|
+
|
336
|
+
if (isPanelTarget) {
|
337
|
+
setAnimationComplete(false);
|
338
|
+
}
|
339
|
+
}; // used to reset margins of the slide in panel when closed/closing
|
340
|
+
|
341
|
+
|
342
|
+
(0, _react.useEffect)(function () {
|
343
|
+
if (!open && slideIn) {
|
344
|
+
var pageContentElement = document.querySelector(selectorPageContent);
|
345
|
+
|
346
|
+
if (placement && placement === 'right' && pageContentElement) {
|
347
|
+
pageContentElement.style.marginRight = 0;
|
348
|
+
} else if (pageContentElement) {
|
349
|
+
pageContentElement.style.marginLeft = 0;
|
350
|
+
}
|
351
|
+
}
|
352
|
+
}, [open, placement, selectorPageContent, slideIn]); // used to set margins of content for slide in panel version
|
353
|
+
|
354
|
+
(0, _react.useEffect)(function () {
|
355
|
+
if (shouldRender && slideIn) {
|
356
|
+
var pageContentElement = document.querySelector(selectorPageContent);
|
357
|
+
|
358
|
+
if (placement && placement === 'right' && pageContentElement) {
|
359
|
+
pageContentElement.style.marginRight = 0;
|
360
|
+
pageContentElement.style.transition = "margin-right ".concat(_motion.moderate02);
|
361
|
+
pageContentElement.style.marginRight = _constants.SIDE_PANEL_SIZES[size];
|
362
|
+
} else if (pageContentElement) {
|
363
|
+
pageContentElement.style.marginLeft = 0;
|
364
|
+
pageContentElement.style.transition = "margin-left ".concat(_motion.moderate02);
|
365
|
+
pageContentElement.style.marginLeft = _constants.SIDE_PANEL_SIZES[size];
|
366
|
+
}
|
367
|
+
}
|
368
|
+
}, [slideIn, selectorPageContent, placement, shouldRender, size]); // adds focus trap functionality
|
369
|
+
|
370
|
+
/* istanbul ignore next */
|
371
|
+
|
372
|
+
var handleBlur = function handleBlur(_ref2) {
|
373
|
+
var oldActiveNode = _ref2.target,
|
374
|
+
currentActiveNode = _ref2.relatedTarget;
|
375
|
+
|
376
|
+
// focus trap should only be set if the side panel is a `slideOver` type
|
377
|
+
if (open && sidePanelInnerRef && !slideIn) {
|
378
|
+
(0, _wrapFocus.default)({
|
379
|
+
bodyNode: sidePanelInnerRef.current,
|
380
|
+
startTrapRef: startTrapRef,
|
381
|
+
endTrapRef: endTrapRef,
|
382
|
+
currentActiveNode: currentActiveNode,
|
383
|
+
oldActiveNode: oldActiveNode
|
384
|
+
});
|
385
|
+
}
|
386
|
+
};
|
387
|
+
|
388
|
+
var primaryActionContainerClassNames = (0, _classnames.default)(["".concat(blockClass, "__actions-container"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__actions-container-condensed"), condensedActions)]);
|
389
|
+
var mainPanelClassNames = (0, _classnames.default)([blockClass, className, "".concat(blockClass, "__container"), "".concat(blockClass, "__container--").concat(size), (_ref4 = {}, (0, _defineProperty2.default)(_ref4, "".concat(blockClass, "__container-right-placement"), placement === 'right'), (0, _defineProperty2.default)(_ref4, "".concat(blockClass, "__container-left-placement"), placement === 'left'), (0, _defineProperty2.default)(_ref4, "".concat(blockClass, "__container-with-action-toolbar"), actionToolbarButtons && actionToolbarButtons.length), (0, _defineProperty2.default)(_ref4, "".concat(blockClass, "__container-without-overlay"), !includeOverlay && !slideIn), (0, _defineProperty2.default)(_ref4, "".concat(blockClass, "__container-is-animating"), !animationComplete || !open), _ref4)]);
|
390
|
+
|
391
|
+
var renderHeader = function renderHeader() {
|
392
|
+
var _cx, _cx2;
|
393
|
+
|
394
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
395
|
+
className: (0, _classnames.default)("".concat(blockClass, "__title-container"), (_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__on-detail-step"), currentStep > 0), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__on-detail-step-without-title"), currentStep > 0 && !title), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__title-container--no-title-animation"), !animateTitle), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__title-container-is-animating"), !animationComplete || !open), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__title-container-without-title"), !title), _cx))
|
396
|
+
}, currentStep > 0 && /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
|
397
|
+
"aria-label": navigationBackIconDescription,
|
398
|
+
kind: "ghost",
|
399
|
+
size: "small",
|
400
|
+
disabled: false,
|
401
|
+
renderIcon: _iconsReact.ArrowLeft20,
|
402
|
+
iconDescription: navigationBackIconDescription,
|
403
|
+
className: "".concat(blockClass, "__navigation-back-button"),
|
404
|
+
onClick: onNavigationBack
|
405
|
+
}), title && title.length && labelText && labelText.length && /*#__PURE__*/_react.default.createElement("p", {
|
406
|
+
className: "".concat(blockClass, "__label-text")
|
407
|
+
}, labelText), title && title.length && renderTitle()), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
|
408
|
+
"aria-label": closeIconDescription,
|
409
|
+
kind: "ghost",
|
410
|
+
size: "small",
|
411
|
+
renderIcon: _iconsReact.Close20,
|
412
|
+
iconDescription: closeIconDescription,
|
413
|
+
className: "".concat(blockClass, "__close-button"),
|
414
|
+
onClick: onRequestClose,
|
415
|
+
ref: sidePanelCloseRef
|
416
|
+
}), subtitle && /*#__PURE__*/_react.default.createElement("p", {
|
417
|
+
className: (0, _classnames.default)("".concat(blockClass, "__subtitle-text"), (_cx2 = {}, (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__subtitle-text-no-animation"), !animateTitle), (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__subtitle-text-no-animation-no-action-toolbar"), !animateTitle && (!actionToolbarButtons || !actionToolbarButtons.length)), (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__subtitle-text-is-animating"), !animationComplete && animateTitle), (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__subtitle-without-title"), !title), _cx2))
|
418
|
+
}, subtitle), actionToolbarButtons && actionToolbarButtons.length && /*#__PURE__*/_react.default.createElement("div", {
|
419
|
+
className: (0, _classnames.default)("".concat(blockClass, "__action-toolbar"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__action-toolbar-no-animation"), !animateTitle))
|
420
|
+
}, actionToolbarButtons.map(function (_ref5) {
|
421
|
+
var _ref6;
|
422
|
+
|
423
|
+
var label = _ref5.label,
|
424
|
+
kind = _ref5.kind,
|
425
|
+
icon = _ref5.icon,
|
426
|
+
leading = _ref5.leading,
|
427
|
+
disabled = _ref5.disabled,
|
428
|
+
className = _ref5.className,
|
429
|
+
onClick = _ref5.onClick,
|
430
|
+
rest = (0, _objectWithoutProperties2.default)(_ref5, _excluded2);
|
431
|
+
return /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, (0, _extends2.default)({}, rest, {
|
432
|
+
key: label,
|
433
|
+
kind: kind || 'ghost',
|
434
|
+
size: "small",
|
435
|
+
renderIcon: icon,
|
436
|
+
iconDescription: label,
|
437
|
+
tooltipPosition: "bottom",
|
438
|
+
tooltipAlignment: "center",
|
439
|
+
hasIconOnly: !leading,
|
440
|
+
disabled: disabled,
|
441
|
+
className: (0, _classnames.default)(["".concat(blockClass, "__action-toolbar-button"), className, (_ref6 = {}, (0, _defineProperty2.default)(_ref6, "".concat(blockClass, "__action-toolbar-icon-only-button"), icon && !leading), (0, _defineProperty2.default)(_ref6, "".concat(blockClass, "__action-toolbar-leading-button"), leading), _ref6)]),
|
442
|
+
onClick: onClick
|
443
|
+
}), leading && label);
|
444
|
+
})));
|
445
|
+
};
|
446
|
+
|
447
|
+
var renderTitle = function renderTitle() {
|
448
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, title && title.length && /*#__PURE__*/_react.default.createElement("h2", {
|
449
|
+
className: "".concat(blockClass, "__title-text"),
|
450
|
+
title: title,
|
451
|
+
"aria-hidden": false
|
452
|
+
}, title), animateTitle && title && title.length && /*#__PURE__*/_react.default.createElement("h2", {
|
453
|
+
className: "".concat(blockClass, "__collapsed-title-text"),
|
454
|
+
title: title,
|
455
|
+
"aria-hidden": true
|
456
|
+
}, title));
|
457
|
+
};
|
458
|
+
|
459
|
+
var contentRef = ref || sidePanelRef;
|
460
|
+
(0, _reactResizeDetector.useResizeDetector)({
|
461
|
+
handleHeight: true,
|
462
|
+
onResize: handleResize,
|
463
|
+
targetRef: contentRef
|
464
|
+
});
|
465
|
+
return shouldRender && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, (0, _devtools.getDevtoolsProps)(componentName), rest, {
|
466
|
+
id: "".concat(blockClass, "-outer"),
|
467
|
+
className: mainPanelClassNames,
|
468
|
+
style: {
|
469
|
+
animation: "".concat(open ? placement === 'right' ? "sidePanelEntranceRight ".concat(_motion.moderate02) : "sidePanelEntranceLeft ".concat(_motion.moderate02) : placement === 'right' ? "sidePanelExitRight ".concat(_motion.moderate02) : "sidePanelExitLeft ".concat(_motion.moderate02))
|
470
|
+
},
|
471
|
+
onAnimationEnd: onAnimationEnd,
|
472
|
+
onAnimationStart: function onAnimationStart(event) {
|
473
|
+
return _onAnimationStart(event);
|
474
|
+
},
|
475
|
+
onBlur: handleBlur,
|
476
|
+
ref: contentRef,
|
477
|
+
role: "complementary",
|
478
|
+
"aria-label": title
|
479
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
480
|
+
ref: startTrapRef,
|
481
|
+
tabIndex: "0",
|
482
|
+
role: "link",
|
483
|
+
className: "".concat(blockClass, "__visually-hidden")
|
484
|
+
}, "Focus sentinel"), !animateTitle && renderHeader(), /*#__PURE__*/_react.default.createElement("div", {
|
485
|
+
ref: sidePanelInnerRef,
|
486
|
+
className: (0, _classnames.default)("".concat(blockClass, "__inner-content"), (_cx4 = {}, (0, _defineProperty2.default)(_cx4, "".concat(blockClass, "__static-inner-content"), !animateTitle), (0, _defineProperty2.default)(_cx4, "".concat(blockClass, "__inner-content-with-actions"), actions && actions.length), _cx4))
|
487
|
+
}, animateTitle && renderHeader(), /*#__PURE__*/_react.default.createElement("div", {
|
488
|
+
className: "".concat(blockClass, "__body-content")
|
489
|
+
}, children), /*#__PURE__*/_react.default.createElement(_ActionSet.ActionSet, {
|
490
|
+
actions: actions,
|
491
|
+
className: primaryActionContainerClassNames,
|
492
|
+
size: size
|
493
|
+
})), /*#__PURE__*/_react.default.createElement("span", {
|
494
|
+
ref: endTrapRef,
|
495
|
+
tabIndex: "0",
|
496
|
+
role: "link",
|
497
|
+
className: "".concat(blockClass, "__visually-hidden")
|
498
|
+
}, "Focus sentinel")), includeOverlay && /*#__PURE__*/_react.default.createElement("div", {
|
499
|
+
ref: sidePanelOverlayRef,
|
500
|
+
className: "".concat(blockClass, "__overlay"),
|
501
|
+
style: {
|
502
|
+
animation: "".concat(open ? "sidePanelOverlayEntrance ".concat(_motion.moderate02) : "sidePanelOverlayExit ".concat(_motion.moderate02))
|
503
|
+
}
|
504
|
+
}));
|
505
|
+
}); // Return a placeholder if not released and not enabled by feature flag
|
506
|
+
|
507
|
+
|
508
|
+
exports.SidePanel = SidePanel;
|
509
|
+
exports.SidePanel = SidePanel = _settings.pkg.checkComponentEnabled(SidePanel, componentName);
|
510
|
+
SidePanel.propTypes = {
|
511
|
+
/**
|
512
|
+
* Sets the action toolbar buttons
|
513
|
+
*/
|
514
|
+
actionToolbarButtons: _propTypes.default.arrayOf(_propTypes.default.shape({
|
515
|
+
label: _propTypes.default.string,
|
516
|
+
leading: _propTypes.default.bool,
|
517
|
+
icon: _propTypes.default.object,
|
518
|
+
onClick: _propTypes.default.func,
|
519
|
+
kind: _propTypes.default.oneOf(['ghost', 'tertiary', 'secondary', 'primary'])
|
520
|
+
})),
|
521
|
+
|
522
|
+
/**
|
523
|
+
* The primary actions to be shown in the side panel. Each action is
|
524
|
+
* specified as an object with optional fields: 'label' to supply the button
|
525
|
+
* label, 'kind' to select the button kind (must be 'primary', 'secondary' or
|
526
|
+
* 'ghost'), 'loading' to display a loading indicator, and 'onClick' to
|
527
|
+
* receive notifications when the button is clicked. Additional fields in the
|
528
|
+
* object will be passed to the Button component, and these can include
|
529
|
+
* 'disabled', 'ref', 'className', and any other Button props. Any other
|
530
|
+
* fields in the object will be passed through to the button element as HTML
|
531
|
+
* attributes.
|
532
|
+
*
|
533
|
+
* See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
|
534
|
+
*/
|
535
|
+
actions: (0, _propsHelper.allPropTypes)([_ActionSet.ActionSet.validateActions(), _propTypes.default.arrayOf(_propTypes.default.shape(_objectSpread(_objectSpread({}, _carbonComponentsReact.Button.propTypes), {}, {
|
536
|
+
kind: _propTypes.default.oneOf(['ghost', 'secondary', 'primary']),
|
537
|
+
label: _propTypes.default.string,
|
538
|
+
loading: _propTypes.default.bool,
|
539
|
+
// we duplicate this Button prop to improve the DocGen here
|
540
|
+
onClick: _carbonComponentsReact.Button.propTypes.onClick
|
541
|
+
})))]),
|
542
|
+
|
543
|
+
/**
|
544
|
+
* Determines if the title will animate on scroll
|
545
|
+
*/
|
546
|
+
animateTitle: _propTypes.default.bool,
|
547
|
+
|
548
|
+
/**
|
549
|
+
* Sets the body content of the side panel
|
550
|
+
*/
|
551
|
+
children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]).isRequired,
|
552
|
+
|
553
|
+
/**
|
554
|
+
* Sets an optional className to be added to the side panel outermost element
|
555
|
+
*/
|
556
|
+
className: _propTypes.default.string,
|
557
|
+
|
558
|
+
/**
|
559
|
+
* Sets the close button icon description
|
560
|
+
*/
|
561
|
+
closeIconDescription: _propTypes.default.string.isRequired,
|
562
|
+
|
563
|
+
/**
|
564
|
+
* Determines whether the side panel should render the condensed version (affects action buttons primarily)
|
565
|
+
*/
|
566
|
+
condensedActions: _propTypes.default.bool,
|
567
|
+
|
568
|
+
/**
|
569
|
+
* Sets the current step of the side panel
|
570
|
+
*/
|
571
|
+
currentStep: _propTypes.default.number,
|
572
|
+
|
573
|
+
/**
|
574
|
+
* Determines whether the side panel should render with an overlay
|
575
|
+
*/
|
576
|
+
includeOverlay: _propTypes.default.bool,
|
577
|
+
|
578
|
+
/**
|
579
|
+
* Sets the label text which will display above the title text
|
580
|
+
*/
|
581
|
+
labelText: _propTypes.default.string,
|
582
|
+
|
583
|
+
/**
|
584
|
+
* Sets the icon description for the navigation back icon button
|
585
|
+
*/
|
586
|
+
navigationBackIconDescription: _propTypes.default.string,
|
587
|
+
|
588
|
+
/**
|
589
|
+
* Changes the current side panel page to the previous page
|
590
|
+
*/
|
591
|
+
onNavigationBack: _propTypes.default.func,
|
592
|
+
|
593
|
+
/**
|
594
|
+
* Specify a handler for closing the side panel.
|
595
|
+
* This handler closes the modal, e.g. changing `open` prop.
|
596
|
+
*/
|
597
|
+
onRequestClose: _propTypes.default.func,
|
598
|
+
|
599
|
+
/**
|
600
|
+
* Optional function called when the side panel exit animation is complete.
|
601
|
+
* This handler can be used for any state cleanup needed before the panel is removed from the DOM.
|
602
|
+
*/
|
603
|
+
onUnmount: _propTypes.default.func,
|
604
|
+
|
605
|
+
/**
|
606
|
+
* Determines whether the side panel should render or not
|
607
|
+
*/
|
608
|
+
open: _propTypes.default.bool.isRequired,
|
609
|
+
|
610
|
+
/**
|
611
|
+
* Determines if the side panel is on the right or left
|
612
|
+
*/
|
613
|
+
placement: _propTypes.default.oneOf(['left', 'right']),
|
614
|
+
|
615
|
+
/**
|
616
|
+
* Prevent closing on click outside of the panel
|
617
|
+
*/
|
618
|
+
preventCloseOnClickOutside: _propTypes.default.bool,
|
619
|
+
|
620
|
+
/**
|
621
|
+
* This is the selector to the element that contains all of the page content that will shrink if the panel is a slide in.
|
622
|
+
* This prop is required when using the `slideIn` variant of the side panel.
|
623
|
+
*/
|
624
|
+
selectorPageContent: _propTypes.default.string.isRequired.if(function (_ref7) {
|
625
|
+
var slideIn = _ref7.slideIn;
|
626
|
+
return slideIn;
|
627
|
+
}),
|
628
|
+
|
629
|
+
/**
|
630
|
+
* Specify a CSS selector that matches the DOM element that should
|
631
|
+
* be focused when the side panel opens
|
632
|
+
*/
|
633
|
+
selectorPrimaryFocus: _propTypes.default.string,
|
634
|
+
|
635
|
+
/**
|
636
|
+
* Sets the size of the side panel
|
637
|
+
*/
|
638
|
+
size: _propTypes.default.oneOf(['xs', 'sm', 'md', 'lg', 'max']),
|
639
|
+
|
640
|
+
/**
|
641
|
+
* Determines if this panel slides in
|
642
|
+
*/
|
643
|
+
slideIn: _propTypes.default.bool,
|
644
|
+
|
645
|
+
/**
|
646
|
+
* Sets the subtitle text
|
647
|
+
*/
|
648
|
+
subtitle: _propTypes.default.node,
|
649
|
+
|
650
|
+
/**
|
651
|
+
* Sets the title text
|
652
|
+
*/
|
653
|
+
title: _propTypes.default.string.isRequired.if(function (_ref8) {
|
654
|
+
var labelText = _ref8.labelText;
|
655
|
+
return labelText;
|
656
|
+
})
|
657
|
+
};
|
658
|
+
SidePanel.defaultProps = {
|
659
|
+
animateTitle: true,
|
660
|
+
placement: 'right',
|
661
|
+
size: 'md',
|
662
|
+
slideIn: false,
|
663
|
+
currentStep: 0,
|
664
|
+
navigationBackIconDescription: 'Back',
|
665
|
+
closeIconDescription: 'Close',
|
666
|
+
preventCloseOnClickOutside: false
|
667
|
+
};
|
668
|
+
SidePanel.displayName = componentName;
|