@stack-spot/portal-layout 0.0.65 → 1.0.0-dev.1768482785050
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +779 -0
- package/dist/Layout.d.ts +60 -8
- package/dist/Layout.d.ts.map +1 -1
- package/dist/Layout.js +59 -24
- package/dist/Layout.js.map +1 -1
- package/dist/LayoutOverlayManager.d.ts +274 -19
- package/dist/LayoutOverlayManager.d.ts.map +1 -1
- package/dist/LayoutOverlayManager.js +373 -82
- package/dist/LayoutOverlayManager.js.map +1 -1
- package/dist/WelcomeTour.d.ts +2 -0
- package/dist/WelcomeTour.d.ts.map +1 -0
- package/dist/WelcomeTour.js +8 -0
- package/dist/WelcomeTour.js.map +1 -0
- package/dist/components/Backdrop.d.ts +75 -0
- package/dist/components/Backdrop.d.ts.map +1 -0
- package/dist/components/Backdrop.js +69 -0
- package/dist/components/Backdrop.js.map +1 -0
- package/dist/components/Contact/show-contact-modal.d.ts +5 -0
- package/dist/components/Contact/show-contact-modal.d.ts.map +1 -0
- package/dist/components/Contact/show-contact-modal.js +37 -0
- package/dist/components/Contact/show-contact-modal.js.map +1 -0
- package/dist/components/ContactModal.d.ts +1 -0
- package/dist/components/ContactModal.d.ts.map +1 -0
- package/dist/components/ContactModal.js +2 -0
- package/dist/components/ContactModal.js.map +1 -0
- package/dist/components/Dialog.d.ts +54 -7
- package/dist/components/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog.js +8 -2
- package/dist/components/Dialog.js.map +1 -1
- package/dist/components/Header.d.ts +38 -2
- package/dist/components/Header.d.ts.map +1 -1
- package/dist/components/Header.js +9 -4
- package/dist/components/Header.js.map +1 -1
- package/dist/components/NotificationCenter/NotificationPanel.d.ts +3 -0
- package/dist/components/NotificationCenter/NotificationPanel.d.ts.map +1 -0
- package/dist/components/NotificationCenter/NotificationPanel.js +19 -0
- package/dist/components/NotificationCenter/NotificationPanel.js.map +1 -0
- package/dist/components/NotificationCenter/NotificationPanelHeader.d.ts +3 -0
- package/dist/components/NotificationCenter/NotificationPanelHeader.d.ts.map +1 -0
- package/dist/components/NotificationCenter/NotificationPanelHeader.js +16 -0
- package/dist/components/NotificationCenter/NotificationPanelHeader.js.map +1 -0
- package/dist/components/NotificationCenter/NotificationsPanelFooter.d.ts +4 -0
- package/dist/components/NotificationCenter/NotificationsPanelFooter.d.ts.map +1 -0
- package/dist/components/NotificationCenter/NotificationsPanelFooter.js +12 -0
- package/dist/components/NotificationCenter/NotificationsPanelFooter.js.map +1 -0
- package/dist/components/NotificationCenter/dictionary.d.ts +2 -0
- package/dist/components/NotificationCenter/dictionary.d.ts.map +1 -0
- package/dist/components/NotificationCenter/dictionary.js +43 -0
- package/dist/components/NotificationCenter/dictionary.js.map +1 -0
- package/dist/components/NotificationCenter/index.d.ts +2 -0
- package/dist/components/NotificationCenter/index.d.ts.map +1 -0
- package/dist/components/NotificationCenter/index.js +34 -0
- package/dist/components/NotificationCenter/index.js.map +1 -0
- package/dist/components/NotificationCenter/styled.d.ts +3 -0
- package/dist/components/NotificationCenter/styled.d.ts.map +1 -0
- package/dist/components/NotificationCenter/styled.js +74 -0
- package/dist/components/NotificationCenter/styled.js.map +1 -0
- package/dist/components/NotificationCenter/types.d.ts +21 -0
- package/dist/components/NotificationCenter/types.d.ts.map +1 -0
- package/dist/components/NotificationCenter/types.js.map +1 -0
- package/dist/components/NotificationCenter/utils.d.ts +5 -0
- package/dist/components/NotificationCenter/utils.d.ts.map +1 -0
- package/dist/components/NotificationCenter/utils.js +18 -0
- package/dist/components/NotificationCenter/utils.js.map +1 -0
- package/dist/components/OverlayContent.d.ts +27 -1
- package/dist/components/OverlayContent.d.ts.map +1 -1
- package/dist/components/OverlayContent.js +8 -4
- package/dist/components/OverlayContent.js.map +1 -1
- package/dist/components/PortalSwitcher.d.ts +19 -1
- package/dist/components/PortalSwitcher.d.ts.map +1 -1
- package/dist/components/PortalSwitcher.js +16 -31
- package/dist/components/PortalSwitcher.js.map +1 -1
- package/dist/components/PrivacyPolicyMessage/hooks.d.ts +10 -0
- package/dist/components/PrivacyPolicyMessage/hooks.d.ts.map +1 -0
- package/dist/components/PrivacyPolicyMessage/hooks.js +33 -0
- package/dist/components/PrivacyPolicyMessage/hooks.js.map +1 -0
- package/dist/components/PrivacyPolicyMessage/index.d.ts +7 -0
- package/dist/components/PrivacyPolicyMessage/index.d.ts.map +1 -0
- package/dist/components/PrivacyPolicyMessage/index.js +5 -0
- package/dist/components/PrivacyPolicyMessage/index.js.map +1 -0
- package/dist/components/Rate/FeedbackModal.d.ts +8 -0
- package/dist/components/Rate/FeedbackModal.d.ts.map +1 -0
- package/dist/components/Rate/FeedbackModal.js +52 -0
- package/dist/components/Rate/FeedbackModal.js.map +1 -0
- package/dist/components/Rate/hook.d.ts +3 -0
- package/dist/components/Rate/hook.d.ts.map +1 -0
- package/dist/components/Rate/hook.js +48 -0
- package/dist/components/Rate/hook.js.map +1 -0
- package/dist/components/Rate/index.d.ts +10 -0
- package/dist/components/Rate/index.d.ts.map +1 -0
- package/dist/components/Rate/index.js +16 -0
- package/dist/components/Rate/index.js.map +1 -0
- package/dist/components/Rate/on-nps-submit.d.ts +7 -0
- package/dist/components/Rate/on-nps-submit.d.ts.map +1 -0
- package/dist/components/Rate/on-nps-submit.js +8 -0
- package/dist/components/Rate/on-nps-submit.js.map +1 -0
- package/dist/components/Rate/show-rate-us-modals.d.ts +17 -0
- package/dist/components/Rate/show-rate-us-modals.d.ts.map +1 -0
- package/dist/components/Rate/show-rate-us-modals.js +14 -0
- package/dist/components/Rate/show-rate-us-modals.js.map +1 -0
- package/dist/components/Rate/utils.d.ts +2 -0
- package/dist/components/Rate/utils.d.ts.map +1 -0
- package/dist/components/Rate/utils.js +10 -0
- package/dist/components/Rate/utils.js.map +1 -0
- package/dist/components/Toaster.d.ts +35 -0
- package/dist/components/Toaster.d.ts.map +1 -1
- package/dist/components/Toaster.js +32 -4
- package/dist/components/Toaster.js.map +1 -1
- package/dist/components/TypeForm/hook.d.ts +2 -0
- package/dist/components/TypeForm/hook.d.ts.map +1 -0
- package/dist/components/TypeForm/hook.js +11 -0
- package/dist/components/TypeForm/hook.js.map +1 -0
- package/dist/components/TypeForm/index.d.ts +6 -0
- package/dist/components/TypeForm/index.d.ts.map +1 -0
- package/dist/components/TypeForm/index.js +23 -0
- package/dist/components/TypeForm/index.js.map +1 -0
- package/dist/components/TypeForm/show-typeform-modal.d.ts +5 -0
- package/dist/components/TypeForm/show-typeform-modal.d.ts.map +1 -0
- package/dist/components/TypeForm/show-typeform-modal.js +11 -0
- package/dist/components/TypeForm/show-typeform-modal.js.map +1 -0
- package/dist/components/TypeForm/utils.d.ts +2 -0
- package/dist/components/TypeForm/utils.d.ts.map +1 -0
- package/dist/components/TypeForm/utils.js +9 -0
- package/dist/components/TypeForm/utils.js.map +1 -0
- package/dist/components/UserMenu.d.ts +19 -2
- package/dist/components/UserMenu.d.ts.map +1 -1
- package/dist/components/UserMenu.js +12 -6
- package/dist/components/UserMenu.js.map +1 -1
- package/dist/components/error/ErrorBoundary.d.ts +25 -4
- package/dist/components/error/ErrorBoundary.d.ts.map +1 -1
- package/dist/components/error/ErrorBoundary.js +10 -1
- package/dist/components/error/ErrorBoundary.js.map +1 -1
- package/dist/components/error/ErrorManager.d.ts +22 -6
- package/dist/components/error/ErrorManager.d.ts.map +1 -1
- package/dist/components/error/ErrorManager.js +21 -1
- package/dist/components/error/ErrorManager.js.map +1 -1
- package/dist/components/error/SilentErrorBoundary.d.ts +26 -5
- package/dist/components/error/SilentErrorBoundary.d.ts.map +1 -1
- package/dist/components/error/SilentErrorBoundary.js +10 -0
- package/dist/components/error/SilentErrorBoundary.js.map +1 -1
- package/dist/components/menu/MenuContent.d.ts +20 -4
- package/dist/components/menu/MenuContent.d.ts.map +1 -1
- package/dist/components/menu/MenuContent.js +89 -88
- package/dist/components/menu/MenuContent.js.map +1 -1
- package/dist/components/menu/MenuSectionGroup.d.ts +2 -0
- package/dist/components/menu/MenuSectionGroup.d.ts.map +1 -0
- package/dist/components/menu/MenuSectionGroup.js +121 -0
- package/dist/components/menu/MenuSectionGroup.js.map +1 -0
- package/dist/components/menu/MenuSections.d.ts +17 -0
- package/dist/components/menu/MenuSections.d.ts.map +1 -1
- package/dist/components/menu/MenuSections.js +159 -39
- package/dist/components/menu/MenuSections.js.map +1 -1
- package/dist/components/menu/PageSelector.d.ts +5 -0
- package/dist/components/menu/PageSelector.d.ts.map +1 -1
- package/dist/components/menu/PageSelector.js +9 -4
- package/dist/components/menu/PageSelector.js.map +1 -1
- package/dist/components/menu/types.d.ts +219 -8
- package/dist/components/menu/types.d.ts.map +1 -1
- package/dist/components/tour/StepContainer.d.ts +37 -0
- package/dist/components/tour/StepContainer.d.ts.map +1 -0
- package/dist/components/tour/StepContainer.js +51 -0
- package/dist/components/tour/StepContainer.js.map +1 -0
- package/dist/components/tour/StepNavigation.d.ts +29 -0
- package/dist/components/tour/StepNavigation.d.ts.map +1 -0
- package/dist/components/tour/StepNavigation.js +37 -0
- package/dist/components/tour/StepNavigation.js.map +1 -0
- package/dist/components/tour/StepTitle.d.ts +17 -0
- package/dist/components/tour/StepTitle.d.ts.map +1 -0
- package/dist/components/tour/StepTitle.js +10 -0
- package/dist/components/tour/StepTitle.js.map +1 -0
- package/dist/components/tour/hook.d.ts +3 -0
- package/dist/components/tour/hook.d.ts.map +1 -0
- package/dist/components/tour/hook.js +10 -0
- package/dist/components/tour/hook.js.map +1 -0
- package/dist/components/tour/index.d.ts +5 -0
- package/dist/components/tour/index.d.ts.map +1 -0
- package/dist/components/tour/index.js +5 -0
- package/dist/components/tour/index.js.map +1 -0
- package/dist/components/tour/manager.d.ts +34 -0
- package/dist/components/tour/manager.d.ts.map +1 -0
- package/dist/components/tour/manager.js +104 -0
- package/dist/components/tour/manager.js.map +1 -0
- package/dist/components/tour/utils.d.ts +67 -0
- package/dist/components/tour/utils.d.ts.map +1 -0
- package/dist/components/tour/utils.js +60 -0
- package/dist/components/tour/utils.js.map +1 -0
- package/dist/components/user-menu-manager.d.ts +13 -0
- package/dist/components/user-menu-manager.d.ts.map +1 -0
- package/dist/components/user-menu-manager.js +36 -0
- package/dist/components/user-menu-manager.js.map +1 -0
- package/dist/dictionary.d.ts +6 -1
- package/dist/dictionary.d.ts.map +1 -1
- package/dist/dictionary.js +7 -2
- package/dist/dictionary.js.map +1 -1
- package/dist/elements.d.ts +7 -0
- package/dist/elements.d.ts.map +1 -1
- package/dist/elements.js +7 -0
- package/dist/elements.js.map +1 -1
- package/dist/index.d.ts +15 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -8
- package/dist/index.js.map +1 -1
- package/dist/layout.css +190 -35
- package/dist/svg/StarFillWithGradient.d.ts +6 -0
- package/dist/svg/StarFillWithGradient.d.ts.map +1 -0
- package/dist/svg/StarFillWithGradient.js +4 -0
- package/dist/svg/StarFillWithGradient.js.map +1 -0
- package/dist/toaster.d.ts +55 -9
- package/dist/toaster.d.ts.map +1 -1
- package/dist/toaster.js +34 -6
- package/dist/toaster.js.map +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +6 -69
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +9 -130
- package/dist/utils.js.map +1 -1
- package/package.dev.json +3 -0
- package/package.json +24 -13
- package/package.stg.json +3 -0
- package/readme.md +147 -0
- package/src/Layout.tsx +166 -58
- package/src/LayoutOverlayManager.tsx +499 -85
- package/src/WelcomeTour.tsx +8 -0
- package/src/components/Backdrop.tsx +116 -0
- package/src/components/Contact/show-contact-modal.tsx +71 -0
- package/src/components/Dialog.tsx +58 -9
- package/src/components/Header.tsx +53 -5
- package/src/components/NotificationCenter/NotificationPanel.tsx +40 -0
- package/src/components/NotificationCenter/NotificationPanelHeader.tsx +53 -0
- package/src/components/NotificationCenter/NotificationsPanelFooter.tsx +25 -0
- package/src/components/NotificationCenter/dictionary.ts +44 -0
- package/src/components/NotificationCenter/index.tsx +58 -0
- package/src/components/NotificationCenter/styled.ts +75 -0
- package/src/components/NotificationCenter/types.ts +24 -0
- package/src/components/NotificationCenter/utils.ts +20 -0
- package/src/components/OverlayContent.tsx +40 -5
- package/src/components/PortalSwitcher.tsx +33 -39
- package/src/components/PrivacyPolicyMessage/hooks.tsx +49 -0
- package/src/components/PrivacyPolicyMessage/index.tsx +21 -0
- package/src/components/Rate/FeedbackModal.tsx +86 -0
- package/src/components/Rate/hook.tsx +61 -0
- package/src/components/Rate/index.tsx +36 -0
- package/src/components/Rate/on-nps-submit.ts +18 -0
- package/src/components/Rate/show-rate-us-modals.tsx +29 -0
- package/src/components/Rate/utils.ts +11 -0
- package/src/components/Toaster.tsx +82 -3
- package/src/components/TypeForm/hook.tsx +13 -0
- package/src/components/TypeForm/index.tsx +50 -0
- package/src/components/TypeForm/show-typeform-modal.tsx +10 -0
- package/src/components/TypeForm/utils.ts +8 -0
- package/src/components/UserMenu.tsx +32 -8
- package/src/components/error/ErrorBoundary.tsx +11 -2
- package/src/components/error/ErrorManager.ts +22 -6
- package/src/components/error/SilentErrorBoundary.tsx +12 -2
- package/src/components/menu/MenuContent.tsx +102 -110
- package/src/components/menu/MenuSectionGroup.tsx +121 -0
- package/src/components/menu/MenuSections.tsx +342 -93
- package/src/components/menu/PageSelector.tsx +16 -4
- package/src/components/menu/types.ts +221 -9
- package/src/components/tour/StepContainer.tsx +92 -0
- package/src/components/tour/StepNavigation.tsx +72 -0
- package/src/components/tour/StepTitle.tsx +28 -0
- package/src/components/tour/hook.ts +12 -0
- package/src/components/tour/index.ts +6 -0
- package/src/components/tour/manager.tsx +119 -0
- package/src/components/tour/utils.tsx +119 -0
- package/src/components/user-menu-manager.ts +31 -0
- package/src/dictionary.ts +7 -2
- package/src/elements.ts +7 -0
- package/src/index.ts +15 -8
- package/src/layout.css +190 -35
- package/src/svg/StarFillWithGradient.tsx +14 -0
- package/src/toaster.tsx +90 -13
- package/src/types.ts +4 -0
- package/src/utils.ts +9 -142
- package/dist/components/BottomNotification.d.ts +0 -1
- package/dist/components/BottomNotification.d.ts.map +0 -1
- package/dist/components/BottomNotification.js +0 -2
- package/dist/components/BottomNotification.js.map +0 -1
- package/dist/components/BottomPanel.d.ts +0 -1
- package/dist/components/BottomPanel.d.ts.map +0 -1
- package/dist/components/BottomPanel.js +0 -2
- package/dist/components/BottomPanel.js.map +0 -1
- package/dist/components/SelectionList.d.ts +0 -36
- package/dist/components/SelectionList.d.ts.map +0 -1
- package/dist/components/SelectionList.js +0 -140
- package/dist/components/SelectionList.js.map +0 -1
- package/dist/components/error/ErrorFeedback.d.ts +0 -3
- package/dist/components/error/ErrorFeedback.d.ts.map +0 -1
- package/dist/components/error/ErrorFeedback.js +0 -66
- package/dist/components/error/ErrorFeedback.js.map +0 -1
- package/dist/components/menu/use-check-text-overflow.d.ts +0 -6
- package/dist/components/menu/use-check-text-overflow.d.ts.map +0 -1
- package/dist/components/menu/use-check-text-overflow.js +0 -20
- package/dist/components/menu/use-check-text-overflow.js.map +0 -1
- package/dist/components/menu/use-keyboard-controls.d.ts +0 -23
- package/dist/components/menu/use-keyboard-controls.d.ts.map +0 -1
- package/dist/components/menu/use-keyboard-controls.js +0 -49
- package/dist/components/menu/use-keyboard-controls.js.map +0 -1
- package/dist/components/tour/PortalSwitcherStep.d.ts +0 -3
- package/dist/components/tour/PortalSwitcherStep.d.ts.map +0 -1
- package/dist/components/tour/PortalSwitcherStep.js +0 -29
- package/dist/components/tour/PortalSwitcherStep.js.map +0 -1
- package/dist/components/types.d.ts +0 -15
- package/dist/components/types.d.ts.map +0 -1
- package/dist/components/types.js.map +0 -1
- package/dist/layout-context.d.ts +0 -10
- package/dist/layout-context.d.ts.map +0 -1
- package/dist/layout-context.js +0 -11
- package/dist/layout-context.js.map +0 -1
- package/dist/svg/AI.d.ts +0 -6
- package/dist/svg/AI.d.ts.map +0 -1
- package/dist/svg/AI.js +0 -9
- package/dist/svg/AI.js.map +0 -1
- package/dist/svg/EDP.d.ts +0 -6
- package/dist/svg/EDP.d.ts.map +0 -1
- package/dist/svg/EDP.js +0 -5
- package/dist/svg/EDP.js.map +0 -1
- package/dist/svg/Forbidden.d.ts +0 -6
- package/dist/svg/Forbidden.d.ts.map +0 -1
- package/dist/svg/Forbidden.js +0 -4
- package/dist/svg/Forbidden.js.map +0 -1
- package/dist/svg/HUB.d.ts +0 -6
- package/dist/svg/HUB.d.ts.map +0 -1
- package/dist/svg/HUB.js +0 -5
- package/dist/svg/HUB.js.map +0 -1
- package/dist/svg/Logo.d.ts +0 -2
- package/dist/svg/Logo.d.ts.map +0 -1
- package/dist/svg/Logo.js +0 -4
- package/dist/svg/Logo.js.map +0 -1
- package/dist/svg/NotFound.d.ts +0 -6
- package/dist/svg/NotFound.d.ts.map +0 -1
- package/dist/svg/NotFound.js +0 -4
- package/dist/svg/NotFound.js.map +0 -1
- package/dist/svg/ServerError.d.ts +0 -6
- package/dist/svg/ServerError.d.ts.map +0 -1
- package/dist/svg/ServerError.js +0 -4
- package/dist/svg/ServerError.js.map +0 -1
- package/dist/svg/Unauthenticated.d.ts +0 -6
- package/dist/svg/Unauthenticated.d.ts.map +0 -1
- package/dist/svg/Unauthenticated.js +0 -4
- package/dist/svg/Unauthenticated.js.map +0 -1
- package/src/components/BottomPanel.tsx +0 -0
- package/src/components/SelectionList.tsx +0 -272
- package/src/components/error/ErrorFeedback.tsx +0 -114
- package/src/components/menu/use-check-text-overflow.tsx +0 -26
- package/src/components/menu/use-keyboard-controls.tsx +0 -70
- package/src/components/tour/PortalSwitcherStep.tsx +0 -36
- package/src/components/types.ts +0 -15
- package/src/layout-context.tsx +0 -22
- package/src/svg/AI.tsx +0 -37
- package/src/svg/EDP.tsx +0 -35
- package/src/svg/Forbidden.tsx +0 -22
- package/src/svg/HUB.tsx +0 -35
- package/src/svg/Logo.tsx +0 -35
- package/src/svg/NotFound.tsx +0 -16
- package/src/svg/ServerError.tsx +0 -33
- package/src/svg/Unauthenticated.tsx +0 -16
- /package/dist/components/{types.js → NotificationCenter/types.js} +0 -0
- /package/src/components/{BottomNotification.tsx → ContactModal.tsx} +0 -0
package/src/Layout.tsx
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CSSToCitricAdapter,
|
|
1
|
+
import { FadingOverflow } from '@stack-spot/portal-components/FadingOverflow'
|
|
2
|
+
import { CSSToCitricAdapter, listToClass, WithStyle } from '@stack-spot/portal-theme'
|
|
3
3
|
import '@stack-spot/portal-theme/dist/theme.css'
|
|
4
4
|
import { ReactElement, ReactNode, useEffect } from 'react'
|
|
5
5
|
import { overlay } from './LayoutOverlayManager'
|
|
6
|
+
import { WelcomeTour } from './WelcomeTour'
|
|
6
7
|
import { Header, HeaderProps } from './components/Header'
|
|
7
8
|
import { Toaster } from './components/Toaster'
|
|
8
9
|
import { ErrorBoundary } from './components/error/ErrorBoundary'
|
|
@@ -10,88 +11,180 @@ import { DescriptionFn, ErrorHandler, ErrorManager } from './components/error/Er
|
|
|
10
11
|
import { SilentErrorBoundary } from './components/error/SilentErrorBoundary'
|
|
11
12
|
import { MenuContent } from './components/menu/MenuContent'
|
|
12
13
|
import { MenuSections } from './components/menu/MenuSections'
|
|
13
|
-
import { MenuProps } from './components/menu/types'
|
|
14
|
-
import {
|
|
15
|
-
import { elementIds, getLayoutElements } from './elements'
|
|
16
|
-
import { LayoutContext, LayoutProvider } from './layout-context'
|
|
14
|
+
import { MenuProps, MenuPropsWithDynamicContent, MenuSectionContent } from './components/menu/types'
|
|
15
|
+
import { elementIds } from './elements'
|
|
17
16
|
import './layout.css'
|
|
18
17
|
|
|
19
|
-
interface Props extends WithStyle
|
|
18
|
+
interface Props extends WithStyle {
|
|
19
|
+
/**
|
|
20
|
+
* The config for the menu.
|
|
21
|
+
*/
|
|
20
22
|
menu: MenuProps,
|
|
23
|
+
/**
|
|
24
|
+
* The config for the header.
|
|
25
|
+
*/
|
|
21
26
|
header: HeaderProps,
|
|
27
|
+
/**
|
|
28
|
+
* The React node to go in the page content.
|
|
29
|
+
*/
|
|
22
30
|
children: ReactNode,
|
|
31
|
+
/**
|
|
32
|
+
* A React node to place right after the page.
|
|
33
|
+
*/
|
|
23
34
|
extra?: ReactNode,
|
|
35
|
+
/**
|
|
36
|
+
* A function to convert errors into a readable format so they're properly rendered and logged.
|
|
37
|
+
*/
|
|
24
38
|
errorDescriptor?: DescriptionFn,
|
|
39
|
+
/**
|
|
40
|
+
* A function to run whenever an error is catch by an error boundary.
|
|
41
|
+
*/
|
|
25
42
|
onError?: ErrorHandler,
|
|
26
|
-
|
|
43
|
+
/**
|
|
44
|
+
* When true, the sections menu auto-collapses whenever a secondary (contextual) menu appears.
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
autoCollapseSectionsMenu?: boolean,
|
|
27
48
|
}
|
|
28
49
|
|
|
29
|
-
interface RawProps extends WithStyle
|
|
50
|
+
interface RawProps extends WithStyle {
|
|
51
|
+
/**
|
|
52
|
+
* The React element to go in the menu sections.
|
|
53
|
+
*/
|
|
30
54
|
menuSections?: ReactElement,
|
|
55
|
+
/**
|
|
56
|
+
* The React element to go in the menu content.
|
|
57
|
+
*/
|
|
31
58
|
menuContent?: ReactElement,
|
|
59
|
+
/**
|
|
60
|
+
* The React element to go in the menu inner content (third level nav).
|
|
61
|
+
*/
|
|
62
|
+
menuInnerContent?: ReactElement,
|
|
63
|
+
/**
|
|
64
|
+
* The React element to go in the header.
|
|
65
|
+
*/
|
|
32
66
|
header?: ReactElement,
|
|
67
|
+
/**
|
|
68
|
+
* The React node to go in the page content.
|
|
69
|
+
*/
|
|
33
70
|
children?: ReactNode,
|
|
71
|
+
/**
|
|
72
|
+
* A React node to place right after the page.
|
|
73
|
+
*/
|
|
34
74
|
extra?: ReactNode,
|
|
75
|
+
/**
|
|
76
|
+
* A function to convert errors into a readable format so they're properly rendered and logged.
|
|
77
|
+
*/
|
|
35
78
|
errorDescriptor?: DescriptionFn,
|
|
79
|
+
/**
|
|
80
|
+
* A function to run whenever an error is catch by an error boundary.
|
|
81
|
+
*/
|
|
36
82
|
onError?: ErrorHandler,
|
|
37
|
-
tourProps?: TourProps,
|
|
38
83
|
}
|
|
39
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Renders the layout with the React elements passed in the props.
|
|
87
|
+
* @param props the component's props {@link RawProps}.
|
|
88
|
+
*/
|
|
40
89
|
export const RawLayout = (
|
|
41
|
-
{ menuSections, menuContent, header, children,
|
|
42
|
-
extra, errorDescriptor, onError, className, style
|
|
90
|
+
{ menuSections, menuContent, menuInnerContent, header, children,
|
|
91
|
+
extra, errorDescriptor, onError, className, style }:
|
|
43
92
|
RawProps,
|
|
44
93
|
) => {
|
|
45
|
-
// @ts-ignore
|
|
46
94
|
const { bottomDialog, modal, rightPanel } = overlay.useOverlays()
|
|
47
|
-
const { layout } = getLayoutElements()
|
|
48
|
-
const isCompactedOnlyIcons = layout?.classList.contains('menu-compact')
|
|
49
|
-
const portalSwitcherStep = usePortalSwitcherStep()
|
|
50
|
-
|
|
51
|
-
const classes = [
|
|
52
|
-
menuContent && !isCompactedOnlyIcons ? 'menu-content-visible' : undefined,
|
|
53
|
-
menuSections ? undefined : 'no-menu-sections',
|
|
54
|
-
className,
|
|
55
|
-
isCompactedOnlyIcons ? 'menu-compact' : undefined,
|
|
56
|
-
]
|
|
57
|
-
|
|
58
|
-
const tourPropsWithDefaults = { ...defaultTourConfig, ...(tourProps || {}) }
|
|
59
|
-
tourPropsWithDefaults.steps = [
|
|
60
|
-
portalSwitcherStep,
|
|
61
|
-
...tourPropsWithDefaults.steps,
|
|
62
|
-
].filter(isNewTourStep)
|
|
63
95
|
|
|
64
96
|
useEffect(() => {
|
|
65
97
|
if (errorDescriptor) ErrorManager.setDescriptionFunction(errorDescriptor)
|
|
66
98
|
if (onError) ErrorManager.setErrorHandler(onError)
|
|
67
99
|
}, [])
|
|
68
100
|
|
|
101
|
+
// controls classes in the layout element. This can't be a React prop because we don't want classes to be replaced, we want them to be
|
|
102
|
+
// merged with the previous set of classes.
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
const classList = document.getElementById(elementIds.layout)?.classList
|
|
105
|
+
if (!classList) return
|
|
106
|
+
const hasMenuContent = !!menuContent && !!document.getElementById(elementIds.menuContent)?.children.length
|
|
107
|
+
const hasMenuInnerContent = !!menuInnerContent && !!document.getElementById(elementIds.menuInnerContent)?.children.length
|
|
108
|
+
|
|
109
|
+
if (hasMenuContent) {
|
|
110
|
+
classList.add('menu-content-visible')
|
|
111
|
+
if (!classList.contains('menu-manual')) {
|
|
112
|
+
classList.add('menu-compact')
|
|
113
|
+
}
|
|
114
|
+
} else {
|
|
115
|
+
classList.remove('menu-content-visible')
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (hasMenuInnerContent) {
|
|
119
|
+
classList.add('menu-inner-content-visible')
|
|
120
|
+
} else {
|
|
121
|
+
classList.remove('menu-inner-content-visible')
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
classList[menuSections ? 'remove' : 'add']('no-menu-sections')
|
|
125
|
+
if (className) classList.add(...className.split(/\s+/))
|
|
126
|
+
}, [menuContent, menuInnerContent, menuSections, className])
|
|
127
|
+
|
|
69
128
|
return (
|
|
70
129
|
<CSSToCitricAdapter>
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
130
|
+
<WelcomeTour />
|
|
131
|
+
<div id={elementIds.layout} style={style} className="menu-manual menu-compact">
|
|
132
|
+
{header && <header id={elementIds.header}><SilentErrorBoundary>{header}</SilentErrorBoundary></header>}
|
|
133
|
+
{extra && <SilentErrorBoundary>{extra}</SilentErrorBoundary>}
|
|
134
|
+
<aside id={elementIds.menu}>
|
|
135
|
+
{menuInnerContent &&
|
|
136
|
+
<nav role="menubar" id={elementIds.menuInnerContent}><SilentErrorBoundary>{menuInnerContent}</SilentErrorBoundary></nav>
|
|
137
|
+
}
|
|
138
|
+
<nav role="menubar" id={elementIds.menuContent}><SilentErrorBoundary>{menuContent}</SilentErrorBoundary></nav>
|
|
139
|
+
{menuSections &&
|
|
140
|
+
<FadingOverflow sides={['top', 'bottom']} scroll="arrows">
|
|
141
|
+
<nav role="menubar" id={elementIds.menuSections}>
|
|
142
|
+
<SilentErrorBoundary>{menuSections}</SilentErrorBoundary>
|
|
143
|
+
</nav>
|
|
144
|
+
</FadingOverflow>
|
|
145
|
+
}
|
|
146
|
+
</aside>
|
|
147
|
+
{children && <div id={elementIds.page}>
|
|
148
|
+
<article id={elementIds.content}><ErrorBoundary>{children}</ErrorBoundary></article>
|
|
149
|
+
</div>}
|
|
150
|
+
<div id={elementIds.bottomDialog} role="dialog"><ErrorBoundary>{bottomDialog}</ErrorBoundary></div>
|
|
151
|
+
<div id={elementIds.backdrop}>
|
|
152
|
+
<div id={elementIds.rightPanel} aria-modal role="dialog">
|
|
153
|
+
<ErrorBoundary>
|
|
154
|
+
{rightPanel.length === 1 && !rightPanel[0].stack
|
|
155
|
+
? rightPanel[0].element
|
|
156
|
+
: rightPanel.map(
|
|
157
|
+
(m, i) => <div
|
|
158
|
+
key={i}
|
|
159
|
+
className={listToClass([
|
|
160
|
+
'right-panel-instance',
|
|
161
|
+
(i === rightPanel.length - 1) && 'active',
|
|
162
|
+
modal.length > 0 && 'disabled',
|
|
163
|
+
])}
|
|
164
|
+
{...(modal.length > 0 ? { inert: true } : {})}
|
|
165
|
+
>
|
|
166
|
+
{m.element}
|
|
167
|
+
</div>,
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
</ErrorBoundary>
|
|
171
|
+
</div>
|
|
172
|
+
<div id={elementIds.modal} aria-modal role="dialog">
|
|
173
|
+
<ErrorBoundary>
|
|
174
|
+
{modal.length === 1 && !modal[0].stack
|
|
175
|
+
? modal[0].element
|
|
176
|
+
: modal.map(
|
|
177
|
+
(m, i) =>
|
|
178
|
+
<div key={i} className={listToClass(['modal-instance', (i === modal.length - 1) && 'active'])}>{m.element}</div>,
|
|
179
|
+
)
|
|
180
|
+
}
|
|
181
|
+
</ErrorBoundary>
|
|
92
182
|
</div>
|
|
93
|
-
</
|
|
94
|
-
|
|
183
|
+
</div>
|
|
184
|
+
<Toaster />
|
|
185
|
+
<div id={elementIds.accessibilityAnnouncer} aria-atomic aria-live="assertive">
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
95
188
|
</CSSToCitricAdapter>
|
|
96
189
|
)
|
|
97
190
|
}
|
|
@@ -99,23 +192,38 @@ export const RawLayout = (
|
|
|
99
192
|
const MenuContentRenderer = ({ content }: Required<Pick<Props['menu'], 'content'>>) => {
|
|
100
193
|
const menuContent = typeof content === 'function' ? content() : content
|
|
101
194
|
return <MenuContent {...menuContent} />
|
|
195
|
+
|
|
102
196
|
}
|
|
197
|
+
const MenuInnerContentRenderer = ({ content }: { content?: MenuSectionContent | (() => MenuSectionContent | undefined) }) => {
|
|
198
|
+
const menuContent = typeof content === 'function' ? content() : content
|
|
199
|
+
return menuContent && <MenuContent {...menuContent} />
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const hasInnerContent = (menu: MenuProps): menu is MenuPropsWithDynamicContent => 'innerContent' in menu
|
|
103
203
|
|
|
104
|
-
|
|
204
|
+
/**
|
|
205
|
+
* Renders the layout with a menu and header that follow the config objects passed as parameter.
|
|
206
|
+
* @param props the component's props {@link Props}.
|
|
207
|
+
*/
|
|
208
|
+
export const Layout = ({ menu, header, children, extra, errorDescriptor, onError, className, style }: Props) => (
|
|
105
209
|
<RawLayout
|
|
106
210
|
header={<Header {...header} />}
|
|
107
211
|
menuSections={menu.sections ? <MenuSections {...menu} /> : undefined}
|
|
108
|
-
menuContent={
|
|
109
|
-
|
|
110
|
-
|
|
212
|
+
menuContent={
|
|
213
|
+
menu.content
|
|
214
|
+
? <MenuContentRenderer key={'contentKey' in menu ? menu.contentKey : undefined} content={menu.content} />
|
|
215
|
+
: undefined
|
|
216
|
+
}
|
|
217
|
+
menuInnerContent={
|
|
218
|
+
hasInnerContent(menu) && menu.innerContent
|
|
219
|
+
? <MenuInnerContentRenderer key={'contentKey' in menu ? menu.contentKey : undefined} content={menu.innerContent} />
|
|
220
|
+
: undefined
|
|
111
221
|
}
|
|
112
222
|
errorDescriptor={errorDescriptor}
|
|
113
223
|
onError={onError}
|
|
114
224
|
extra={extra}
|
|
115
225
|
className={className}
|
|
116
226
|
style={style}
|
|
117
|
-
tourProps={tourProps}
|
|
118
|
-
anchorTag={anchorTag}
|
|
119
227
|
>
|
|
120
228
|
{children}
|
|
121
229
|
</RawLayout>
|