@stack-spot/portal-layout 0.0.64 → 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 -547
- 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 +66 -8
- package/dist/components/tour/utils.d.ts.map +1 -1
- package/dist/components/tour/utils.js +57 -45
- package/dist/components/tour/utils.js.map +1 -1
- 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 +26 -15
- package/package.stg.json +3 -0
- package/readme.md +147 -0
- package/src/Layout.tsx +166 -57
- 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/ErrorDescriptor.d.ts +0 -12
- package/dist/components/error/ErrorDescriptor.d.ts.map +0 -1
- package/dist/components/error/ErrorDescriptor.js +0 -17
- package/dist/components/error/ErrorDescriptor.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/menu/useCheckTextOverflow.d.ts +0 -6
- package/dist/components/menu/useCheckTextOverflow.d.ts.map +0 -1
- package/dist/components/menu/useCheckTextOverflow.js +0 -20
- package/dist/components/menu/useCheckTextOverflow.js.map +0 -1
- package/dist/components/tour/Navigation.d.ts +0 -8
- package/dist/components/tour/Navigation.d.ts.map +0 -1
- package/dist/components/tour/Navigation.js +0 -15
- package/dist/components/tour/Navigation.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/tour/config.d.ts +0 -3
- package/dist/components/tour/config.d.ts.map +0 -1
- package/dist/components/tour/config.js +0 -22
- package/dist/components/tour/config.js.map +0 -1
- package/dist/components/tour/steps/PortalSwitcherStep.d.ts +0 -3
- package/dist/components/tour/steps/PortalSwitcherStep.d.ts.map +0 -1
- package/dist/components/tour/steps/PortalSwitcherStep.js +0 -30
- package/dist/components/tour/steps/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
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
4
|
-
import { Flex, IconBox, Text } from '@citric/core';
|
|
2
|
+
import { Box, Flex, IconBox, Text } from '@citric/core';
|
|
5
3
|
import { ArrowLeft, ChevronDown } from '@citric/icons';
|
|
6
4
|
import { LoadingCircular } from '@citric/ui';
|
|
5
|
+
import { useCheckTextOverflow } from '@stack-spot/portal-components';
|
|
6
|
+
import { useAnchorTag } from '@stack-spot/portal-components/anchor';
|
|
7
7
|
import { listToClass, theme } from '@stack-spot/portal-theme';
|
|
8
8
|
import { useMemo, useState } from 'react';
|
|
9
9
|
import { styled } from 'styled-components';
|
|
10
|
-
import { useAnchorTag } from '../../layout-context.js';
|
|
11
10
|
import { hideOverlayImmediately } from './MenuSections.js';
|
|
12
11
|
import { PageSelector } from './PageSelector.js';
|
|
13
12
|
import { MENU_CONTENT_ITEM_PADDING as ITEM_PADDING, MENU_CONTENT_PADDING as PADDING } from './constants.js';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
align-items: center;
|
|
19
|
-
margin: ${PADDING}px;
|
|
20
|
-
margin-bottom: 16px;
|
|
21
|
-
gap: 6px;
|
|
22
|
-
`;
|
|
13
|
+
/**
|
|
14
|
+
* The list (`<ul>`) used for grouping items in a menu.
|
|
15
|
+
*/
|
|
16
|
+
// fixme: remove explicit type when TS is upgraded to 5.5 or greater
|
|
23
17
|
export const MenuGroup = styled.ul `
|
|
24
18
|
padding: 0 0 0 16px;
|
|
25
19
|
display: flex;
|
|
@@ -31,30 +25,18 @@ export const MenuGroup = styled.ul `
|
|
|
31
25
|
padding: 0;
|
|
32
26
|
}
|
|
33
27
|
|
|
34
|
-
.item-row-group > a {
|
|
35
|
-
padding: 0 16px;
|
|
36
|
-
margin: 0;
|
|
37
|
-
border-radius: 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.item-row-group > a::before {
|
|
41
|
-
content: '';
|
|
42
|
-
position: absolute;
|
|
43
|
-
top: 0;
|
|
44
|
-
left: 0;
|
|
45
|
-
right: 0;
|
|
46
|
-
bottom: 0;
|
|
47
|
-
background-color: var(--light-300);
|
|
48
|
-
opacity: 0.24;
|
|
49
|
-
border-radius: inherit;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
28
|
.item-row {
|
|
53
29
|
display: flex;
|
|
54
30
|
flex-direction: row;
|
|
55
31
|
gap: 8px;
|
|
56
32
|
align-items: center;
|
|
57
33
|
|
|
34
|
+
&.root {
|
|
35
|
+
padding: 0 16px;
|
|
36
|
+
margin-top: 16px;
|
|
37
|
+
border-radius: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
58
40
|
.label {
|
|
59
41
|
flex: 1;
|
|
60
42
|
&.hidden, &.ellipsis {
|
|
@@ -66,73 +48,77 @@ export const MenuGroup = styled.ul `
|
|
|
66
48
|
}
|
|
67
49
|
}
|
|
68
50
|
}
|
|
69
|
-
|
|
70
|
-
.item-row-group {
|
|
71
|
-
margin-top: 16px;
|
|
72
|
-
}
|
|
73
51
|
|
|
74
|
-
li
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
transition: height 0.3s, background-color 0.2s;
|
|
79
|
-
margin-left: ${PADDING - ITEM_PADDING}px;
|
|
80
|
-
padding-left: ${ITEM_PADDING}px;
|
|
52
|
+
li {
|
|
53
|
+
.item-row-title {
|
|
54
|
+
opacity: 0.7;
|
|
55
|
+
}
|
|
81
56
|
|
|
82
|
-
|
|
83
|
-
|
|
57
|
+
.item-as-title {
|
|
58
|
+
position: relative;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
margin-left: ${PADDING - ITEM_PADDING}px;
|
|
84
61
|
}
|
|
85
62
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
63
|
+
a {
|
|
64
|
+
position: relative;
|
|
65
|
+
height: 0;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
transition: height 0.3s, background-color 0.2s;
|
|
68
|
+
margin-left: ${PADDING - ITEM_PADDING}px;
|
|
69
|
+
padding-left: ${ITEM_PADDING}px;
|
|
70
|
+
|
|
71
|
+
&:hover {
|
|
72
|
+
background-color: ${theme.color.light['500']};
|
|
95
73
|
}
|
|
74
|
+
|
|
75
|
+
&.action {
|
|
76
|
+
&:before {
|
|
77
|
+
content: '';
|
|
78
|
+
position: absolute;
|
|
79
|
+
left: 2px;
|
|
80
|
+
width: 2px;
|
|
81
|
+
height: 0;
|
|
82
|
+
background: inherit;
|
|
83
|
+
transition: height 0.2s;
|
|
84
|
+
}
|
|
96
85
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
86
|
+
&.active {
|
|
87
|
+
|
|
88
|
+
&:hover {
|
|
89
|
+
background-color: transparent;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:before {
|
|
93
|
+
background: ${theme.color.primary['500']};
|
|
94
|
+
height: 24px;
|
|
95
|
+
}
|
|
101
96
|
}
|
|
102
|
-
|
|
103
|
-
&:before {
|
|
104
|
-
background: ${theme.color.
|
|
97
|
+
|
|
98
|
+
&:not(.active):hover:before {
|
|
99
|
+
background: ${theme.color.light.contrastText};
|
|
105
100
|
height: 24px;
|
|
106
101
|
}
|
|
107
102
|
}
|
|
108
103
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
.chevron {
|
|
116
|
-
transition: transform 0.3s;
|
|
117
|
-
&:not(.open) {
|
|
118
|
-
transform: rotate(-90deg);
|
|
104
|
+
.chevron {
|
|
105
|
+
transition: transform 0.3s;
|
|
106
|
+
&:not(.open) {
|
|
107
|
+
transform: rotate(-90deg);
|
|
108
|
+
}
|
|
119
109
|
}
|
|
120
110
|
}
|
|
121
|
-
|
|
122
|
-
.item-row-title {
|
|
123
|
-
opacity: 0.7;
|
|
124
|
-
}
|
|
125
111
|
}
|
|
126
112
|
|
|
127
113
|
&.open {
|
|
128
114
|
visibility: visible;
|
|
129
115
|
transition: unset;
|
|
130
|
-
& > li > a, & > li > .item-
|
|
116
|
+
& > li > a, & > li > .item-as-title {
|
|
131
117
|
height: 40px;
|
|
132
118
|
}
|
|
133
119
|
}
|
|
134
120
|
|
|
135
|
-
&:not(.open) &.open > li > a {
|
|
121
|
+
&:not(.open) &.open > li > a, &:not(.open) &.open > li > .item-as-title {
|
|
136
122
|
height: 0;
|
|
137
123
|
}
|
|
138
124
|
|
|
@@ -155,12 +141,20 @@ export const MenuGroup = styled.ul `
|
|
|
155
141
|
}
|
|
156
142
|
}
|
|
157
143
|
`;
|
|
144
|
+
/**
|
|
145
|
+
* The header (<header>) for a group of items in a menu. Contains the title of the group.
|
|
146
|
+
*/
|
|
147
|
+
// fixme: remove explicit type when TS is upgraded to 5.5 or greater
|
|
158
148
|
export const Title = styled.header `
|
|
159
149
|
display: flex;
|
|
160
150
|
flex-direction: column;
|
|
161
151
|
margin: ${PADDING}px 0 24px ${PADDING}px;
|
|
162
152
|
`;
|
|
163
|
-
|
|
153
|
+
/**
|
|
154
|
+
* A menu item that performs an action.
|
|
155
|
+
* @param props the props for the component {@link MenuAction}.
|
|
156
|
+
*/
|
|
157
|
+
export const ActionItem = ({ label, onClick, href, active, icon, badge, target, overflow = 'wrap' }) => {
|
|
164
158
|
const Link = useAnchorTag();
|
|
165
159
|
const { ref, overflow: textOverflow } = useCheckTextOverflow();
|
|
166
160
|
const isTextLabel = typeof label === 'string';
|
|
@@ -170,28 +164,35 @@ export const ActionItem = ({ label, onClick, href, active, icon, badge, overflow
|
|
|
170
164
|
if (onClick)
|
|
171
165
|
onClick();
|
|
172
166
|
hideOverlayImmediately();
|
|
173
|
-
}, className: listToClass(['action', 'item-row', active ? 'active' : undefined]), ...(active ? { 'aria-current': 'page' } : undefined), ...(!href ? { 'tabIndex': 0 } : undefined), children: [icon, isTextLabel ?
|
|
167
|
+
}, target: target, className: listToClass(['action', 'item-row', active ? 'active' : undefined]), ...(active ? { 'aria-current': 'page' } : undefined), ...(!href ? { 'tabIndex': 0 } : undefined), children: [icon, isTextLabel ?
|
|
174
168
|
_jsx(Text, { ref: ref, appearance: "body2", className: `label ${overflow}`, title: textOverflow ? label : '', children: label }) :
|
|
175
169
|
label.element, badge] }));
|
|
176
170
|
};
|
|
177
|
-
|
|
171
|
+
/**
|
|
172
|
+
* A menu item that is actually a subgroup and can be collapsed/expanded.
|
|
173
|
+
* @param props the props for the component {@link ItemGroup} & { root: boolean }. Pass root=true to style this group as a root group.
|
|
174
|
+
* Root groups have slightly different visuals.
|
|
175
|
+
*/
|
|
176
|
+
const CollapsibleGroupItem = ({ label, showAsTitle, open: initiallyOpened, children, icon, badge, root, overflow = 'wrap' }) => {
|
|
178
177
|
const [open, setOpen] = useState(initiallyOpened ?? children?.some(c => 'active' in c && c.active) ?? false);
|
|
179
178
|
const items = useMemo(() => children?.filter(i => !i.hidden).map(renderOption), [children]);
|
|
180
179
|
const id = `menuGroup${label}`;
|
|
181
|
-
return (_jsxs(_Fragment, { children: [_jsxs("a", { onClick: () => setOpen(!open), onKeyDown: e => e.key === 'Enter' && setOpen(!open), className:
|
|
182
|
-
};
|
|
183
|
-
const RootGroupItem = (props) => {
|
|
184
|
-
const items = useMemo(() => props.children?.filter(i => !i.hidden).map(renderOption), [props.children]);
|
|
185
|
-
return _jsx(_Fragment, { children: items.length ? _jsx("div", { className: "item-row-group", children: _jsx(CollapsibleGroupItem, { ...props, open: true, root: true }) }) :
|
|
186
|
-
_jsxs(_Fragment, { children: [_jsxs("div", { className: "item-row", children: [props.icon, _jsx(Text, { appearance: "overheader2", colorScheme: "light.700", className: `group-title label ${props.overflow}`, children: props.label }), props.badge] }), _jsx(MenuGroup, { className: "open no-indentation", children: items })] }) });
|
|
180
|
+
return (_jsxs(_Fragment, { children: [showAsTitle ? _jsxs(Box, { className: listToClass(['item-row', root && 'root', 'item-as-title']), children: [icon, _jsx(Text, { appearance: root ? 'overheader2' : 'body2', colorScheme: "light.contrastText", className: `label ${overflow} ${root ? 'item-row-title' : ''}`, children: label })] }) : _jsxs("a", { onClick: () => setOpen(!open), onKeyDown: e => e.key === 'Enter' && setOpen(!open), className: listToClass(['item-row', root && 'root']), tabIndex: 0, "aria-controls": id, "aria-expanded": open, children: [icon, _jsx(Text, { appearance: root ? 'overheader2' : 'body2', colorScheme: "light.contrastText", className: `label ${overflow} ${root ? 'item-row-title' : ''}`, children: label }), badge, _jsx(IconBox, { sx: { mr: root ? undefined : '5' }, children: _jsx(ChevronDown, { className: listToClass(['chevron', open ? 'open' : '']) }) })] }), _jsx(MenuGroup, { id: id, className: `${open ? 'open' : ''} ${root ? 'no-indentation' : ''}`, "aria-hidden": !open, children: items })] }));
|
|
187
181
|
};
|
|
188
|
-
const GroupItem = ({ root, ...item }) => (root ? _jsx(RootGroupItem, { ...item }) : _jsx(CollapsibleGroupItem, { ...item }));
|
|
189
182
|
function renderOption({ root, ...option }) {
|
|
190
183
|
const labelText = typeof option.label === 'string' ? option.label : option.label.id;
|
|
191
|
-
return (_jsx("li", { role: "menuitem", "aria-selected": 'children' in option ? undefined : option.active, children: 'children' in option ? _jsx(
|
|
184
|
+
return (_jsx("li", { role: "menuitem", "aria-selected": 'children' in option ? undefined : option.active, children: 'children' in option ? _jsx(CollapsibleGroupItem, { ...option, root: root, open: option.open ?? root }) : _jsx(ActionItem, { ...option }) }, labelText));
|
|
192
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Renders a menu-content interface.
|
|
188
|
+
*
|
|
189
|
+
* Considering the Stackspot UI, this is the "menu content", not the "menu sections", i.e. it's the second menu from left to right, the
|
|
190
|
+
* one that changes according to section selected.
|
|
191
|
+
* @param props the props for the component {@link MenuSectionContent}.
|
|
192
|
+
*/
|
|
193
193
|
export const MenuContent = ({ pageSelector, goBack, title, subtitle, afterTitle, options = [], loading, error }) => {
|
|
194
194
|
const items = useMemo(() => options.filter(o => !o.hidden).map(o => renderOption({ ...o, root: true })), [options]);
|
|
195
|
+
const Link = useAnchorTag();
|
|
195
196
|
function renderContent() {
|
|
196
197
|
if (loading) {
|
|
197
198
|
return (_jsx(Flex, { justifyContent: "center", alignItems: "center", flex: 1, sx: { padding: '40px' }, children: _jsx(LoadingCircular, {}) }));
|
|
@@ -200,7 +201,7 @@ export const MenuContent = ({ pageSelector, goBack, title, subtitle, afterTitle,
|
|
|
200
201
|
return _jsx(Text, { colorScheme: "danger", children: error });
|
|
201
202
|
return _jsx(MenuGroup, { className: "open root no-indentation", children: items });
|
|
202
203
|
}
|
|
203
|
-
return (_jsxs(_Fragment, { children: [goBack && (_jsxs(
|
|
204
|
+
return (_jsxs(_Fragment, { children: [goBack && (_jsxs(Link, { href: goBack.href, onClick: goBack.onClick, className: "goBackLink", children: [_jsx(IconBox, { colorIcon: "inverse.500", size: "sm", children: _jsx(ArrowLeft, {}) }), typeof goBack?.label === 'string' ?
|
|
204
205
|
_jsx(Text, { appearance: "body2", nowrapEllipsis: true, children: goBack.label }) :
|
|
205
206
|
goBack.label.element] })), title && (_jsxs(Title, { children: [_jsx(Text, { appearance: "overheader1", colorScheme: "primary", sx: { fontSize: '0.75rem', mt: 2, mb: 2 }, children: title }), subtitle && _jsx(Text, { appearance: "h5", children: subtitle })] })), afterTitle, pageSelector && _jsx(PageSelector, { ...pageSelector }), renderContent()] }));
|
|
206
207
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuContent.js","sourceRoot":"","sources":["../../../src/components/menu/MenuContent.tsx"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"MenuContent.js","sourceRoot":"","sources":["../../../src/components/menu/MenuContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AACnE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE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AK,eACJ,KAAC,IAAI,IAAC,UAAU,EAAC,aAAa,EAAC,WAAW,EAAC,SAAS,EAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,YAAG,KAAK,GAAQ,EAC7G,QAAQ,IAAI,KAAC,IAAI,IAAC,UAAU,EAAC,IAAI,YAAE,QAAQ,GAAQ,IAC9C,CACT,EACA,UAAU,EACV,YAAY,IAAI,KAAC,YAAY,OAAK,YAAY,GAAI,EAClD,aAAa,EAAE,IACf,CACJ,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuSectionGroup.d.ts","sourceRoot":"","sources":["../../../src/components/menu/MenuSectionGroup.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAoH7E,CAAA"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { theme } from '@stack-spot/portal-theme';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { MENU_CONTENT_PADDING as PADDING } from './constants.js';
|
|
4
|
+
export const MenuSectionGroup = styled.ul `
|
|
5
|
+
padding: 0 0 0 16px;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
visibility: hidden;
|
|
9
|
+
transition: visibility 0s 0.3s;
|
|
10
|
+
|
|
11
|
+
&.no-indentation {
|
|
12
|
+
padding: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.item-row {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: row;
|
|
18
|
+
gap: 8px;
|
|
19
|
+
align-items: center;
|
|
20
|
+
|
|
21
|
+
&.root {
|
|
22
|
+
padding: 0 16px;
|
|
23
|
+
margin-top: 16px;
|
|
24
|
+
border-radius: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.label {
|
|
28
|
+
flex: 1;
|
|
29
|
+
&.hidden, &.ellipsis {
|
|
30
|
+
white-space: nowrap;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
}
|
|
33
|
+
&.ellipsis {
|
|
34
|
+
text-overflow: ellipsis;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
li a {
|
|
40
|
+
position: relative;
|
|
41
|
+
height: 0;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
transition: height 0.3s, background-color 0.2s;
|
|
44
|
+
|
|
45
|
+
&:hover {
|
|
46
|
+
background-color: ${theme.color.light['500']};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&.action {
|
|
50
|
+
&:before {
|
|
51
|
+
content: '';
|
|
52
|
+
position: absolute;
|
|
53
|
+
left: 2px;
|
|
54
|
+
width: 2px;
|
|
55
|
+
height: 0;
|
|
56
|
+
background: inherit;
|
|
57
|
+
transition: height 0.2s;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.active {
|
|
61
|
+
|
|
62
|
+
&:hover {
|
|
63
|
+
background-color: transparent;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:before {
|
|
67
|
+
background: ${theme.color.primary['500']};
|
|
68
|
+
height: 24px;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&:not(.active):hover:before {
|
|
73
|
+
background: ${theme.color.light.contrastText};
|
|
74
|
+
height: 24px;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.chevron {
|
|
79
|
+
transition: transform 0.5s;
|
|
80
|
+
&:not(.open) {
|
|
81
|
+
transform: rotate(180deg);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.item-row-title {
|
|
86
|
+
opacity: 0.7;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.open {
|
|
91
|
+
visibility: visible;
|
|
92
|
+
transition: unset;
|
|
93
|
+
& > li > a {
|
|
94
|
+
height: 56px;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:not(.open) &.open > li > a {
|
|
99
|
+
height: 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.root {
|
|
103
|
+
/* margin-bottom: ${PADDING}px; */
|
|
104
|
+
|
|
105
|
+
& > li {
|
|
106
|
+
.group-title {
|
|
107
|
+
margin-left: ${PADDING}px;
|
|
108
|
+
margin-bottom: 5px;
|
|
109
|
+
margin-top: 40px;
|
|
110
|
+
display: block;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&:first-child {
|
|
114
|
+
.group-title {
|
|
115
|
+
margin-top: 0;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
`;
|
|
121
|
+
//# sourceMappingURL=MenuSectionGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuSectionGroup.js","sourceRoot":"","sources":["../../../src/components/menu/MenuSectionGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,oBAAoB,IAAI,OAAO,EAAE,MAAM,aAAa,CAAA;AAE7D,MAAM,CAAC,MAAM,gBAAgB,GAAqD,MAAM,CAAC,EAAE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA0CjE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;wBAqB1B,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;;;;;;sBAM5B,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA8B5B,OAAO;;;;uBAIR,OAAO;;;;;;;;;;;;;CAa7B,CAAA"}
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
import { MenuProps } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Hides the menu overlay without waiting for anything. This is not cancellable.
|
|
4
|
+
*/
|
|
2
5
|
export declare function hideOverlayImmediately(): void;
|
|
6
|
+
/**
|
|
7
|
+
* Renders a menu-sections interface.
|
|
8
|
+
*
|
|
9
|
+
* Considering the Stackspot UI, this is the "menu sections", not the "menu content", i.e. it's the first menu from left to right, the
|
|
10
|
+
* one with the icons and section names: the main menu.
|
|
11
|
+
*
|
|
12
|
+
* Attention: each section in the menu is identified by its index. To avoid errors, the array passed to this component must never change.
|
|
13
|
+
* To control whether or not to show an item, use the property `hidden`, instead of adding/removing it to the array. Example of error:
|
|
14
|
+
* start the section menu with 5 items, remove the 5th item and add another item. The previous 5th item and the new 5th items are different,
|
|
15
|
+
* but since we identify the item by its index, the two different sections will be rendered as if they were the same, causing a react hook
|
|
16
|
+
* call order problem.
|
|
17
|
+
*
|
|
18
|
+
* @param props the props for the component {@link MenuProps}.
|
|
19
|
+
*/
|
|
3
20
|
export declare const MenuSections: ({ sections, ...props }: MenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
21
|
//# sourceMappingURL=MenuSections.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuSections.d.ts","sourceRoot":"","sources":["../../../src/components/menu/MenuSections.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MenuSections.d.ts","sourceRoot":"","sources":["../../../src/components/menu/MenuSections.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,SAAS,EAAe,MAAM,SAAS,CAAA;AAyChD;;GAEG;AACH,wBAAgB,sBAAsB,SAOrC;AAiKD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,GAAI,wBAA6B,SAAS,4CAyJlE,CAAA"}
|